From f778190f3b823cc2c9edefeabfecbfa8f5bc1a2d Mon Sep 17 00:00:00 2001 From: wugang <1029149336@qq.com> Date: Mon, 11 Dec 2017 10:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=89=B2=20+=20=E6=B5=8B=E8=AF=95winf?= =?UTF-8?q?orm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3ButcherManageClient.sln | 10 +- BO/BarCodeScan/BardCodeHook.cs | 12 +- BO/Utils/AfterLoginUtil.cs | 4 +- BO/Utils/ServerUrlConfig.cs | 1 + BO/Utils/UrlUtil.cs | 43 +- ButcherManageClient/Login.cs | 6 +- ButcherManageClient/SettingForm.Designer.cs | 34 +- ButcherManageClient/SettingForm.cs | 2 + .../ByProductWeightForm.Designer.cs | 50 +- SegmentationWeight/SegmentationWeight.csproj | 1 + .../SegmentationWeightForm.Designer.cs | 221 ++++---- SegmentationWeight/SegmentationWeightForm.cs | 36 +- SegmentationWeight/SegmentationWeightPrint.cs | 60 +++ .../TrunksIousOutInStoreForm.Designer.cs | 208 ++------ .../TrunksIousOutInStoreForm.cs | 483 +++++++----------- .../TrunksIousOutInStoreForm.resx | 12 +- WeighAndGrading/GradeFrom.cs | 6 +- WinFormTest/App.config | 6 + WinFormTest/Form1.Designer.cs | 63 +++ WinFormTest/Form1.cs | 57 +++ WinFormTest/Form1.resx | 120 +++++ WinFormTest/Program.cs | 22 + WinFormTest/Properties/AssemblyInfo.cs | 36 ++ WinFormTest/Properties/Resources.Designer.cs | 71 +++ WinFormTest/Properties/Resources.resx | 117 +++++ WinFormTest/Properties/Settings.Designer.cs | 30 ++ WinFormTest/Properties/Settings.settings | 7 + WinFormTest/WinFormTest.csproj | 99 ++++ 28 files changed, 1174 insertions(+), 643 deletions(-) create mode 100644 SegmentationWeight/SegmentationWeightPrint.cs create mode 100644 WinFormTest/App.config create mode 100644 WinFormTest/Form1.Designer.cs create mode 100644 WinFormTest/Form1.cs create mode 100644 WinFormTest/Form1.resx create mode 100644 WinFormTest/Program.cs create mode 100644 WinFormTest/Properties/AssemblyInfo.cs create mode 100644 WinFormTest/Properties/Resources.Designer.cs create mode 100644 WinFormTest/Properties/Resources.resx create mode 100644 WinFormTest/Properties/Settings.Designer.cs create mode 100644 WinFormTest/Properties/Settings.settings create mode 100644 WinFormTest/WinFormTest.csproj diff --git a/B3ButcherManageClient.sln b/B3ButcherManageClient.sln index 72e564d..0ce7c87 100644 --- a/B3ButcherManageClient.sln +++ b/B3ButcherManageClient.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}" EndProject @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distribution", "Distributio EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DropPigReOrder", "DropPigReOrder\DropPigReOrder.csproj", "{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormTest", "WinFormTest\WinFormTest.csproj", "{E9831F50-FD30-465C-9BF1-D3C9C415EF5B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -109,6 +111,10 @@ Global {031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Debug|Any CPU.Build.0 = Debug|Any CPU {031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.ActiveCfg = Release|Any CPU {031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.Build.0 = Release|Any CPU + {E9831F50-FD30-465C-9BF1-D3C9C415EF5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9831F50-FD30-465C-9BF1-D3C9C415EF5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9831F50-FD30-465C-9BF1-D3C9C415EF5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9831F50-FD30-465C-9BF1-D3C9C415EF5B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BO/BarCodeScan/BardCodeHook.cs b/BO/BarCodeScan/BardCodeHook.cs index 9e6f8ae..6aaec7f 100644 --- a/BO/BarCodeScan/BardCodeHook.cs +++ b/BO/BarCodeScan/BardCodeHook.cs @@ -106,15 +106,6 @@ namespace BO { barCode.VirtKey = msg.message & 0xff;//虚拟吗 barCode.ScanCode = msg.paramL & 0xff;//扫描码 - StringBuilder strKeyName = new StringBuilder(225); - if (GetKeyNameText(barCode.ScanCode * 65536, strKeyName, 255) > 0) - { - barCode.KeyName = strKeyName.ToString().Trim(new char[] { ' ', '\0' }); - } - else - { - barCode.KeyName = ""; - } byte[] kbArray = new byte[256]; uint uKey = 0; GetKeyboardState(kbArray); @@ -159,6 +150,8 @@ namespace BO barCode.IsValid = true; sbBarCode.Remove(0, sbBarCode.Length); } + Debug.Print(sbBarCode.ToString()+ " "+ barCode.Chr.ToString()); + sbBarCode.Append(barCode.Chr.ToString()); } @@ -177,6 +170,7 @@ namespace BO BarCodeEvent(barCode);//触发事件 + barCode.BarCode = ""; diff --git a/BO/Utils/AfterLoginUtil.cs b/BO/Utils/AfterLoginUtil.cs index 92a363c..7f25bca 100644 --- a/BO/Utils/AfterLoginUtil.cs +++ b/BO/Utils/AfterLoginUtil.cs @@ -24,8 +24,10 @@ namespace BO.Utils new Tuple("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"), new Tuple("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"), new Tuple("窒晕员",@"C:\BwpB3Project\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"), + new Tuple("胴体白条出入库",@"C:\B3\src\B3ButcherManageClient\TrunksIousOutInStore\bin\Debug\TrunksIousOutInStore"), new Tuple("掉猪处理员",@"C:\BwpB3Project\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"), - new Tuple("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution") + new Tuple("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution"), + new Tuple("分割称重",@"C:\B3\src\B3ButcherManageClient\SegmentationWeight\bin\Debug\SegmentationWeight") }; #else static List> roleToAssemblies = new List>() diff --git a/BO/Utils/ServerUrlConfig.cs b/BO/Utils/ServerUrlConfig.cs index f017666..6ff85fe 100644 --- a/BO/Utils/ServerUrlConfig.cs +++ b/BO/Utils/ServerUrlConfig.cs @@ -11,5 +11,6 @@ namespace BO.Utils public string ServerUrl { get; set; } public string OfflineSqlConnection { get; set; } + public string OutAddress { get; set; }//外网地址,追溯用的 } } diff --git a/BO/Utils/UrlUtil.cs b/BO/Utils/UrlUtil.cs index 933e8cd..5417f54 100644 --- a/BO/Utils/UrlUtil.cs +++ b/BO/Utils/UrlUtil.cs @@ -17,56 +17,35 @@ namespace BO.Utils if (barCode.Contains("?") && barCode.ToLower().Contains("http")) { - barCode = barCode.Replace("http://www.bwpsoft.com?code=", ""); + barCode = barCode.Replace(ButcherAppContext.Context.UrlConfig.OutAddress+"?code=", ""); var andIndex = barCode.IndexOf("&", StringComparison.Ordinal); barCode = barCode.Substring(0, andIndex); } return barCode.Trim(); - -// if (barCode.Contains("?") && barCode.ToLower().Contains("http")) -// { -// Uri uri = new Uri(barCode); -// string queryString = uri.Query; -// NameValueCollection col = GetQueryString(queryString); -// string code = col["code"]; -// -// return code; -// } -// else -// { -// return barCode; -// } - } public static string GetGoodsName(string barCode) { //如果是链接 - if (barCode.Contains("name=")) { var index = barCode.IndexOf("name=", StringComparison.Ordinal); barCode = barCode.Substring(index+5); - return barCode.Trim(); + var name= barCode.Trim(); + if (name == "qpbt") + { + return "去皮白条"; + } + if (name == "dpbt") + { + return "带皮白条"; + } + return name; } return ""; - - // if (barCode.Contains("?") && barCode.ToLower().Contains("http")) - // { - // Uri uri = new Uri(barCode); - // string queryString = uri.Query; - // NameValueCollection col = GetQueryString(queryString); - // string name = col["name"]; - // return name; - // } - // else - // { - // return ""; - // } - } private static NameValueCollection GetQueryString(string queryString) diff --git a/ButcherManageClient/Login.cs b/ButcherManageClient/Login.cs index 3266d46..4106fd2 100644 --- a/ButcherManageClient/Login.cs +++ b/ButcherManageClient/Login.cs @@ -33,7 +33,7 @@ namespace ButcherManageClient { InitializeComponent(); userNameTxt.Text = ButcherAppContext.Context.UserConfig.UserName; - pwdTxt.Text = "123"; + pwdTxt.Text = ""; } private void settingBtn_Click(object sender, EventArgs e) @@ -65,8 +65,8 @@ namespace ButcherManageClient throw new Exception("离线状态请保持与上次用户名一致"); ButcherAppContext.Context.UserConfig.Connection = false; } - var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role); - // var form = AfterLoginUtil.CreateForm("配货员"); +// var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role); + var form = AfterLoginUtil.CreateForm("分割称重"); if (form == null) throw new Exception("权限不符"); form.FormClosing += delegate { SubFormClosing(); }; diff --git a/ButcherManageClient/SettingForm.Designer.cs b/ButcherManageClient/SettingForm.Designer.cs index f2d9653..6d419df 100644 --- a/ButcherManageClient/SettingForm.Designer.cs +++ b/ButcherManageClient/SettingForm.Designer.cs @@ -34,12 +34,14 @@ this.label1 = new System.Windows.Forms.Label(); this.offlineSqlConInput = new BWP.WinFormControl.UTextBoxWithPad(); this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.txtOutAddress = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // cancelBtn // this.cancelBtn.Font = new System.Drawing.Font("宋体", 20F); - this.cancelBtn.Location = new System.Drawing.Point(238, 164); + this.cancelBtn.Location = new System.Drawing.Point(236, 245); this.cancelBtn.Name = "cancelBtn"; this.cancelBtn.Size = new System.Drawing.Size(81, 53); this.cancelBtn.TabIndex = 7; @@ -50,7 +52,7 @@ // saveBtn // this.saveBtn.Font = new System.Drawing.Font("宋体", 20F); - this.saveBtn.Location = new System.Drawing.Point(97, 164); + this.saveBtn.Location = new System.Drawing.Point(95, 245); this.saveBtn.Name = "saveBtn"; this.saveBtn.Size = new System.Drawing.Size(81, 53); this.saveBtn.TabIndex = 6; @@ -63,7 +65,7 @@ this.uTextBoxWithPad1.Font = new System.Drawing.Font("宋体", 15F); this.uTextBoxWithPad1.Location = new System.Drawing.Point(140, 41); this.uTextBoxWithPad1.Name = "uTextBoxWithPad1"; - this.uTextBoxWithPad1.Size = new System.Drawing.Size(246, 30); + this.uTextBoxWithPad1.Size = new System.Drawing.Size(363, 30); this.uTextBoxWithPad1.TabIndex = 5; this.uTextBoxWithPad1.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Normal; // @@ -82,7 +84,7 @@ this.offlineSqlConInput.Font = new System.Drawing.Font("宋体", 15F); this.offlineSqlConInput.Location = new System.Drawing.Point(140, 106); this.offlineSqlConInput.Name = "offlineSqlConInput"; - this.offlineSqlConInput.Size = new System.Drawing.Size(246, 30); + this.offlineSqlConInput.Size = new System.Drawing.Size(363, 30); this.offlineSqlConInput.TabIndex = 9; this.offlineSqlConInput.Type = BWP.WinFormControl.UTextBoxWithPad.TextBoxType.Normal; // @@ -96,13 +98,33 @@ this.label2.TabIndex = 8; this.label2.Text = "离线数据库:"; // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("宋体", 15F); + this.label3.Location = new System.Drawing.Point(38, 170); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(109, 20); + this.label3.TabIndex = 8; + this.label3.Text = "外网地址:"; + // + // txtOutAddress + // + this.txtOutAddress.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOutAddress.Location = new System.Drawing.Point(140, 170); + this.txtOutAddress.Name = "txtOutAddress"; + this.txtOutAddress.Size = new System.Drawing.Size(363, 26); + this.txtOutAddress.TabIndex = 10; + // // SettingForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(404, 242); + this.ClientSize = new System.Drawing.Size(533, 355); this.ControlBox = false; + this.Controls.Add(this.txtOutAddress); this.Controls.Add(this.offlineSqlConInput); + this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.cancelBtn); this.Controls.Add(this.saveBtn); @@ -124,5 +146,7 @@ private System.Windows.Forms.Label label1; private BWP.WinFormControl.UTextBoxWithPad offlineSqlConInput; private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtOutAddress; } } \ No newline at end of file diff --git a/ButcherManageClient/SettingForm.cs b/ButcherManageClient/SettingForm.cs index 7448160..294d0c3 100644 --- a/ButcherManageClient/SettingForm.cs +++ b/ButcherManageClient/SettingForm.cs @@ -20,6 +20,7 @@ namespace ButcherManageClient InitializeComponent(); uTextBoxWithPad1.Text = ButcherAppContext.Context.UrlConfig.ServerUrl; offlineSqlConInput.Text = ButcherAppContext.Context.UrlConfig.OfflineSqlConnection; + txtOutAddress.Text = ButcherAppContext.Context.UrlConfig.OutAddress; if (string.IsNullOrEmpty(offlineSqlConInput.Text)) offlineSqlConInput.Text = "Server=localhost;Database=LocalClientService;Integrated Security=true;Language=Simplified Chinese;"; mInited = rpcFacadeInited; @@ -37,6 +38,7 @@ namespace ButcherManageClient throw new Exception("请先设置服务器地址"); ButcherAppContext.Context.UrlConfig.ServerUrl = uri; ButcherAppContext.Context.UrlConfig.OfflineSqlConnection = offlineSqlConInput.Text.Trim(); + ButcherAppContext.Context.UrlConfig.OutAddress = txtOutAddress.Text.Trim(); ButcherAppContext.Context.Save(); if (mInited) diff --git a/ByProductWeight/ByProductWeightForm.Designer.cs b/ByProductWeight/ByProductWeightForm.Designer.cs index cc17053..e47e9e1 100644 --- a/ByProductWeight/ByProductWeightForm.Designer.cs +++ b/ByProductWeight/ByProductWeightForm.Designer.cs @@ -28,9 +28,9 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = 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 dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); @@ -92,7 +92,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label2.Location = new System.Drawing.Point(285, 1); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(139, 50); + this.label2.Size = new System.Drawing.Size(138, 50); this.label2.TabIndex = 0; this.label2.Text = "数量"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -102,9 +102,9 @@ this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label3.Location = new System.Drawing.Point(431, 1); + this.label3.Location = new System.Drawing.Point(430, 1); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(83, 50); + this.label3.Size = new System.Drawing.Size(87, 50); this.label3.TabIndex = 0; this.label3.Text = "重量"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -125,9 +125,9 @@ this.lblWeight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblWeight.Location = new System.Drawing.Point(431, 52); + this.lblWeight.Location = new System.Drawing.Point(430, 52); this.lblWeight.Name = "lblWeight"; - this.lblWeight.Size = new System.Drawing.Size(83, 45); + this.lblWeight.Size = new System.Drawing.Size(87, 45); this.lblWeight.TabIndex = 0; this.lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -139,7 +139,7 @@ this.tableLayoutPanel1.ColumnCount = 3; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 65.90909F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34.09091F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 88F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 92F)); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0); this.tableLayoutPanel1.Controls.Add(this.label3, 2, 0); @@ -151,7 +151,7 @@ this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 53.57143F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 46.42857F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(518, 98); + this.tableLayoutPanel1.Size = new System.Drawing.Size(521, 98); this.tableLayoutPanel1.TabIndex = 0; // // lblNumber @@ -161,7 +161,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.lblNumber.Location = new System.Drawing.Point(285, 52); this.lblNumber.Name = "lblNumber"; - this.lblNumber.Size = new System.Drawing.Size(139, 45); + this.lblNumber.Size = new System.Drawing.Size(138, 45); this.lblNumber.TabIndex = 0; this.lblNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -341,20 +341,20 @@ this.uDataGridView1.AllowUserToDeleteRows = false; this.uDataGridView1.AllowUserToResizeColumns = false; this.uDataGridView1.AllowUserToResizeRows = false; - dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, @@ -367,12 +367,12 @@ this.uDataGridView1.Name = "uDataGridView1"; this.uDataGridView1.ReadOnly = true; this.uDataGridView1.RowHeadersVisible = false; - dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3; this.uDataGridView1.RowTemplate.Height = 23; this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.uDataGridView1.Size = new System.Drawing.Size(518, 374); + this.uDataGridView1.Size = new System.Drawing.Size(521, 374); this.uDataGridView1.TabIndex = 2; // // dataGridViewTextBoxColumn1 diff --git a/SegmentationWeight/SegmentationWeight.csproj b/SegmentationWeight/SegmentationWeight.csproj index 82e6b5f..a6045d9 100644 --- a/SegmentationWeight/SegmentationWeight.csproj +++ b/SegmentationWeight/SegmentationWeight.csproj @@ -67,6 +67,7 @@ SegmentationWeightGoodsSetForm.cs + Form diff --git a/SegmentationWeight/SegmentationWeightForm.Designer.cs b/SegmentationWeight/SegmentationWeightForm.Designer.cs index a6d61c4..7573723 100644 --- a/SegmentationWeight/SegmentationWeightForm.Designer.cs +++ b/SegmentationWeight/SegmentationWeightForm.Designer.cs @@ -28,9 +28,9 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - 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.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panel1 = new System.Windows.Forms.Panel(); this.btnGoodsSet = new System.Windows.Forms.Button(); @@ -41,6 +41,12 @@ this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.flpGoods = new System.Windows.Forms.FlowLayoutPanel(); this.flpClass = new System.Windows.Forms.FlowLayoutPanel(); + this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); + this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.产品 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.净重 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.毛重 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); @@ -48,12 +54,6 @@ this.lblGoodsName = new System.Windows.Forms.Label(); this.lblNumber = new System.Windows.Forms.Label(); this.lblWeight = new System.Windows.Forms.Label(); - this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); - this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.产品 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.净重 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.毛重 = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -64,8 +64,8 @@ this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -91,7 +91,6 @@ // // panel1 // - this.panel1.Controls.Add(this.btnGoodsSet); this.panel1.Controls.Add(this.enableWeight); this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.btnWeightSet); @@ -103,10 +102,11 @@ // // btnGoodsSet // - this.btnGoodsSet.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnGoodsSet.Location = new System.Drawing.Point(437, 23); + this.btnGoodsSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnGoodsSet.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnGoodsSet.Location = new System.Drawing.Point(416, 16); this.btnGoodsSet.Name = "btnGoodsSet"; - this.btnGoodsSet.Size = new System.Drawing.Size(114, 63); + this.btnGoodsSet.Size = new System.Drawing.Size(95, 50); this.btnGoodsSet.TabIndex = 34; this.btnGoodsSet.Text = "产品设置"; this.btnGoodsSet.UseVisualStyleBackColor = true; @@ -165,6 +165,7 @@ // // splitContainer2.Panel1 // + this.splitContainer2.Panel1.Controls.Add(this.btnGoodsSet); this.splitContainer2.Panel1.Controls.Add(this.flpGoods); this.splitContainer2.Panel1.Controls.Add(this.flpClass); // @@ -173,7 +174,7 @@ this.splitContainer2.Panel2.Controls.Add(this.uDataGridView1); this.splitContainer2.Panel2.Controls.Add(this.tableLayoutPanel1); this.splitContainer2.Size = new System.Drawing.Size(1041, 487); - this.splitContainer2.SplitterDistance = 556; + this.splitContainer2.SplitterDistance = 517; this.splitContainer2.SplitterWidth = 1; this.splitContainer2.TabIndex = 0; // @@ -185,7 +186,7 @@ this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flpGoods.Location = new System.Drawing.Point(4, 87); this.flpGoods.Name = "flpGoods"; - this.flpGoods.Size = new System.Drawing.Size(541, 395); + this.flpGoods.Size = new System.Drawing.Size(507, 395); this.flpGoods.TabIndex = 1; // // flpClass @@ -195,9 +196,89 @@ this.flpClass.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flpClass.Location = new System.Drawing.Point(4, 4); this.flpClass.Name = "flpClass"; - this.flpClass.Size = new System.Drawing.Size(547, 76); + this.flpClass.Size = new System.Drawing.Size(392, 76); this.flpClass.TabIndex = 0; // + // uDataGridView1 + // + this.uDataGridView1.AllowUserToAddRows = false; + this.uDataGridView1.AllowUserToDeleteRows = false; + this.uDataGridView1.AllowUserToResizeColumns = false; + this.uDataGridView1.AllowUserToResizeRows = false; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.序号, + this.条码, + this.产品, + this.净重, + this.毛重}); + this.uDataGridView1.Location = new System.Drawing.Point(3, 108); + 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; + this.uDataGridView1.RowTemplate.Height = 23; + this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.uDataGridView1.Size = new System.Drawing.Size(533, 374); + this.uDataGridView1.TabIndex = 1; + // + // 序号 + // + this.序号.DataPropertyName = "ID"; + this.序号.HeaderText = "序号"; + this.序号.Name = "序号"; + this.序号.ReadOnly = true; + this.序号.Width = 80; + // + // 条码 + // + this.条码.DataPropertyName = "BarCode"; + this.条码.HeaderText = "条码"; + this.条码.Name = "条码"; + this.条码.ReadOnly = true; + // + // 产品 + // + this.产品.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.产品.DataPropertyName = "Goods_Name"; + this.产品.HeaderText = "产品"; + this.产品.MinimumWidth = 100; + this.产品.Name = "产品"; + this.产品.ReadOnly = true; + // + // 净重 + // + this.净重.DataPropertyName = "JingWeight"; + this.净重.HeaderText = "净重"; + this.净重.Name = "净重"; + this.净重.ReadOnly = true; + this.净重.Width = 80; + // + // 毛重 + // + this.毛重.DataPropertyName = "MaoWeight"; + this.毛重.HeaderText = "毛重"; + this.毛重.Name = "毛重"; + this.毛重.ReadOnly = true; + this.毛重.Width = 80; + // // tableLayoutPanel1 // this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -206,7 +287,7 @@ this.tableLayoutPanel1.ColumnCount = 3; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 65.90909F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34.09091F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 96F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 106F)); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0); this.tableLayoutPanel1.Controls.Add(this.label3, 2, 0); @@ -218,7 +299,7 @@ this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 53.57143F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 46.42857F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(482, 98); + this.tableLayoutPanel1.Size = new System.Drawing.Size(529, 98); this.tableLayoutPanel1.TabIndex = 0; // // label1 @@ -228,7 +309,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label1.Location = new System.Drawing.Point(4, 1); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(245, 50); + this.label1.Size = new System.Drawing.Size(270, 50); this.label1.TabIndex = 0; this.label1.Text = "产品"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -238,9 +319,9 @@ this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label2.Location = new System.Drawing.Point(256, 1); + this.label2.Location = new System.Drawing.Point(281, 1); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(124, 50); + this.label2.Size = new System.Drawing.Size(136, 50); this.label2.TabIndex = 0; this.label2.Text = "数量"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -250,9 +331,9 @@ this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label3.Location = new System.Drawing.Point(387, 1); + this.label3.Location = new System.Drawing.Point(424, 1); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(91, 50); + this.label3.Size = new System.Drawing.Size(101, 50); this.label3.TabIndex = 0; this.label3.Text = "重量"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -264,7 +345,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.lblGoodsName.Location = new System.Drawing.Point(4, 52); this.lblGoodsName.Name = "lblGoodsName"; - this.lblGoodsName.Size = new System.Drawing.Size(245, 45); + this.lblGoodsName.Size = new System.Drawing.Size(270, 45); this.lblGoodsName.TabIndex = 0; this.lblGoodsName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -273,9 +354,9 @@ this.lblNumber.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblNumber.Location = new System.Drawing.Point(256, 52); + this.lblNumber.Location = new System.Drawing.Point(281, 52); this.lblNumber.Name = "lblNumber"; - this.lblNumber.Size = new System.Drawing.Size(124, 45); + this.lblNumber.Size = new System.Drawing.Size(136, 45); this.lblNumber.TabIndex = 0; this.lblNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -284,92 +365,12 @@ this.lblWeight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblWeight.Location = new System.Drawing.Point(387, 52); + this.lblWeight.Location = new System.Drawing.Point(424, 52); this.lblWeight.Name = "lblWeight"; - this.lblWeight.Size = new System.Drawing.Size(91, 45); + this.lblWeight.Size = new System.Drawing.Size(101, 45); this.lblWeight.TabIndex = 0; this.lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // uDataGridView1 - // - this.uDataGridView1.AllowUserToAddRows = false; - this.uDataGridView1.AllowUserToDeleteRows = false; - this.uDataGridView1.AllowUserToResizeColumns = false; - this.uDataGridView1.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; - this.uDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; - this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.序号, - this.条码, - this.产品, - this.净重, - this.毛重}); - this.uDataGridView1.Location = new System.Drawing.Point(3, 108); - this.uDataGridView1.MultiSelect = false; - this.uDataGridView1.Name = "uDataGridView1"; - this.uDataGridView1.ReadOnly = true; - this.uDataGridView1.RowHeadersVisible = false; - dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3; - this.uDataGridView1.RowTemplate.Height = 23; - this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.uDataGridView1.Size = new System.Drawing.Size(486, 374); - this.uDataGridView1.TabIndex = 1; - // - // 序号 - // - this.序号.DataPropertyName = "ID"; - this.序号.HeaderText = "序号"; - this.序号.Name = "序号"; - this.序号.ReadOnly = true; - this.序号.Width = 80; - // - // 条码 - // - this.条码.DataPropertyName = "BarCode"; - this.条码.HeaderText = "条码"; - this.条码.Name = "条码"; - this.条码.ReadOnly = true; - // - // 产品 - // - this.产品.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.产品.DataPropertyName = "Goods_Name"; - this.产品.HeaderText = "产品"; - this.产品.MinimumWidth = 100; - this.产品.Name = "产品"; - this.产品.ReadOnly = true; - // - // 净重 - // - this.净重.DataPropertyName = "JingWeight"; - this.净重.HeaderText = "净重"; - this.净重.Name = "净重"; - this.净重.ReadOnly = true; - this.净重.Width = 80; - // - // 毛重 - // - this.毛重.DataPropertyName = "MaoWeight"; - this.毛重.HeaderText = "毛重"; - this.毛重.Name = "毛重"; - this.毛重.ReadOnly = true; - this.毛重.Width = 80; - // // SegmentationWeightForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -394,8 +395,8 @@ this.splitContainer2.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); } diff --git a/SegmentationWeight/SegmentationWeightForm.cs b/SegmentationWeight/SegmentationWeightForm.cs index f740b73..b181eae 100644 --- a/SegmentationWeight/SegmentationWeightForm.cs +++ b/SegmentationWeight/SegmentationWeightForm.cs @@ -349,10 +349,42 @@ namespace SegmentationWeight record.ID = id; mWeightRecords.Add(record); + RefreshUi(); - } + var entity = CreatePrintEntity("5号里脊肉"); + SegmentationWeightPrint.Print(entity); + } + PrintEntity CreatePrintEntity(string goodsName) + { + var entity = new PrintEntity(); + entity.AccountingUnit_Name = "青岛万福集团股份有限公司"; + entity.Goods_Name = goodsName; + entity.Date = DateTime.Today; + entity.Checker = ""; + entity.StoreCondition = "0-4℃"; + entity.Place = "青岛莱西市"; + entity.TelNumber = "0532-88488888"; + + int maxindex=0; +// if (index == null) +// { +//// maxindex = LocalGradeAndWeightBL.GetTodayTotalCount(butcherTimeInput.Date.Value); +// maxindex++; +// } +// else +// { +// maxindex = index.Value; +// } + + string indexCode = maxindex.ToString("D6"); + + entity.BarCode = string.Format("WF{0}{1:00000}", DateTime.Today.ToString("yyyyMMdd"), indexCode); + entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress + "?code={0}&name={1}", entity.BarCode, goodsName); + + return entity; + } private SegmentationWeightRecord GetRecordBySet(SegmentationWeightGoodSet set,decimal maoWeight) { var record=new SegmentationWeightRecord(); @@ -393,7 +425,7 @@ namespace SegmentationWeight uDataGridView1.DataSource = mWeightRecords; } - public string RoleName { get { return "分割计数"; } } + public string RoleName { get { return "分割称重"; } } public Form Generate() { return this; diff --git a/SegmentationWeight/SegmentationWeightPrint.cs b/SegmentationWeight/SegmentationWeightPrint.cs new file mode 100644 index 0000000..ca8d6f8 --- /dev/null +++ b/SegmentationWeight/SegmentationWeightPrint.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using BWP.WinFormControl; + +namespace SegmentationWeight +{ + public class SegmentationWeightPrint + { + public static void Print(PrintEntity entity) + { + PrintAPI.B_GetUSBBufferLen(); + PrintAPI.B_EnumUSB(new byte[128]); + PrintAPI.B_CreateUSBPort(1); + + PrintAPI.B_Prn_Text_TrueType(110, 26, 31, "宋体", 1, 700, 0, 0, 0, "C1", entity.AccountingUnit_Name); + PrintAPI.B_Prn_Text_TrueType(42, 70, 31, "宋体", 1, 700, 0, 0, 0, "C2", "合格证"); + PrintAPI.B_Prn_Text_TrueType(440, 70, 31, "宋体", 1, 700, 0, 0, 0, "C3", entity.Goods_Name); + + PrintAPI.B_Prn_Text_TrueType(42, 120, 27, "宋体", 1, 400, 0, 0, 0, "C4", string.Format("生产日期:{0}", entity.Date.ToString("yyyy/MM/dd"))); + PrintAPI.B_Prn_Text_TrueType(42, 160, 27, "宋体", 1, 400, 0, 0, 0, "C5", string.Format("检 验 员:{0}", entity.Checker)); + PrintAPI.B_Prn_Text_TrueType(42, 200, 27, "宋体", 1, 400, 0, 0, 0, "C6", string.Format("保 质 期:{0}", entity.StoreCondition)); + + PrintAPI.B_Prn_Text_TrueType(42, 240, 23, "宋体", 1, 400, 0, 0, 0, "C7", string.Format("电话:{0}", entity.TelNumber)); + PrintAPI.B_Prn_Text_TrueType(42, 280, 23, "宋体", 1, 400, 0, 0, 0, "C8", string.Format("产地:{0}", entity.Place)); + + PrintAPI.B_Prn_Barcode(42, 320, 0, "1", 3, 22, 35, 'N', entity.BarCode); + PrintAPI.B_Prn_Text_TrueType(173, 360, 25, "宋体", 1, 500, 0, 0, 0, "C9", entity.BarCode); + PrintAPI.B_Bar2d_QR(430, 105, 2, 6, 'M', 'A', 0, 0, 0, entity._2DQRCode); + + PrintAPI.B_Set_Direction('B'); + PrintAPI.B_Print_Out(1); + PrintAPI.B_ClosePrn(); + } + } + public class PrintEntity + { + public string AccountingUnit_Name { get; set; } + + public string Goods_Name { get; set; } + + public DateTime Date { get; set; } + + public string Checker { get; set; } + + public string StoreCondition { get; set; } + + public string Place { get; set; } + + public string TelNumber { get; set; } + + public string Address { get; set; } + + public string BarCode { get; set; } + + public string _2DQRCode { get; set; } + } +} diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs index 5a090a1..574e5be 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs @@ -29,23 +29,20 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = 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 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 dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + 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.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panel1 = new System.Windows.Forms.Panel(); this.enableWeight = new System.Windows.Forms.CheckBox(); this.panel2 = new System.Windows.Forms.Panel(); this.lblChengZhong = new System.Windows.Forms.Label(); - this.btnWeightSet = new System.Windows.Forms.Button(); - this.btnSycnStatus = new System.Windows.Forms.Button(); this.btnNetStatus = new System.Windows.Forms.Button(); + this.btnWeightSet = new System.Windows.Forms.Button(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.cbxBaiTiaoStatus = new System.Windows.Forms.ComboBox(); - this.label2 = new System.Windows.Forms.Label(); this.btnCreateBill = new System.Windows.Forms.Button(); this.btnSubmit = new System.Windows.Forms.Button(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); @@ -63,12 +60,7 @@ this.uncheck产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uncheck数量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uncheck重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.flpClass = new System.Windows.Forms.FlowLayoutPanel(); - this.flpGoods = new System.Windows.Forms.FlowLayoutPanel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); this.timerChectNetStatus = new System.Windows.Forms.Timer(this.components); - this.timerSyncToService = new System.Windows.Forms.Timer(this.components); - this.timerCheckSyncSucessed = new System.Windows.Forms.Timer(this.components); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -81,7 +73,6 @@ this.splitContainer2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); this.splitContainer3.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).BeginInit(); @@ -116,6 +107,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.panel1.Controls.Add(this.enableWeight); this.panel1.Controls.Add(this.panel2); + this.panel1.Controls.Add(this.btnNetStatus); this.panel1.Controls.Add(this.btnWeightSet); this.panel1.Location = new System.Drawing.Point(11, 3); this.panel1.Name = "panel1"; @@ -155,6 +147,17 @@ this.lblChengZhong.TabIndex = 0; this.lblChengZhong.Text = "0.00"; // + // btnNetStatus + // + this.btnNetStatus.Enabled = false; + this.btnNetStatus.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnNetStatus.Location = new System.Drawing.Point(515, 8); + this.btnNetStatus.Name = "btnNetStatus"; + this.btnNetStatus.Size = new System.Drawing.Size(120, 46); + this.btnNetStatus.TabIndex = 0; + this.btnNetStatus.Text = "网络畅通"; + this.btnNetStatus.UseVisualStyleBackColor = true; + // // btnWeightSet // this.btnWeightSet.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); @@ -166,28 +169,6 @@ this.btnWeightSet.UseVisualStyleBackColor = true; this.btnWeightSet.Click += new System.EventHandler(this.btnWeightSet_Click); // - // btnSycnStatus - // - this.btnSycnStatus.Enabled = false; - this.btnSycnStatus.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnSycnStatus.Location = new System.Drawing.Point(61, 83); - this.btnSycnStatus.Name = "btnSycnStatus"; - this.btnSycnStatus.Size = new System.Drawing.Size(120, 46); - this.btnSycnStatus.TabIndex = 0; - this.btnSycnStatus.Text = "同步完成"; - this.btnSycnStatus.UseVisualStyleBackColor = true; - // - // btnNetStatus - // - this.btnNetStatus.Enabled = false; - this.btnNetStatus.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnNetStatus.Location = new System.Drawing.Point(61, 14); - this.btnNetStatus.Name = "btnNetStatus"; - this.btnNetStatus.Size = new System.Drawing.Size(120, 46); - this.btnNetStatus.TabIndex = 0; - this.btnNetStatus.Text = "网络畅通"; - this.btnNetStatus.UseVisualStyleBackColor = true; - // // splitContainer2 // this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -197,12 +178,8 @@ // // splitContainer2.Panel1 // - this.splitContainer2.Panel1.Controls.Add(this.cbxBaiTiaoStatus); - this.splitContainer2.Panel1.Controls.Add(this.label2); this.splitContainer2.Panel1.Controls.Add(this.btnCreateBill); - this.splitContainer2.Panel1.Controls.Add(this.btnSycnStatus); this.splitContainer2.Panel1.Controls.Add(this.btnSubmit); - this.splitContainer2.Panel1.Controls.Add(this.btnNetStatus); // // splitContainer2.Panel2 // @@ -212,31 +189,6 @@ this.splitContainer2.SplitterWidth = 1; this.splitContainer2.TabIndex = 0; // - // cbxBaiTiaoStatus - // - this.cbxBaiTiaoStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxBaiTiaoStatus.Font = new System.Drawing.Font("宋体", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cbxBaiTiaoStatus.FormattingEnabled = true; - this.cbxBaiTiaoStatus.Items.AddRange(new object[] { - "入预冷库", - "分割领用", - "入销售库", - "销售出库"}); - this.cbxBaiTiaoStatus.Location = new System.Drawing.Point(41, 197); - this.cbxBaiTiaoStatus.Name = "cbxBaiTiaoStatus"; - this.cbxBaiTiaoStatus.Size = new System.Drawing.Size(167, 35); - this.cbxBaiTiaoStatus.TabIndex = 34; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(41, 170); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(106, 24); - this.label2.TabIndex = 1; - this.label2.Text = "白条状态"; - // // btnCreateBill // this.btnCreateBill.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); @@ -270,13 +222,8 @@ // this.splitContainer3.Panel1.Controls.Add(this.groupBox2); this.splitContainer3.Panel1.Controls.Add(this.groupBox1); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.flpClass); - this.splitContainer3.Panel2.Controls.Add(this.flpGoods); this.splitContainer3.Size = new System.Drawing.Size(1015, 610); - this.splitContainer3.SplitterDistance = 726; + this.splitContainer3.SplitterDistance = 780; this.splitContainer3.SplitterWidth = 1; this.splitContainer3.TabIndex = 0; // @@ -288,7 +235,7 @@ this.groupBox2.Controls.Add(this.gridChecked); this.groupBox2.Location = new System.Drawing.Point(14, 259); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(699, 340); + this.groupBox2.Size = new System.Drawing.Size(755, 340); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "已提交"; @@ -299,17 +246,17 @@ this.gridChecked.AllowUserToDeleteRows = false; this.gridChecked.AllowUserToResizeColumns = false; this.gridChecked.AllowUserToResizeRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.gridChecked.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.gridChecked.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridChecked.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.序号, @@ -323,20 +270,22 @@ this.gridChecked.Name = "gridChecked"; this.gridChecked.ReadOnly = true; this.gridChecked.RowHeadersVisible = false; - dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle3; this.gridChecked.RowTemplate.Height = 23; this.gridChecked.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridChecked.Size = new System.Drawing.Size(693, 320); + this.gridChecked.Size = new System.Drawing.Size(749, 320); this.gridChecked.TabIndex = 4; // // 序号 // + this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.序号.DataPropertyName = "ID"; this.序号.HeaderText = "序号"; this.序号.Name = "序号"; this.序号.ReadOnly = true; + this.序号.Width = 60; // // 条码 // @@ -375,7 +324,7 @@ this.groupBox1.Controls.Add(this.gridUnCheck); this.groupBox1.Location = new System.Drawing.Point(14, 15); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(705, 220); + this.groupBox1.Size = new System.Drawing.Size(761, 220); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "待提交"; @@ -386,17 +335,17 @@ this.gridUnCheck.AllowUserToDeleteRows = false; this.gridUnCheck.AllowUserToResizeColumns = false; this.gridUnCheck.AllowUserToResizeRows = false; - dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; this.gridUnCheck.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle17.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle17.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle17.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle17.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.gridUnCheck.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridUnCheck.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uncheck序号, @@ -410,12 +359,12 @@ this.gridUnCheck.Name = "gridUnCheck"; this.gridUnCheck.ReadOnly = true; this.gridUnCheck.RowHeadersVisible = false; - dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle18; + 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.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle6; this.gridUnCheck.RowTemplate.Height = 23; this.gridUnCheck.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridUnCheck.Size = new System.Drawing.Size(699, 200); + this.gridUnCheck.Size = new System.Drawing.Size(755, 200); this.gridUnCheck.TabIndex = 3; // // uncheck序号 @@ -436,11 +385,12 @@ // // uncheck产品名称 // + this.uncheck产品名称.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.uncheck产品名称.DataPropertyName = "Goods_Name"; this.uncheck产品名称.HeaderText = "产品名称"; this.uncheck产品名称.Name = "uncheck产品名称"; this.uncheck产品名称.ReadOnly = true; - this.uncheck产品名称.Width = 120; + this.uncheck产品名称.Width = 97; // // uncheck数量 // @@ -456,51 +406,12 @@ this.uncheck重量.Name = "uncheck重量"; this.uncheck重量.ReadOnly = true; // - // flpClass - // - this.flpClass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.flpClass.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.flpClass.Location = new System.Drawing.Point(3, 11); - this.flpClass.Name = "flpClass"; - this.flpClass.Size = new System.Drawing.Size(283, 76); - this.flpClass.TabIndex = 1; - // - // flpGoods - // - this.flpGoods.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.flpGoods.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.flpGoods.Location = new System.Drawing.Point(0, 117); - this.flpGoods.Name = "flpGoods"; - this.flpGoods.Size = new System.Drawing.Size(289, 491); - this.flpGoods.TabIndex = 0; - // - // timer1 - // - this.timer1.Enabled = true; - this.timer1.Interval = 3000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // // timerChectNetStatus // this.timerChectNetStatus.Enabled = true; this.timerChectNetStatus.Interval = 2000; this.timerChectNetStatus.Tick += new System.EventHandler(this.timerChectNetStatus_Tick); // - // timerSyncToService - // - this.timerSyncToService.Enabled = true; - this.timerSyncToService.Interval = 5000; - this.timerSyncToService.Tick += new System.EventHandler(this.timerSyncToService_Tick); - // - // timerCheckSyncSucessed - // - this.timerCheckSyncSucessed.Enabled = true; - this.timerCheckSyncSucessed.Interval = 4000; - this.timerCheckSyncSucessed.Tick += new System.EventHandler(this.timerCheckSyncSucessed_Tick); - // // TrunksIousOutInStoreForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -516,7 +427,6 @@ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TrunksIousOutInStoreForm_FormClosing); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.TrunksIousOutInStoreForm_FormClosed); this.Load += new System.EventHandler(this.TrunksIousOutInStoreForm_Load); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TrunksIousOutInStoreForm_KeyDown); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); @@ -526,12 +436,10 @@ this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel1.PerformLayout(); this.splitContainer2.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); this.splitContainer3.ResumeLayout(false); this.groupBox2.ResumeLayout(false); @@ -549,7 +457,6 @@ private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.Button btnNetStatus; private System.Windows.Forms.SplitContainer splitContainer3; - private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btnCreateBill; private System.Windows.Forms.Button btnSubmit; private System.Windows.Forms.Button btnWeightSet; @@ -557,16 +464,10 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.DataGridView gridUnCheck; private BWP.WinFormControl.UDataGridView gridChecked; - private System.Windows.Forms.Timer timer1; private System.Windows.Forms.CheckBox enableWeight; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label lblChengZhong; - private System.Windows.Forms.ComboBox cbxBaiTiaoStatus; - private System.Windows.Forms.FlowLayoutPanel flpGoods; private System.Windows.Forms.Timer timerChectNetStatus; - private System.Windows.Forms.Timer timerSyncToService; - private System.Windows.Forms.Timer timerCheckSyncSucessed; - private System.Windows.Forms.Button btnSycnStatus; private System.Windows.Forms.DataGridViewTextBoxColumn 序号; private System.Windows.Forms.DataGridViewTextBoxColumn 条码; private System.Windows.Forms.DataGridViewTextBoxColumn 产品名称; @@ -577,6 +478,5 @@ private System.Windows.Forms.DataGridViewTextBoxColumn uncheck产品名称; private System.Windows.Forms.DataGridViewTextBoxColumn uncheck数量; private System.Windows.Forms.DataGridViewTextBoxColumn uncheck重量; - private System.Windows.Forms.FlowLayoutPanel flpClass; } } \ No newline at end of file diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs index 2c261e0..e3ec974 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs @@ -17,6 +17,8 @@ using BO.BO.Dtos; using BO.Utils; using BO.Utils.BillRpc; using BWP.WinFormControl.WeightDataFormat; +using Forks.JsonRpc.Client; +using Newtonsoft.Json; using TrunksIousOutInStore.LocalSyncBO; using TrunksIousOutInStore.Rpc; @@ -24,9 +26,10 @@ namespace TrunksIousOutInStore { public partial class TrunksIousOutInStoreForm : Form, IAfterLogin { + private Thread tdSyncUnSubmit, tdSyncSubmited; + + private readonly string BaseRpcUrl = "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/"; - private readonly string ClientGoodsSetApplyClient = "白条出入库"; - public const string DATA_PATH = "LocalData/TrunksIousOutInStore"; // BardCodeHooK BarCode = new BardCodeHooK(); @@ -51,42 +54,45 @@ namespace TrunksIousOutInStore { if (_inQueryThread != null && _inQueryThread.IsAlive) DisableWeight(); - // if (syncWork != null && syncWork.IsAlive) - // syncWork.Abort(); - // if (syncToServer != null && syncToServer.IsAlive) - // syncToServer.Abort(); + if (tdSyncUnSubmit != null && tdSyncUnSubmit.IsAlive) + tdSyncUnSubmit.Abort(); + if (tdSyncSubmited != null && tdSyncSubmited.IsAlive) + tdSyncSubmited.Abort(); }; // BarCode.BarCodeEvent += new BardCodeHooK.BardCodeDeletegate(BarCode_BarCodeEvent); - - if (!Directory.Exists(DATA_PATH)) - { - Directory.CreateDirectory(DATA_PATH); - } - } - void BarCode_BarCodeEvent(BardCodeHooK.BarCodes barCode) - { - ShowInfo(barCode); - } - private delegate void ShowInfoDelegate(BardCodeHooK.BarCodes barCode); - - private void ShowInfo(BardCodeHooK.BarCodes barCode) - { - if (this.InvokeRequired) - { - this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); - } - else - { - if (barCode.IsValid) - { - // var code = UrlUtil.GetBarCode(barCode.BarCode.Trim()); - // var goodsName = UrlUtil.GetGoodsName(barCode.BarCode); - var code = barCode.BarCode.Trim(); - doInsertUnSubmit(code, "", null); - } - } - } + + tdSyncUnSubmit=new Thread(SyncUnSubmit); + tdSyncSubmited = new Thread(SyncSubmited); + tdSyncUnSubmit.Start(); + tdSyncSubmited.Start(); + } + + + +// void BarCode_BarCodeEvent(BardCodeHooK.BarCodes barCode) +// { +// ShowInfo(barCode); +// } +// private delegate void ShowInfoDelegate(BardCodeHooK.BarCodes barCode); +// +// private void ShowInfo(BardCodeHooK.BarCodes barCode) +// { +// if (this.InvokeRequired) +// { +// this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); +// } +// else +// { +// if (barCode.IsValid) +// { +// // var code = UrlUtil.GetBarCode(barCode.BarCode.Trim()); +// // var goodsName = UrlUtil.GetGoodsName(barCode.BarCode); +// var code = barCode.BarCode.Trim(); +// doInsertUnSubmit(code, "", null); +// } +// } +// } #region weightNeed void OpenSerialPort() @@ -182,7 +188,7 @@ namespace TrunksIousOutInStore if (str != "0") { //AddWeightDetail(decimal.Parse(lblChengZhong.Text)); - doInsertUnSubmit("", "", decimal.Parse(lblChengZhong.Text)); + doInsertUnSubmit( decimal.Parse(lblChengZhong.Text)); } })); } @@ -205,7 +211,7 @@ namespace TrunksIousOutInStore //lblChengZhong.Text = string.Format(format, num); if (str != "0") { - doInsertUnSubmit("", "", decimal.Parse(string.Format(format, num))); + doInsertUnSubmit(decimal.Parse(string.Format(format, num))); //AddWeightDetail(decimal.Parse(string.Format(format, num))); } })); @@ -296,59 +302,35 @@ namespace TrunksIousOutInStore + static object _obj = new object(); - private void doInsertUnSubmit(string barCode, string goodsName, decimal? weight) + private void doInsertUnSubmit(decimal weight) { lock (_obj) { - var record = new TrunksIousOutInStoreRecord(); - record.Goods_Name = goodsName; - var set = GetSelectedClientGoodsSet(); - if (set != null) - { - record.Goods_Name = set.Goods_Name; - record.Goods_ID = set.Goods_ID; - } - record.Number = 1; - record.CarcassStatus = cbxBaiTiaoStatus.Text; - if (!string.IsNullOrWhiteSpace(barCode)) - {//扫码 - record.BarCode = barCode; - //找到条码为空但是重量不为空的 - var fd = unSumbitList.FirstOrDefault(x => string.IsNullOrWhiteSpace(x.BarCode) && x.Weight.HasValue); - if (fd == null) - { - // record.ID = unSumbitList.Max(x => x.ID) + 1; - unSumbitList.Add(record); - } - else - { - //给条码赋值 - fd.BarCode = barCode; - } - } - if (weight.HasValue) - {//称重 - record.Weight = weight; + + //称重 + //找到称重为空条码不为空的 - var fd = unSumbitList.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight == null); + var fd = unSubmitList.LastOrDefault(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight == null); if (fd == null) { + //todo 记录一个异常 // record.ID = unSumbitList.Max(x => x.ID) + 1; - unSumbitList.Add(record); +// unSumbitList.Add(record); } else { //给条码赋值 fd.Weight = weight; + //请求中间服务器 + RpcFacade.Call(BaseRpcUrl+ "SetWeight", fd.ID, weight); } - } + gridUnCheck.Refresh(); Application.DoEvents(); // BindUnCheckGrid(); } - - // barCodequeue.Enqueue(barCode); } @@ -361,170 +343,132 @@ namespace TrunksIousOutInStore { return this; } - - - - - - string goodsSetFileName = Path.Combine(DATA_PATH, "TrunksIousOutInStoreClientGoodsSet.xml"); - - private List mLocaList; - - void InitLocalList() - { - if (LoginRpcUtil.TestConnection()) - { - mLocaList = ClientGoodsSetRpc.GetListByApplyClient(ClientGoodsSetApplyClient).Select(x => x.CreateChild()).ToList(); - XmlUtil.SerializerObjToFile(mLocaList, goodsSetFileName); - } - else - { - mLocaList = XmlUtil.DeserializeFromFile>(goodsSetFileName); - } - - } - + private void TrunksIousOutInStoreForm_Load(object sender, EventArgs e) { // BarCode.Start(); - InitLocalList(); - InitGoodsControl(); - - GridUnCheckFocus(); + //GridUnCheckFocus(); } - private void InitGoodsControl() + private void TrunksIousOutInStoreForm_FormClosing(object sender, FormClosingEventArgs e) { - flpClass.Controls.Clear(); - foreach (IGrouping grouping in mLocaList.Where(x => !string.IsNullOrWhiteSpace(x.Name)).GroupBy(x => x.Name)) + if (unSubmitList.Count > 0) { - var btn = CreateClassButton(grouping.Key); - flpClass.Controls.Add(btn); + if (MessageBox.Show("待提交区域不为空,确定关闭?", "确定关闭", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == + DialogResult.OK) + { + e.Cancel = false; + } + else + { + e.Cancel = true; + + } } } - private Button CreateClassButton(string text) - { - var btn = new Button() { Text = text }; - btn.Width = 100; - btn.Height = 60; - btn.Click += BtnClass_Click; - return btn; - } + BindingList unSubmitList = new BindingList(); + BindingList submitedList = new BindingList(); + // ConcurrentQueue barCodequeue=new ConcurrentQueue(); - private void BtnClass_Click(object sender, EventArgs e) - { - var btnClass = sender as Button; - flpGoods.Controls.Clear(); - foreach (TrunksIousOutInStoreClientGoodsSet set in mLocaList.Where(x => x.Name == btnClass.Text)) - { - var btn = CreateGoodsSetButton(set); - flpGoods.Controls.Add(btn); - } - GridUnCheckFocus(); - Application.DoEvents(); - } - private Button CreateGoodsSetButton(TrunksIousOutInStoreClientGoodsSet set) - { - var btn = new Button(); - btn.Text = set.Goods_Name; - btn.Tag = set; - btn.Width = 100; - btn.Height = 60; - btn.Click += BtnSet_Click; - return btn; - } - private void BtnSet_Click(object sender, EventArgs e) +// private static object _unSubmitListObj=new object(); +// void AddUnSubmitList(TrunksIousOutInStoreRecord record) +// { +// lock (_unSubmitListObj) +// { +// unSubmitList.Add(record); +// } +// } +// void RemoveUnSubmitList(TrunksIousOutInStoreRecord record) +// { +// lock (_unSubmitListObj) +// { +// unSubmitList.Remove(record); +// } +// } + + void SyncUnSubmit() { - var btn = sender as Button; - foreach (Button button in flpGoods.Controls) + while (true) { - if (button.Text == btn.Text) + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/GetUnSubmitList"); + var list = JsonConvert.DeserializeObject>(json); + + if (this.IsHandleCreated) { - if (button.BackColor == Color.Aqua) - { - button.BackColor = SystemColors.Control; - } - else + this.Invoke(new Action(() => { - button.BackColor = Color.Aqua; - } + if (list.Count > 0) + { + unSubmitList.Clear(); + foreach (TrunksIousOutInStoreRecord record in list) + { + unSubmitList.Add(record); + } + } + BindUnSubmitGrid(); + })); } - else - { - button.BackColor = SystemColors.Control; + + + Thread.Sleep(2000); } - } - gridUnCheck.Focus(); - Application.DoEvents(); } - - TrunksIousOutInStoreClientGoodsSet GetSelectedClientGoodsSet() + void SyncSubmited() { - foreach (Button button in flpGoods.Controls) + while (true) { - if (button.BackColor == Color.Aqua) - { - return button.Tag as TrunksIousOutInStoreClientGoodsSet; - } - } - return null; - } + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/GetSubmitedList"); + var list = JsonConvert.DeserializeObject>(json); - private void TrunksIousOutInStoreForm_FormClosing(object sender, FormClosingEventArgs e) - { - if (unSumbitList.Count > 0) - { - if (MessageBox.Show("待提交区域不为空,确定关闭?", "确定关闭", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == - DialogResult.OK) + if (this.IsHandleCreated) { - e.Cancel = false; - } - else - { - e.Cancel = true; + this.Invoke(new Action(() => + { + if (list.Count > 0) + { + submitedList.Clear(); + foreach (TrunksIousOutInStoreRecord record in list) + { + submitedList.Add(record); + } + } + BindSubmitedGrid(); + })); } + + Thread.Sleep(2000); } } - BindingList unSumbitList = new BindingList(); - BindingList sumbitedList = new BindingList(); - // ConcurrentQueue barCodequeue=new ConcurrentQueue(); - private void timer1_Tick(object sender, EventArgs e) + void BindUnSubmitGrid() { - timer1.Stop(); - if (unSumbitList == null) + if (gridUnCheck.DataSource == null) { - return; + gridUnCheck.DataSource = unSubmitList; } - - var canSubmitList = unSumbitList.Where(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight != null).ToList(); - foreach (TrunksIousOutInStoreRecord record in canSubmitList) + else { - - LocalDmoSession.Insert(record); - unSumbitList.Remove(record); - sumbitedList.Insert(0, record); + gridUnCheck.Refresh(); } - - BindUnCheckGrid(); - BindCheckedGrid(); - - timer1.Start(); +// gridUnCheck.CurrentCell = null; } - - void BindUnCheckGrid() - { - gridUnCheck.DataSource = unSumbitList; - } - void BindCheckedGrid() + void BindSubmitedGrid() { - gridChecked.DataSource = sumbitedList; + if (gridChecked.DataSource == null) + { + gridChecked.DataSource = submitedList; + } + else + { + gridChecked.Refresh(); + } +// gridChecked.CurrentCell = null; } @@ -535,14 +479,14 @@ namespace TrunksIousOutInStore if (f.ShowDialog() == DialogResult.OK) { enableWeight_Click(sender, e); - GridUnCheckFocus(); +// GridUnCheckFocus(); } } - void GridUnCheckFocus() - { - gridUnCheck.Focus(); - } +// void GridUnCheckFocus() +// { +// gridUnCheck.Focus(); +// } private void TrunksIousOutInStoreForm_FormClosed(object sender, FormClosedEventArgs e) { @@ -573,93 +517,56 @@ namespace TrunksIousOutInStore #endregion - #region 同步到中间服务器 - //同步到 - private void timerSyncToService_Tick(object sender, EventArgs e) - { - timerSyncToService.Stop(); - if (LoginRpcUtil.TestConnection()) - { - TrunksIousOutInStoreRecordRpc.GetInstance().SyncToServer(); - } - timerSyncToService.Start(); - } - - #endregion - - #region 检查是否同步完成 - - //检查是否同步完成 - private void timerCheckSyncSucessed_Tick(object sender, EventArgs e) - { - timerCheckSyncSucessed.Stop(); - if (LoginRpcUtil.TestConnection()) - { - if (TrunksIousOutInStoreRecordRpc.GetInstance().IsSyncSucessed()) - { - btnSycnStatus.Text = "同步完成"; - btnSycnStatus.BackColor = Color.Green; - } - else - { - btnSycnStatus.Text = "正在同步"; - btnSycnStatus.BackColor = Color.Red; - } - } - timerCheckSyncSucessed.Start(); - } - #endregion private void btnCreateBill_Click(object sender, EventArgs e) { - GridUnCheckFocus(); - } - - BwpBarCodes barCodes = new BwpBarCodes(); - - private void TrunksIousOutInStoreForm_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyData == (Keys.ShiftKey | Keys.Shift)) - { - return; - } - TimeSpan ts = DateTime.Now.Subtract(barCodes.Time); - var str = BwpBarCodeUtil.GetStringByKeyKeyEventArgs(e); - barCodes.StringBuilder.Append(str); - - if (ts.TotalMilliseconds < 50) - { - if (e.KeyData == Keys.Enter && barCodes.BarCode.Length > 0) - { - //回车 - barCodes.IsValid = true; - barCodes.StringBuilder.Remove(barCodes.StringBuilder.Length - 1, 1); - } - } - try - { - if (barCodes.IsValid) - { - - - // MessageBox.Show(barCodes.BarCode); - var code = UrlUtil.GetBarCode(barCodes.BarCode.ToLower().Trim()); - var goodsName = UrlUtil.GetGoodsName(barCodes.BarCode.ToLower()); - - doInsertUnSubmit(code, goodsName, null); - barCodes.StringBuilder = new StringBuilder(); - } - } - catch - { - } - finally - { - - barCodes.IsValid = false; //最后一定要 设置barCode无效 - barCodes.Time = DateTime.Now; - } - - } +// GridUnCheckFocus(); + } + +// BwpBarCodes barCodes = new BwpBarCodes(); +// +// private void TrunksIousOutInStoreForm_KeyDown(object sender, KeyEventArgs e) +// { +// if (e.KeyData == (Keys.ShiftKey | Keys.Shift)) +// { +// return; +// } +// TimeSpan ts = DateTime.Now.Subtract(barCodes.Time); +// var str = BwpBarCodeUtil.GetStringByKeyKeyEventArgs(e); +// barCodes.StringBuilder.Append(str); +// +// if (ts.TotalMilliseconds < 50) +// { +// if (e.KeyData == Keys.Enter && barCodes.BarCode.Length > 0) +// { +// //回车 +// barCodes.IsValid = true; +// barCodes.StringBuilder.Remove(barCodes.StringBuilder.Length - 1, 1); +// } +// } +// try +// { +// if (barCodes.IsValid) +// { +// // MessageBox.Show(barCodes.BarCode); +// var code = UrlUtil.GetBarCode(barCodes.BarCode.ToLower().Trim()); +// var goodsName = UrlUtil.GetGoodsName(barCodes.BarCode.ToLower()); +// +// doInsertUnSubmit(code, goodsName, null); +// barCodes.StringBuilder = new StringBuilder(); +// } +// } +// catch(Exception ex) +// { +// MessageBox.Show(ex.ToString()); +// } +// finally +// { +// +// barCodes.IsValid = false; //最后一定要 设置barCode无效 +// barCodes.Time = DateTime.Now; +// } +// +// } } } diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx b/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx index 84a5835..b31712e 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx @@ -147,16 +147,10 @@ True - - 4, 19 - - 98, 19 - - - 273, 19 + 180, 26 - - 440, 19 + + 65 \ No newline at end of file diff --git a/WeighAndGrading/GradeFrom.cs b/WeighAndGrading/GradeFrom.cs index 690e712..11758a5 100644 --- a/WeighAndGrading/GradeFrom.cs +++ b/WeighAndGrading/GradeFrom.cs @@ -435,11 +435,11 @@ namespace WeighAndGrading string goodsName; if (jibie == "烫褪") { - goodsName = "带皮白条"; + goodsName ="dpbt"; //"带皮白条"; } else { - goodsName = "去皮白条"; + goodsName ="qpbt"; //"去皮白条"; } var entity = new PrintEntity(); @@ -465,7 +465,7 @@ namespace WeighAndGrading string indexCode = maxindex.ToString("D6"); entity.BarCode = string.Format("WF{0}{1:00000}", DateTime.Today.ToString("yyyyMMdd"), indexCode); - entity._2DQRCode = string.Format("http://www.bwpsoft.com?code={0}&name={1}", entity.BarCode, goodsName); + entity._2DQRCode = string.Format(ButcherAppContext.Context.UrlConfig.OutAddress+"?code={0}&name={1}", entity.BarCode, goodsName); return entity; } diff --git a/WinFormTest/App.config b/WinFormTest/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/WinFormTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WinFormTest/Form1.Designer.cs b/WinFormTest/Form1.Designer.cs new file mode 100644 index 0000000..af9164d --- /dev/null +++ b/WinFormTest/Form1.Designer.cs @@ -0,0 +1,63 @@ +namespace WinFormTest +{ + partial class Form1 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(40, 98); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(601, 452); + this.Controls.Add(this.label1); + this.Name = "Form1"; + this.Text = "Form1"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); + this.Load += new System.EventHandler(this.Form1_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} + diff --git a/WinFormTest/Form1.cs b/WinFormTest/Form1.cs new file mode 100644 index 0000000..1a51ec0 --- /dev/null +++ b/WinFormTest/Form1.cs @@ -0,0 +1,57 @@ +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; +using BO; + +namespace WinFormTest +{ + public partial class Form1 : Form + { + BardCodeHooK BarCode = new BardCodeHooK(); + public Form1() + { + InitializeComponent(); + BarCode.BarCodeEvent += new BardCodeHooK.BardCodeDeletegate(BarCode_BarCodeEvent); + } + + void BarCode_BarCodeEvent(BardCodeHooK.BarCodes barCode) + { + ShowInfo(barCode); + } + private delegate void ShowInfoDelegate(BardCodeHooK.BarCodes barCode); + + private void ShowInfo(BardCodeHooK.BarCodes barCode) + { + if (this.InvokeRequired) + { + this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); + } + else + { + if (barCode.IsValid) + { + // var code = UrlUtil.GetBarCode(barCode.BarCode.Trim()); + // var goodsName = UrlUtil.GetGoodsName(barCode.BarCode); + var code = barCode.BarCode.Trim(); + label1.Text = code; + } + } + } + + private void Form1_Load(object sender, EventArgs e) + { + BarCode.Start(); + } + + private void Form1_FormClosed(object sender, FormClosedEventArgs e) + { + BarCode.Stop(); + } + } +} diff --git a/WinFormTest/Form1.resx b/WinFormTest/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WinFormTest/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/WinFormTest/Program.cs b/WinFormTest/Program.cs new file mode 100644 index 0000000..45a683f --- /dev/null +++ b/WinFormTest/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WinFormTest +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/WinFormTest/Properties/AssemblyInfo.cs b/WinFormTest/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..246247b --- /dev/null +++ b/WinFormTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinFormTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WinFormTest")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +//将 ComVisible 设置为 false 将使此程序集中的类型 +//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("e9831f50-fd30-465c-9bf1-d3c9c415ef5b")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinFormTest/Properties/Resources.Designer.cs b/WinFormTest/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6d239b8 --- /dev/null +++ b/WinFormTest/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.42000 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WinFormTest.Properties +{ + + + /// + /// 强类型资源类,用于查找本地化字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的缓存 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinFormTest.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 覆盖当前线程的 CurrentUICulture 属性 + /// 使用此强类型的资源类的资源查找。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/WinFormTest/Properties/Resources.resx b/WinFormTest/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/WinFormTest/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFormTest/Properties/Settings.Designer.cs b/WinFormTest/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a3296bd --- /dev/null +++ b/WinFormTest/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WinFormTest.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/WinFormTest/Properties/Settings.settings b/WinFormTest/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/WinFormTest/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/WinFormTest/WinFormTest.csproj b/WinFormTest/WinFormTest.csproj new file mode 100644 index 0000000..a1333b7 --- /dev/null +++ b/WinFormTest/WinFormTest.csproj @@ -0,0 +1,99 @@ + + + + + Debug + AnyCPU + {E9831F50-FD30-465C-9BF1-D3C9C415EF5B} + WinExe + Properties + WinFormTest + WinFormTest + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {8968f14a-c7c7-4751-96ce-b114fbfd65ef} + BO + + + {a782b23e-be6d-4f51-b5cb-5cd259ba97cc} + BWP.WinFormControl + + + + + \ No newline at end of file