Browse Source

DQUpdate 不能通过ReferenceTo更新字段。

master
yibo 8 years ago
parent
commit
df945af99b
2 changed files with 11 additions and 9 deletions
  1. +0
    -8
      B3ClientService/BO/Bill/WeightBill/WeightBillCheck.cs
  2. +11
    -1
      B3ClientService/Tasks/UpdateLoad/DoCheckBills.cs

+ 0
- 8
B3ClientService/BO/Bill/WeightBill/WeightBillCheck.cs View File

@ -51,13 +51,5 @@ namespace BWP.B3ClientService.BO
query.Where.Conditions.Add(DQCondition.EQ("ID", id));
return query.EExists();
}
public static void SetSynced(long b3ID)
{
var update = new DQUpdateDom(typeof(WeightBillCheck));
update.Columns.Add(new DQUpdateColumn("Sync", true));
update.Where.Conditions.Add(DQCondition.EQ("B3ID", b3ID));
update.EExecute();
}
}
}

+ 11
- 1
B3ClientService/Tasks/UpdateLoad/DoCheckBills.cs View File

@ -19,7 +19,17 @@ namespace BWP.B3ClientService.Tasks.UpdateLoad
{
var bwpClient = new BWPClient(uri, item.Item2);
bwpClient.Call<int>("/MainSystem/B3ButcherManage/Rpcs/WeighBillRpc/DoCheck", item.Item1);
WeightBillCheck.SetSynced(item.Item1);
SetSynced(item.Item1);
}
}
static void SetSynced(long b3ID)
{
using (var session = Dmo.NewSession())
{
var sql = "update a set a.[Sync]=1 from B3ClientService_WeightBillCheck a left outer join B3ClientService_WeightBill w on a.ID=w.ID where w.B3ID=" + b3ID;
session.ExecuteSqlNonQuery(sql);
session.Commit();
}
}


Loading…
Cancel
Save