|
|
@@ -271,7 +271,19 @@ namespace UAS_MES.Make
|
|
|
code.Text = "";
|
|
|
return false;
|
|
|
}
|
|
|
- if (!(ListA.Rows[step - 2]["psr_prefix"].ToString() == "" ? true : code.Text.StartsWith(ListA.Rows[step - 2]["psr_prefix"].ToString())))
|
|
|
+ //以|符号分割前缀
|
|
|
+ string[] preFixs = ListA.Rows[step - 2]["psr_prefix"].ToString().Split('|');
|
|
|
+ //只要满足其中一个前缀条件即可
|
|
|
+ bool isfit = false;
|
|
|
+ for (int i=0;i<preFixs.Length;i++) {
|
|
|
+ if (preFixs[i] == "" ? true : code.Text.StartsWith(preFixs[i]))
|
|
|
+ {
|
|
|
+ //满足其中一条即可
|
|
|
+ isfit = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isfit)
|
|
|
{
|
|
|
OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"] + "前缀校验不通过,请重新输入\n", Color.Red);
|
|
|
OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black);
|
|
|
@@ -310,8 +322,8 @@ namespace UAS_MES.Make
|
|
|
case "NETCODE":
|
|
|
if (checkExist("MS_" + type + "='" + code.Text + "'"))
|
|
|
{
|
|
|
- OperateResult.AppendText(">>" + type + ":" + code.Text + "错误,不允许重复\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请输入" + type + "\n", Color.Black);
|
|
|
+ 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 = "";
|
|
|
return false;
|
|
|
}
|
|
|
@@ -320,7 +332,7 @@ namespace UAS_MES.Make
|
|
|
break;
|
|
|
}
|
|
|
//满足规则,则采集
|
|
|
- hs.Add(type, code.Text);
|
|
|
+ hs.Add(ListA.Rows[step - 2]["psr_type"].ToString(), code.Text);
|
|
|
//说明已经是最后一个校验规则
|
|
|
if (step == ListA.Rows.Count + 1)
|
|
|
{
|
|
|
@@ -332,7 +344,7 @@ namespace UAS_MES.Make
|
|
|
//遍历判断已采集的信息是否已存在
|
|
|
foreach (DictionaryEntry de in hs)
|
|
|
{
|
|
|
- if (dh.CheckExist("makeserial", "MS_" + de.Key + "='" + de.Value + "'"))
|
|
|
+ if (dh.CheckExist("makeserial", "MS_" + de.Key=="WIFI"?"MAC":de.Key + "='" + de.Value + "'"))
|
|
|
{
|
|
|
flag = false;
|
|
|
OperateResult.AppendText(">>" + de.Key + "已被使用,请重新输入TSN,重新转换\n", Color.Red);
|