|
|
@@ -38,6 +38,8 @@ namespace UAS_LabelMachine
|
|
|
/// 当前扫描的所在行
|
|
|
/// </summary>
|
|
|
int CurrentRowIndex = 0;
|
|
|
+
|
|
|
+ bool Checking = false;
|
|
|
/// <summary>
|
|
|
/// 正则表达式用于项目匹配
|
|
|
/// </summary>
|
|
|
@@ -178,10 +180,10 @@ namespace UAS_LabelMachine
|
|
|
private void SaveGrid_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
DataTable savedt = (LabelInf.DataSource as DataTable);
|
|
|
+ savedt.EndInit();
|
|
|
if (savedt != null && savedt.GetChanges() != null)
|
|
|
{
|
|
|
- MidSource.EndEdit();
|
|
|
- dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
|
|
|
+ dh.CallProcedure("sp_uploadbarcode", savedt.GetChanges());
|
|
|
CheckRecheckStatus();
|
|
|
MessageBox.Show("保存成功!");
|
|
|
}
|
|
|
@@ -258,12 +260,6 @@ namespace UAS_LabelMachine
|
|
|
return;
|
|
|
}
|
|
|
CollectInputData();
|
|
|
- DataTable savedt = (LabelInf.DataSource as DataTable);
|
|
|
- if (savedt != null && savedt.GetChanges() != null)
|
|
|
- {
|
|
|
- MidSource.EndEdit();
|
|
|
- dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -294,7 +290,11 @@ namespace UAS_LabelMachine
|
|
|
string orispeccode = LabelInf.Rows[i].Cells["pr_orispeccode"].Value.ToString();
|
|
|
if ((MatchStr(arr[j].ToString(), "MPN").Contains(orispeccode) || MatchStr(arr[j].ToString(), "MPN").Trim().Replace(" ", "").Contains(orispeccode) || orispeccode == MatchStr(arr[j].ToString(), "MPN") || LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "CPN")) && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
|
|
|
{
|
|
|
- CurrentRowIndex = i;
|
|
|
+ if (!Checking)
|
|
|
+ {
|
|
|
+ CurrentRowIndex = i;
|
|
|
+ Checking = true;
|
|
|
+ }
|
|
|
if (CurrentRowIndex - 5 > 0)
|
|
|
LabelInf.FirstDisplayedScrollingRowIndex = CurrentRowIndex - 5;
|
|
|
else
|
|
|
@@ -417,6 +417,7 @@ namespace UAS_LabelMachine
|
|
|
dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
|
|
|
CheckRecheckStatus();
|
|
|
LabelInf.Invalidate();
|
|
|
+ Checking = false;
|
|
|
}
|
|
|
//采集未通过的时候
|
|
|
else
|
|
|
@@ -517,7 +518,6 @@ namespace UAS_LabelMachine
|
|
|
cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_orispeccode"];
|
|
|
Matchstr = MatchStr(data[j], "MPN");
|
|
|
//采集的供应商号不匹配的话
|
|
|
- Console.WriteLine(Matchstr.Trim().Replace(" ", ""));
|
|
|
if (cell.Value.ToString() == Matchstr || Matchstr.Trim().Replace(" ", "").Contains(cell.Value.ToString()) || Matchstr.Contains(cell.Value.ToString()))
|
|
|
{
|
|
|
ErrorType.Add("OK_MPN");
|