|
|
@ -10,6 +10,7 @@ using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using System.Web.Script.Serialization; |
|
|
using TSingSoft.WebPluginFramework; |
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
|
|
|
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
@ -17,9 +18,14 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static class WeightBillRpc |
|
|
public static class WeightBillRpc |
|
|
{ |
|
|
{ |
|
|
|
|
|
static JavaScriptSerializer serializer = new JavaScriptSerializer(); |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static BackRpcObj UploadBill(WeightBill dmo) |
|
|
|
|
|
|
|
|
public static BackRpcObj UploadBill(WeightBill dmo, string recordDetail) |
|
|
{ |
|
|
{ |
|
|
|
|
|
recordDetail = recordDetail.ESerializeDateTime(); |
|
|
|
|
|
var records = serializer.Deserialize<List<WeightDetail>>(recordDetail); |
|
|
|
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
if (dmo.ID == 0) |
|
|
if (dmo.ID == 0) |
|
|
@ -40,6 +46,13 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
session.Insert(item); |
|
|
session.Insert(item); |
|
|
else |
|
|
else |
|
|
session.Update(item); |
|
|
session.Update(item); |
|
|
|
|
|
foreach (var r in records) |
|
|
|
|
|
{ |
|
|
|
|
|
if (r.Delete) |
|
|
|
|
|
session.Delete(r); |
|
|
|
|
|
else |
|
|
|
|
|
session.Insert(r); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
dmo.FarmerDetails = new WeightBill_FarmerDetailCollection(); |
|
|
dmo.FarmerDetails = new WeightBill_FarmerDetailCollection(); |
|
|
dmo.Details = new WeightBill_DetailCollection(); |
|
|
dmo.Details = new WeightBill_DetailCollection(); |
|
|
@ -389,6 +402,15 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static string GetWeightRecord(long id) |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DmoQuery(typeof(WeightDetail)); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("WeightBill_Detail_ID", id)); |
|
|
|
|
|
var result = query.EExecuteList(); |
|
|
|
|
|
return serializer.Serialize(result); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[RpcObject] |
|
|
[RpcObject] |
|
|
|