|
|
@@ -115,8 +115,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red,code);
|
|
|
return;
|
|
|
}
|
|
|
//获取需要关联采集的信息,以及校验规则
|
|
|
@@ -124,8 +123,7 @@ namespace UAS_MES.Make
|
|
|
//没有获取到就提示错误请维护产品对应的关联采集信息
|
|
|
if (ListA.Rows.Count == 0)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>请维护产品对应的关联采集信息\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请维护产品对应的关联采集信息\n", Color.Red,code);
|
|
|
OperateResult.AppendText("<<请输入TSN\n", Color.Black);
|
|
|
return;
|
|
|
}
|
|
|
@@ -140,14 +138,12 @@ namespace UAS_MES.Make
|
|
|
TSN = code.Text;
|
|
|
//显示序列号
|
|
|
show_sncode.Text = TSN;
|
|
|
- code.Text = "";
|
|
|
- OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
|
|
|
+ OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green,code);
|
|
|
ChangeResult.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>不存在该已转序列号:" + code.Text + "\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>不存在该已转序列号:" + code.Text + "\n", Color.Red,code);
|
|
|
OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
|
|
|
}
|
|
|
}
|
|
|
@@ -164,29 +160,25 @@ namespace UAS_MES.Make
|
|
|
TSN = code.Text;
|
|
|
//显示之前的序列号
|
|
|
show_sncode.Text = TSN;
|
|
|
- code.Text = "";
|
|
|
- OperateResult.AppendText("<<请输入SN\n", Color.Green);
|
|
|
+ OperateResult.AppendText("<<请输入SN\n", Color.Green,code);
|
|
|
ChangeResult.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
//不为空,进行过转换。不勾选修改结果,就不能再修改
|
|
|
{
|
|
|
- OperateResult.AppendText(">>序列号" + code.Text + "已经转换过\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>序列号" + code.Text + "已经转换过\n", Color.Red,code);
|
|
|
OperateResult.AppendText("<<请重新输入TSN\n", Color.Black);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
|
|
|
}
|
|
|
}
|
|
|
else if (step == 1)
|
|
|
@@ -207,8 +199,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
//判断转换后序列号的范围是否合法
|
|
|
if (!checkStartAndEnd()) {
|
|
|
- OperateResult.AppendText(">>序列号" + code.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>序列号" + code.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red,code);
|
|
|
return;
|
|
|
}
|
|
|
//SN校验成功,合法,记录下SN
|
|
|
@@ -228,8 +219,7 @@ namespace UAS_MES.Make
|
|
|
else
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + code.Text + "已存在\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请输入SN\n", Color.Black,code);
|
|
|
}
|
|
|
}
|
|
|
else if (step < ListA.Rows.Count + 2)
|
|
|
@@ -244,8 +234,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red,code);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -277,8 +266,7 @@ namespace UAS_MES.Make
|
|
|
if (code.Text.Trim().Length != int.Parse(textbox.Text))
|
|
|
{
|
|
|
//序列号校验错误,长度错误
|
|
|
- OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,长度错误\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,长度错误\n", Color.Red,code);
|
|
|
OperateResult.AppendText("<<请重新输入" + TSNorSN + "\n", Color.Black);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -289,8 +277,7 @@ namespace UAS_MES.Make
|
|
|
if (!code.Text.StartsWith(textbox.Text.Trim()))
|
|
|
{
|
|
|
//序列号校验错误,前缀错误
|
|
|
- OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,前缀错误\n", Color.Red);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>" + TSNorSN + ":" + code.Text + "校验错误,前缀错误\n", Color.Red,code);
|
|
|
OperateResult.AppendText("<<请重新输入" + TSNorSN + "\n", Color.Black);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -310,8 +297,7 @@ namespace UAS_MES.Make
|
|
|
if ((ListA.Rows[step - 2]["psr_length"].ToString() == "" ? true : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"] + "长度校验不通过,请重新输入\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black,code);
|
|
|
return false;
|
|
|
}
|
|
|
//以|符号分割前缀
|
|
|
@@ -329,8 +315,7 @@ namespace UAS_MES.Make
|
|
|
if (!isfit)
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"] + "前缀校验不通过,请重新输入\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black,code);
|
|
|
return false;
|
|
|
}
|
|
|
switch (type)
|
|
|
@@ -341,8 +326,7 @@ namespace UAS_MES.Make
|
|
|
if (!ChangeResult.Checked&&checkExist("ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "'"))
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + type + ":" + code.Text + "错误,不允许重复\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请输入" + type + "\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请输入" + type + "\n", Color.Black,code);
|
|
|
return false;
|
|
|
}
|
|
|
else
|
|
|
@@ -351,8 +335,7 @@ namespace UAS_MES.Make
|
|
|
if (imei.ToString().Contains(code.Text))
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + type + ":" + code.Text + "已录,请重新输入\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请输入" + type + "\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请输入" + type + "\n", Color.Black,code);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -366,8 +349,7 @@ namespace UAS_MES.Make
|
|
|
if (!ChangeResult.Checked&&checkExist("MS_" + type + "='" + code.Text + "'"))
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不允许重复\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black,code);
|
|
|
return false;
|
|
|
}
|
|
|
//通过校验,将包含IMEI的值拼接
|
|
|
@@ -453,8 +435,7 @@ namespace UAS_MES.Make
|
|
|
else
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号" + SN + "已存在\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请重新输入TSN\n", Color.Black);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText(">>请重新输入TSN\n", Color.Black,code);
|
|
|
//清空信息
|
|
|
clearInfo();
|
|
|
}
|
|
|
@@ -463,8 +444,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText("<<请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green);
|
|
|
- code.Text = "";
|
|
|
+ OperateResult.AppendText("<<请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green,code);
|
|
|
return true;
|
|
|
}
|
|
|
}
|