diff --git a/SegmentationWeight/SegmentationWeightForm.cs b/SegmentationWeight/SegmentationWeightForm.cs index decba7f..77de99d 100644 --- a/SegmentationWeight/SegmentationWeightForm.cs +++ b/SegmentationWeight/SegmentationWeightForm.cs @@ -872,7 +872,7 @@ namespace SegmentationWeight { btnEnableWeight.Text = "开始称重"; btnEnableWeight.BackColor = SystemColors.Control; - btnEnablePrint.UseVisualStyleBackColor = true; + btnEnableWeight.UseVisualStyleBackColor = true; DisableWeight(); } diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs index 2c5861f..6b541f2 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs @@ -28,42 +28,30 @@ /// 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(); + 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(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = 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.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.btnEnableWeight = new System.Windows.Forms.Button(); + this.picNetStatus = new System.Windows.Forms.PictureBox(); + this.label10 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); - this.cbxBatch = new System.Windows.Forms.ComboBox(); + this.cbxStore = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); this.cbxWorkUnit = new System.Windows.Forms.ComboBox(); - this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.cbxWorkShop = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); - this.cbxStore = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.lblChengZhong = new System.Windows.Forms.Label(); + this.btnWeightSet = new System.Windows.Forms.Button(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.gridChecked = new BWP.WinFormControl.UDataGridView(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.gridUnCheck = new System.Windows.Forms.DataGridView(); - this.uncheck序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.uncheck条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.uncheck产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.uncheck数量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.uncheck重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.picSyncStatus = new System.Windows.Forms.PictureBox(); - this.picNetStatus = new System.Windows.Forms.PictureBox(); - this.label11 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.btnEnableWeight = new System.Windows.Forms.Button(); this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -71,22 +59,28 @@ this.入库重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.胴体重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.损耗 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.gridUnCheck = new System.Windows.Forms.DataGridView(); + this.uncheck序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.uncheck条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.uncheck产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.uncheck数量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.uncheck重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picNetStatus)).BeginInit(); + this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.SuspendLayout(); - this.panel3.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridUnCheck)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picSyncStatus)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.picNetStatus)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -114,12 +108,9 @@ this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel1.Controls.Add(this.btnEnableWeight); - this.panel1.Controls.Add(this.picSyncStatus); this.panel1.Controls.Add(this.picNetStatus); - this.panel1.Controls.Add(this.label11); this.panel1.Controls.Add(this.label10); this.panel1.Controls.Add(this.panel3); - this.panel1.Controls.Add(this.enableWeight); this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.btnWeightSet); this.panel1.Location = new System.Drawing.Point(11, 3); @@ -127,65 +118,35 @@ this.panel1.Size = new System.Drawing.Size(1060, 159); this.panel1.TabIndex = 1; // - // enableWeight - // - this.enableWeight.AutoCheck = false; - this.enableWeight.AutoSize = true; - this.enableWeight.Font = new System.Drawing.Font("宋体", 18F); - this.enableWeight.Location = new System.Drawing.Point(412, 23); - this.enableWeight.Name = "enableWeight"; - this.enableWeight.Size = new System.Drawing.Size(125, 28); - this.enableWeight.TabIndex = 33; - this.enableWeight.Text = "启用称重"; - this.enableWeight.UseVisualStyleBackColor = true; - this.enableWeight.Click += new System.EventHandler(this.enableWeight_Click); - // - // panel2 - // - this.panel2.BackColor = System.Drawing.Color.Black; - this.panel2.Controls.Add(this.lblChengZhong); - this.panel2.Location = new System.Drawing.Point(3, 8); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(237, 88); - this.panel2.TabIndex = 32; - // - // lblChengZhong - // - this.lblChengZhong.AutoSize = true; - this.lblChengZhong.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblChengZhong.ForeColor = System.Drawing.Color.Red; - this.lblChengZhong.Location = new System.Drawing.Point(14, 22); - this.lblChengZhong.Name = "lblChengZhong"; - this.lblChengZhong.Size = new System.Drawing.Size(97, 40); - this.lblChengZhong.TabIndex = 0; - this.lblChengZhong.Text = "0.00"; - // - // btnWeightSet + // btnEnableWeight // - this.btnWeightSet.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnWeightSet.Location = new System.Drawing.Point(3, 108); - this.btnWeightSet.Name = "btnWeightSet"; - this.btnWeightSet.Size = new System.Drawing.Size(111, 37); - this.btnWeightSet.TabIndex = 0; - this.btnWeightSet.Text = "称设置"; - this.btnWeightSet.UseVisualStyleBackColor = true; - this.btnWeightSet.Click += new System.EventHandler(this.btnWeightSet_Click); + this.btnEnableWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnEnableWeight.Location = new System.Drawing.Point(129, 108); + this.btnEnableWeight.Name = "btnEnableWeight"; + this.btnEnableWeight.Size = new System.Drawing.Size(111, 37); + this.btnEnableWeight.TabIndex = 44; + this.btnEnableWeight.Text = "启用称重"; + this.btnEnableWeight.UseVisualStyleBackColor = true; + this.btnEnableWeight.Click += new System.EventHandler(this.btnEnableWeight_Click); // - // splitContainer2 + // picNetStatus // - this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; + this.picNetStatus.ErrorImage = null; + this.picNetStatus.InitialImage = null; + this.picNetStatus.Location = new System.Drawing.Point(321, 14); + this.picNetStatus.Name = "picNetStatus"; + this.picNetStatus.Size = new System.Drawing.Size(30, 30); + this.picNetStatus.TabIndex = 43; + this.picNetStatus.TabStop = false; // - // splitContainer2.Panel1 + // label10 // - this.splitContainer2.Panel1.Controls.Add(this.groupBox2); - this.splitContainer2.Panel1.Controls.Add(this.groupBox1); - this.splitContainer2.Size = new System.Drawing.Size(1085, 445); - this.splitContainer2.SplitterDistance = 763; - this.splitContainer2.SplitterWidth = 1; - this.splitContainer2.TabIndex = 0; + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(286, 22); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(29, 12); + this.label10.TabIndex = 41; + this.label10.Text = "网络"; // // panel3 // @@ -193,50 +154,48 @@ this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel3.Controls.Add(this.cbxStore); this.panel3.Controls.Add(this.label1); - this.panel3.Controls.Add(this.cbxBatch); this.panel3.Controls.Add(this.cbxWorkUnit); - this.panel3.Controls.Add(this.label6); this.panel3.Controls.Add(this.label5); this.panel3.Controls.Add(this.cbxWorkShop); this.panel3.Controls.Add(this.label4); - this.panel3.Location = new System.Drawing.Point(597, 6); + this.panel3.Location = new System.Drawing.Point(809, 8); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(234, 153); + this.panel3.Size = new System.Drawing.Size(234, 139); this.panel3.TabIndex = 35; // - // cbxBatch + // cbxStore + // + this.cbxStore.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxStore.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cbxStore.FormattingEnabled = true; + this.cbxStore.Location = new System.Drawing.Point(75, 91); + this.cbxStore.Name = "cbxStore"; + this.cbxStore.Size = new System.Drawing.Size(121, 24); + this.cbxStore.TabIndex = 43; + // + // label1 // - this.cbxBatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxBatch.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cbxBatch.FormattingEnabled = true; - this.cbxBatch.Location = new System.Drawing.Point(75, 82); - this.cbxBatch.Name = "cbxBatch"; - this.cbxBatch.Size = new System.Drawing.Size(121, 24); - this.cbxBatch.TabIndex = 39; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 98); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(65, 12); + this.label1.TabIndex = 42; + this.label1.Text = "仓 库:"; // // cbxWorkUnit // this.cbxWorkUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxWorkUnit.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cbxWorkUnit.FormattingEnabled = true; - this.cbxWorkUnit.Location = new System.Drawing.Point(75, 45); + this.cbxWorkUnit.Location = new System.Drawing.Point(75, 48); this.cbxWorkUnit.Name = "cbxWorkUnit"; this.cbxWorkUnit.Size = new System.Drawing.Size(121, 24); this.cbxWorkUnit.TabIndex = 40; // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(9, 89); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(65, 12); - this.label6.TabIndex = 36; - this.label6.Text = "生产批次:"; - // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(9, 51); + this.label5.Location = new System.Drawing.Point(9, 54); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(65, 12); this.label5.TabIndex = 37; @@ -261,24 +220,52 @@ this.label4.TabIndex = 38; this.label4.Text = "车 间:"; // - // cbxStore + // panel2 // - this.cbxStore.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxStore.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cbxStore.FormattingEnabled = true; - this.cbxStore.Location = new System.Drawing.Point(75, 117); - this.cbxStore.Name = "cbxStore"; - this.cbxStore.Size = new System.Drawing.Size(121, 24); - this.cbxStore.TabIndex = 43; + this.panel2.BackColor = System.Drawing.Color.Black; + this.panel2.Controls.Add(this.lblChengZhong); + this.panel2.Location = new System.Drawing.Point(3, 8); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(237, 88); + this.panel2.TabIndex = 32; // - // label1 + // lblChengZhong // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(9, 124); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 12); - this.label1.TabIndex = 42; - this.label1.Text = "仓 库:"; + this.lblChengZhong.AutoSize = true; + this.lblChengZhong.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblChengZhong.ForeColor = System.Drawing.Color.Red; + this.lblChengZhong.Location = new System.Drawing.Point(14, 22); + this.lblChengZhong.Name = "lblChengZhong"; + this.lblChengZhong.Size = new System.Drawing.Size(97, 40); + this.lblChengZhong.TabIndex = 0; + this.lblChengZhong.Text = "0.00"; + // + // btnWeightSet + // + this.btnWeightSet.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnWeightSet.Location = new System.Drawing.Point(3, 108); + this.btnWeightSet.Name = "btnWeightSet"; + this.btnWeightSet.Size = new System.Drawing.Size(111, 37); + this.btnWeightSet.TabIndex = 0; + this.btnWeightSet.Text = "称设置"; + this.btnWeightSet.UseVisualStyleBackColor = true; + this.btnWeightSet.Click += new System.EventHandler(this.btnWeightSet_Click); + // + // splitContainer2 + // + this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.groupBox2); + this.splitContainer2.Panel1.Controls.Add(this.groupBox1); + this.splitContainer2.Size = new System.Drawing.Size(1085, 445); + this.splitContainer2.SplitterDistance = 763; + this.splitContainer2.SplitterWidth = 1; + this.splitContainer2.TabIndex = 0; // // groupBox2 // @@ -299,17 +286,17 @@ this.gridChecked.AllowUserToDeleteRows = false; this.gridChecked.AllowUserToResizeColumns = false; this.gridChecked.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle37; this.gridChecked.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.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle38.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle38.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle38.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle38.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38; this.gridChecked.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridChecked.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.序号, @@ -325,14 +312,67 @@ this.gridChecked.Name = "gridChecked"; this.gridChecked.ReadOnly = true; this.gridChecked.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.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle39.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle39.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle39; this.gridChecked.RowTemplate.Height = 23; this.gridChecked.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.gridChecked.Size = new System.Drawing.Size(661, 159); this.gridChecked.TabIndex = 4; // + // 序号 + // + this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.序号.DataPropertyName = "ID"; + this.序号.HeaderText = "序号"; + this.序号.Name = "序号"; + this.序号.ReadOnly = true; + this.序号.Width = 65; + // + // 条码 + // + this.条码.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.条码.DataPropertyName = "BarCode"; + this.条码.HeaderText = "条码"; + this.条码.Name = "条码"; + this.条码.ReadOnly = true; + this.条码.Width = 65; + // + // 产品名称 + // + this.产品名称.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.产品名称.DataPropertyName = "Goods_Name"; + this.产品名称.HeaderText = "产品名称"; + this.产品名称.Name = "产品名称"; + this.产品名称.ReadOnly = true; + this.产品名称.Width = 97; + // + // 数量 + // + this.数量.DataPropertyName = "Number"; + this.数量.HeaderText = "数量"; + this.数量.Name = "数量"; + this.数量.ReadOnly = true; + // + // 入库重量 + // + this.入库重量.DataPropertyName = "Weight"; + this.入库重量.HeaderText = "入库重量"; + this.入库重量.Name = "入库重量"; + this.入库重量.ReadOnly = true; + // + // 胴体重量 + // + this.胴体重量.HeaderText = "胴体重量"; + this.胴体重量.Name = "胴体重量"; + this.胴体重量.ReadOnly = true; + // + // 损耗 + // + this.损耗.HeaderText = "损耗"; + this.损耗.Name = "损耗"; + this.损耗.ReadOnly = true; + // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -351,17 +391,17 @@ this.gridUnCheck.AllowUserToDeleteRows = false; this.gridUnCheck.AllowUserToResizeColumns = false; this.gridUnCheck.AllowUserToResizeRows = false; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle40.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle40; this.gridUnCheck.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.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle41.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle41.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle41.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle41.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle41.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle41.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle41; this.gridUnCheck.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridUnCheck.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uncheck序号, @@ -375,9 +415,9 @@ this.gridUnCheck.Name = "gridUnCheck"; this.gridUnCheck.ReadOnly = true; this.gridUnCheck.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.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle42.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle42.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle42; this.gridUnCheck.RowTemplate.Height = 23; this.gridUnCheck.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.gridUnCheck.Size = new System.Drawing.Size(664, 200); @@ -422,107 +462,6 @@ this.uncheck重量.Name = "uncheck重量"; this.uncheck重量.ReadOnly = true; // - // picSyncStatus - // - this.picSyncStatus.ErrorImage = null; - this.picSyncStatus.InitialImage = null; - this.picSyncStatus.Location = new System.Drawing.Point(321, 59); - this.picSyncStatus.Name = "picSyncStatus"; - this.picSyncStatus.Size = new System.Drawing.Size(30, 30); - this.picSyncStatus.TabIndex = 42; - this.picSyncStatus.TabStop = false; - // - // picNetStatus - // - this.picNetStatus.ErrorImage = null; - this.picNetStatus.InitialImage = null; - this.picNetStatus.Location = new System.Drawing.Point(321, 14); - this.picNetStatus.Name = "picNetStatus"; - this.picNetStatus.Size = new System.Drawing.Size(30, 30); - this.picNetStatus.TabIndex = 43; - this.picNetStatus.TabStop = false; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(286, 70); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(29, 12); - this.label11.TabIndex = 40; - this.label11.Text = "同步"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(286, 22); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(29, 12); - this.label10.TabIndex = 41; - this.label10.Text = "网络"; - // - // btnEnableWeight - // - this.btnEnableWeight.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnEnableWeight.Location = new System.Drawing.Point(129, 108); - this.btnEnableWeight.Name = "btnEnableWeight"; - this.btnEnableWeight.Size = new System.Drawing.Size(111, 37); - this.btnEnableWeight.TabIndex = 44; - this.btnEnableWeight.Text = "启用称重"; - this.btnEnableWeight.UseVisualStyleBackColor = true; - // - // 序号 - // - this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.序号.DataPropertyName = "ID"; - this.序号.HeaderText = "序号"; - this.序号.Name = "序号"; - this.序号.ReadOnly = true; - this.序号.Width = 65; - // - // 条码 - // - this.条码.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.条码.DataPropertyName = "BarCode"; - this.条码.HeaderText = "条码"; - this.条码.Name = "条码"; - this.条码.ReadOnly = true; - this.条码.Width = 65; - // - // 产品名称 - // - this.产品名称.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.产品名称.DataPropertyName = "Goods_Name"; - this.产品名称.HeaderText = "产品名称"; - this.产品名称.Name = "产品名称"; - this.产品名称.ReadOnly = true; - this.产品名称.Width = 97; - // - // 数量 - // - this.数量.DataPropertyName = "Number"; - this.数量.HeaderText = "数量"; - this.数量.Name = "数量"; - this.数量.ReadOnly = true; - // - // 入库重量 - // - this.入库重量.DataPropertyName = "Weight"; - this.入库重量.HeaderText = "入库重量"; - this.入库重量.Name = "入库重量"; - this.入库重量.ReadOnly = true; - // - // 胴体重量 - // - this.胴体重量.HeaderText = "胴体重量"; - this.胴体重量.Name = "胴体重量"; - this.胴体重量.ReadOnly = true; - // - // 损耗 - // - this.损耗.HeaderText = "损耗"; - this.损耗.Name = "损耗"; - this.损耗.ReadOnly = true; - // // TrunksIousOutInStoreForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -544,19 +483,18 @@ this.splitContainer1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picNetStatus)).EndInit(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); this.splitContainer2.Panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); - this.panel3.ResumeLayout(false); - this.panel3.PerformLayout(); this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).EndInit(); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridUnCheck)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picSyncStatus)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.picNetStatus)).EndInit(); this.ResumeLayout(false); } @@ -567,13 +505,10 @@ private System.Windows.Forms.Panel panel1; private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.Button btnWeightSet; - private System.Windows.Forms.CheckBox enableWeight; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label lblChengZhong; private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.ComboBox cbxBatch; private System.Windows.Forms.ComboBox cbxWorkUnit; - private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.ComboBox cbxWorkShop; private System.Windows.Forms.Label label4; @@ -588,9 +523,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn uncheck产品名称; private System.Windows.Forms.DataGridViewTextBoxColumn uncheck数量; private System.Windows.Forms.DataGridViewTextBoxColumn uncheck重量; - private System.Windows.Forms.PictureBox picSyncStatus; private System.Windows.Forms.PictureBox picNetStatus; - private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label10; private System.Windows.Forms.Button btnEnableWeight; private System.Windows.Forms.DataGridViewTextBoxColumn 序号; diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs index e3ec974..2078fc1 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs @@ -8,6 +8,7 @@ using System.Drawing; using System.IO; using System.IO.Ports; using System.Linq; +using System.Reflection; using System.Text; using System.Threading; using System.Windows.Forms; @@ -26,7 +27,11 @@ namespace TrunksIousOutInStore { public partial class TrunksIousOutInStoreForm : Form, IAfterLogin { + private readonly string mDropDownSetsFileName = "TrunksIousOutInStore_DropDownSets.xml"; + private DropDownSets mDropDownSets; + private Thread tdSyncUnSubmit, tdSyncSubmited; + private readonly Thread _tcCheckNetStatus; private readonly string BaseRpcUrl = "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/"; @@ -49,6 +54,8 @@ namespace TrunksIousOutInStore gridUnCheck.AutoGenerateColumns = false; gridChecked.AutoGenerateColumns = false; + InitCombox(); + weightPort = new SerialPort(); this.FormClosing += delegate { @@ -58,6 +65,10 @@ namespace TrunksIousOutInStore tdSyncUnSubmit.Abort(); if (tdSyncSubmited != null && tdSyncSubmited.IsAlive) tdSyncSubmited.Abort(); + if (_tcCheckNetStatus != null && _tcCheckNetStatus.IsAlive) + { + _tcCheckNetStatus.Abort(); + } }; // BarCode.BarCodeEvent += new BardCodeHooK.BardCodeDeletegate(BarCode_BarCodeEvent); @@ -66,38 +77,82 @@ namespace TrunksIousOutInStore tdSyncSubmited = new Thread(SyncSubmited); tdSyncUnSubmit.Start(); tdSyncSubmited.Start(); + + _tcCheckNetStatus = new Thread(CheckNetStatus); + _tcCheckNetStatus.Start(); } + private bool laseConnection = false; + private void CheckNetStatus() + { + while (true) + { + try + { + var newConnection = LoginRpcUtil.TestConnection(500); + if (newConnection && laseConnection) + { + Thread.Sleep(1000); + continue; + } + var png = "stop.png"; + if (newConnection) + png = "working.png"; + var imgPath = Path.Combine(Application.StartupPath, "BWP.WinFormControl.dll"); + var s = Assembly.LoadFile(imgPath).GetManifestResourceStream("BWP.WinFormControl.Images." + png); + if (this.InvokeRequired) + { + this.BeginInvoke(new Action(() => + { + picNetStatus.Image = Image.FromStream(s); + picNetStatus.Refresh(); + })); + } + else + { + picNetStatus.Image = Image.FromStream(s); + picNetStatus.Refresh(); + } + laseConnection = newConnection; + } + catch (Exception e) + { + //LogUtil.Error(e.ToString()); + } + + Thread.Sleep(1000); + } + } -// 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); -// } -// } -// } + // 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() { - if (enableWeight.Checked) + if (!_enableWeight) return; if (TrunksIousOutInStoreContext.Config.RateSet == null) throw new Exception("请先配置称相关信息"); @@ -284,23 +339,93 @@ namespace TrunksIousOutInStore weightPort.Close(); } - public void enableWeight_Click(object sender, EventArgs e) + #endregion + + + private void InitCombox() { - if (!enableWeight.Checked) + if (LoginRpcUtil.TestConnection(500)) { - OpenSerialPort(); - _mainProcessIsRun = true; - ReadData(); + mDropDownSets = GetmDropDownSets(); + XmlUtil.SerializerObjToFile(mDropDownSets, mDropDownSetsFileName); } else { - DisableWeight(); + mDropDownSets = XmlUtil.DeserializeFromFile(mDropDownSetsFileName); } - enableWeight.CheckState = enableWeight.Checked ? CheckState.Unchecked : CheckState.Checked; + var shop = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.车间); + if (shop != null) + { + cbxWorkShop.DataSource = shop.Details; + cbxWorkShop.DisplayMember = "Name"; + cbxWorkShop.ValueMember = "ID"; + } + + var unit = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.单元); + if (unit != null) + { + cbxWorkUnit.DataSource = unit.Details; + cbxWorkUnit.DisplayMember = "Name"; + cbxWorkUnit.ValueMember = "Code"; + } + + var batch = mDropDownSets.Details.FirstOrDefault(x => x.Name == DropDownSets.批次); + if (batch != null) + { + cbxStore.DataSource = batch.Details; + cbxStore.DisplayMember = "Name"; + cbxStore.ValueMember = "ID"; + } + } - #endregion + private DropDownSets GetmDropDownSets() + { + var sets = new DropDownSets(); + var wrokUnitSet = GetWrokUnitSet(); + var wrokShopSet = GetWrokShopSet(); + var storeSet = GetStoreSet(); + sets.Details.Add(wrokUnitSet); + sets.Details.Add(wrokShopSet); + sets.Details.Add(storeSet); + return sets; + } + + private DropDownSet GetStoreSet() + { + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetStoreList"); + var set = new DropDownSet(); + set.Name = DropDownSets.仓库; + foreach (var detail in JsonConvert.DeserializeObject>(json)) + { + set.Details.Add(detail); + } + return set; + } + + private DropDownSet GetWrokShopSet() + { + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetWorkShopList"); + var set = new DropDownSet(); + set.Name = DropDownSets.车间; + foreach (var detail in JsonConvert.DeserializeObject>(json)) + { + set.Details.Add(detail); + } + return set; + } + private DropDownSet GetWrokUnitSet() + { + var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BaseInfoRpc/GetWorkUnitList"); + var set = new DropDownSet(); + set.Name = DropDownSets.单元; + foreach (var detail in JsonConvert.DeserializeObject>(json)) + { + set.Details.Add(detail); + } + return set; + } static object _obj = new object(); @@ -308,9 +433,7 @@ namespace TrunksIousOutInStore { lock (_obj) { - - //称重 - + //称重 //找到称重为空条码不为空的 var fd = unSubmitList.LastOrDefault(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight == null); if (fd == null) @@ -324,7 +447,14 @@ namespace TrunksIousOutInStore //给条码赋值 fd.Weight = weight; //请求中间服务器 - RpcFacade.Call(BaseRpcUrl+ "SetWeight", fd.ID, weight); + string biaosh = ""; + string store=""; + this.Invoke(new Action(() => + { + biaosh = cbxWorkUnit.Text; + store = cbxStore.Text; + })); + RpcFacade.Call(BaseRpcUrl+ "SetWeight", fd.ID, weight, biaosh, store); } gridUnCheck.Refresh(); @@ -478,7 +608,7 @@ namespace TrunksIousOutInStore if (f.ShowDialog() == DialogResult.OK) { - enableWeight_Click(sender, e); +// enableWeight_Click(sender, e); // GridUnCheckFocus(); } } @@ -492,32 +622,30 @@ namespace TrunksIousOutInStore { // BarCode.Stop(); } - - - #region 检查网络畅通 - private void timerChectNetStatus_Tick(object sender, EventArgs e) - { - timerChectNetStatus.Stop(); - ChectConnectionStatus(); - timerChectNetStatus.Start(); - } - void ChectConnectionStatus() + private bool _enableWeight = false; + private void btnEnableWeight_Click(object sender, EventArgs e) { - if (LoginRpcUtil.TestConnection()) + _enableWeight = !_enableWeight; + if (_enableWeight) { - btnNetStatus.Text = "网络畅通"; - btnNetStatus.BackColor = Color.Green; + btnEnableWeight.Text = "停止称重"; + btnEnableWeight.BackColor = Color.ForestGreen; + + OpenSerialPort(); + _mainProcessIsRun = true; + ReadData(); + } else { - btnNetStatus.Text = "网络不通"; - btnNetStatus.BackColor = Color.Red; + btnEnableWeight.Text = "开始称重"; + btnEnableWeight.BackColor = SystemColors.Control; + btnEnableWeight.UseVisualStyleBackColor = true; + + DisableWeight(); } } - #endregion - - private void btnCreateBill_Click(object sender, EventArgs e) { // GridUnCheckFocus();