diff --git a/SjMes/PunchAssemble/PunchAndWeld/App.config b/SjMes/PunchAssemble/PunchAndWeld/App.config index 33f99f3..e5a79a5 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/App.config +++ b/SjMes/PunchAssemble/PunchAndWeld/App.config @@ -9,8 +9,8 @@ - - + + diff --git a/SjMes/PunchAssemble/PunchAndWeld/DataSouce/ProScreenFunc.cs b/SjMes/PunchAssemble/PunchAndWeld/DataSouce/ProScreenFunc.cs index c286c3b..4a77ebb 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/DataSouce/ProScreenFunc.cs +++ b/SjMes/PunchAssemble/PunchAndWeld/DataSouce/ProScreenFunc.cs @@ -1831,7 +1831,7 @@ namespace PunchAndWeld.DataSouce try { - string sql = $@"select ID from {tableName} where BarCode='" + barCode + @"'"; + string sql = $@"select ID from tb_ScanRecord_Laser where BarCode='" + barCode + "' union all select ID from tb_ScanRecord_LaserL where BarCode='" + barCode + "'"; DataTable dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); if (dt != null && dt.Rows.Count > 0) { @@ -1865,14 +1865,19 @@ namespace PunchAndWeld.DataSouce return res; } - public static DataTable GetScanRecord_Lasers(DateTime timeFr,DateTime timeTo) + public static DataTable GetScanRecord_Lasers(DateTime timeFr,DateTime timeTo,string barCode) { bool res = false; try { - string sql = $@"select BarCode,ScanTime,LeftOrRight,MCode,'高' as Cfg from tb_ScanRecord_Laser where ScanTime>='{timeFr}' and ScanTime<='{timeTo}' - union all select BarCode,ScanTime,LeftOrRight,MCode,'低' as Cfg from tb_ScanRecord_LaserL where ScanTime>='{timeFr}' and ScanTime<='{timeTo}'"; + string whereStr = $"ScanTime>='{timeFr}' and ScanTime<='{timeTo}'"; + if(!string.IsNullOrEmpty(barCode)) + { + whereStr = whereStr + $" and BarCode='{barCode}'"; + } + string sql = $@"select BarCode,ScanTime,LeftOrRight,MCode,'高' as Cfg from tb_ScanRecord_Laser where {whereStr} + union all select BarCode,ScanTime,LeftOrRight,MCode,'低' as Cfg from tb_ScanRecord_LaserL where {whereStr}"; DataTable dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); return dt; } diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.Designer.cs b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.Designer.cs index e12a3ee..d199be3 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.Designer.cs +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.Designer.cs @@ -31,6 +31,7 @@ this.components = new System.ComponentModel.Container(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); + this.txtLastScanL = new System.Windows.Forms.TextBox(); this.txtLastScanR = new System.Windows.Forms.TextBox(); this.txtProduceModel = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); @@ -40,7 +41,7 @@ this.label3 = new System.Windows.Forms.Label(); this.lbLinkState = new System.Windows.Forms.Label(); this.btnOpenParamDialog = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); + this.btnSearch = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.txtRightScan = new System.Windows.Forms.TextBox(); @@ -60,6 +61,11 @@ this.txtAllQty = new System.Windows.Forms.Label(); this.lbVer = new System.Windows.Forms.Label(); this.dgridScanRecords = new System.Windows.Forms.DataGridView(); + 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.lbMsg = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.lbEnd = new System.Windows.Forms.Label(); @@ -67,12 +73,6 @@ this.lbBegin = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.focusTimer = new System.Windows.Forms.Timer(this.components); - 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.txtLastScanL = new System.Windows.Forms.TextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); @@ -121,7 +121,7 @@ this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.lbLinkState); this.panel1.Controls.Add(this.btnOpenParamDialog); - this.panel1.Controls.Add(this.button1); + this.panel1.Controls.Add(this.btnSearch); this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(3, 3); @@ -129,6 +129,15 @@ this.panel1.Size = new System.Drawing.Size(1273, 94); this.panel1.TabIndex = 0; // + // txtLastScanL + // + this.txtLastScanL.Font = new System.Drawing.Font("宋体", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtLastScanL.Location = new System.Drawing.Point(40, 46); + this.txtLastScanL.Name = "txtLastScanL"; + this.txtLastScanL.ReadOnly = true; + this.txtLastScanL.Size = new System.Drawing.Size(457, 38); + this.txtLastScanL.TabIndex = 11; + // // txtLastScanR // this.txtLastScanR.Font = new System.Drawing.Font("宋体", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); @@ -223,15 +232,16 @@ this.btnOpenParamDialog.UseVisualStyleBackColor = true; this.btnOpenParamDialog.Click += new System.EventHandler(this.btnOpenParamDialog_Click); // - // button1 + // btnSearch // - this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button1.Location = new System.Drawing.Point(1089, 4); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(175, 37); - this.button1.TabIndex = 1; - this.button1.Text = "查询明细"; - this.button1.UseVisualStyleBackColor = true; + this.btnSearch.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSearch.Location = new System.Drawing.Point(1089, 4); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(175, 37); + this.btnSearch.TabIndex = 1; + this.btnSearch.Text = "查询明细"; + this.btnSearch.UseVisualStyleBackColor = true; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); // // label1 // @@ -517,6 +527,52 @@ this.dgridScanRecords.Size = new System.Drawing.Size(1273, 439); this.dgridScanRecords.TabIndex = 4; // + // 塑件唯一码 + // + this.塑件唯一码.DataPropertyName = "BarCode"; + this.塑件唯一码.HeaderText = "塑件唯一码"; + this.塑件唯一码.MinimumWidth = 6; + this.塑件唯一码.Name = "塑件唯一码"; + this.塑件唯一码.ReadOnly = true; + this.塑件唯一码.Width = 200; + // + // 零件号 + // + this.零件号.DataPropertyName = "MCode"; + this.零件号.HeaderText = "零件号"; + this.零件号.MinimumWidth = 6; + this.零件号.Name = "零件号"; + this.零件号.ReadOnly = true; + this.零件号.Visible = false; + this.零件号.Width = 200; + // + // 位置 + // + this.位置.DataPropertyName = "LeftOrRight"; + this.位置.HeaderText = "位置"; + this.位置.MinimumWidth = 6; + this.位置.Name = "位置"; + this.位置.ReadOnly = true; + this.位置.Width = 200; + // + // 配置 + // + this.配置.DataPropertyName = "Cfg"; + this.配置.HeaderText = "配置"; + this.配置.MinimumWidth = 6; + this.配置.Name = "配置"; + this.配置.ReadOnly = true; + this.配置.Width = 200; + // + // 生产时间 + // + this.生产时间.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.生产时间.DataPropertyName = "ScanTime"; + this.生产时间.HeaderText = "生产时间"; + this.生产时间.MinimumWidth = 6; + this.生产时间.Name = "生产时间"; + this.生产时间.ReadOnly = true; + // // lbMsg // this.lbMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -589,61 +645,6 @@ this.focusTimer.Interval = 1500; this.focusTimer.Tick += new System.EventHandler(this.focusTimer_Tick); // - // 塑件唯一码 - // - this.塑件唯一码.DataPropertyName = "BarCode"; - this.塑件唯一码.HeaderText = "塑件唯一码"; - this.塑件唯一码.MinimumWidth = 6; - this.塑件唯一码.Name = "塑件唯一码"; - this.塑件唯一码.ReadOnly = true; - this.塑件唯一码.Width = 200; - // - // 零件号 - // - this.零件号.DataPropertyName = "MCode"; - this.零件号.HeaderText = "零件号"; - this.零件号.MinimumWidth = 6; - this.零件号.Name = "零件号"; - this.零件号.ReadOnly = true; - this.零件号.Visible = false; - this.零件号.Width = 200; - // - // 位置 - // - this.位置.DataPropertyName = "LeftOrRight"; - this.位置.HeaderText = "位置"; - this.位置.MinimumWidth = 6; - this.位置.Name = "位置"; - this.位置.ReadOnly = true; - this.位置.Width = 200; - // - // 配置 - // - this.配置.DataPropertyName = "Cfg"; - this.配置.HeaderText = "配置"; - this.配置.MinimumWidth = 6; - this.配置.Name = "配置"; - this.配置.ReadOnly = true; - this.配置.Width = 200; - // - // 生产时间 - // - this.生产时间.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.生产时间.DataPropertyName = "ScanTime"; - this.生产时间.HeaderText = "生产时间"; - this.生产时间.MinimumWidth = 6; - this.生产时间.Name = "生产时间"; - this.生产时间.ReadOnly = true; - // - // txtLastScanL - // - this.txtLastScanL.Font = new System.Drawing.Font("宋体", 16.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.txtLastScanL.Location = new System.Drawing.Point(40, 46); - this.txtLastScanL.Name = "txtLastScanL"; - this.txtLastScanL.ReadOnly = true; - this.txtLastScanL.Size = new System.Drawing.Size(457, 38); - this.txtLastScanL.TabIndex = 11; - // // timer1 // this.timer1.Interval = 1000; @@ -657,7 +658,7 @@ this.Controls.Add(this.tableLayoutPanel1); this.Name = "FrmDoorSill_214_3"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "FrmDoorSill_214_3"; + this.Text = "214门槛冲孔"; this.Load += new System.EventHandler(this.FrmDoorSill_214_3_Load); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); @@ -679,7 +680,7 @@ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button btnOpenParamDialog; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button btnSearch; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label txtProduceModel; private System.Windows.Forms.Label label7; diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs index 9c865e0..6ce193a 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs @@ -24,6 +24,8 @@ namespace PunchAndWeld private string _produceModel = string.Empty; private SynchronizationContext _syncontext = SynchronizationContext.Current; //同步上下文 private string _lastScan = string.Empty; + private string _leftScanCode = string.Empty; + private string _rightScanCode = string.Empty; public FrmDoorSill_214_3() { InitializeComponent(); @@ -92,7 +94,7 @@ namespace PunchAndWeld { if(e.KeyCode == Keys.Enter) { - ScanBarCode("左"); + ScanBarCode(txtLeftScan,"左"); } } @@ -100,7 +102,7 @@ namespace PunchAndWeld { if (e.KeyCode == Keys.Enter) { - ScanBarCode("右"); + ScanBarCode(txtRightScan,"右"); } } @@ -323,7 +325,7 @@ namespace PunchAndWeld _conditionDialog.ShowDialog(); } - void ScanBarCode( string leftOrRight) + void ScanBarCode(TextBox scanBox, string leftOrRight) { try { @@ -331,8 +333,12 @@ namespace PunchAndWeld if (lbScanState.Text.StartsWith("处理中")) { ShowHint($"设备正在处理中,请等待完成后,再重新操作", true); + scanBox.Focus(); + scanBox.SelectAll(); return; } + string model = txtProduceModel.Text?.Trim(); + ShowHint("", true); int produceModel = 0; int config = 0; @@ -341,36 +347,73 @@ namespace PunchAndWeld if (VerifyConfig(leftOrRight, ref produceModel, ref config, ref barCode, ref tableName) == false) return; + if (ProScreenFunc.IsBarCodeExsit214(barCode) == false) { ShowHint($"条码[{barCode}]在系统中不存在,请扫新的条码", true); + scanBox.Focus(); + scanBox.SelectAll(); return; } if (ProScreenFunc.IsScanNew(barCode, tableName) == true) { ShowHint($"条码[{barCode}]已存在扫码记录,请扫新的条码", true); + scanBox.Focus(); + scanBox.SelectAll(); return; } - if(leftOrRight == "左") + + + if (leftOrRight == "左") { txtLastScanL.Text = barCode; + _leftScanCode = barCode; } else { txtLastScanR.Text = barCode; + _rightScanCode = barCode; } txtLeftScan.Text = ""; txtRightScan.Text = ""; - - ProScreenFunc.AddScanRecordNew(barCode, "", leftOrRight, tableName); - SendToPLC(config.ToString(), produceModel.ToString(), 1); - - string model = txtProduceModel.Text?.Trim(); if (model == "左右") { LeftAndRightFocus(); + if (string.IsNullOrEmpty(_leftScanCode) || string.IsNullOrEmpty(_rightScanCode)) // txtLeftScan + { + ShowHint($"扫描条码{leftOrRight}条码:{barCode}", false); + return; + } + if (_leftScanCode == _rightScanCode) + { + _leftScanCode = string.Empty; + _rightScanCode = string.Empty; + ShowHint($"左侧条码和右侧条码不能相同,请重新扫描条码", true); + return; + } + + + ProScreenFunc.AddScanRecordNew(_leftScanCode, "LR", "左", tableName); + ProScreenFunc.AddScanRecordNew(_rightScanCode, "RL", "右", tableName); + + ShowHint($"操作条码左:{_leftScanCode} 右:{_rightScanCode} ,操作成功", false); + _leftScanCode = string.Empty; + _rightScanCode = string.Empty; } - Action searchAction = GetScanRecords; + else + { + ProScreenFunc.AddScanRecordNew(barCode, "", leftOrRight, tableName); + ShowHint($"操作{leftOrRight}条码:{_leftScanCode},操作成功", false); + } + + SendToPLC(config.ToString(), produceModel.ToString(), 1); + + + //if (model == "左右") + //{ + // LeftAndRightFocus(); + //} + Action searchAction = GetScanRecords; searchAction.BeginInvoke(null, null); } @@ -391,7 +434,7 @@ namespace PunchAndWeld DateTime.TryParse(lbBegin.Text, out timeFr); DateTime.TryParse(lbEnd.Text, out timeTo); - DataTable dt = ProScreenFunc.GetScanRecord_Lasers(timeFr, timeTo); + DataTable dt = ProScreenFunc.GetScanRecord_Lasers(timeFr, timeTo,""); dgridScanRecords.DataSource = dt; txtAllQty.Text = dt.Rows.Count.ToString(); @@ -576,8 +619,14 @@ namespace PunchAndWeld + + #endregion - + private void btnSearch_Click(object sender, EventArgs e) + { + FrmDoorSill_214_3_Grid gridFrm = new FrmDoorSill_214_3_Grid(); + gridFrm.Show(); + } } } diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx index a65a826..9b5729a 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx @@ -132,9 +132,6 @@ True - - 17, 17 - True @@ -150,6 +147,9 @@ True + + 17, 17 + 155, 17 diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.Designer.cs b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.Designer.cs new file mode 100644 index 0000000..7532724 --- /dev/null +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.Designer.cs @@ -0,0 +1,471 @@ +namespace PunchAndWeld +{ + partial class FrmDoorSill_214_3_Grid + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.btnSearch = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.txtBarCode = new System.Windows.Forms.TextBox(); + this.dateTimeFr = new System.Windows.Forms.DateTimePicker(); + this.dateTimeTo = new System.Windows.Forms.DateTimePicker(); + this.label3 = new System.Windows.Forms.Label(); + this.dgridScanRecords = new System.Windows.Forms.DataGridView(); + 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.txtLowQty = new System.Windows.Forms.Label(); + this.txtLeftQty = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.txtAllQty = new System.Windows.Forms.Label(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.txtHighQty = new System.Windows.Forms.Label(); + this.txtRightQty = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.lbVer = new System.Windows.Forms.Label(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgridScanRecords)).BeginInit(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.dgridScanRecords, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 3; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1372, 708); + this.tableLayoutPanel1.TabIndex = 0; + // + // panel1 + // + this.panel1.Controls.Add(this.label3); + this.panel1.Controls.Add(this.dateTimeTo); + this.panel1.Controls.Add(this.dateTimeFr); + this.panel1.Controls.Add(this.txtBarCode); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.btnSearch); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(3, 3); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1366, 44); + this.panel1.TabIndex = 0; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(376, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(51, 20); + this.label1.TabIndex = 1; + this.label1.Text = "条码"; + // + // btnSearch + // + this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnSearch.Font = new System.Drawing.Font("宋体", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSearch.Location = new System.Drawing.Point(1245, 6); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(112, 35); + this.btnSearch.TabIndex = 0; + this.btnSearch.Text = "查询"; + this.btnSearch.UseVisualStyleBackColor = true; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(705, 12); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(93, 20); + this.label2.TabIndex = 2; + this.label2.Text = "操作时间"; + // + // txtBarCode + // + this.txtBarCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txtBarCode.Location = new System.Drawing.Point(443, 9); + this.txtBarCode.Name = "txtBarCode"; + this.txtBarCode.Size = new System.Drawing.Size(243, 25); + this.txtBarCode.TabIndex = 3; + // + // dateTimeFr + // + this.dateTimeFr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.dateTimeFr.CustomFormat = "yyyy-MM-dd HH:mm"; + this.dateTimeFr.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimeFr.Location = new System.Drawing.Point(804, 9); + this.dateTimeFr.Name = "dateTimeFr"; + this.dateTimeFr.Size = new System.Drawing.Size(200, 25); + this.dateTimeFr.TabIndex = 4; + // + // dateTimeTo + // + this.dateTimeTo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.dateTimeTo.CustomFormat = "yyyy-MM-dd HH:mm"; + this.dateTimeTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimeTo.Location = new System.Drawing.Point(1039, 9); + this.dateTimeTo.Name = "dateTimeTo"; + this.dateTimeTo.Size = new System.Drawing.Size(200, 25); + this.dateTimeTo.TabIndex = 5; + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(1010, 12); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(20, 20); + this.label3.TabIndex = 6; + this.label3.Text = "-"; + // + // dgridScanRecords + // + this.dgridScanRecords.AllowUserToAddRows = false; + this.dgridScanRecords.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgridScanRecords.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.塑件唯一码, + this.零件号, + this.位置, + this.配置, + this.生产时间}); + this.dgridScanRecords.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgridScanRecords.Location = new System.Drawing.Point(3, 53); + this.dgridScanRecords.Name = "dgridScanRecords"; + this.dgridScanRecords.ReadOnly = true; + this.dgridScanRecords.RowHeadersWidth = 51; + this.dgridScanRecords.RowTemplate.Height = 27; + this.dgridScanRecords.Size = new System.Drawing.Size(1366, 592); + this.dgridScanRecords.TabIndex = 5; + // + // 塑件唯一码 + // + this.塑件唯一码.DataPropertyName = "BarCode"; + this.塑件唯一码.HeaderText = "塑件唯一码"; + this.塑件唯一码.MinimumWidth = 6; + this.塑件唯一码.Name = "塑件唯一码"; + this.塑件唯一码.ReadOnly = true; + this.塑件唯一码.Width = 200; + // + // 零件号 + // + this.零件号.DataPropertyName = "MCode"; + this.零件号.HeaderText = "零件号"; + this.零件号.MinimumWidth = 6; + this.零件号.Name = "零件号"; + this.零件号.ReadOnly = true; + this.零件号.Visible = false; + this.零件号.Width = 200; + // + // 位置 + // + this.位置.DataPropertyName = "LeftOrRight"; + this.位置.HeaderText = "位置"; + this.位置.MinimumWidth = 6; + this.位置.Name = "位置"; + this.位置.ReadOnly = true; + this.位置.Width = 200; + // + // 配置 + // + this.配置.DataPropertyName = "Cfg"; + this.配置.HeaderText = "配置"; + this.配置.MinimumWidth = 6; + this.配置.Name = "配置"; + this.配置.ReadOnly = true; + this.配置.Width = 200; + // + // 生产时间 + // + this.生产时间.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.生产时间.DataPropertyName = "ScanTime"; + this.生产时间.HeaderText = "生产时间"; + this.生产时间.MinimumWidth = 6; + this.生产时间.Name = "生产时间"; + this.生产时间.ReadOnly = true; + // + // txtLowQty + // + this.txtLowQty.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.txtLowQty.AutoSize = true; + this.txtLowQty.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtLowQty.Location = new System.Drawing.Point(763, 0); + this.txtLowQty.Name = "txtLowQty"; + this.txtLowQty.Size = new System.Drawing.Size(94, 54); + this.txtLowQty.TabIndex = 9; + this.txtLowQty.Text = "0"; + this.txtLowQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtLeftQty + // + this.txtLeftQty.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.txtLeftQty.AutoSize = true; + this.txtLeftQty.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtLeftQty.Location = new System.Drawing.Point(243, 0); + this.txtLeftQty.Name = "txtLeftQty"; + this.txtLeftQty.Size = new System.Drawing.Size(94, 54); + this.txtLeftQty.TabIndex = 6; + this.txtLeftQty.Text = "0"; + this.txtLeftQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label12 + // + this.label12.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.label12.AutoSize = true; + this.label12.BackColor = System.Drawing.Color.Lime; + this.label12.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(3, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(74, 54); + this.label12.TabIndex = 0; + this.label12.Text = "总数"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label13 + // + this.label13.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.label13.AutoSize = true; + this.label13.BackColor = System.Drawing.Color.Lime; + this.label13.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(183, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(54, 54); + this.label13.TabIndex = 1; + this.label13.Text = "左"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtAllQty + // + this.txtAllQty.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.txtAllQty.AutoSize = true; + this.txtAllQty.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtAllQty.Location = new System.Drawing.Point(83, 0); + this.txtAllQty.Name = "txtAllQty"; + this.txtAllQty.Size = new System.Drawing.Size(94, 54); + this.txtAllQty.TabIndex = 5; + this.txtAllQty.Text = "0"; + this.txtAllQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 11; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.txtLowQty, 9, 0); + this.tableLayoutPanel3.Controls.Add(this.txtHighQty, 7, 0); + this.tableLayoutPanel3.Controls.Add(this.txtRightQty, 5, 0); + this.tableLayoutPanel3.Controls.Add(this.txtLeftQty, 3, 0); + this.tableLayoutPanel3.Controls.Add(this.label12, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.label13, 2, 0); + this.tableLayoutPanel3.Controls.Add(this.label14, 4, 0); + this.tableLayoutPanel3.Controls.Add(this.label15, 6, 0); + this.tableLayoutPanel3.Controls.Add(this.label16, 8, 0); + this.tableLayoutPanel3.Controls.Add(this.txtAllQty, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.lbVer, 10, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 651); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 1; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(1366, 54); + this.tableLayoutPanel3.TabIndex = 6; + // + // txtHighQty + // + this.txtHighQty.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.txtHighQty.AutoSize = true; + this.txtHighQty.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtHighQty.Location = new System.Drawing.Point(583, 0); + this.txtHighQty.Name = "txtHighQty"; + this.txtHighQty.Size = new System.Drawing.Size(94, 54); + this.txtHighQty.TabIndex = 8; + this.txtHighQty.Text = "0"; + this.txtHighQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtRightQty + // + this.txtRightQty.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.txtRightQty.AutoSize = true; + this.txtRightQty.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtRightQty.Location = new System.Drawing.Point(403, 0); + this.txtRightQty.Name = "txtRightQty"; + this.txtRightQty.Size = new System.Drawing.Size(94, 54); + this.txtRightQty.TabIndex = 7; + this.txtRightQty.Text = "0"; + this.txtRightQty.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label14 + // + this.label14.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.label14.AutoSize = true; + this.label14.BackColor = System.Drawing.Color.Lime; + this.label14.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label14.Location = new System.Drawing.Point(343, 0); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(54, 54); + this.label14.TabIndex = 2; + this.label14.Text = "右"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label15 + // + this.label15.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.label15.AutoSize = true; + this.label15.BackColor = System.Drawing.Color.Lime; + this.label15.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label15.Location = new System.Drawing.Point(503, 0); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(74, 54); + this.label15.TabIndex = 3; + this.label15.Text = "高配"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label16 + // + this.label16.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.label16.AutoSize = true; + this.label16.BackColor = System.Drawing.Color.Lime; + this.label16.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label16.Location = new System.Drawing.Point(683, 0); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(74, 54); + this.label16.TabIndex = 4; + this.label16.Text = "低配"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lbVer + // + this.lbVer.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lbVer.AutoSize = true; + this.lbVer.Location = new System.Drawing.Point(1324, 19); + this.lbVer.Name = "lbVer"; + this.lbVer.Size = new System.Drawing.Size(39, 15); + this.lbVer.TabIndex = 10; + this.lbVer.Text = " "; + // + // FrmDoorSill_214_3_Grid + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1372, 708); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "FrmDoorSill_214_3_Grid"; + this.Text = "214冲孔记录查询"; + this.Load += new System.EventHandler(this.FrmDoorSill_214_3_Grid_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgridScanRecords)).EndInit(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnSearch; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DateTimePicker dateTimeTo; + private System.Windows.Forms.DateTimePicker dateTimeFr; + private System.Windows.Forms.TextBox txtBarCode; + private System.Windows.Forms.DataGridView dgridScanRecords; + private System.Windows.Forms.DataGridViewTextBoxColumn 塑件唯一码; + private System.Windows.Forms.DataGridViewTextBoxColumn 零件号; + private System.Windows.Forms.DataGridViewTextBoxColumn 位置; + private System.Windows.Forms.DataGridViewTextBoxColumn 配置; + private System.Windows.Forms.DataGridViewTextBoxColumn 生产时间; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Label txtLowQty; + private System.Windows.Forms.Label txtHighQty; + private System.Windows.Forms.Label txtRightQty; + private System.Windows.Forms.Label txtLeftQty; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label txtAllQty; + private System.Windows.Forms.Label lbVer; + } +} \ No newline at end of file diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.cs b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.cs new file mode 100644 index 0000000..d585957 --- /dev/null +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using PunchAndWeld.DataSouce; + +namespace PunchAndWeld +{ + public partial class FrmDoorSill_214_3_Grid : Form + { + public FrmDoorSill_214_3_Grid() + { + InitializeComponent(); + } + + private void btnSearch_Click(object sender, EventArgs e) + { + string date1 = this.dateTimeFr.Value.ToString("yyyy-MM-dd 00:00:00"); + if (string.IsNullOrWhiteSpace(this.dateTimeFr.Text)) + { + date1 = "1900-01-01 00:00:00"; + } + string date2 = this.dateTimeTo.Value.ToString("yyyy-MM-dd 23:59:59"); + if (string.IsNullOrWhiteSpace(this.dateTimeTo.Text)) + { + date2 = "9999-01-01 00:00:00"; + } + + DateTime timeFr = DateTime.Now; + DateTime timeTo = DateTime.Now; + DateTime.TryParse(date1, out timeFr); + DateTime.TryParse(date2, out timeTo); + + DataTable dt = ProScreenFunc.GetScanRecord_Lasers(timeFr, timeTo, txtBarCode.Text?.Trim()); + dgridScanRecords.DataSource = dt; + + txtAllQty.Text = dt.Rows.Count.ToString(); + + var grp1 = dt.AsEnumerable().GroupBy(p => p.Field("LeftOrRight")); + foreach (var item1 in grp1) + { + if (item1.Key == "左") + { + txtLeftQty.Text = item1.ToList().Count.ToString(); + } + else + { + txtRightQty.Text = item1.ToList().Count.ToString(); + } + } + + var grp2 = dt.AsEnumerable().GroupBy(p => p.Field("Cfg")); + foreach (var item2 in grp2) + { + if (item2.Key == "高") + { + txtHighQty.Text = item2.ToList().Count.ToString(); + } + else + { + txtLowQty.Text = item2.ToList().Count.ToString(); + } + } + } + + private void FrmDoorSill_214_3_Grid_Load(object sender, EventArgs e) + { + this.dateTimeFr.Value = DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00"); + this.dateTimeTo.Value = DateTime.Now; + dgridScanRecords.RowsAdded += DgridScanRecords_RowsAdded; + } + private void DgridScanRecords_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) + { + for (int i = 0; i < e.RowCount; i++) + { + ((DataGridView)sender).Rows[e.RowIndex + i].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; + ((DataGridView)sender).Rows[e.RowIndex + i].HeaderCell.Value = (e.RowIndex + i + 1).ToString(); + } + } + } +} diff --git a/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.resx b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.resx new file mode 100644 index 0000000..7d759cc --- /dev/null +++ b/SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj b/SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj index f540440..9a44bd3 100644 --- a/SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj +++ b/SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj @@ -111,6 +111,12 @@ FrmDoorSill_214_3_Condition.cs + + Form + + + FrmDoorSill_214_3_Grid.cs + Form @@ -275,6 +281,9 @@ FrmDoorSill_214_3_Condition.cs + + FrmDoorSill_214_3_Grid.cs + FrmHybird.cs