|
|
|
@ -83,31 +83,35 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Technics", type)); |
|
|
|
if (order.HasValue) |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Order", order)); |
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Time")); |
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Index", true)); |
|
|
|
return serializer.Serialize(query.EExecuteList()); |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static long InsertDetail(string json) |
|
|
|
public static long InsertOrInsertDetail(string json) |
|
|
|
{ |
|
|
|
json = json.ESerializeDateTime(); |
|
|
|
var entity = serializer.Deserialize<GradeAndWeight_Detail>(json); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
session.Insert(entity); |
|
|
|
if (entity.ID == 0) |
|
|
|
session.Insert(entity); |
|
|
|
else |
|
|
|
session.Update(entity); |
|
|
|
session.Commit(); |
|
|
|
return entity.ID; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static int FillWeight(long id, decimal weight) |
|
|
|
public static int UpdateLivestock(long id, long liveStockID, string liveStockName) |
|
|
|
{ |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
var update = new DQUpdateDom(typeof(GradeAndWeight_Detail)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Weight", weight)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Livestock_ID", liveStockID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("Livestock_Name", liveStockName)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
|