Browse Source

1.增加记录查询统计页面和功能

2.左右侧扫码,改为左右侧扫完后,一起提交保存.
3.左右侧的一些优化验证,提醒,左右扫码框跳转等工作.
4.低配生产完的条码,高配还能用的BUG优化.
master
wrx 5 months ago
parent
commit
55791fa18d
  1. 4
      SjMes/PunchAssemble/PunchAndWeld/App.config
  2. 13
      SjMes/PunchAssemble/PunchAndWeld/DataSouce/ProScreenFunc.cs
  3. 147
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.Designer.cs
  4. 69
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs
  5. 6
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx
  6. 471
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.Designer.cs
  7. 85
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.cs
  8. 150
      SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.resx
  9. 9
      SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj

4
SjMes/PunchAssemble/PunchAndWeld/App.config

@ -9,8 +9,8 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<connectionStrings>
<!--<add name="SqlConnString" connectionString="DATA SOURCE = 192.168.0.225;USER ID = sa;PASSWORD = Microsoft@2021;INITIAL CATALOG = BBMPT" />-->
<add name="SqlConnString" connectionString="DATA SOURCE = dev.ccwin-in.com,6191;USER ID = sa;PASSWORD = Microsoft@2021;INITIAL CATALOG = BBMPT" />
<add name="SqlConnString" connectionString="DATA SOURCE = 192.168.0.225;USER ID = sa;PASSWORD = Microsoft@2021;INITIAL CATALOG = BBMPT" />
<!--<add name="SqlConnString" connectionString="DATA SOURCE = dev.ccwin-in.com,6191;USER ID = sa;PASSWORD = Microsoft@2021;INITIAL CATALOG = BBMPT" />-->
<!--<add name="SqlConnString" connectionString="Persist Security Info=true;Initial Catalog=BBMPT;Data Source=10.60.101.9;User ID=sa;Password=a1+" />-->
<!--<add name="SqlConnString" connectionString="Persist Security Info=true;Initial Catalog=BBMPT;Data Source=39.97.227.79;User ID=sa;Password=a1+"/>-->
</connectionStrings>

13
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;
}

147
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;

69
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,35 +347,72 @@ 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 == "左")
{
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;
}
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
#endregion
private void btnSearch_Click(object sender, EventArgs e)
{
FrmDoorSill_214_3_Grid gridFrm = new FrmDoorSill_214_3_Grid();
gridFrm.Show();
}
}
}

6
SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.resx

@ -132,9 +132,6 @@
<metadata name="生产时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="focusTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="塑件唯一码.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -150,6 +147,9 @@
<metadata name="生产时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="focusTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>155, 17</value>
</metadata>

471
SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.Designer.cs

@ -0,0 +1,471 @@
namespace PunchAndWeld
{
partial class FrmDoorSill_214_3_Grid
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

85
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<string>("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<string>("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();
}
}
}
}

150
SjMes/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3_Grid.resx

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="塑件唯一码.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="零件号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="位置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="配置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="生产时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="塑件唯一码.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="零件号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="位置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="配置.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="生产时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

9
SjMes/PunchAssemble/PunchAndWeld/PunchAndWeld.csproj

@ -111,6 +111,12 @@
<Compile Include="FrmDoorSill_214_3_Condition.Designer.cs">
<DependentUpon>FrmDoorSill_214_3_Condition.cs</DependentUpon>
</Compile>
<Compile Include="FrmDoorSill_214_3_Grid.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmDoorSill_214_3_Grid.Designer.cs">
<DependentUpon>FrmDoorSill_214_3_Grid.cs</DependentUpon>
</Compile>
<Compile Include="FrmHybird.cs">
<SubType>Form</SubType>
</Compile>
@ -275,6 +281,9 @@
<EmbeddedResource Include="FrmDoorSill_214_3_Condition.resx">
<DependentUpon>FrmDoorSill_214_3_Condition.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmDoorSill_214_3_Grid.resx">
<DependentUpon>FrmDoorSill_214_3_Grid.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmHybird.resx">
<DependentUpon>FrmHybird.cs</DependentUpon>
</EmbeddedResource>

Loading…
Cancel
Save