From 73d6fec8bdf924fa35d5afeb97521f3c5a7cbdc2 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 24 May 2018 21:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/Base/ExtensionObj.cs | 2 + .../Bill/CarcassSaleOut_Detail.cs | 23 +- ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs | 73 ++- ButcherFactory.BO/Utils/AppContext.cs | 7 +- .../ButcherFactory.Form.csproj | 9 + .../CarcassSaleOutForm.Designer.cs | 425 +++++++++++------- .../CarcassSaleOut_/CarcassSaleOutForm.cs | 101 ++++- .../CarcassSaleOut_/CarcassSaleOutForm.resx | 28 +- .../Dialogs/AddWeightRecord.Designer.cs | 234 ++++++++++ .../Dialogs/AddWeightRecord.cs | 64 +++ .../Dialogs/AddWeightRecord.resx | 153 +++++++ .../Dialogs/SelectCustomerDialog.Designer.cs | 30 +- .../Dialogs/SelectCustomerDialog.cs | 3 +- .../Dialogs/WeightRecordDialog.Designer.cs | 183 +++++++- .../Dialogs/WeightRecordDialog.cs | 47 +- .../Dialogs/WeightRecordDialog.resx | 37 ++ .../SegmentProductionPrint.cs | 4 +- 17 files changed, 1211 insertions(+), 212 deletions(-) create mode 100644 ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs create mode 100644 ButcherFactory.Form/Dialogs/AddWeightRecord.cs create mode 100644 ButcherFactory.Form/Dialogs/AddWeightRecord.resx diff --git a/ButcherFactory.BO/Base/ExtensionObj.cs b/ButcherFactory.BO/Base/ExtensionObj.cs index eb22065..e017bb2 100644 --- a/ButcherFactory.BO/Base/ExtensionObj.cs +++ b/ButcherFactory.BO/Base/ExtensionObj.cs @@ -12,6 +12,8 @@ namespace ButcherFactory.BO public long? LongExt2 { get; set; } + public long? LongExt3 { get; set; } + public decimal? DecimalExt1 { get; set; } public string StringExt1 { get; set; } diff --git a/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs b/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs index 119e637..85d2bc5 100644 --- a/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs +++ b/ButcherFactory.BO/Bill/CarcassSaleOut_Detail.cs @@ -24,6 +24,19 @@ namespace ButcherFactory.BO public string BarCode { get; set; } + [NonDmoProperty] + public string ShortCode + { + get + { + if (string.IsNullOrEmpty(BarCode)) + return null; + if (BarCode.Contains("260912011")) + return BarCode.Replace("260912011", ""); + return BarCode; + } + } + public long? Goods_ID { get; set; } public string Goods_Name { get; set; } @@ -62,7 +75,13 @@ namespace ButcherFactory.BO { get { return mSelected; } set { mSelected = value; } - } + } + + public long? WeightRecord_ID { get; set; } + + public long? ScanRecord_ID { get; set; } + + public string Operator { get; set; } } public class SaleOutStore @@ -88,6 +107,8 @@ namespace ButcherFactory.BO public string Customer_Name { get; set; } + public long? Goods_ID { get; set; } + public string Goods_Code { get; set; } public string Goods_Name { get; set; } diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs index c6a7cb2..db73c5b 100644 --- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs @@ -37,6 +37,12 @@ namespace ButcherFactory.BO.LocalBL query.Where.Conditions.Add(DQCondition.EQ("DetailID", detailID)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); var list = query.EExecuteList().Cast().ToList(); + var idx = list.Count; + foreach (var item in list) + { + item.Idx = idx; + idx--; + } return new BindingList(list); } @@ -116,6 +122,15 @@ namespace ButcherFactory.BO.LocalBL } } + public static void UpdateWeightNumber(long id, decimal number) + { + using (var session = DmoSession.New()) + { + Update(session, id, new Tuple("Number", number)); + session.Commit(); + } + } + static void Update(IDmoSession session, long id, params Tuple[] pops) { var update = new DQUpdateDom(typeof(CarcassSaleOut_Detail)); @@ -161,15 +176,23 @@ namespace ButcherFactory.BO.LocalBL public static void SubmitDetails(IEnumerable details, SaleOutStore_Detail detail) { - var arr = details.Select(x => new WeightRecord { WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); - RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); - - var update = new DQUpdateDom(typeof(CarcassSaleOut_Detail)); - update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), details.Select(x => DQExpression.Value(x.ID)).ToArray())); - update.Columns.Add(new DQUpdateColumn("BillID", detail.SaleOutStore_ID)); - update.Columns.Add(new DQUpdateColumn("DetailID", detail.ID)); - update.EExecute(); + var arr = details.Select(x => new WeightRecord { ID = x.ID, WeightTime = x.Time, MainUnitNum = x.Weight, SecondNumber = x.Number, ProductBatch_ID = x.ProductBatch_ID, BarCode = x.BarCode }); + var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.ID); + var back = JsonConvert.DeserializeObject>(json); + using (var session = DmoSession.New()) + { + foreach (var item in details) + { + var first = back.First(x => x.LongExt1 == item.ID); + Update(session, item.ID, new Tuple("BillID", detail.SaleOutStore_ID), + new Tuple("DetailID", detail.ID), + new Tuple("WeightRecord_ID", first.LongExt2), + new Tuple("ScanRecord_ID", first.LongExt3) + ); + } + session.Commit(); + } detail.SNumber = (detail.SNumber ?? 0) + details.Sum(x => x.Weight); detail.SSecondNumber = (detail.SSecondNumber ?? 0) + details.Sum(x => x.Number); } @@ -181,7 +204,12 @@ namespace ButcherFactory.BO.LocalBL public static void SetGoodsFinish(long id) { - RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SetFinishAssignState", id); + RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SetFinishAssignState", id, true); + } + + public static void SetGoodsUnFinish(long id) + { + RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SetFinishAssignState", id, false); } public static void Delete(long id) @@ -190,6 +218,32 @@ namespace ButcherFactory.BO.LocalBL delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); delete.EExecute(); } + + public static void AddAndUpdate(CarcassSaleOut_Detail detail) + { + using (var session = DmoSession.New()) + { + session.Insert(detail); + var arr = new List { new WeightRecord { ID = detail.ID, WeightTime = detail.Time, MainUnitNum = detail.Weight, SecondNumber = detail.Number } }; + var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveWeightRecord", JsonConvert.SerializeObject(arr), detail.DetailID); + var back = JsonConvert.DeserializeObject>(json); + + var first = back.First(); + + Update(session, detail.ID, new Tuple("WeightRecord_ID", first.LongExt2), + new Tuple("ScanRecord_ID", first.LongExt3) + ); + + session.Commit(); + } + } + + public static void DeleteAndUpdate(CarcassSaleOut_Detail tag) + { + var json = JsonConvert.SerializeObject(new ExtensionObj { LongExt1 = tag.DetailID, LongExt2 = tag.WeightRecord_ID, LongExt3 = tag.ScanRecord_ID }); + RpcFacade.Call(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", json); + Delete(tag.ID); + } } class SaleOutCarcassObj @@ -201,6 +255,7 @@ namespace ButcherFactory.BO.LocalBL class WeightRecord { + public long ID { get; set; } public string BarCode { get; set; } public long? ProductBatch_ID { get; set; } public DateTime WeightTime { get; set; } diff --git a/ButcherFactory.BO/Utils/AppContext.cs b/ButcherFactory.BO/Utils/AppContext.cs index effb2e2..80328c8 100644 --- a/ButcherFactory.BO/Utils/AppContext.cs +++ b/ButcherFactory.BO/Utils/AppContext.cs @@ -37,7 +37,12 @@ namespace ButcherFactory.BO.Utils public string SqlConnection { get; set; } - public string TraceBackUrl { get; set; } + private string _traceBackUrl = "default"; + public string TraceBackUrl + { + get { return _traceBackUrl; } + set { _traceBackUrl = value; } + } public void Save() { diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index fa5d8c9..a2e2763 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -69,6 +69,12 @@ CarcassSaleOutForm.cs + + Form + + + AddWeightRecord.cs + CalendarSelecter.xaml @@ -153,6 +159,9 @@ CarcassTakeOutForm.cs + + AddWeightRecord.cs + ClientGoodsSetDialog.cs diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs index fd590f7..4ce3670 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs @@ -29,27 +29,27 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassSaleOutForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle49 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle50 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle51 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle63 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle59 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle60 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle61 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle62 = new System.Windows.Forms.DataGridViewCellStyle(); this.uWeightControl1 = new WinFormControl.UWeightControl(); this.panel1 = new System.Windows.Forms.Panel(); this.carNumberLabel = new WinFormControl.ULabel(); @@ -79,8 +79,10 @@ this.uLabel3 = new WinFormControl.ULabel(); this.uLabel1 = new WinFormControl.ULabel(); this.panel3 = new System.Windows.Forms.Panel(); - this.alreadyViewBtn = new WinFormControl.UButton(); + this.panel5 = new System.Windows.Forms.Panel(); this.goodsFinishBtn = new WinFormControl.UButton(); + this.unFinishBtn = new WinFormControl.UButton(); + this.alreadyViewBtn = new WinFormControl.UButton(); this.weightRecordBtn = new WinFormControl.UButton(); this.mainGridView = new WinFormControl.UDataGridView(); this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -102,8 +104,6 @@ this.D_DiffNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.sendGridView = new WinFormControl.UDataGridView(); - this.commitBtn = new WinFormControl.UButton(); - this.deleteBtn = new WinFormControl.UButton(); this.F_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_Selected = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_Image = new System.Windows.Forms.DataGridViewImageColumn(); @@ -116,9 +116,15 @@ this.F_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_DiffWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.F_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.commitBtn = new WinFormControl.UButton(); + this.deleteBtn = new WinFormControl.UButton(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.halfBtn = new WinFormControl.UButton(); + this.fullBtn = new WinFormControl.UButton(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.panel3.SuspendLayout(); + this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); this.panel4.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -296,9 +302,9 @@ this.uTimerLabel1.Format = "M月d日 H:mm:ss"; this.uTimerLabel1.Location = new System.Drawing.Point(1167, 49); this.uTimerLabel1.Name = "uTimerLabel1"; - this.uTimerLabel1.Size = new System.Drawing.Size(128, 16); + this.uTimerLabel1.Size = new System.Drawing.Size(136, 16); this.uTimerLabel1.TabIndex = 11; - this.uTimerLabel1.Text = "5月23日 9:28:31"; + this.uTimerLabel1.Text = "5月24日 15:28:37"; // // uScanPanel1 // @@ -469,34 +475,23 @@ // panel3 // this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.panel3.Controls.Add(this.panel5); + this.panel3.Controls.Add(this.unFinishBtn); this.panel3.Controls.Add(this.alreadyViewBtn); - this.panel3.Controls.Add(this.goodsFinishBtn); this.panel3.Controls.Add(this.weightRecordBtn); this.panel3.Location = new System.Drawing.Point(2, 263); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(492, 70); + this.panel3.Size = new System.Drawing.Size(492, 115); this.panel3.TabIndex = 4; // - // alreadyViewBtn + // panel5 // - this.alreadyViewBtn.AsClicked = false; - this.alreadyViewBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("alreadyViewBtn.BackgroundImage"))); - this.alreadyViewBtn.EnableGroup = false; - this.alreadyViewBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); - this.alreadyViewBtn.FlatAppearance.BorderSize = 0; - this.alreadyViewBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.alreadyViewBtn.ForeColor = System.Drawing.Color.Black; - this.alreadyViewBtn.Location = new System.Drawing.Point(31, 17); - this.alreadyViewBtn.Name = "alreadyViewBtn"; - this.alreadyViewBtn.PlaySound = false; - this.alreadyViewBtn.SelfControlEnable = false; - this.alreadyViewBtn.Size = new System.Drawing.Size(100, 30); - this.alreadyViewBtn.SoundType = WinFormControl.SoundType.Click; - this.alreadyViewBtn.TabIndex = 14; - this.alreadyViewBtn.Text = "已配货"; - this.alreadyViewBtn.UseVisualStyleBackColor = true; - this.alreadyViewBtn.WithStataHode = false; - this.alreadyViewBtn.Click += new System.EventHandler(this.alreadyViewBtn_Click); + this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + this.panel5.Controls.Add(this.goodsFinishBtn); + this.panel5.Location = new System.Drawing.Point(342, 15); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(137, 81); + this.panel5.TabIndex = 16; // // goodsFinishBtn // @@ -506,12 +501,13 @@ this.goodsFinishBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); this.goodsFinishBtn.FlatAppearance.BorderSize = 0; this.goodsFinishBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.goodsFinishBtn.Font = new System.Drawing.Font("宋体", 12F); this.goodsFinishBtn.ForeColor = System.Drawing.Color.Black; - this.goodsFinishBtn.Location = new System.Drawing.Point(345, 17); + this.goodsFinishBtn.Location = new System.Drawing.Point(19, 10); this.goodsFinishBtn.Name = "goodsFinishBtn"; this.goodsFinishBtn.PlaySound = false; this.goodsFinishBtn.SelfControlEnable = false; - this.goodsFinishBtn.Size = new System.Drawing.Size(100, 30); + this.goodsFinishBtn.Size = new System.Drawing.Size(100, 60); this.goodsFinishBtn.SoundType = WinFormControl.SoundType.Click; this.goodsFinishBtn.TabIndex = 13; this.goodsFinishBtn.Text = "配货完成"; @@ -519,6 +515,48 @@ this.goodsFinishBtn.WithStataHode = false; this.goodsFinishBtn.Click += new System.EventHandler(this.goodsFinishBtn_Click); // + // unFinishBtn + // + this.unFinishBtn.AsClicked = false; + this.unFinishBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("unFinishBtn.BackgroundImage"))); + this.unFinishBtn.EnableGroup = false; + this.unFinishBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.unFinishBtn.FlatAppearance.BorderSize = 0; + this.unFinishBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.unFinishBtn.ForeColor = System.Drawing.Color.Black; + this.unFinishBtn.Location = new System.Drawing.Point(31, 68); + this.unFinishBtn.Name = "unFinishBtn"; + this.unFinishBtn.PlaySound = false; + this.unFinishBtn.SelfControlEnable = false; + this.unFinishBtn.Size = new System.Drawing.Size(100, 30); + this.unFinishBtn.SoundType = WinFormControl.SoundType.Click; + this.unFinishBtn.TabIndex = 15; + this.unFinishBtn.Text = "撤销完成"; + this.unFinishBtn.UseVisualStyleBackColor = true; + this.unFinishBtn.WithStataHode = false; + this.unFinishBtn.Click += new System.EventHandler(this.unFinishBtn_Click); + // + // alreadyViewBtn + // + this.alreadyViewBtn.AsClicked = false; + this.alreadyViewBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("alreadyViewBtn.BackgroundImage"))); + this.alreadyViewBtn.EnableGroup = false; + this.alreadyViewBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.alreadyViewBtn.FlatAppearance.BorderSize = 0; + this.alreadyViewBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.alreadyViewBtn.ForeColor = System.Drawing.Color.Black; + this.alreadyViewBtn.Location = new System.Drawing.Point(31, 17); + this.alreadyViewBtn.Name = "alreadyViewBtn"; + this.alreadyViewBtn.PlaySound = false; + this.alreadyViewBtn.SelfControlEnable = false; + this.alreadyViewBtn.Size = new System.Drawing.Size(100, 30); + this.alreadyViewBtn.SoundType = WinFormControl.SoundType.Click; + this.alreadyViewBtn.TabIndex = 14; + this.alreadyViewBtn.Text = "已配货"; + this.alreadyViewBtn.UseVisualStyleBackColor = true; + this.alreadyViewBtn.WithStataHode = false; + this.alreadyViewBtn.Click += new System.EventHandler(this.alreadyViewBtn_Click); + // // weightRecordBtn // this.weightRecordBtn.AsClicked = false; @@ -546,17 +584,17 @@ this.mainGridView.AllowUserToDeleteRows = false; this.mainGridView.AllowUserToResizeColumns = false; this.mainGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle43.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle43; this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.mainGridView.BackgroundColor = System.Drawing.Color.White; this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle44.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle44.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle44.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle44; this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.M_ID, @@ -567,23 +605,23 @@ this.mainGridView.MultiSelect = false; this.mainGridView.Name = "mainGridView"; this.mainGridView.ReadOnly = true; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mainGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle46.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle46.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle46.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle46.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle46.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle46.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle46.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle46; this.mainGridView.RowHeadersVisible = false; - dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle47.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle47.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle47; this.mainGridView.RowTemplate.Height = 40; this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.mainGridView.Size = new System.Drawing.Size(493, 254); this.mainGridView.TabIndex = 5; - this.mainGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.mainGridView_CellMouseClick); + this.mainGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mainGridView_CellClick); // // M_ID // @@ -605,8 +643,8 @@ // this.M_SendTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.M_SendTime.DataPropertyName = "SendTime"; - dataGridViewCellStyle3.Format = "yyyy/MM/dd"; - this.M_SendTime.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle45.Format = "yyyy/MM/dd"; + this.M_SendTime.DefaultCellStyle = dataGridViewCellStyle45; this.M_SendTime.HeaderText = "发货时间"; this.M_SendTime.Name = "M_SendTime"; this.M_SendTime.ReadOnly = true; @@ -649,15 +687,15 @@ this.orderGridView.AllowUserToDeleteRows = false; this.orderGridView.AllowUserToResizeColumns = false; this.orderGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle48.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle48; this.orderGridView.BackgroundColor = System.Drawing.Color.White; this.orderGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle49.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle49.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle49.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle49.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle49; this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.D_ID, @@ -676,9 +714,9 @@ this.orderGridView.Name = "orderGridView"; this.orderGridView.ReadOnly = true; this.orderGridView.RowHeadersVisible = false; - dataGridViewCellStyle13.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle55.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle55.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle55; this.orderGridView.RowTemplate.Height = 40; this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.orderGridView.Size = new System.Drawing.Size(789, 200); @@ -732,8 +770,8 @@ // D_SecondNumber // this.D_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle8.Format = "#0.######"; - this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle50.Format = "#0.######"; + this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle50; this.D_SecondNumber.HeaderText = "辅数量"; this.D_SecondNumber.Name = "D_SecondNumber"; this.D_SecondNumber.ReadOnly = true; @@ -741,8 +779,8 @@ // D_Number // this.D_Number.DataPropertyName = "Number"; - dataGridViewCellStyle9.Format = "#0.######"; - this.D_Number.DefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle51.Format = "#0.######"; + this.D_Number.DefaultCellStyle = dataGridViewCellStyle51; this.D_Number.HeaderText = "报价数量"; this.D_Number.Name = "D_Number"; this.D_Number.ReadOnly = true; @@ -750,8 +788,8 @@ // D_SSecondNumber // this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; - dataGridViewCellStyle10.Format = "#0.######"; - this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle52.Format = "#0.######"; + this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle52; this.D_SSecondNumber.HeaderText = "配货辅数量"; this.D_SSecondNumber.Name = "D_SSecondNumber"; this.D_SSecondNumber.ReadOnly = true; @@ -759,8 +797,8 @@ // D_SNumber // this.D_SNumber.DataPropertyName = "SNumber"; - dataGridViewCellStyle11.Format = "#0.######"; - this.D_SNumber.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle53.Format = "#0.######"; + this.D_SNumber.DefaultCellStyle = dataGridViewCellStyle53; this.D_SNumber.HeaderText = "配货数量"; this.D_SNumber.Name = "D_SNumber"; this.D_SNumber.ReadOnly = true; @@ -768,8 +806,8 @@ // D_DiffNumber // this.D_DiffNumber.DataPropertyName = "DiffNumber"; - dataGridViewCellStyle12.Format = "#0.######"; - this.D_DiffNumber.DefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle54.Format = "#0.######"; + this.D_DiffNumber.DefaultCellStyle = dataGridViewCellStyle54; this.D_DiffNumber.HeaderText = "差异数量"; this.D_DiffNumber.Name = "D_DiffNumber"; this.D_DiffNumber.ReadOnly = true; @@ -791,15 +829,15 @@ this.sendGridView.AllowUserToDeleteRows = false; this.sendGridView.AllowUserToResizeColumns = false; this.sendGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.sendGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle56.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.sendGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle56; this.sendGridView.BackgroundColor = System.Drawing.Color.White; this.sendGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle15.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.sendGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle57.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle57.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle57.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.sendGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle57; this.sendGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.sendGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.F_ID, @@ -820,59 +858,15 @@ this.sendGridView.Name = "sendGridView"; this.sendGridView.ReadOnly = true; this.sendGridView.RowHeadersVisible = false; - dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.sendGridView.RowsDefaultCellStyle = dataGridViewCellStyle21; + dataGridViewCellStyle63.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle63.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.sendGridView.RowsDefaultCellStyle = dataGridViewCellStyle63; this.sendGridView.RowTemplate.Height = 40; this.sendGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.sendGridView.Size = new System.Drawing.Size(789, 200); this.sendGridView.TabIndex = 1; this.sendGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sendGridView_CellClick); // - // commitBtn - // - this.commitBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.commitBtn.AsClicked = false; - this.commitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("commitBtn.BackgroundImage"))); - this.commitBtn.EnableGroup = false; - this.commitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); - this.commitBtn.FlatAppearance.BorderSize = 0; - this.commitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.commitBtn.ForeColor = System.Drawing.Color.Black; - this.commitBtn.Location = new System.Drawing.Point(1197, 566); - this.commitBtn.Name = "commitBtn"; - this.commitBtn.PlaySound = false; - this.commitBtn.SelfControlEnable = false; - this.commitBtn.Size = new System.Drawing.Size(100, 30); - this.commitBtn.SoundType = WinFormControl.SoundType.Click; - this.commitBtn.TabIndex = 15; - this.commitBtn.Text = "提交"; - this.commitBtn.UseVisualStyleBackColor = true; - this.commitBtn.WithStataHode = false; - this.commitBtn.Click += new System.EventHandler(this.commitBtn_Click); - // - // deleteBtn - // - this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.deleteBtn.AsClicked = false; - this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage"))); - this.deleteBtn.EnableGroup = false; - this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); - this.deleteBtn.FlatAppearance.BorderSize = 0; - this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.deleteBtn.ForeColor = System.Drawing.Color.Black; - this.deleteBtn.Location = new System.Drawing.Point(994, 566); - this.deleteBtn.Name = "deleteBtn"; - this.deleteBtn.PlaySound = false; - this.deleteBtn.SelfControlEnable = false; - this.deleteBtn.Size = new System.Drawing.Size(100, 30); - this.deleteBtn.SoundType = WinFormControl.SoundType.Click; - this.deleteBtn.TabIndex = 16; - this.deleteBtn.Text = "删除选中"; - this.deleteBtn.UseVisualStyleBackColor = true; - this.deleteBtn.WithStataHode = false; - this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); - // // F_ID // this.F_ID.DataPropertyName = "ID"; @@ -907,8 +901,8 @@ // // F_BarCode // - this.F_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.F_BarCode.DataPropertyName = "BarCode"; + this.F_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_BarCode.DataPropertyName = "ShortCode"; this.F_BarCode.HeaderText = "存货条码"; this.F_BarCode.MinimumWidth = 100; this.F_BarCode.Name = "F_BarCode"; @@ -916,7 +910,7 @@ // // F_GoodsCode // - this.F_GoodsCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_GoodsCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.F_GoodsCode.DataPropertyName = "Goods_Code"; this.F_GoodsCode.HeaderText = "产品编码"; this.F_GoodsCode.MinimumWidth = 100; @@ -925,7 +919,7 @@ // // F_Goods_Name // - this.F_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.F_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.F_Goods_Name.DataPropertyName = "Goods_Name"; this.F_Goods_Name.HeaderText = "产品名称"; this.F_Goods_Name.MinimumWidth = 100; @@ -935,55 +929,163 @@ // F_Number // this.F_Number.DataPropertyName = "Number"; - dataGridViewCellStyle16.Format = "#0.######"; - this.F_Number.DefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle58.Format = "#0.######"; + this.F_Number.DefaultCellStyle = dataGridViewCellStyle58; this.F_Number.HeaderText = "数量"; this.F_Number.Name = "F_Number"; this.F_Number.ReadOnly = true; + this.F_Number.Width = 60; // // F_InStoreWeight // this.F_InStoreWeight.DataPropertyName = "InStoreWeight"; - dataGridViewCellStyle17.Format = "#0.######"; - this.F_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle59.Format = "#0.######"; + this.F_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle59; this.F_InStoreWeight.HeaderText = "入库重量"; this.F_InStoreWeight.Name = "F_InStoreWeight"; this.F_InStoreWeight.ReadOnly = true; + this.F_InStoreWeight.Width = 90; // // F_Weight // this.F_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle18.Format = "#0.######"; - this.F_Weight.DefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle60.Format = "#0.######"; + this.F_Weight.DefaultCellStyle = dataGridViewCellStyle60; this.F_Weight.HeaderText = "重量"; this.F_Weight.Name = "F_Weight"; this.F_Weight.ReadOnly = true; + this.F_Weight.Width = 80; // // F_DiffWeight // this.F_DiffWeight.DataPropertyName = "DiffWeight"; - dataGridViewCellStyle19.Format = "#0.######"; - this.F_DiffWeight.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle61.Format = "#0.######"; + this.F_DiffWeight.DefaultCellStyle = dataGridViewCellStyle61; this.F_DiffWeight.HeaderText = "差异"; this.F_DiffWeight.Name = "F_DiffWeight"; this.F_DiffWeight.ReadOnly = true; + this.F_DiffWeight.Width = 70; // // F_Time // this.F_Time.DataPropertyName = "Time"; - dataGridViewCellStyle20.Format = "MM/dd HH:mm:ss"; - this.F_Time.DefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle62.Format = "MM.dd HH:mm:ss"; + this.F_Time.DefaultCellStyle = dataGridViewCellStyle62; this.F_Time.HeaderText = "时间"; this.F_Time.Name = "F_Time"; this.F_Time.ReadOnly = true; this.F_Time.Width = 120; // + // commitBtn + // + this.commitBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.commitBtn.AsClicked = false; + this.commitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("commitBtn.BackgroundImage"))); + this.commitBtn.EnableGroup = false; + this.commitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.commitBtn.FlatAppearance.BorderSize = 0; + this.commitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.commitBtn.Font = new System.Drawing.Font("宋体", 15F); + this.commitBtn.ForeColor = System.Drawing.Color.Black; + this.commitBtn.Location = new System.Drawing.Point(1180, 549); + this.commitBtn.Name = "commitBtn"; + this.commitBtn.PlaySound = false; + this.commitBtn.SelfControlEnable = false; + this.commitBtn.Size = new System.Drawing.Size(107, 58); + this.commitBtn.SoundType = WinFormControl.SoundType.Click; + this.commitBtn.TabIndex = 15; + this.commitBtn.Text = "提交"; + this.commitBtn.UseVisualStyleBackColor = true; + this.commitBtn.WithStataHode = false; + this.commitBtn.Click += new System.EventHandler(this.commitBtn_Click); + // + // deleteBtn + // + this.deleteBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.deleteBtn.AsClicked = false; + this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage"))); + this.deleteBtn.EnableGroup = false; + this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.deleteBtn.FlatAppearance.BorderSize = 0; + this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.deleteBtn.ForeColor = System.Drawing.Color.Black; + this.deleteBtn.Location = new System.Drawing.Point(994, 566); + this.deleteBtn.Name = "deleteBtn"; + this.deleteBtn.PlaySound = false; + this.deleteBtn.SelfControlEnable = false; + this.deleteBtn.Size = new System.Drawing.Size(100, 30); + this.deleteBtn.SoundType = WinFormControl.SoundType.Click; + this.deleteBtn.TabIndex = 16; + this.deleteBtn.Text = "删除选中"; + this.deleteBtn.UseVisualStyleBackColor = true; + this.deleteBtn.WithStataHode = false; + this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); + // + // checkBox1 + // + this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("宋体", 12F); + this.checkBox1.Location = new System.Drawing.Point(534, 570); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(91, 20); + this.checkBox1.TabIndex = 17; + this.checkBox1.Text = "扫码发货"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // halfBtn + // + this.halfBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.halfBtn.AsClicked = false; + this.halfBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("halfBtn.BackgroundImage"))); + this.halfBtn.EnableGroup = false; + this.halfBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.halfBtn.FlatAppearance.BorderSize = 0; + this.halfBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.halfBtn.ForeColor = System.Drawing.Color.Black; + this.halfBtn.Location = new System.Drawing.Point(681, 566); + this.halfBtn.Name = "halfBtn"; + this.halfBtn.PlaySound = false; + this.halfBtn.SelfControlEnable = false; + this.halfBtn.Size = new System.Drawing.Size(100, 30); + this.halfBtn.SoundType = WinFormControl.SoundType.Click; + this.halfBtn.TabIndex = 18; + this.halfBtn.Text = "0.5"; + this.halfBtn.UseVisualStyleBackColor = true; + this.halfBtn.WithStataHode = false; + this.halfBtn.Click += new System.EventHandler(this.halfBtn_Click); + // + // fullBtn + // + this.fullBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.fullBtn.AsClicked = false; + this.fullBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("fullBtn.BackgroundImage"))); + this.fullBtn.EnableGroup = false; + this.fullBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.fullBtn.FlatAppearance.BorderSize = 0; + this.fullBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.fullBtn.ForeColor = System.Drawing.Color.Black; + this.fullBtn.Location = new System.Drawing.Point(815, 566); + this.fullBtn.Name = "fullBtn"; + this.fullBtn.PlaySound = false; + this.fullBtn.SelfControlEnable = false; + this.fullBtn.Size = new System.Drawing.Size(100, 30); + this.fullBtn.SoundType = WinFormControl.SoundType.Click; + this.fullBtn.TabIndex = 19; + this.fullBtn.Text = "1"; + this.fullBtn.UseVisualStyleBackColor = true; + this.fullBtn.WithStataHode = false; + this.fullBtn.Click += new System.EventHandler(this.fullBtn_Click); + // // CarcassSaleOutForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1305, 611); + this.Controls.Add(this.fullBtn); + this.Controls.Add(this.halfBtn); + this.Controls.Add(this.checkBox1); this.Controls.Add(this.deleteBtn); this.Controls.Add(this.commitBtn); this.Controls.Add(this.groupBox2); @@ -1001,6 +1103,7 @@ this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.panel3.ResumeLayout(false); + this.panel5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).EndInit(); this.panel4.ResumeLayout(false); this.groupBox1.ResumeLayout(false); @@ -1008,6 +1111,7 @@ this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.sendGridView)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -1067,6 +1171,9 @@ private System.Windows.Forms.DataGridViewTextBoxColumn M_Customer_Name; private System.Windows.Forms.DataGridViewTextBoxColumn M_SendTime; private System.Windows.Forms.DataGridViewTextBoxColumn M_DeliverGoodsLine_Name; + private System.Windows.Forms.CheckBox checkBox1; + private WinFormControl.UButton halfBtn; + private WinFormControl.UButton fullBtn; private System.Windows.Forms.DataGridViewTextBoxColumn F_ID; private System.Windows.Forms.DataGridViewTextBoxColumn F_Selected; private System.Windows.Forms.DataGridViewImageColumn F_Image; @@ -1079,5 +1186,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn F_DiffWeight; private System.Windows.Forms.DataGridViewTextBoxColumn F_Time; + private WinFormControl.UButton unFinishBtn; + private System.Windows.Forms.Panel panel5; } } \ No newline at end of file diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs index 9a28d1b..1919e55 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs @@ -117,7 +117,10 @@ namespace ButcherFactory.CarcassSaleOut_ detail.Idx = 1; weightRecord.Insert(0, detail); sendGridView.FirstDisplayedScrollingRowIndex = 0; - sendGridView.Refresh(); + if (!checkBox1.Checked) + AfterScan("G8536"); + else + sendGridView.Refresh(); })); } } @@ -125,6 +128,13 @@ namespace ButcherFactory.CarcassSaleOut_ void uScanPanel1_AfterScan() { var barCode = uScanPanel1.TextBox.Text.Trim(); + if (!barCode.StartsWith("G") && weightRecord.Any(x => x.BarCode == barCode)) + return; + AfterScan(barCode); + } + + void AfterScan(string barCode) + { if (string.IsNullOrEmpty(barCode)) throw new Exception("条码错误"); var first = weightRecord.LastOrDefault(x => !x.Filled); @@ -146,8 +156,11 @@ namespace ButcherFactory.CarcassSaleOut_ { if (orderGridView.CurrentRow == null) throw new Exception("请选择配货明细"); - var detailID = (long)orderGridView.CurrentRow.Cells[0].Value; - new WeightRecordDialog(detailID).ShowDialog(); + var detail = orderGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; + var dg = new WeightRecordDialog(details.First(x => x.ID == detail.ID), already); + dg.ShowDialog(); + if (dg.Changed) + BindOrderGrid(detail.SaleOutStore_ID); } private void goodsFinishBtn_Click(object sender, EventArgs e) @@ -156,18 +169,39 @@ namespace ButcherFactory.CarcassSaleOut_ throw new Exception("请选择要配货完成的发货单"); var id = (long)mainGridView.CurrentRow.Cells[0].Value; - var details = CarcassSaleOutBL.GetSaleOutStoreDetailList(id); - if (details.Any(x => x.SSecondNumber == null || x.SSecondNumber == 0)) + var ds = CarcassSaleOutBL.GetSaleOutStoreDetailList(id); + if (ds.Any(x => x.SSecondNumber == null || x.SSecondNumber == 0)) { if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return; } - CarcassSaleOutBL.SetGoodsFinish(id); + CarcassSaleOutBL.SetGoodsFinish(id); + AfterChangeFinishGoods(id); + UMessageBox.Show("配货完成!"); + } + + private void unFinishBtn_Click(object sender, EventArgs e) + { + if (mainGridView.CurrentRow == null) + throw new Exception("请选择要配货完成的发货单"); + var id = (long)mainGridView.CurrentRow.Cells[0].Value; + CarcassSaleOutBL.SetGoodsUnFinish(id); + AfterChangeFinishGoods(id); + UMessageBox.Show("撤销成功!"); + } + + private void AfterChangeFinishGoods(long id) + { saleOutStoreList.Remove(saleOutStoreList.First(x => x.ID == id)); mainGridView.Refresh(); - details.Clear(); + if (details != null) + details.Clear(); orderGridView.Refresh(); - UMessageBox.Show("配货完成!"); + + billIDLabel.Text = string.Empty; + customerLabel.Text = string.Empty; + addressLabel.Text = string.Empty; + carNumberLabel.Text = string.Empty; } private void commitBtn_Click(object sender, EventArgs e) @@ -267,7 +301,7 @@ namespace ButcherFactory.CarcassSaleOut_ storeID = null; } - private void mainGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) + private void mainGridView_CellClick(object sender, DataGridViewCellEventArgs e) { var id = (long)mainGridView.CurrentRow.Cells[0].Value; var first = saleOutStoreList.First(x => x.ID == id); @@ -275,15 +309,35 @@ namespace ButcherFactory.CarcassSaleOut_ customerLabel.Text = first.Customer_Name; addressLabel.Text = first.Address; carNumberLabel.Text = first.CarNumber; + BindOrderGrid(null); + } + + void BindOrderGrid(long? detailID) + { + var id = long.Parse(billIDLabel.Text); details = CarcassSaleOutBL.GetSaleOutStoreDetailList(id); foreach (var item in details) { item.SaleOutStore_ID = id; - item.Customer_Name = first.Customer_Name; + item.Customer_Name = customerLabel.Text; } orderGridView.DataSource = details; - if (details.Any()) - orderGridView.FirstDisplayedScrollingRowIndex = 0; + if (detailID.HasValue) + { + foreach (DataGridViewRow row in orderGridView.Rows) + { + if ((long)row.Cells[0].Value == detailID) + { + row.Selected = true; + break; + } + } + } + else + { + if (details.Any()) + orderGridView.FirstDisplayedScrollingRowIndex = 0; + } orderGridView.Refresh(); } @@ -297,6 +351,7 @@ namespace ButcherFactory.CarcassSaleOut_ { commitBtn.Enabled = !already; goodsFinishBtn.Enabled = !already; + unFinishBtn.Enabled = already; if (details != null) { details.Clear(); @@ -361,5 +416,27 @@ namespace ButcherFactory.CarcassSaleOut_ first.Selected = !first.Selected; sendGridView.Refresh(); } + + private void halfBtn_Click(object sender, EventArgs e) + { + SetWeightNumber(0.5m); + } + + private void fullBtn_Click(object sender, EventArgs e) + { + SetWeightNumber(1); + } + + private void SetWeightNumber(decimal number) + { + if (sendGridView.CurrentRow == null) + return; + var id = (long)sendGridView.CurrentRow.Cells[0].Value; + CarcassSaleOutBL.UpdateWeightNumber(id, number); + var first = weightRecord.First(x => x.ID == id); + first.Selected = true; + first.Number = number; + sendGridView.Refresh(); + } } } diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx index d3b19e1..12c520e 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx @@ -142,7 +142,7 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK @@ -150,7 +150,15 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK @@ -258,6 +266,22 @@ wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs b/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs new file mode 100644 index 0000000..fdbce67 --- /dev/null +++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs @@ -0,0 +1,234 @@ +namespace ButcherFactory.Dialogs +{ + partial class AddWeightRecord + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddWeightRecord)); + this.uLabel1 = new WinFormControl.ULabel(); + this.uLabel2 = new WinFormControl.ULabel(); + this.uLabel3 = new WinFormControl.ULabel(); + this.okBtn = new WinFormControl.UButton(); + this.cancelBtn = new WinFormControl.UButton(); + this.goodsLabel = new WinFormControl.ULabel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.fullBtn = new WinFormControl.UButton(); + this.helfBtn = new WinFormControl.UButton(); + this.weightInput = new WinFormControl.UTextBoxWithPad(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // uLabel1 + // + this.uLabel1.AutoSize = true; + this.uLabel1.BackColor = System.Drawing.Color.Transparent; + this.uLabel1.Font = new System.Drawing.Font("宋体", 12F); + this.uLabel1.Location = new System.Drawing.Point(57, 41); + this.uLabel1.Name = "uLabel1"; + this.uLabel1.Size = new System.Drawing.Size(88, 16); + this.uLabel1.TabIndex = 0; + this.uLabel1.Text = "存货名称:"; + // + // uLabel2 + // + this.uLabel2.AutoSize = true; + this.uLabel2.BackColor = System.Drawing.Color.Transparent; + this.uLabel2.Font = new System.Drawing.Font("宋体", 12F); + this.uLabel2.Location = new System.Drawing.Point(57, 109); + this.uLabel2.Name = "uLabel2"; + this.uLabel2.Size = new System.Drawing.Size(80, 16); + this.uLabel2.TabIndex = 1; + this.uLabel2.Text = "数 量:"; + // + // uLabel3 + // + this.uLabel3.AutoSize = true; + this.uLabel3.BackColor = System.Drawing.Color.Transparent; + this.uLabel3.Font = new System.Drawing.Font("宋体", 12F); + this.uLabel3.Location = new System.Drawing.Point(57, 190); + this.uLabel3.Name = "uLabel3"; + this.uLabel3.Size = new System.Drawing.Size(80, 16); + this.uLabel3.TabIndex = 2; + this.uLabel3.Text = "重 量:"; + // + // okBtn + // + this.okBtn.AsClicked = false; + this.okBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("okBtn.BackgroundImage"))); + this.okBtn.EnableGroup = false; + this.okBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.okBtn.FlatAppearance.BorderSize = 0; + this.okBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.okBtn.Font = new System.Drawing.Font("宋体", 12F); + this.okBtn.ForeColor = System.Drawing.Color.Black; + this.okBtn.Location = new System.Drawing.Point(174, 280); + this.okBtn.Name = "okBtn"; + this.okBtn.PlaySound = false; + this.okBtn.SelfControlEnable = false; + this.okBtn.Size = new System.Drawing.Size(92, 40); + this.okBtn.SoundType = WinFormControl.SoundType.Click; + this.okBtn.TabIndex = 3; + this.okBtn.Text = "确定"; + this.okBtn.UseVisualStyleBackColor = true; + this.okBtn.WithStataHode = false; + this.okBtn.Click += new System.EventHandler(this.okBtn_Click); + // + // cancelBtn + // + this.cancelBtn.AsClicked = false; + this.cancelBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cancelBtn.BackgroundImage"))); + this.cancelBtn.EnableGroup = false; + this.cancelBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.cancelBtn.FlatAppearance.BorderSize = 0; + this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cancelBtn.Font = new System.Drawing.Font("宋体", 12F); + this.cancelBtn.ForeColor = System.Drawing.Color.Black; + this.cancelBtn.Location = new System.Drawing.Point(332, 280); + this.cancelBtn.Name = "cancelBtn"; + this.cancelBtn.PlaySound = false; + this.cancelBtn.SelfControlEnable = false; + this.cancelBtn.Size = new System.Drawing.Size(92, 40); + this.cancelBtn.SoundType = WinFormControl.SoundType.Click; + this.cancelBtn.TabIndex = 4; + this.cancelBtn.Text = "取消"; + this.cancelBtn.UseVisualStyleBackColor = true; + this.cancelBtn.WithStataHode = false; + this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); + // + // goodsLabel + // + this.goodsLabel.AutoSize = true; + this.goodsLabel.BackColor = System.Drawing.Color.Transparent; + this.goodsLabel.Font = new System.Drawing.Font("宋体", 15F); + this.goodsLabel.ForeColor = System.Drawing.Color.Red; + this.goodsLabel.Location = new System.Drawing.Point(174, 41); + this.goodsLabel.Name = "goodsLabel"; + this.goodsLabel.Size = new System.Drawing.Size(49, 20); + this.goodsLabel.TabIndex = 5; + this.goodsLabel.Text = "存货"; + // + // panel1 + // + this.panel1.Controls.Add(this.fullBtn); + this.panel1.Controls.Add(this.helfBtn); + this.panel1.Location = new System.Drawing.Point(178, 100); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(242, 42); + this.panel1.TabIndex = 6; + // + // fullBtn + // + this.fullBtn.AsClicked = true; + this.fullBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("fullBtn.BackgroundImage"))); + this.fullBtn.EnableGroup = true; + this.fullBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.fullBtn.FlatAppearance.BorderSize = 0; + this.fullBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.fullBtn.Font = new System.Drawing.Font("宋体", 12F); + this.fullBtn.ForeColor = System.Drawing.Color.White; + this.fullBtn.Location = new System.Drawing.Point(154, 3); + this.fullBtn.Name = "fullBtn"; + this.fullBtn.PlaySound = false; + this.fullBtn.SelfControlEnable = false; + this.fullBtn.Size = new System.Drawing.Size(85, 36); + this.fullBtn.SoundType = WinFormControl.SoundType.Click; + this.fullBtn.TabIndex = 1; + this.fullBtn.Text = "1"; + this.fullBtn.UseVisualStyleBackColor = true; + this.fullBtn.WithStataHode = true; + this.fullBtn.Click += new System.EventHandler(this.fullBtn_Click); + // + // helfBtn + // + this.helfBtn.AsClicked = false; + this.helfBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("helfBtn.BackgroundImage"))); + this.helfBtn.EnableGroup = true; + this.helfBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.helfBtn.FlatAppearance.BorderSize = 0; + this.helfBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.helfBtn.Font = new System.Drawing.Font("宋体", 12F); + this.helfBtn.ForeColor = System.Drawing.Color.Black; + this.helfBtn.Location = new System.Drawing.Point(3, 3); + this.helfBtn.Name = "helfBtn"; + this.helfBtn.PlaySound = false; + this.helfBtn.SelfControlEnable = false; + this.helfBtn.Size = new System.Drawing.Size(85, 36); + this.helfBtn.SoundType = WinFormControl.SoundType.Click; + this.helfBtn.TabIndex = 0; + this.helfBtn.Text = "0.5"; + this.helfBtn.UseVisualStyleBackColor = true; + this.helfBtn.WithStataHode = true; + this.helfBtn.Click += new System.EventHandler(this.helfBtn_Click); + // + // weightInput + // + this.weightInput.Font = new System.Drawing.Font("宋体", 20F); + this.weightInput.Location = new System.Drawing.Point(178, 181); + this.weightInput.Name = "weightInput"; + this.weightInput.Size = new System.Drawing.Size(242, 38); + this.weightInput.TabIndex = 7; + this.weightInput.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; + // + // AddWeightRecord + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(582, 357); + this.ControlBox = false; + this.Controls.Add(this.weightInput); + this.Controls.Add(this.panel1); + this.Controls.Add(this.goodsLabel); + this.Controls.Add(this.cancelBtn); + this.Controls.Add(this.okBtn); + this.Controls.Add(this.uLabel3); + this.Controls.Add(this.uLabel2); + this.Controls.Add(this.uLabel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "AddWeightRecord"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "新增"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private WinFormControl.ULabel uLabel1; + private WinFormControl.ULabel uLabel2; + private WinFormControl.ULabel uLabel3; + private WinFormControl.UButton okBtn; + private WinFormControl.UButton cancelBtn; + private WinFormControl.ULabel goodsLabel; + private System.Windows.Forms.Panel panel1; + private WinFormControl.UButton helfBtn; + private WinFormControl.UTextBoxWithPad weightInput; + private WinFormControl.UButton fullBtn; + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.cs b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs new file mode 100644 index 0000000..5e42c32 --- /dev/null +++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs @@ -0,0 +1,64 @@ +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO.Utils; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ButcherFactory.Dialogs +{ + public partial class AddWeightRecord : Form + { + SaleOutStore_Detail mDetail; + decimal number = 1; + public AddWeightRecord(SaleOutStore_Detail detail) + { + InitializeComponent(); + mDetail = detail; + goodsLabel.Text = mDetail.Goods_Name; + } + + private void okBtn_Click(object sender, EventArgs e) + { + decimal weight = 0; + if (!decimal.TryParse(weightInput.Text, out weight)) + throw new Exception("请输入重量"); + + var record = new CarcassSaleOut_Detail(); + record.BillID = mDetail.SaleOutStore_ID; + record.DetailID = mDetail.ID; + record.Filled = true; + record.Goods_Code = mDetail.Goods_Code; + record.Goods_ID = mDetail.Goods_ID; + record.Goods_Name = mDetail.Goods_Name; + record.Number = number; + record.Weight = weight; + record.Operator = AppContext.Worker.Name; + + CarcassSaleOutBL.AddAndUpdate(record); + DialogResult = DialogResult.OK; + this.Close(); + } + + private void cancelBtn_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void helfBtn_Click(object sender, EventArgs e) + { + number = 0.5m; + } + + private void fullBtn_Click(object sender, EventArgs e) + { + number = 1; + } + } +} diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.resx b/ButcherFactory.Form/Dialogs/AddWeightRecord.resx new file mode 100644 index 0000000..4178b2b --- /dev/null +++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABzSURBVGhD7dABDQAgDMAwDKEYX9eDg89AkyrouW9Y + CAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKC + oCAoCAqCgqAgKAgKgoKgICgICoKCoNWbDyxvHbTQUKATAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs index ade2c35..244b4c2 100644 --- a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs @@ -37,6 +37,7 @@ this.uButton1 = new WinFormControl.UButton(); this.searchBtn = new WinFormControl.UButton(); this.panel1 = new System.Windows.Forms.Panel(); + this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -48,26 +49,26 @@ this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1000, 278); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1049, 252); this.flowLayoutPanel1.TabIndex = 0; // // flowLayoutPanel2 // - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 47); + this.flowLayoutPanel2.Location = new System.Drawing.Point(48, 122); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Size = new System.Drawing.Size(1000, 54); this.flowLayoutPanel2.TabIndex = 1; // // flowLayoutPanel3 // - this.flowLayoutPanel3.Location = new System.Drawing.Point(26, 114); + this.flowLayoutPanel3.Location = new System.Drawing.Point(74, 189); this.flowLayoutPanel3.Name = "flowLayoutPanel3"; this.flowLayoutPanel3.Size = new System.Drawing.Size(974, 54); this.flowLayoutPanel3.TabIndex = 2; // // flowLayoutPanel4 // - this.flowLayoutPanel4.Location = new System.Drawing.Point(62, 179); + this.flowLayoutPanel4.Location = new System.Drawing.Point(110, 254); this.flowLayoutPanel4.Name = "flowLayoutPanel4"; this.flowLayoutPanel4.Size = new System.Drawing.Size(938, 54); this.flowLayoutPanel4.TabIndex = 3; @@ -75,7 +76,7 @@ // textBox1 // this.textBox1.Font = new System.Drawing.Font("宋体", 14F); - this.textBox1.Location = new System.Drawing.Point(14, 9); + this.textBox1.Location = new System.Drawing.Point(14, 11); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(194, 29); this.textBox1.TabIndex = 4; @@ -90,7 +91,7 @@ this.uButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.uButton1.Font = new System.Drawing.Font("宋体", 12F); this.uButton1.ForeColor = System.Drawing.Color.Black; - this.uButton1.Location = new System.Drawing.Point(233, 9); + this.uButton1.Location = new System.Drawing.Point(358, 10); this.uButton1.Name = "uButton1"; this.uButton1.PlaySound = false; this.uButton1.SelfControlEnable = false; @@ -112,7 +113,7 @@ this.searchBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.searchBtn.Font = new System.Drawing.Font("宋体", 12F); this.searchBtn.ForeColor = System.Drawing.Color.Black; - this.searchBtn.Location = new System.Drawing.Point(340, 9); + this.searchBtn.Location = new System.Drawing.Point(235, 10); this.searchBtn.Name = "searchBtn"; this.searchBtn.PlaySound = false; this.searchBtn.SelfControlEnable = false; @@ -127,23 +128,31 @@ // panel1 // this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.panel1.Controls.Add(this.flowLayoutPanel5); this.panel1.Controls.Add(this.textBox1); this.panel1.Controls.Add(this.searchBtn); this.panel1.Controls.Add(this.flowLayoutPanel2); this.panel1.Controls.Add(this.uButton1); this.panel1.Controls.Add(this.flowLayoutPanel3); this.panel1.Controls.Add(this.flowLayoutPanel4); - this.panel1.Location = new System.Drawing.Point(2, 286); + this.panel1.Location = new System.Drawing.Point(2, 260); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1000, 238); + this.panel1.Size = new System.Drawing.Size(1049, 314); this.panel1.TabIndex = 7; // + // flowLayoutPanel5 + // + this.flowLayoutPanel5.Location = new System.Drawing.Point(14, 53); + this.flowLayoutPanel5.Name = "flowLayoutPanel5"; + this.flowLayoutPanel5.Size = new System.Drawing.Size(1034, 54); + this.flowLayoutPanel5.TabIndex = 7; + // // SelectCustomerDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(1005, 536); + this.ClientSize = new System.Drawing.Size(1054, 586); this.Controls.Add(this.panel1); this.Controls.Add(this.flowLayoutPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; @@ -166,5 +175,6 @@ private WinFormControl.UButton uButton1; private WinFormControl.UButton searchBtn; private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5; } } \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.cs b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.cs index e00a854..e8bea04 100644 --- a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.cs +++ b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.cs @@ -24,10 +24,11 @@ namespace ButcherFactory.Dialogs void InitKeyBoard() { var chars = new char[][] { + new char[]{'1','2','3','4','5','6','7','8','9','0'}, new char[] { 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P' }, new char[] { 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L' }, new char[] { 'Z', 'X', 'C', 'V', 'B', 'N', 'M' } }; - var panel = new FlowLayoutPanel[] { flowLayoutPanel2, flowLayoutPanel3, flowLayoutPanel4 }; + var panel = new FlowLayoutPanel[] { flowLayoutPanel5, flowLayoutPanel2, flowLayoutPanel3, flowLayoutPanel4 }; var idx = 0; foreach (var v in chars) { diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs index 8681aaa..182cc14 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs @@ -30,19 +30,31 @@ { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WeightRecordDialog)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.uDataGridView1 = new WinFormControl.UDataGridView(); + this.addBtn = new WinFormControl.UButton(); + this.panel1 = new System.Windows.Forms.Panel(); + this.closeBtn = new WinFormControl.UButton(); + this.deleteBtn = new WinFormControl.UButton(); + this.weightLabel = new WinFormControl.ULabel(); + this.R_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_Idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Goods_Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_InStoreWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_DiffWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_Operator = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); + this.panel1.SuspendLayout(); this.SuspendLayout(); // // uDataGridView1 @@ -57,6 +69,7 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; + this.uDataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; @@ -64,30 +77,141 @@ this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.R_ID, + this.R_Idx, this.R_BarCode, this.R_Goods_Code, this.R_Goods_Name, + this.R_Number, this.R_InStoreWeight, this.R_Weight, this.R_DiffWeight, + this.R_Operator, this.R_Time}); - this.uDataGridView1.Location = new System.Drawing.Point(21, 22); + this.uDataGridView1.Location = new System.Drawing.Point(12, 22); this.uDataGridView1.MultiSelect = false; this.uDataGridView1.Name = "uDataGridView1"; this.uDataGridView1.ReadOnly = true; this.uDataGridView1.RowHeadersVisible = false; - dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle7; this.uDataGridView1.RowTemplate.Height = 23; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.uDataGridView1.Size = new System.Drawing.Size(782, 470); + this.uDataGridView1.Size = new System.Drawing.Size(1012, 434); this.uDataGridView1.TabIndex = 0; // + // addBtn + // + this.addBtn.AsClicked = false; + this.addBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("addBtn.BackgroundImage"))); + this.addBtn.EnableGroup = false; + this.addBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.addBtn.FlatAppearance.BorderSize = 0; + this.addBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.addBtn.Font = new System.Drawing.Font("宋体", 12F); + this.addBtn.ForeColor = System.Drawing.Color.Black; + this.addBtn.Location = new System.Drawing.Point(3, 5); + this.addBtn.Name = "addBtn"; + this.addBtn.PlaySound = false; + this.addBtn.SelfControlEnable = false; + this.addBtn.Size = new System.Drawing.Size(117, 43); + this.addBtn.SoundType = WinFormControl.SoundType.Click; + this.addBtn.TabIndex = 1; + this.addBtn.Text = "新增"; + this.addBtn.UseVisualStyleBackColor = true; + this.addBtn.WithStataHode = false; + this.addBtn.Click += new System.EventHandler(this.addBtn_Click); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.Controls.Add(this.closeBtn); + this.panel1.Controls.Add(this.deleteBtn); + this.panel1.Controls.Add(this.addBtn); + this.panel1.Location = new System.Drawing.Point(219, 468); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(604, 52); + this.panel1.TabIndex = 2; + // + // closeBtn + // + this.closeBtn.AsClicked = false; + this.closeBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("closeBtn.BackgroundImage"))); + this.closeBtn.EnableGroup = false; + this.closeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.closeBtn.FlatAppearance.BorderSize = 0; + this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.closeBtn.Font = new System.Drawing.Font("宋体", 12F); + this.closeBtn.ForeColor = System.Drawing.Color.Black; + this.closeBtn.Location = new System.Drawing.Point(428, 5); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.PlaySound = false; + this.closeBtn.SelfControlEnable = false; + this.closeBtn.Size = new System.Drawing.Size(117, 43); + this.closeBtn.SoundType = WinFormControl.SoundType.Click; + this.closeBtn.TabIndex = 3; + this.closeBtn.Text = "关闭"; + this.closeBtn.UseVisualStyleBackColor = true; + this.closeBtn.WithStataHode = false; + this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); + // + // deleteBtn + // + this.deleteBtn.AsClicked = false; + this.deleteBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("deleteBtn.BackgroundImage"))); + this.deleteBtn.EnableGroup = false; + this.deleteBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.deleteBtn.FlatAppearance.BorderSize = 0; + this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.deleteBtn.Font = new System.Drawing.Font("宋体", 12F); + this.deleteBtn.ForeColor = System.Drawing.Color.Black; + this.deleteBtn.Location = new System.Drawing.Point(214, 5); + this.deleteBtn.Name = "deleteBtn"; + this.deleteBtn.PlaySound = false; + this.deleteBtn.SelfControlEnable = false; + this.deleteBtn.Size = new System.Drawing.Size(117, 43); + this.deleteBtn.SoundType = WinFormControl.SoundType.Click; + this.deleteBtn.TabIndex = 2; + this.deleteBtn.Text = "删除且更新"; + this.deleteBtn.UseVisualStyleBackColor = true; + this.deleteBtn.WithStataHode = false; + this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); + // + // weightLabel + // + this.weightLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.weightLabel.AutoSize = true; + this.weightLabel.BackColor = System.Drawing.Color.Transparent; + this.weightLabel.Font = new System.Drawing.Font("宋体", 15F); + this.weightLabel.ForeColor = System.Drawing.Color.Red; + this.weightLabel.Location = new System.Drawing.Point(18, 483); + this.weightLabel.Name = "weightLabel"; + this.weightLabel.Size = new System.Drawing.Size(79, 20); + this.weightLabel.TabIndex = 3; + this.weightLabel.Text = "uLabel1"; + // + // R_ID + // + this.R_ID.DataPropertyName = "ID"; + this.R_ID.HeaderText = "ID"; + this.R_ID.Name = "R_ID"; + this.R_ID.ReadOnly = true; + this.R_ID.Visible = false; + // + // R_Idx + // + this.R_Idx.DataPropertyName = "Idx"; + this.R_Idx.HeaderText = "序号"; + this.R_Idx.Name = "R_Idx"; + this.R_Idx.ReadOnly = true; + this.R_Idx.Width = 75; + // // R_BarCode // this.R_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.R_BarCode.DataPropertyName = "BarCode"; + this.R_BarCode.DataPropertyName = "ShortCode"; this.R_BarCode.HeaderText = "存货条码"; this.R_BarCode.MinimumWidth = 100; this.R_BarCode.Name = "R_BarCode"; @@ -109,11 +233,21 @@ this.R_Goods_Name.Name = "R_Goods_Name"; this.R_Goods_Name.ReadOnly = true; // + // R_Number + // + this.R_Number.DataPropertyName = "Number"; + dataGridViewCellStyle3.Format = "#0.######"; + this.R_Number.DefaultCellStyle = dataGridViewCellStyle3; + this.R_Number.HeaderText = "数量"; + this.R_Number.Name = "R_Number"; + this.R_Number.ReadOnly = true; + this.R_Number.Width = 70; + // // R_InStoreWeight // this.R_InStoreWeight.DataPropertyName = "InStoreWeight"; - dataGridViewCellStyle3.Format = "#0.######"; - this.R_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle4.Format = "#0.######"; + this.R_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle4; this.R_InStoreWeight.HeaderText = "入库重量"; this.R_InStoreWeight.Name = "R_InStoreWeight"; this.R_InStoreWeight.ReadOnly = true; @@ -121,8 +255,8 @@ // R_Weight // this.R_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle4.Format = "#0.######"; - this.R_Weight.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle5.Format = "#0.######"; + this.R_Weight.DefaultCellStyle = dataGridViewCellStyle5; this.R_Weight.HeaderText = "重量"; this.R_Weight.Name = "R_Weight"; this.R_Weight.ReadOnly = true; @@ -130,11 +264,19 @@ // R_DiffWeight // this.R_DiffWeight.DataPropertyName = "DiffWeight"; - dataGridViewCellStyle5.Format = "#0.######"; - this.R_DiffWeight.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle6.Format = "#0.######"; + this.R_DiffWeight.DefaultCellStyle = dataGridViewCellStyle6; this.R_DiffWeight.HeaderText = "差异"; this.R_DiffWeight.Name = "R_DiffWeight"; this.R_DiffWeight.ReadOnly = true; + this.R_DiffWeight.Width = 70; + // + // R_Operator + // + this.R_Operator.DataPropertyName = "Operator"; + this.R_Operator.HeaderText = "操作员"; + this.R_Operator.Name = "R_Operator"; + this.R_Operator.ReadOnly = true; // // R_Time // @@ -151,26 +293,39 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(832, 519); + this.ClientSize = new System.Drawing.Size(1036, 528); + this.Controls.Add(this.weightLabel); + this.Controls.Add(this.panel1); this.Controls.Add(this.uDataGridView1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Name = "WeightRecordDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "称重记录"; ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); + this.panel1.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private WinFormControl.UDataGridView uDataGridView1; + private WinFormControl.UButton addBtn; + private System.Windows.Forms.Panel panel1; + private WinFormControl.UButton deleteBtn; + private WinFormControl.UButton closeBtn; + private WinFormControl.ULabel weightLabel; + private System.Windows.Forms.DataGridViewTextBoxColumn R_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn R_Idx; private System.Windows.Forms.DataGridViewTextBoxColumn R_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn R_Goods_Code; private System.Windows.Forms.DataGridViewTextBoxColumn R_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn R_Number; private System.Windows.Forms.DataGridViewTextBoxColumn R_InStoreWeight; private System.Windows.Forms.DataGridViewTextBoxColumn R_Weight; private System.Windows.Forms.DataGridViewTextBoxColumn R_DiffWeight; + private System.Windows.Forms.DataGridViewTextBoxColumn R_Operator; private System.Windows.Forms.DataGridViewTextBoxColumn R_Time; } } \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs index 3e4d769..472bbc1 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs @@ -1,4 +1,5 @@ -using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; using System; using System.Collections.Generic; using System.ComponentModel; @@ -13,13 +14,53 @@ namespace ButcherFactory.Dialogs { public partial class WeightRecordDialog : Form { - public WeightRecordDialog(long detailID) + BindingList list; + SaleOutStore_Detail mDetail; + public bool Changed = false; + public WeightRecordDialog(SaleOutStore_Detail detail, bool readOnly) { InitializeComponent(); + mDetail = detail; + if (readOnly) + { + addBtn.Enabled = false; + deleteBtn.Enabled = true; + } uDataGridView1.BorderStyle = BorderStyle.FixedSingle; - var list = CarcassSaleOutBL.GetWeightRecord(detailID); + BindGrid(); + } + + void BindGrid() + { + list = CarcassSaleOutBL.GetWeightRecord(mDetail.ID); uDataGridView1.DataSource = list; uDataGridView1.Refresh(); + weightLabel.Text = string.Format("{0:#0.######} KG", list.Sum(x => x.Weight)); + } + + private void addBtn_Click(object sender, EventArgs e) + { + if (new AddWeightRecord(mDetail).ShowDialog() == DialogResult.OK) + { + BindGrid(); + Changed = true; + } + } + + private void deleteBtn_Click(object sender, EventArgs e) + { + if(uDataGridView1.CurrentRow==null) + return; + var id = (long)uDataGridView1.CurrentRow.Cells[0].Value; + var tag = list.First(x => x.ID == id); + CarcassSaleOutBL.DeleteAndUpdate(tag); + BindGrid(); + Changed = true; + } + + private void closeBtn_Click(object sender, EventArgs e) + { + Close(); } } } diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx b/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx index 0e12117..e888d57 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + True @@ -126,6 +132,9 @@ True + + True + True @@ -135,7 +144,35 @@ True + + True + True + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs index e1614f1..f252d38 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs @@ -17,6 +17,8 @@ namespace ButcherFactory.SegmentProduction_ const string IMGFILE = @"TempImg\_img{0}.png"; public static void Print(SegmentProduction entity, DateTime? dt) { + if (AppContext.ConnectInfo.TraceBackUrl == "default") + throw new Exception("请先配置追溯服务器地址"); if (dt == null) dt = DateTime.Today; var dic = new Dictionary(); @@ -28,7 +30,7 @@ namespace ButcherFactory.SegmentProduction_ BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 100); dic.Add("$ImageUrl", imgUrl); BwpClientPrint.BwpClientWebPrint.Print(PRINTFILE, dic); - AfterPrint(); + AfterPrint(); } public static void PrintEnd(List list)