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. 7
      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 #endregion
#region 判断计划单里是否有此产品的生产计划并且是未完成 #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()); DataTable hdt = pbll.IsHavePlan(textBox2.Text.Trim().Substring(0,10), textBox4.Text.Trim());
if (hdt != null && hdt.Rows.Count > 0) if (hdt != null && hdt.Rows.Count > 0)

9
SjMes/PurchingMistakeNew/Form4.cs

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

8
SjMes/PurchingMistakeNew/Form7.cs

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

7
SjMes/PurchingMistakeNew/Form9.cs

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

7
SjMes/PurchingMistakeNew/FrmProduct_243.cs

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

1
SjMes/PurchingMistakeNew/PurchingMistakeNew.csproj

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