From 23c6d555b1371bd8763573ac8cddc25933b02088 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sat, 26 May 2018 11:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=B3=BB=E5=88=97=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs | 21 ++- .../ButcherFactory.Form.csproj | 1 + .../CarcassSaleOutForm.Designer.cs | 170 +++++++++--------- .../CarcassSaleOut_/CarcassSaleOutForm.cs | 39 ++-- .../CarcassSaleOut_/CarcassSaleOutForm.resx | 8 +- .../CarcassSaleOutFormConfig.cs | 15 ++ .../Dialogs/AddWeightRecord.Designer.cs | 28 ++- .../Dialogs/AddWeightRecord.cs | 12 +- .../Dialogs/ClientGoodsSetDialog.Designer.cs | 4 + .../Dialogs/NumberSetDialog.Designer.cs | 1 + .../Dialogs/SelectBillStateDialog.Designer.cs | 1 + .../Dialogs/SelectCustomerDialog.Designer.cs | 1 + .../SelectDeliverGoodsLineDialog.Designer.cs | 1 + .../Dialogs/SelectStoreDialog.Designer.cs | 1 + .../Dialogs/WeightRecordDialog.Designer.cs | 63 ++++++- .../Dialogs/WeightRecordDialog.cs | 37 +++- .../Dialogs/WeightRecordDialog.resx | 14 ++ 17 files changed, 280 insertions(+), 137 deletions(-) create mode 100644 ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs index db73c5b..b68c96f 100644 --- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs @@ -197,11 +197,6 @@ namespace ButcherFactory.BO.LocalBL detail.SSecondNumber = (detail.SSecondNumber ?? 0) + details.Sum(x => x.Number); } - public static void SaveAssignNum(long id, decimal number) - { - RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SaveAssignNum", id, number); - } - public static void SetGoodsFinish(long id) { RpcFacade.Call(RpcPath + "SaleOutStoreRpc/SetFinishAssignState", id, true); @@ -240,10 +235,24 @@ namespace ButcherFactory.BO.LocalBL public static void DeleteAndUpdate(CarcassSaleOut_Detail tag) { - var json = JsonConvert.SerializeObject(new ExtensionObj { LongExt1 = tag.DetailID, LongExt2 = tag.WeightRecord_ID, LongExt3 = tag.ScanRecord_ID }); + var json = JsonConvert.SerializeObject(new List() { new ExtensionObj { LongExt1 = tag.DetailID, LongExt2 = tag.WeightRecord_ID, LongExt3 = tag.ScanRecord_ID } }); RpcFacade.Call(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", json); Delete(tag.ID); } + + public static void RollBackDetails(List backList) + { + var list = backList.Select(x => new ExtensionObj { LongExt1 = x.DetailID, LongExt2 = x.WeightRecord_ID, LongExt3 = x.ScanRecord_ID }); + RpcFacade.Call(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", JsonConvert.SerializeObject(list)); + + var update = new DQUpdateDom(typeof(CarcassSaleOut_Detail)); + update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), backList.Select(x => DQExpression.Value(x.ID)).ToArray())); + update.Columns.Add(new DQUpdateColumn("BillID", DQExpression.NULL)); + update.Columns.Add(new DQUpdateColumn("DetailID", DQExpression.NULL)); + update.Columns.Add(new DQUpdateColumn("WeightRecord_ID", DQExpression.NULL)); + update.Columns.Add(new DQUpdateColumn("ScanRecord_ID", DQExpression.NULL)); + update.EExecute(); + } } class SaleOutCarcassObj diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index a2e2763..d989ccf 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -68,6 +68,7 @@ CarcassSaleOutForm.cs + Form diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.Designer.cs index 4ce3670..34f114b 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 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle(); this.uWeightControl1 = new WinFormControl.UWeightControl(); this.panel1 = new System.Windows.Forms.Panel(); this.carNumberLabel = new WinFormControl.ULabel(); @@ -304,7 +304,7 @@ this.uTimerLabel1.Name = "uTimerLabel1"; this.uTimerLabel1.Size = new System.Drawing.Size(136, 16); this.uTimerLabel1.TabIndex = 11; - this.uTimerLabel1.Text = "5月24日 15:28:37"; + this.uTimerLabel1.Text = "5月26日 10:37:38"; // // uScanPanel1 // @@ -565,12 +565,13 @@ this.weightRecordBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); this.weightRecordBtn.FlatAppearance.BorderSize = 0; this.weightRecordBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.weightRecordBtn.Font = new System.Drawing.Font("宋体", 12F); this.weightRecordBtn.ForeColor = System.Drawing.Color.Black; - this.weightRecordBtn.Location = new System.Drawing.Point(182, 17); + this.weightRecordBtn.Location = new System.Drawing.Point(191, 25); this.weightRecordBtn.Name = "weightRecordBtn"; this.weightRecordBtn.PlaySound = false; this.weightRecordBtn.SelfControlEnable = false; - this.weightRecordBtn.Size = new System.Drawing.Size(100, 30); + this.weightRecordBtn.Size = new System.Drawing.Size(100, 60); this.weightRecordBtn.SoundType = WinFormControl.SoundType.Click; this.weightRecordBtn.TabIndex = 12; this.weightRecordBtn.Text = "称重记录"; @@ -584,17 +585,17 @@ this.mainGridView.AllowUserToDeleteRows = false; this.mainGridView.AllowUserToResizeColumns = false; this.mainGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle43.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle43; + dataGridViewCellStyle22.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle22; 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; - 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; + dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle23.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle23.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle23; this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.M_ID, @@ -605,18 +606,18 @@ this.mainGridView.MultiSelect = false; this.mainGridView.Name = "mainGridView"; this.mainGridView.ReadOnly = true; - 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; + dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle25.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle25.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle25.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle25.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle25; this.mainGridView.RowHeadersVisible = false; - 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; + dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle26; this.mainGridView.RowTemplate.Height = 40; this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.mainGridView.Size = new System.Drawing.Size(493, 254); @@ -643,8 +644,8 @@ // this.M_SendTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.M_SendTime.DataPropertyName = "SendTime"; - dataGridViewCellStyle45.Format = "yyyy/MM/dd"; - this.M_SendTime.DefaultCellStyle = dataGridViewCellStyle45; + dataGridViewCellStyle24.Format = "yyyy/MM/dd"; + this.M_SendTime.DefaultCellStyle = dataGridViewCellStyle24; this.M_SendTime.HeaderText = "发货时间"; this.M_SendTime.Name = "M_SendTime"; this.M_SendTime.ReadOnly = true; @@ -687,15 +688,15 @@ this.orderGridView.AllowUserToDeleteRows = false; this.orderGridView.AllowUserToResizeColumns = false; this.orderGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle48.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle48; + dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.orderGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle27; this.orderGridView.BackgroundColor = System.Drawing.Color.White; this.orderGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - 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; + dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle28.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.orderGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28; this.orderGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.orderGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.D_ID, @@ -714,14 +715,13 @@ this.orderGridView.Name = "orderGridView"; this.orderGridView.ReadOnly = true; this.orderGridView.RowHeadersVisible = false; - 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; + dataGridViewCellStyle34.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle34.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle34; this.orderGridView.RowTemplate.Height = 40; this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.orderGridView.Size = new System.Drawing.Size(789, 200); this.orderGridView.TabIndex = 0; - this.orderGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGridView_CellClick); this.orderGridView.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.orderGridView_RowPrePaint); // // D_ID @@ -770,8 +770,8 @@ // D_SecondNumber // this.D_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle50.Format = "#0.######"; - this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle50; + dataGridViewCellStyle29.Format = "#0.######"; + this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle29; this.D_SecondNumber.HeaderText = "辅数量"; this.D_SecondNumber.Name = "D_SecondNumber"; this.D_SecondNumber.ReadOnly = true; @@ -779,8 +779,8 @@ // D_Number // this.D_Number.DataPropertyName = "Number"; - dataGridViewCellStyle51.Format = "#0.######"; - this.D_Number.DefaultCellStyle = dataGridViewCellStyle51; + dataGridViewCellStyle30.Format = "#0.######"; + this.D_Number.DefaultCellStyle = dataGridViewCellStyle30; this.D_Number.HeaderText = "报价数量"; this.D_Number.Name = "D_Number"; this.D_Number.ReadOnly = true; @@ -788,8 +788,8 @@ // D_SSecondNumber // this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; - dataGridViewCellStyle52.Format = "#0.######"; - this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle52; + dataGridViewCellStyle31.Format = "#0.######"; + this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle31; this.D_SSecondNumber.HeaderText = "配货辅数量"; this.D_SSecondNumber.Name = "D_SSecondNumber"; this.D_SSecondNumber.ReadOnly = true; @@ -797,8 +797,8 @@ // D_SNumber // this.D_SNumber.DataPropertyName = "SNumber"; - dataGridViewCellStyle53.Format = "#0.######"; - this.D_SNumber.DefaultCellStyle = dataGridViewCellStyle53; + dataGridViewCellStyle32.Format = "#0.######"; + this.D_SNumber.DefaultCellStyle = dataGridViewCellStyle32; this.D_SNumber.HeaderText = "配货数量"; this.D_SNumber.Name = "D_SNumber"; this.D_SNumber.ReadOnly = true; @@ -806,8 +806,8 @@ // D_DiffNumber // this.D_DiffNumber.DataPropertyName = "DiffNumber"; - dataGridViewCellStyle54.Format = "#0.######"; - this.D_DiffNumber.DefaultCellStyle = dataGridViewCellStyle54; + dataGridViewCellStyle33.Format = "#0.######"; + this.D_DiffNumber.DefaultCellStyle = dataGridViewCellStyle33; this.D_DiffNumber.HeaderText = "差异数量"; this.D_DiffNumber.Name = "D_DiffNumber"; this.D_DiffNumber.ReadOnly = true; @@ -829,15 +829,15 @@ this.sendGridView.AllowUserToDeleteRows = false; this.sendGridView.AllowUserToResizeColumns = false; this.sendGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle56.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.sendGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle56; + dataGridViewCellStyle35.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.sendGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle35; this.sendGridView.BackgroundColor = System.Drawing.Color.White; this.sendGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; - 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; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle36.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle36.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.sendGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle36; this.sendGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.sendGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.F_ID, @@ -858,9 +858,9 @@ this.sendGridView.Name = "sendGridView"; this.sendGridView.ReadOnly = true; this.sendGridView.RowHeadersVisible = false; - 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; + dataGridViewCellStyle42.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle42.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.sendGridView.RowsDefaultCellStyle = dataGridViewCellStyle42; this.sendGridView.RowTemplate.Height = 40; this.sendGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.sendGridView.Size = new System.Drawing.Size(789, 200); @@ -929,8 +929,8 @@ // F_Number // this.F_Number.DataPropertyName = "Number"; - dataGridViewCellStyle58.Format = "#0.######"; - this.F_Number.DefaultCellStyle = dataGridViewCellStyle58; + dataGridViewCellStyle37.Format = "#0.######"; + this.F_Number.DefaultCellStyle = dataGridViewCellStyle37; this.F_Number.HeaderText = "数量"; this.F_Number.Name = "F_Number"; this.F_Number.ReadOnly = true; @@ -939,8 +939,8 @@ // F_InStoreWeight // this.F_InStoreWeight.DataPropertyName = "InStoreWeight"; - dataGridViewCellStyle59.Format = "#0.######"; - this.F_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle59; + dataGridViewCellStyle38.Format = "#0.######"; + this.F_InStoreWeight.DefaultCellStyle = dataGridViewCellStyle38; this.F_InStoreWeight.HeaderText = "入库重量"; this.F_InStoreWeight.Name = "F_InStoreWeight"; this.F_InStoreWeight.ReadOnly = true; @@ -949,8 +949,8 @@ // F_Weight // this.F_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle60.Format = "#0.######"; - this.F_Weight.DefaultCellStyle = dataGridViewCellStyle60; + dataGridViewCellStyle39.Format = "#0.######"; + this.F_Weight.DefaultCellStyle = dataGridViewCellStyle39; this.F_Weight.HeaderText = "重量"; this.F_Weight.Name = "F_Weight"; this.F_Weight.ReadOnly = true; @@ -959,8 +959,8 @@ // F_DiffWeight // this.F_DiffWeight.DataPropertyName = "DiffWeight"; - dataGridViewCellStyle61.Format = "#0.######"; - this.F_DiffWeight.DefaultCellStyle = dataGridViewCellStyle61; + dataGridViewCellStyle40.Format = "#0.######"; + this.F_DiffWeight.DefaultCellStyle = dataGridViewCellStyle40; this.F_DiffWeight.HeaderText = "差异"; this.F_DiffWeight.Name = "F_DiffWeight"; this.F_DiffWeight.ReadOnly = true; @@ -969,8 +969,8 @@ // F_Time // this.F_Time.DataPropertyName = "Time"; - dataGridViewCellStyle62.Format = "MM.dd HH:mm:ss"; - this.F_Time.DefaultCellStyle = dataGridViewCellStyle62; + dataGridViewCellStyle41.Format = "MM.dd HH:mm:ss"; + this.F_Time.DefaultCellStyle = dataGridViewCellStyle41; this.F_Time.HeaderText = "时间"; this.F_Time.Name = "F_Time"; this.F_Time.ReadOnly = true; diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs index aab0f54..06b917d 100644 --- a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.cs @@ -74,11 +74,24 @@ namespace ButcherFactory.CarcassSaleOut_ billState = 0; billStateBox.Text = "未审核"; sendDateBox.Text = sendTime.ToString("yyyy-MM-dd"); + + var config = XmlUtil.DeserializeFromFile(); + if (config.Store_ID.HasValue) + { + storeBox.Text = config.Store_Name; + storeID = config.Store_ID; + } + this.mainGridView.BorderStyle = BorderStyle.FixedSingle; + BindWeightRecord(); + BindProductBatch(); + } + + void BindWeightRecord() + { weightRecord = CarcassSaleOutBL.GetUnSubmitWeightRecord(); sendGridView.DataSource = weightRecord; sendGridView.Refresh(); - BindProductBatch(); } private void BindProductBatch() @@ -161,6 +174,8 @@ namespace ButcherFactory.CarcassSaleOut_ dg.ShowDialog(); if (dg.Changed) BindOrderGrid(detail.SaleOutStore_ID); + if (dg.rolBack) + BindWeightRecord(); } private void goodsFinishBtn_Click(object sender, EventArgs e) @@ -278,6 +293,7 @@ namespace ButcherFactory.CarcassSaleOut_ { textBox.Text = sb.Result.Item1; storeID = sb.Result.Item2; + XmlUtil.SerializerObjToFile(new CarcassSaleOutFormConfig { Store_ID = storeID, Store_Name = textBox.Text }); } break; } @@ -386,27 +402,6 @@ namespace ButcherFactory.CarcassSaleOut_ } } - private void orderGridView_CellClick(object sender, DataGridViewCellEventArgs e) - { - if (already) - return; - if (e.RowIndex < 0 || e.ColumnIndex < orderGridView.Columns.Count - 3) - return; - var keyBoard = new NumberPad(); - if (keyBoard.ShowDialog() == true) - { - decimal n = 0; - if (decimal.TryParse(keyBoard.Result, out n)) - { - var d = details.First(x => x.ID == (long)orderGridView.CurrentRow.Cells[0].Value); - CarcassSaleOutBL.SaveAssignNum(d.ID, n); - d.SNumber = n; - orderGridView.Refresh(); - } - - } - } - private void sendGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutForm.resx index 12c520e..8091f9d 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,7 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK @@ -158,7 +158,7 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK @@ -166,7 +166,7 @@ KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= - + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK diff --git a/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs new file mode 100644 index 0000000..d684b18 --- /dev/null +++ b/ButcherFactory.Form/CarcassSaleOut_/CarcassSaleOutFormConfig.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.CarcassSaleOut_ +{ + public class CarcassSaleOutFormConfig + { + public long? Store_ID { get; set; } + + public string Store_Name { get; set; } + } +} diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs b/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs index fdbce67..dc4fc05 100644 --- a/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs +++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.Designer.cs @@ -39,6 +39,7 @@ this.fullBtn = new WinFormControl.UButton(); this.helfBtn = new WinFormControl.UButton(); this.weightInput = new WinFormControl.UTextBoxWithPad(); + this.numberInput = new WinFormControl.UTextBoxWithPad(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -69,7 +70,7 @@ 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.Location = new System.Drawing.Point(57, 235); this.uLabel3.Name = "uLabel3"; this.uLabel3.Size = new System.Drawing.Size(80, 16); this.uLabel3.TabIndex = 2; @@ -85,13 +86,13 @@ 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.Location = new System.Drawing.Point(174, 310); 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.TabIndex = 4; this.okBtn.Text = "确定"; this.okBtn.UseVisualStyleBackColor = true; this.okBtn.WithStataHode = false; @@ -107,13 +108,13 @@ 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.Location = new System.Drawing.Point(332, 310); 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.TabIndex = 5; this.cancelBtn.Text = "取消"; this.cancelBtn.UseVisualStyleBackColor = true; this.cancelBtn.WithStataHode = false; @@ -187,19 +188,29 @@ // weightInput // this.weightInput.Font = new System.Drawing.Font("宋体", 20F); - this.weightInput.Location = new System.Drawing.Point(178, 181); + this.weightInput.Location = new System.Drawing.Point(178, 226); this.weightInput.Name = "weightInput"; this.weightInput.Size = new System.Drawing.Size(242, 38); - this.weightInput.TabIndex = 7; + this.weightInput.TabIndex = 3; this.weightInput.Type = WinFormControl.UTextBoxWithPad.TextBoxType.Number; // + // numberInput + // + this.numberInput.Font = new System.Drawing.Font("宋体", 20F); + this.numberInput.Location = new System.Drawing.Point(178, 163); + this.numberInput.Name = "numberInput"; + this.numberInput.Size = new System.Drawing.Size(242, 38); + this.numberInput.TabIndex = 2; + this.numberInput.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.ClientSize = new System.Drawing.Size(582, 394); this.ControlBox = false; + this.Controls.Add(this.numberInput); this.Controls.Add(this.weightInput); this.Controls.Add(this.panel1); this.Controls.Add(this.goodsLabel); @@ -230,5 +241,6 @@ private WinFormControl.UButton helfBtn; private WinFormControl.UTextBoxWithPad weightInput; private WinFormControl.UButton fullBtn; + private WinFormControl.UTextBoxWithPad numberInput; } } \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.cs b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs index db43c71..fe1f7b1 100644 --- a/ButcherFactory.Form/Dialogs/AddWeightRecord.cs +++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs @@ -17,12 +17,12 @@ namespace ButcherFactory.Dialogs { SaleOutStore_Detail mDetail; long? mBatchID = null; - decimal number = 1; public AddWeightRecord(SaleOutStore_Detail detail,long? batchID) { InitializeComponent(); mDetail = detail; mBatchID = batchID; + numberInput.Text = "1"; goodsLabel.Text = mDetail.Goods_Name; } @@ -31,7 +31,11 @@ namespace ButcherFactory.Dialogs decimal weight = 0; if (!decimal.TryParse(weightInput.Text, out weight)) throw new Exception("请输入重量"); - + decimal number = 0; + if (!decimal.TryParse(numberInput.Text, out number)) + throw new Exception("请输入数量"); + if (number < 0) + throw new Exception("数量不能为负"); var record = new CarcassSaleOut_Detail(); record.BillID = mDetail.SaleOutStore_ID; record.DetailID = mDetail.ID; @@ -56,12 +60,12 @@ namespace ButcherFactory.Dialogs private void helfBtn_Click(object sender, EventArgs e) { - number = 0.5m; + numberInput.Text = "0.5"; } private void fullBtn_Click(object sender, EventArgs e) { - number = 1; + numberInput.Text = "1"; } } } diff --git a/ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs b/ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs index 91caae5..14f07db 100644 --- a/ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs @@ -69,6 +69,7 @@ this.closeBtn.Location = new System.Drawing.Point(696, 2); this.closeBtn.Name = "closeBtn"; this.closeBtn.PlaySound = false; + this.closeBtn.SelfControlEnable = false; this.closeBtn.Size = new System.Drawing.Size(111, 34); this.closeBtn.SoundType = WinFormControl.SoundType.Click; this.closeBtn.TabIndex = 26; @@ -86,7 +87,10 @@ this.Controls.Add(this.closeBtn); this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "ClientGoodsSetDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "存货设置"; this.ResumeLayout(false); diff --git a/ButcherFactory.Form/Dialogs/NumberSetDialog.Designer.cs b/ButcherFactory.Form/Dialogs/NumberSetDialog.Designer.cs index 8dab94b..69c7e3e 100644 --- a/ButcherFactory.Form/Dialogs/NumberSetDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/NumberSetDialog.Designer.cs @@ -119,6 +119,7 @@ this.Controls.Add(this.numBox); this.Controls.Add(this.uLabel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "NumberSetDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "数量设置"; diff --git a/ButcherFactory.Form/Dialogs/SelectBillStateDialog.Designer.cs b/ButcherFactory.Form/Dialogs/SelectBillStateDialog.Designer.cs index 4177788..673a0ea 100644 --- a/ButcherFactory.Form/Dialogs/SelectBillStateDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/SelectBillStateDialog.Designer.cs @@ -133,6 +133,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(445, 263); + this.ControlBox = false; this.Controls.Add(this.uButton4); this.Controls.Add(this.uButton3); this.Controls.Add(this.uButton2); diff --git a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs index 244b4c2..5b3e6aa 100644 --- a/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/SelectCustomerDialog.Designer.cs @@ -156,6 +156,7 @@ this.Controls.Add(this.panel1); this.Controls.Add(this.flowLayoutPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "SelectCustomerDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "选择客户"; diff --git a/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.Designer.cs b/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.Designer.cs index bf8b61e..ed53877 100644 --- a/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.Designer.cs @@ -51,6 +51,7 @@ this.ClientSize = new System.Drawing.Size(1005, 536); this.Controls.Add(this.tabControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "SelectDeliverGoodsLineDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "送货线路"; diff --git a/ButcherFactory.Form/Dialogs/SelectStoreDialog.Designer.cs b/ButcherFactory.Form/Dialogs/SelectStoreDialog.Designer.cs index f81f06a..7a04f58 100644 --- a/ButcherFactory.Form/Dialogs/SelectStoreDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/SelectStoreDialog.Designer.cs @@ -37,6 +37,7 @@ this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1005, 536); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "SelectStoreDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "仓库"; diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs index 182cc14..ddc4667 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs @@ -42,7 +42,10 @@ this.closeBtn = new WinFormControl.UButton(); this.deleteBtn = new WinFormControl.UButton(); this.weightLabel = new WinFormControl.ULabel(); + this.rollBackBtn = new WinFormControl.UButton(); this.R_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_Selected = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_Image = new System.Windows.Forms.DataGridViewImageColumn(); 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(); @@ -78,6 +81,8 @@ this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.R_ID, + this.R_Selected, + this.R_Image, this.R_Idx, this.R_BarCode, this.R_Goods_Code, @@ -96,10 +101,12 @@ 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.RowTemplate.Height = 40; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.uDataGridView1.Size = new System.Drawing.Size(1012, 434); + this.uDataGridView1.Size = new System.Drawing.Size(1045, 434); this.uDataGridView1.TabIndex = 0; + this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellClick); + this.uDataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.uDataGridView1_CellFormatting); // // addBtn // @@ -127,12 +134,13 @@ // 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.rollBackBtn); 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.Location = new System.Drawing.Point(185, 468); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(604, 52); + this.panel1.Size = new System.Drawing.Size(776, 52); this.panel1.TabIndex = 2; // // closeBtn @@ -145,7 +153,7 @@ 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.Location = new System.Drawing.Point(623, 5); this.closeBtn.Name = "closeBtn"; this.closeBtn.PlaySound = false; this.closeBtn.SelfControlEnable = false; @@ -167,7 +175,7 @@ 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.Location = new System.Drawing.Point(204, 5); this.deleteBtn.Name = "deleteBtn"; this.deleteBtn.PlaySound = false; this.deleteBtn.SelfControlEnable = false; @@ -192,6 +200,28 @@ this.weightLabel.TabIndex = 3; this.weightLabel.Text = "uLabel1"; // + // rollBackBtn + // + this.rollBackBtn.AsClicked = false; + this.rollBackBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("rollBackBtn.BackgroundImage"))); + this.rollBackBtn.EnableGroup = false; + this.rollBackBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.rollBackBtn.FlatAppearance.BorderSize = 0; + this.rollBackBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.rollBackBtn.Font = new System.Drawing.Font("宋体", 12F); + this.rollBackBtn.ForeColor = System.Drawing.Color.Black; + this.rollBackBtn.Location = new System.Drawing.Point(414, 5); + this.rollBackBtn.Name = "rollBackBtn"; + this.rollBackBtn.PlaySound = false; + this.rollBackBtn.SelfControlEnable = false; + this.rollBackBtn.Size = new System.Drawing.Size(117, 43); + this.rollBackBtn.SoundType = WinFormControl.SoundType.Click; + this.rollBackBtn.TabIndex = 4; + this.rollBackBtn.Text = "退回"; + this.rollBackBtn.UseVisualStyleBackColor = true; + this.rollBackBtn.WithStataHode = false; + this.rollBackBtn.Click += new System.EventHandler(this.rollBackBtn_Click); + // // R_ID // this.R_ID.DataPropertyName = "ID"; @@ -200,6 +230,21 @@ this.R_ID.ReadOnly = true; this.R_ID.Visible = false; // + // R_Selected + // + this.R_Selected.DataPropertyName = "Selected"; + this.R_Selected.HeaderText = "Selected"; + this.R_Selected.Name = "R_Selected"; + this.R_Selected.ReadOnly = true; + this.R_Selected.Visible = false; + // + // R_Image + // + this.R_Image.HeaderText = "选中"; + this.R_Image.Name = "R_Image"; + this.R_Image.ReadOnly = true; + this.R_Image.Width = 50; + // // R_Idx // this.R_Idx.DataPropertyName = "Idx"; @@ -293,11 +338,12 @@ 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(1036, 528); + this.ClientSize = new System.Drawing.Size(1069, 528); this.Controls.Add(this.weightLabel); this.Controls.Add(this.panel1); this.Controls.Add(this.uDataGridView1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MinimizeBox = false; this.Name = "WeightRecordDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "称重记录"; @@ -316,7 +362,10 @@ private WinFormControl.UButton deleteBtn; private WinFormControl.UButton closeBtn; private WinFormControl.ULabel weightLabel; + private WinFormControl.UButton rollBackBtn; private System.Windows.Forms.DataGridViewTextBoxColumn R_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn R_Selected; + private System.Windows.Forms.DataGridViewImageColumn R_Image; private System.Windows.Forms.DataGridViewTextBoxColumn R_Idx; private System.Windows.Forms.DataGridViewTextBoxColumn R_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn R_Goods_Code; diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs index 9d1b692..2489854 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs @@ -14,10 +14,13 @@ namespace ButcherFactory.Dialogs { public partial class WeightRecordDialog : Form { + static Image CheckImg = System.Drawing.Image.FromFile("Images\\check.png"); + static Image UnCheckImg = System.Drawing.Image.FromFile("Images\\uCheck.png"); BindingList list; SaleOutStore_Detail mDetail; long? mBatchID = null; public bool Changed = false; + public bool rolBack = false; public WeightRecordDialog(SaleOutStore_Detail detail, bool readOnly,long? batchID) { InitializeComponent(); @@ -26,7 +29,8 @@ namespace ButcherFactory.Dialogs if (readOnly) { addBtn.Enabled = false; - deleteBtn.Enabled = true; + deleteBtn.Enabled = false; + rollBackBtn.Enabled = false; } uDataGridView1.BorderStyle = BorderStyle.FixedSingle; BindGrid(); @@ -64,5 +68,36 @@ namespace ButcherFactory.Dialogs { Close(); } + + private void uDataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + if (e.RowIndex < 0 || e.ColumnIndex != 2) + return; + var v = (bool)uDataGridView1.Rows[e.RowIndex].Cells[1].Value; + e.Value = v ? CheckImg : UnCheckImg; + } + + private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex < 0) + return; + var id = (long)uDataGridView1.CurrentRow.Cells[0].Value; + var first = list.First(x => x.ID == id); + first.Selected = !first.Selected; + uDataGridView1.Refresh(); + } + + private void rollBackBtn_Click(object sender, EventArgs e) + { + var backList = list.Where(x => x.Selected).ToList(); + if (backList.Count() == 0) + throw new Exception("没有称重记录"); + if (MessageBox.Show("确定退回选中记录?", "请确认", MessageBoxButtons.OKCancel) != DialogResult.OK) + return; + CarcassSaleOutBL.RollBackDetails(backList); + BindGrid(); + Changed = true; + rolBack = true; + } } } diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx b/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx index e888d57..49cc29e 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.resx @@ -120,6 +120,12 @@ True + + True + + + True + True @@ -157,6 +163,14 @@ wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII=