注塑喷涂
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

729 lines
27 KiB

using PunchAndWeld.DataSouce;
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;
namespace PunchAndWeld
{
public partial class FrmProScreen3 : Form
{
OtherPart parts = new OtherPart();
private static string productID3 = "", productID4 = "", productID5 = "", productID6 = "", productID7 = "", productID8 = "";
int[] isCheck = new int[6] { 0, 0, 0, 0, 0, 0 };
public FrmProScreen3()
{
InitializeComponent();
}
public FrmProScreen3(OtherPart part)
{
InitializeComponent();
parts = part;
}
private void FrmProScreen3_Load(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
textBox6.Text = "";
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
textBox4.Enabled = false;
textBox5.Enabled = false;
textBox6.Enabled = false;
label4.Text = "";
label5.Text = "";
label6.Text = "";
label7.Text = "";
label9.Text = "";
label11.Text = "";
int[] isCheck = new int[6] { 0, 0, 0, 0, 0, 0 };
label4.Text = ProScreenFunc.GetPartNoByID(parts.productID3);
label5.Text = ProScreenFunc.GetPartNoByID(parts.productID4);
label6.Text = ProScreenFunc.GetPartNoByID(parts.productID5);
label7.Text = ProScreenFunc.GetPartNoByID(parts.productID6);
label9.Text = ProScreenFunc.GetPartNoByID(parts.productID7);
label11.Text = ProScreenFunc.GetPartNoByID(parts.productID8);
if (!string.IsNullOrWhiteSpace(parts.productID3))
{
textBox1.Enabled = true;
}
if (!string.IsNullOrWhiteSpace(parts.productID4))
{
textBox2.Enabled = true;
}
if (!string.IsNullOrWhiteSpace(parts.productID5))
{
textBox3.Enabled = true;
}
if (!string.IsNullOrWhiteSpace(parts.productID6))
{
textBox4.Enabled = true;
}
if (!string.IsNullOrWhiteSpace(parts.productID7))
{
textBox5.Enabled = true;
}
if (!string.IsNullOrWhiteSpace(parts.productID8))
{
textBox6.Enabled = true;
}
if (textBox1.Enabled )
{
textBox1.Focus();
}
else if (textBox2.Enabled )
{
textBox2.Focus();
}
else if (textBox3.Enabled )
{
textBox3.Focus();
}
else if (textBox4.Enabled )
{
textBox4.Focus();
}
else if (textBox5.Enabled )
{
textBox5.Focus();
}
else if (textBox6.Enabled)
{
textBox6.Focus();
}
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox1.Text.Trim();
productID3 = ProScreenFunc.GetProductID(barcode);
if (parts.productID3 == productID3)
{
isCheck[0] = 1;
if (textBox2.Enabled)
{
textBox2.Text = "";
textBox2.Focus();
}
else if (textBox3.Enabled)
{
textBox3.Text = "";
textBox3.Focus();
}
else if (textBox4.Enabled)
{
textBox4.Text = "";
textBox4.Focus();
}
else if (textBox5.Enabled)
{
textBox5.Text = "";
textBox5.Focus();
}
else if (textBox6.Enabled)
{
textBox6.Text = "";
textBox6.Focus();
}
else
{
isCheck[1] = 1;
isCheck[2] = 1;
isCheck[3] = 1;
isCheck[4] = 1;
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号6未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = "";
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = "";
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = "";
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = "";
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = "";
this.Close();
}
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox1.Text = "";
}
}
}
private void textBox2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox2.Text.Trim();
productID4 = ProScreenFunc.GetProductID(barcode);
if (parts.productID4 == productID4)
{
isCheck[1] = 1;
if (textBox3.Enabled )
{
textBox3.Text = "";
textBox3.Focus();
}
else if (textBox4.Enabled)
{
textBox4.Text = "";
textBox4.Focus();
}
else if (textBox5.Enabled)
{
textBox5.Text = "";
textBox5.Focus();
}
else if (textBox6.Enabled)
{
textBox6.Text = "";
textBox6.Focus();
}
else
{
isCheck[2] = 1;
isCheck[3] = 1;
isCheck[4] = 1;
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox2.Text = "";
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号54未校验!");
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号6未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = ProScreenFunc.GetPartNoByID(productID4);
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = "";
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = "";
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = "";
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = "";
this.Close();
}
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox2.Text = "";
}
}
}
private void textBox3_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox3.Text.Trim();
productID5 = ProScreenFunc.GetProductID(barcode);
if (parts.productID5 == productID5)
{
isCheck[2] = 1;
if (textBox4.Enabled)
{
textBox4.Text = "";
textBox4.Focus();
}
else if (textBox5.Enabled)
{
textBox5.Text = "";
textBox5.Focus();
}
else if (textBox6.Enabled)
{
textBox6.Text = "";
textBox6.Focus();
}
else
{
isCheck[3] = 1;
isCheck[4] = 1;
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox3.Text = "";
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox3.Text = "";
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = ProScreenFunc.GetPartNoByID(productID4);
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = ProScreenFunc.GetPartNoByID(productID5);
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = "";
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = "";
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = "";
this.Close();
}
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox3.Text = "";
}
}
}
private void button1_Click(object sender, EventArgs e)
{
ScanAll.ScanResult = false;
this.Close();
}
private void textBox4_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox4.Text.Trim();
productID6 = ProScreenFunc.GetProductID(barcode);
if (parts.productID6 == productID6)
{
isCheck[3] = 1;
if (textBox5.Enabled)
{
textBox5.Text = "";
textBox5.Focus();
}
else if (textBox6.Enabled)
{
textBox6.Text = "";
textBox6.Focus();
}
else
{
isCheck[4] = 1;
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox4.Text = "";
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox4.Text = "";
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox4.Text = "";
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号6未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = ProScreenFunc.GetPartNoByID(productID4);
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = ProScreenFunc.GetPartNoByID(productID5);
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = ProScreenFunc.GetPartNoByID(productID6);
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = "";
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = "";
this.Close();
}
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox4.Text = "";
}
}
}
private void textBox5_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox5.Text.Trim();
productID7 = ProScreenFunc.GetProductID(barcode);
if (parts.productID7 == productID7)
{
isCheck[4] = 1;
if (textBox6.Enabled)
{
textBox6.Text = "";
textBox6.Focus();
}
else
{
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox5.Text = "";
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox5.Text = "";
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox5.Text = "";
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号6未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = ProScreenFunc.GetPartNoByID(productID4);
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = ProScreenFunc.GetPartNoByID(productID5);
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = ProScreenFunc.GetPartNoByID(productID6);
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = ProScreenFunc.GetPartNoByID(productID7);
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = "";
this.Close();
}
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox4.Text = "";
}
}
}
private void textBox6_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string barcode = textBox6.Text.Trim();
productID8 = ProScreenFunc.GetProductID(barcode);
if (parts.productID8 == productID8)
{
isCheck[5] = 1;
#region 判断关键零件是否都校验
if (isCheck[0] == 0)
{
MessageBox.Show("关键零件号1未校验!");
textBox6.Text = "";
textBox1.SelectAll();
textBox1.Focus();
return;
}
if (isCheck[1] == 0)
{
MessageBox.Show("关键零件号2未校验!");
textBox6.Text = "";
textBox2.SelectAll();
textBox2.Focus();
return;
}
if (isCheck[2] == 0)
{
MessageBox.Show("关键零件号3未校验!");
textBox6.Text = "";
textBox3.SelectAll();
textBox3.Focus();
return;
}
if (isCheck[3] == 0)
{
MessageBox.Show("关键零件号4未校验!");
textBox6.Text = "";
textBox4.SelectAll();
textBox4.Focus();
return;
}
if (isCheck[4] == 0)
{
MessageBox.Show("关键零件号5未校验!");
textBox6.Text = "";
textBox5.SelectAll();
textBox5.Focus();
return;
}
if (isCheck[5] == 0)
{
MessageBox.Show("关键零件号6未校验!");
textBox6.SelectAll();
textBox6.Focus();
return;
}
#endregion
ScanAll.ScanResult = true;
ScanAll.barCode1 = textBox1.Text.Trim();
ScanAll.partNo1 = ProScreenFunc.GetPartNoByID(productID3);
ScanAll.barCode2 = textBox2.Text.Trim();
ScanAll.partNo2 = ProScreenFunc.GetPartNoByID(productID4);
ScanAll.barCode3 = textBox3.Text.Trim();
ScanAll.partNo3 = ProScreenFunc.GetPartNoByID(productID5);
ScanAll.barCode4 = textBox4.Text.Trim();
ScanAll.partNo4 = ProScreenFunc.GetPartNoByID(productID6);
ScanAll.barCode5 = textBox5.Text.Trim();
ScanAll.partNo5 = ProScreenFunc.GetPartNoByID(productID7);
ScanAll.barCode6 = textBox6.Text.Trim();
ScanAll.partNo6 = ProScreenFunc.GetPartNoByID(productID8);
this.Close();
}
else
{
MessageBox.Show("扫入条码与总成不匹配,请检查后再次扫描");
textBox4.Text = "";
}
}
}
}
}