|
|
@ -212,22 +212,21 @@ namespace BO.Utils.BillRpc |
|
|
update.Columns.Add(new DQUpdateColumn(p, type.GetProperty(p).GetValue(detail))); |
|
|
update.Columns.Add(new DQUpdateColumn(p, type.GetProperty(p).GetValue(detail))); |
|
|
} |
|
|
} |
|
|
update.Columns.Add(new DQUpdateColumn("Sync", false)); |
|
|
update.Columns.Add(new DQUpdateColumn("Sync", false)); |
|
|
|
|
|
|
|
|
session.ExecuteNonQuery(update); |
|
|
session.ExecuteNonQuery(update); |
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void Update(GradeAndWeight_Detail detail, GradeAndWeight toEntity) |
|
|
|
|
|
{ |
|
|
|
|
|
if (toEntity == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception(string.Format("请选择左侧的{0}顺序", detail.Technics_Name)); |
|
|
|
|
|
} |
|
|
|
|
|
detail.Order = toEntity.Order; |
|
|
|
|
|
detail.OrderDetail_ID = toEntity.OrderDetail_ID; |
|
|
|
|
|
Update(detail, "OrderDetail_ID", "Order", "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//public static void Update(GradeAndWeight_Detail detail, GradeAndWeight toEntity)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (toEntity == null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// throw new Exception(string.Format("请选择左侧的{0}顺序", detail.Technics_Name));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// detail.Order = toEntity.Order;
|
|
|
|
|
|
// detail.OrderDetail_ID = toEntity.OrderDetail_ID;
|
|
|
|
|
|
// Update(detail, "OrderDetail_ID", "Order", "Livestock_ID", "Livestock_Name", "Technics", "Technics_Name");
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
public static void Sync() |
|
|
public static void Sync() |
|
|
{ |
|
|
{ |
|
|
@ -272,7 +271,7 @@ namespace BO.Utils.BillRpc |
|
|
{ |
|
|
{ |
|
|
var query = new DmoQuery(typeof(GradeAndWeight_Detail)); |
|
|
var query = new DmoQuery(typeof(GradeAndWeight_Detail)); |
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("SID")); |
|
|
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("SID")); |
|
|
query.Range = SelectRange.Top(50); |
|
|
|
|
|
|
|
|
query.Range = SelectRange.Top(1); |
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Sync", false), |
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Sync", false), |
|
|
DQCondition.IsNotNull(DQExpression.Field("Technics")))); |
|
|
DQCondition.IsNotNull(DQExpression.Field("Technics")))); |
|
|
return session.ExecuteList(query).Cast<GradeAndWeight_Detail>(); |
|
|
return session.ExecuteList(query).Cast<GradeAndWeight_Detail>(); |
|
|
|