|
|
@@ -395,12 +395,25 @@ namespace UAS_MES.Make
|
|
|
imeif = code.Text;
|
|
|
}
|
|
|
}
|
|
|
- //如果前缀和长度都满足的话
|
|
|
- if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
|
|
|
+ if (code.Text.Length > 40)
|
|
|
{
|
|
|
- OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为"+ ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
|
|
|
- OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
|
|
|
- return false;
|
|
|
+ //如果前缀和长度都满足的话
|
|
|
+ if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Substring(0,40).Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为" + ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
|
|
|
+ OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //如果前缀和长度都满足的话
|
|
|
+ if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为" + ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
|
|
|
+ OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
//以|符号分割前缀
|
|
|
string[] preFixs = ListA.Rows[step - 2]["psr_prefix"].ToString().Split('|');
|