diff --git a/B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs b/B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs index 7fc04dc..fe2cd64 100644 --- a/B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs +++ b/B3ClientService.Web/Pages/B3ClientService/ToolsPage.cs @@ -16,32 +16,49 @@ namespace BWP.Web.Pages.B3ClientService { protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form) { - var textbox = form.EAdd(new DFDateInput()); - var range = form.EAdd(new DFTextBox()); - var minID = form.EAdd(new DFTextBox()); - form.Controls.Add(new TSButton("DO", delegate - { + //var range = form.EAdd(new DFTextBox()); + //form.Controls.Add(new TSButton("dddd", delegate + //{ + // using (var session = Dmo.NewSession()) + // { + // var obj = new CarcassFullInfo(); + // obj.PickTime = null; + // var update = new DQUpdateDom(typeof(CarcassFullInfo)); + // update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.NULL)); + // update.Columns.Add(new DQUpdateColumn("PickTime", obj.PickTime)); + // update.Where.Conditions.Add(DQCondition.EQ("BarCode", range.Text)); + // session.ExecuteNonQuery(update); + // session.Commit(); + // } + // AspUtil.Alert(this, "OK"); + //})); - using (var session = Dmo.NewSession()) - { - var q = new DmoQuery(typeof(GradeAndWeight_Detail)); - q.Range = SelectRange.Top(int.Parse(range.Text)); - q.Where.Conditions.Add(DQCondition.EQ("Date", textbox.Date)); - q.Where.Conditions.Add(DQCondition.GreaterThan("ID", long.Parse(minID.Text))); - q.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); - var lst = session.ExecuteList(q).Cast(); - foreach (var item in lst) - { - GradeAndWeightBL.InsertTraceBack(item, session); - } + //var textbox = form.EAdd(new DFDateInput()); + //var range = form.EAdd(new DFTextBox()); + //var minID = form.EAdd(new DFTextBox()); + //form.Controls.Add(new TSButton("DO", delegate + //{ - session.Commit(); - var mx = 0L; - if (lst.Any()) - mx = lst.Max(x => x.ID); - AspUtil.Alert(this, lst.Count().ToString() + "Max_" + mx); - } - })); + // using (var session = Dmo.NewSession()) + // { + // var q = new DmoQuery(typeof(GradeAndWeight_Detail)); + // q.Range = SelectRange.Top(int.Parse(range.Text)); + // q.Where.Conditions.Add(DQCondition.EQ("Date", textbox.Date)); + // q.Where.Conditions.Add(DQCondition.GreaterThan("ID", long.Parse(minID.Text))); + // q.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); + // var lst = session.ExecuteList(q).Cast(); + // foreach (var item in lst) + // { + // GradeAndWeightBL.InsertTraceBack(item, session); + // } + + // session.Commit(); + // var mx = 0L; + // if (lst.Any()) + // mx = lst.Max(x => x.ID); + // AspUtil.Alert(this, lst.Count().ToString() + "Max_" + mx); + // } + //})); } } } diff --git a/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs b/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs index 2bf120a..d3e57dd 100644 --- a/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs +++ b/B3ClientService/OfflinRpc/CarcassSaleOutStoreRpc.cs @@ -53,17 +53,28 @@ namespace BWP.B3ClientService.Rpcs static void Update(long id, CarcassSaleOutStoreObj obj, IDmoSession session) { - var goodsID = GetGoodsID(obj.SaleGoods_Code, session); var update = new DQUpdateDom(typeof(CarcassFullInfo)); - update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", goodsID)); - if (obj.Weight.HasValue) - update.Columns.Add(new DQUpdateColumn("PickWeight", obj.Weight)); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + if (obj.Number < 0) + { + update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", DQExpression.NULL)); + update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.NULL)); + update.Columns.Add(new DQUpdateColumn("PickType", DQExpression.NULL)); + obj.Time = null; + obj.Number = null; + } else - update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.Field("InStoreWeight"))); + { + var goodsID = GetGoodsID(obj.SaleGoods_Code, session); + update.Columns.Add(new DQUpdateColumn("SaleGoods_ID", goodsID)); + if (obj.Weight.HasValue) + update.Columns.Add(new DQUpdateColumn("PickWeight", obj.Weight)); + else + update.Columns.Add(new DQUpdateColumn("PickWeight", DQExpression.Field("InStoreWeight"))); + update.Columns.Add(new DQUpdateColumn("PickType", 领用类型.白条销售)); + } update.Columns.Add(new DQUpdateColumn("PickTime", obj.Time)); update.Columns.Add(new DQUpdateColumn("PickNumber", obj.Number)); - update.Columns.Add(new DQUpdateColumn("PickType", 领用类型.白条销售)); - update.Where.Conditions.Add(DQCondition.EQ("ID", id)); session.ExecuteNonQuery(update); } @@ -96,10 +107,17 @@ namespace BWP.B3ClientService.Rpcs static void FillSectionStoreWeight(CarcassSaleOutStoreObj item, IDmoSession session) { var update = new DQUpdateDom(typeof(SectionStoreDetail)); - if (item.Weight.HasValue) - update.Columns.Add(new DQUpdateColumn("Weight", item.Weight)); + if (item.Number < 0) + { + item.Weight = null; + item.Time = null; + item.Number = null; + update.Columns.Add(new DQUpdateColumn("PickType", DQExpression.NULL)); + } + else + update.Columns.Add(new DQUpdateColumn("PickType", 领用类型.白条销售)); + update.Columns.Add(new DQUpdateColumn("Weight", item.Weight)); update.Columns.Add(new DQUpdateColumn("OutStoreTime", item.Time)); - update.Columns.Add(new DQUpdateColumn("PickType", 领用类型.白条销售)); update.Columns.Add(new DQUpdateColumn("PickNumber", item.Number)); update.Where.Conditions.Add(DQCondition.EQ("BarCode", item.BarCode)); session.ExecuteNonQuery(update);