|
|
|
@ -46,7 +46,10 @@ namespace BWP.B3ClientService.Tasks.UpdateLoad |
|
|
|
ClearDetails(item.ID, context.Session); |
|
|
|
item.B3ID = back.ID; |
|
|
|
FillSanctionMoney(context.Session, item.ID, back.SectionDetails); |
|
|
|
SetBillAsSynced(item.ID, item.B3ID.Value, context.Session); |
|
|
|
var money = 0m; |
|
|
|
if (back.SectionDetails != null) |
|
|
|
money = back.SectionDetails.Sum(x => x.Item2 ?? 0); |
|
|
|
SetBillAsSynced(item.ID, item.B3ID.Value, money, context.Session); |
|
|
|
|
|
|
|
context.Commit(); |
|
|
|
} |
|
|
|
@ -129,11 +132,12 @@ namespace BWP.B3ClientService.Tasks.UpdateLoad |
|
|
|
Delete<WeightBill_SanctionDetail>("WeightBill_ID", mainID, session, true); |
|
|
|
} |
|
|
|
|
|
|
|
static void SetBillAsSynced(long id, long B3ID, IDmoSession session) |
|
|
|
static void SetBillAsSynced(long id, long B3ID, decimal money, IDmoSession session) |
|
|
|
{ |
|
|
|
var update = new DQUpdateDom(typeof(WeightBill)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Sync", true)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("B3ID", B3ID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("SanctionMoney", money)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
|