|
|
@@ -174,6 +174,12 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ //判断转换后序列号的范围是否合法
|
|
|
+ if (!checkStartAndEnd()) {
|
|
|
+ OperateResult.AppendText(">>序列号" + code.Text + "校验错误,不在工单防呆规则指定范围内!\n", Color.Red);
|
|
|
+ code.Text = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
//SN校验成功,合法,记录下SN
|
|
|
SN = code.Text;
|
|
|
code.Text = "";
|
|
|
@@ -494,12 +500,10 @@ namespace UAS_MES.Make
|
|
|
//勾选
|
|
|
SNPre_checkBox.Checked = true;
|
|
|
SNPre_checkBox.Enabled = false;
|
|
|
- //记录起止序列号
|
|
|
- startNo = dr["msr_startno"].ToString().Substring(prefix.Length - 1);
|
|
|
- endNo = dr["msr_endno"].ToString().Substring(prefix.Length - 1);
|
|
|
}
|
|
|
- startNo = dr["msr_startno"].ToString();
|
|
|
- endNo = dr["msr_endno"].ToString();
|
|
|
+ //记录起止序列号
|
|
|
+ startNo = dr["msr_startno"].ToString().Substring(prefix.Length);
|
|
|
+ endNo = dr["msr_endno"].ToString().Substring(prefix.Length);
|
|
|
if (length != "" && length != null)
|
|
|
{
|
|
|
//赋值
|
|
|
@@ -539,41 +543,19 @@ namespace UAS_MES.Make
|
|
|
if (system == "decimal")
|
|
|
{
|
|
|
//十进制
|
|
|
- if (SNPre.Text.Trim() == "")
|
|
|
+ if (int.Parse(code.Text.Substring(SNPre.Text.Length)) >= int.Parse(startNo) && int.Parse(code.Text.Substring(SNPre.Text.Length)) <= int.Parse(endNo))
|
|
|
{
|
|
|
- if (int.Parse(code.Text) >= int.Parse(startNo) && int.Parse(code.Text) <= int.Parse(endNo))
|
|
|
- {
|
|
|
- //满足范围条件
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (int.Parse(code.Text.Substring(SNPre.Text.Length - 1)) >= int.Parse(startNo) && int.Parse(code.Text.Substring(SNPre.Text.Length - 1)) <= int.Parse(endNo))
|
|
|
- {
|
|
|
- //满足
|
|
|
- return true;
|
|
|
- }
|
|
|
+ //满足
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//十六进制
|
|
|
- if (SNPre.Text.Trim() == "")
|
|
|
- {
|
|
|
- if (int.Parse(code.Text) >= int.Parse(startNo, System.Globalization.NumberStyles.HexNumber) && int.Parse(code.Text) <= int.Parse(endNo, System.Globalization.NumberStyles.HexNumber))
|
|
|
- {
|
|
|
- //满足范围条件
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ if (int.Parse(code.Text.Substring(SNPre.Text.Length)) >= int.Parse(startNo, System.Globalization.NumberStyles.HexNumber) && int.Parse(code.Text.Substring(SNPre.Text.Length)) <= int.Parse(endNo, System.Globalization.NumberStyles.HexNumber))
|
|
|
{
|
|
|
- if (int.Parse(code.Text.Substring(SNPre.Text.Length - 1)) >= int.Parse(startNo, System.Globalization.NumberStyles.HexNumber) && int.Parse(code.Text.Substring(SNPre.Text.Length - 1)) <= int.Parse(endNo, System.Globalization.NumberStyles.HexNumber))
|
|
|
- {
|
|
|
- //满足
|
|
|
- return true;
|
|
|
- }
|
|
|
+ //满足
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|