Browse Source

小件扫码,增加 校验塑件码扫码格式防错

master
wrx 5 months ago
parent
commit
7322ca1872
  1. 7
      SjMes/PurchingMistakeNew/Form1.cs
  2. 9
      SjMes/PurchingMistakeNew/Form4.cs
  3. 8
      SjMes/PurchingMistakeNew/Form6.cs
  4. 8
      SjMes/PurchingMistakeNew/Form7.cs
  5. 7
      SjMes/PurchingMistakeNew/Form9.cs
  6. 9
      SjMes/PurchingMistakeNew/FrmProduct_243.cs
  7. 1
      SjMes/PurchingMistakeNew/PurchingMistakeNew.csproj
  8. 19
      SjMes/PurchingMistakeNew/VerifyHelper.cs

7
SjMes/PurchingMistakeNew/Form1.cs

@ -452,6 +452,13 @@ namespace PurchingMistakeNew
#endregion
#region 判断计划单里是否有此产品的生产计划并且是未完成
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
DataTable hdt = pbll.IsHavePlan(textBox2.Text.Trim().Substring(0,10), textBox4.Text.Trim());
if (hdt != null && hdt.Rows.Count > 0)

9
SjMes/PurchingMistakeNew/Form4.cs

@ -95,6 +95,15 @@ namespace PurchingMistakeNew
return;
}
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
#region 判断计划单里是否有此产品的生产计划并且是未完成
DataTable hdt = pbll.IsHavePlan(textBox2.Text.Trim().Substring(0, 10), textBox4.Text.Trim());

8
SjMes/PurchingMistakeNew/Form6.cs

@ -152,6 +152,14 @@ namespace PurchingMistakeNew
return;
}
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
#region 判断计划单里是否有此产品的生产计划并且是未完成
DataTable hdt = pbll.IsHavePlan(textBox2.Text.Trim().Substring(0, 10), textBox4.Text.Trim());

8
SjMes/PurchingMistakeNew/Form7.cs

@ -247,6 +247,14 @@ namespace PurchingMistakeNew
textBox2.Focus();
return;
}
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
#region 判断计划单里是否有此产品的生产计划并且是未完成

7
SjMes/PurchingMistakeNew/Form9.cs

@ -145,6 +145,13 @@ namespace PurchingMistakeNew
return;
}
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
#region 判断计划单里是否有此产品的生产计划并且是未完成
DataTable hdt = pbll.IsHavePlan(textBox2.Text.Trim().Substring(0, 10), textBox4.Text.Trim());

9
SjMes/PurchingMistakeNew/FrmProduct_243.cs

@ -153,7 +153,14 @@ namespace PurchingMistakeNew
textBox4.Focus();
return;
}
if (VerifyHelper.ScanSjBarCodeFormat(textBox2.Text.Trim()) == false)
{
MessageBox.Show($"扫描条码[{textBox2.Text.Trim()}]格式错误!", "提示", MessageBoxButtons.OK);
textBox2.Text = "";
textBox2.Focus();
return;
}
#endregion
if (textBox2.Text.Trim().Length < 10)

1
SjMes/PurchingMistakeNew/PurchingMistakeNew.csproj

@ -181,6 +181,7 @@
<Compile Include="UserControl1.Designer.cs">
<DependentUpon>UserControl1.cs</DependentUpon>
</Compile>
<Compile Include="VerifyHelper.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>

19
SjMes/PurchingMistakeNew/VerifyHelper.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PurchingMistakeNew
{
public class VerifyHelper
{
public static bool ScanSjBarCodeFormat(string scanSjBarCode)
{
if (scanSjBarCode.Length > 20 && scanSjBarCode.Contains(".") == false)
{
return false;
}
return true;
}
}
}
Loading…
Cancel
Save