|
|
@ -65,50 +65,25 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static string GetDetailsList(DateTime date, int top) |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DmoQuery(typeof(GradeAndWeight_Detail)); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Date", date)); |
|
|
|
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Index", true)); |
|
|
|
|
|
query.Range = SelectRange.Top(top); |
|
|
|
|
|
return serializer.Serialize(query.EExecuteList()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static long UpdateOrInsertDetail(string json, bool fillTechnics) |
|
|
|
|
|
|
|
|
public static long UpdateOrInsertDetail(string json) |
|
|
{ |
|
|
{ |
|
|
json = json.ESerializeDateTime(); |
|
|
json = json.ESerializeDateTime(); |
|
|
var entity = serializer.Deserialize<GradeAndWeight_Detail>(json); |
|
|
var entity = serializer.Deserialize<GradeAndWeight_Detail>(json); |
|
|
using (var session = Dmo.NewSession()) |
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
if (entity.ID == 0) |
|
|
if (entity.ID == 0) |
|
|
|
|
|
{ |
|
|
session.Insert(entity); |
|
|
session.Insert(entity); |
|
|
|
|
|
if (entity.OrderDetail_ID.HasValue) |
|
|
|
|
|
AddAlready(session, entity.OrderDetail_ID.Value, entity.Technics); |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
session.Update(entity); |
|
|
session.Update(entity); |
|
|
if (fillTechnics && entity.OrderDetail_ID.HasValue) |
|
|
|
|
|
AddAlready(session, entity.OrderDetail_ID.Value, entity.Technics); |
|
|
|
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
return entity.ID; |
|
|
return entity.ID; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static int UpdateLivestock(long id, long liveStockID, string liveStockName, short techincs, string technicsName) |
|
|
|
|
|
{ |
|
|
|
|
|
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("Livestock_ID", liveStockID)); |
|
|
|
|
|
update.Columns.Add(new DQUpdateColumn("Livestock_Name", liveStockName)); |
|
|
|
|
|
update.Columns.Add(new DQUpdateColumn("Technics", techincs)); |
|
|
|
|
|
update.Columns.Add(new DQUpdateColumn("Technics_Name", technicsName)); |
|
|
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
|
|
session.Commit(); |
|
|
|
|
|
} |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static int SetGradeFinish(long orderDetailID, short technics) |
|
|
public static int SetGradeFinish(long orderDetailID, short technics) |
|
|
{ |
|
|
{ |
|
|
@ -184,19 +159,5 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static int UpdateWeight(long id, decimal? weight) |
|
|
|
|
|
{ |
|
|
|
|
|
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)); |
|
|
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
|
|
session.Commit(); |
|
|
|
|
|
} |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |