UAS_出货标签管理.cs 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. using System.Text.RegularExpressions;
  6. using System.Text;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Diagnostics;
  10. using UAS_LabelMachine.PublicMethod;
  11. using UAS_LabelMachine.Entity;
  12. using System.Reflection;
  13. namespace UAS_LabelMachine
  14. {
  15. public partial class UAS_出货标签打印 : Form
  16. {
  17. //自适应屏幕
  18. AutoSizeFormClass asc = new AutoSizeFormClass();
  19. DataHelper dh;
  20. DataTable dt;
  21. /// <summary>
  22. /// 已经打印过的Vivo外箱号
  23. /// </summary>
  24. StringBuilder sql = new StringBuilder();
  25. /// <summary>
  26. /// 当前品牌
  27. /// </summary>
  28. string Brand;
  29. string PI_ID;
  30. /// <summary>
  31. /// 当前扫描的项目
  32. /// </summary>
  33. int CurrentItemIndex = 0;
  34. /// <summary>
  35. /// 当前扫描的所在行
  36. /// </summary>
  37. int CurrentRowIndex = 0;
  38. /// <summary>
  39. /// 正则表达式用于项目匹配
  40. /// </summary>
  41. Regex reg;
  42. /*标识供应商物料编号采集是否通过*/
  43. bool CollectVeProdCodePass = true;
  44. bool CollectQTYPass = true;
  45. bool logout = false;
  46. //每个不同序号存在的
  47. object[] ItemData;
  48. Dictionary<string, string> CollectData;
  49. /// <summary>
  50. /// 是否全选
  51. /// </summary>
  52. bool AllChecked = false;
  53. /*用于存放采集项目的Grid信息*/
  54. Dictionary<string, Dictionary<string, string>> SiItem;
  55. int CloumnCount = 0;
  56. //使用二维数组进行排序
  57. ArrayList<ArrayList<string>> ScanData;
  58. ArrayList<string> GetData;
  59. public UAS_出货标签打印(string Master)
  60. {
  61. this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
  62. this.UpdateStyles();
  63. InitializeComponent();
  64. Type dgvType = this.LabelInf.GetType();
  65. PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
  66. pi.SetValue(this.LabelInf, true, null);
  67. Text = Text + "-" + Master;
  68. }
  69. protected override void WndProc(ref Message m)
  70. {
  71. //拦截双击标题栏、移动窗体的系统消息
  72. if (m.Msg != 0xA3)
  73. {
  74. base.WndProc(ref m);
  75. }
  76. }
  77. private void 贴标机条码打印_Load(object sender, EventArgs e)
  78. {
  79. //杀死之前全部未关闭的进程
  80. Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
  81. for (int i = 0; i < processes.Length; i++)
  82. {
  83. processes[i].Kill();
  84. }
  85. //用计时器重置数据库链接
  86. LogManager.DoLog("程序启动,登陆人员【" + User.UserName + "】");
  87. dh = SystemInf.dh;
  88. CheckForIllegalCrossThreadCalls = false;
  89. CloumnCount = LabelInf.Columns.Count;
  90. pi_inoutno.Focus();
  91. //将本地读取的打印机设置进Combox,并选中默认打印机
  92. sg_brand.FormName = Name;
  93. sg_brand.SetValueField = new string[] { "sg_brand" };
  94. sg_brand.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
  95. sg_brand.TableName = "scangroup";
  96. sg_brand.DbChange += Sg_brand_DbChange;
  97. pr_code.FormName = Name;
  98. pr_code.SetValueField = new string[] { "pr_code" };
  99. pr_code.TableName = "prodiodetail left join product on pd_prodcode=pr_code";
  100. pr_code.SelectField = "pd_pdno # 行号,pr_code # 物料编号";
  101. cu_code.FormName = Name;
  102. cu_code.SetValueField = new string[] { "cu_code" };
  103. cu_code.TableName = "customer";
  104. cu_code.SelectField = "cu_code # 客户编号,cu_name # 客户名称";
  105. Point pt = new Point();
  106. //禁止所有列的排序
  107. foreach (DataGridViewColumn dgv in LabelInf.Columns)
  108. {
  109. dgv.SortMode = DataGridViewColumnSortMode.NotSortable;
  110. }
  111. int ScreenWidth = Screen.GetWorkingArea(pt).Width;
  112. //设置获取当前屏幕大小自动全屏但是保留任务栏
  113. Rectangle ScreenArea = Screen.GetWorkingArea(this);
  114. Top = 0;
  115. Left = 0;
  116. Width = ScreenArea.Width;
  117. Height = ScreenArea.Height;
  118. asc.controllInitializeSize(this);
  119. asc.controlAutoSize(this);
  120. }
  121. private void Sg_brand_DbChange(object sender, EventArgs e)
  122. {
  123. DataTable dt = sg_brand.ReturnData;
  124. BaseUtil.SetFormValue(this.Controls, dt);
  125. }
  126. //只执行一次窗体自适应
  127. bool AutoSized = false;
  128. private void 贴标机条码打印_SizeChanged(object sender, EventArgs e)
  129. {
  130. if (!AutoSized)
  131. {
  132. asc.controlAutoSize(this);
  133. AutoSized = true;
  134. }
  135. }
  136. private void GenerateBarCode_Click(object sender, EventArgs e)
  137. {
  138. 生成条码 form = new 生成条码(pi_inoutno.Text);
  139. form.FormClosed += LoadGridData;
  140. BaseUtil.SetFormCenter(form);
  141. form.ShowDialog();
  142. }
  143. private void CollectionSetting_Click(object sender, EventArgs e)
  144. {
  145. 采集策略 form = new 采集策略(sg_brand.Text);
  146. form.WindowState = FormWindowState.Maximized;
  147. form.FormClosed += sg_brand_UserControlTextChanged;
  148. BaseUtil.SetFormCenter(form);
  149. form.ShowDialog();
  150. }
  151. private void LabelFormClose(object sender, EventArgs e)
  152. {
  153. }
  154. /// <summary>
  155. /// 保存明细
  156. /// </summary>
  157. /// <param name="sender"></param>
  158. /// <param name="e"></param>
  159. private void SaveGrid_Click(object sender, EventArgs e)
  160. {
  161. DataTable savedt = (LabelInf.DataSource as DataTable);
  162. if (savedt != null && savedt.GetChanges() != null)
  163. {
  164. MidSource.EndEdit();
  165. dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
  166. CheckRecheckStatus();
  167. MessageBox.Show("保存成功!");
  168. }
  169. }
  170. //放大镜选择后出发的事件
  171. private void sg_brand_UserControlTextChanged(object sender, EventArgs e)
  172. {
  173. //取已启用的的按照采集次序排序
  174. DataTable dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_brand='" + sg_brand.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
  175. if (dt.Rows.Count == 0)
  176. {
  177. dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where nvl(sg_brand,' ')=' ' and si_enable<>0 order by si_detno,si_innerdetno", "select");
  178. }
  179. BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
  180. if (dt.Rows.Count > 0)
  181. {
  182. sg_separator.Text = dt.Rows[0]["sg_separator"].ToString();
  183. }
  184. //按DetNo排列之后的采集项
  185. ScanData = new ArrayList<ArrayList<string>>();
  186. //每个采集项目的子项
  187. GetData = new ArrayList<string>();
  188. //将数据添加进一个List的二维数组中
  189. for (int i = 0; i < Si_ItemDGV.RowCount; i++)
  190. {
  191. //如果不包含这个则添加进数组
  192. if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
  193. {
  194. GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
  195. }
  196. //如果和后一个的采集次序相同
  197. if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
  198. {
  199. GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
  200. }
  201. else
  202. {
  203. ScanData.Add(GetData);
  204. //添加完一次数据需要一个新的List
  205. GetData = new ArrayList<string>();
  206. }
  207. }
  208. RemindUser();
  209. if (ScanData.ToArray().Length > 0)
  210. {
  211. object[] arr = (ScanData.ToArray()[0] as ArrayList<string>).ToArray();
  212. if (arr.Contains("MPN") || arr.Contains("CPN"))
  213. {
  214. AutoMatch.CheckState = CheckState.Checked;
  215. AutoMatch.Enabled = true;
  216. }
  217. else
  218. {
  219. AutoMatch.CheckState = CheckState.Unchecked;
  220. AutoMatch.Enabled = false;
  221. }
  222. }
  223. }
  224. //输入框Enter事件
  225. private void Input_KeyDown(object sender, KeyEventArgs e)
  226. {
  227. if (e.KeyCode == Keys.Enter)
  228. {
  229. if (Input.Text == "")
  230. {
  231. MessageBox.Show("采集的数据不能为空");
  232. return;
  233. }
  234. if (Si_ItemDGV.Rows.Count == 0)
  235. {
  236. MessageBox.Show("未维护采集策略");
  237. return;
  238. }
  239. CollectInputData();
  240. DataTable savedt = (LabelInf.DataSource as DataTable);
  241. if (savedt != null && savedt.GetChanges() != null)
  242. {
  243. MidSource.EndEdit();
  244. dh.SaveDataTable(savedt.GetChanges(), "ProdioBarCode", "pib_id");
  245. }
  246. }
  247. }
  248. /// <summary>
  249. /// 设置自动匹配的数据的行号
  250. /// </summary>
  251. /// <returns></returns>
  252. private void SetAutoMatchRow()
  253. {
  254. //采集策略的第一组数据
  255. string[] arr = new string[ItemData.Length];
  256. if (sg_separator.Text == "")
  257. {
  258. for (int i = 0; i < arr.Length; i++)
  259. {
  260. arr[i] = Input.Text;
  261. }
  262. }
  263. else
  264. {
  265. arr = Input.Text.Split(sg_separator.Text.ToCharArray()).ToArray();
  266. }
  267. bool FindAutoMatch = false;
  268. for (int i = 0; i < LabelInf.RowCount; i++)
  269. {
  270. for (int j = 0; j < arr.Length; j++)
  271. {
  272. string orispeccode = LabelInf.Rows[i].Cells["pr_orispeccode"].Value.ToString();
  273. 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")
  274. {
  275. CurrentRowIndex = i;
  276. if (CurrentRowIndex - 5 > 0)
  277. LabelInf.FirstDisplayedScrollingRowIndex = CurrentRowIndex - 5;
  278. else
  279. LabelInf.FirstDisplayedScrollingRowIndex = 0;
  280. Brand = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].FormattedValue.ToString();
  281. if (Brand != "")
  282. sg_brand.Text = Brand;
  283. FindAutoMatch = true;
  284. break;
  285. }
  286. }
  287. if (FindAutoMatch)
  288. break;
  289. }
  290. }
  291. /// <summary>
  292. /// 采集数据
  293. /// </summary>
  294. private void CollectInputData()
  295. {
  296. LogManager.DoLog("采集数据【" + Input.Text + "】,使用采集策略编号【" + sg_brand.Text + "】");
  297. //按DetNo排列之后的采集项
  298. ScanData = new ArrayList<ArrayList<string>>();
  299. //每个采集项目的子项
  300. GetData = new ArrayList<string>();
  301. //用于保存采集策略的具体信息
  302. SiItem = new Dictionary<string, Dictionary<string, string>>();
  303. for (int i = 0; i < Si_ItemDGV.RowCount; i++)
  304. {
  305. //如果不包含这个则添加进数组
  306. if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
  307. GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
  308. //如果和后一个的采集次序相同
  309. if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
  310. GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
  311. else
  312. {
  313. ScanData.Add(GetData);
  314. //添加完一次数据需要一个新的List
  315. GetData = new ArrayList<string>();
  316. }
  317. Dictionary<string, string> item = new Dictionary<string, string>();
  318. for (int j = 0; j < Si_ItemDGV.ColumnCount; j++)
  319. {
  320. item.Add(Si_ItemDGV.Columns[j].DataPropertyName, Si_ItemDGV.Rows[i].Cells[j].Value.ToString());
  321. }
  322. SiItem.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString().ToUpper(), item);
  323. }
  324. //采集项目的数组
  325. ItemData = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
  326. //分隔符不为空的时候 //采集的项和Grid的数目不等
  327. //用户采集的数据的分割数组
  328. CollectData = new Dictionary<string, string>();
  329. if (sg_separator.Text == "")
  330. {
  331. for (int i = 0; i < ItemData.Length; i++)
  332. CollectData.Add(ItemData[i].ToString().ToUpper(), Input.Text);
  333. }
  334. else
  335. {
  336. int DataCount = Input.Text.Split(sg_separator.Text.ToCharArray()).Length;
  337. if (DataCount > ItemData.Length)
  338. {
  339. MessageBox.Show("采集数据大于采集项次");
  340. return;
  341. }
  342. else if (DataCount < ItemData.Length)
  343. {
  344. MessageBox.Show("采集数据小于采集项次");
  345. return;
  346. }
  347. for (int i = 0; i < DataCount; i++)
  348. CollectData.Add(ItemData[i].ToString().ToUpper(), Input.Text.Split(sg_separator.Text.ToCharArray())[i]);
  349. }
  350. //首先判断当前采集的个数,如果采集的个数为1则不对数据进行分隔符验证
  351. if (ItemData.Length == 1)
  352. {
  353. CollectData.Clear();
  354. CollectData.Add(ItemData[0].ToString().ToUpper(), Input.Text);
  355. //勾选了自动匹配调用该函数
  356. if (AutoMatch.Checked)
  357. SetAutoMatchRow();
  358. //将筛选之后的值赋给Cell
  359. SetDataToCell(ref CollectData, ItemData[0].ToString().ToUpper());
  360. }
  361. //如果本次采集的数据分割后和当前的采集项目个数不一样提示用户错误
  362. else if (CollectData.ToArray().Length == ItemData.Length)
  363. {
  364. for (int i = 0; i < ItemData.Length; i++)
  365. {
  366. //勾选了自动匹配调用该函数
  367. if (AutoMatch.Checked)
  368. SetAutoMatchRow();
  369. //将筛选之后的值赋给Cell
  370. SetDataToCell(ref CollectData, ItemData[i].ToString().ToUpper());
  371. }
  372. }
  373. else
  374. {
  375. MessageBox.Show("所采集的数据个数和采集项目不符");
  376. return;
  377. }
  378. //采集项目的索引+1
  379. CurrentItemIndex = CurrentItemIndex + 1;
  380. //如果已经采集完了最后一个
  381. if (CurrentItemIndex == ScanData.ToArray().Length)
  382. {
  383. //数据校验均已通过则勾选上已采集
  384. if (CollectVeProdCodePass && CollectQTYPass)
  385. {
  386. //如果按盒号采集,所有的此盒的均更新为
  387. DataTable dt = (DataTable)MidSource.DataSource;
  388. LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
  389. LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
  390. string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
  391. string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
  392. string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
  393. ErrorType.Clear();
  394. dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
  395. CheckRecheckStatus();
  396. LabelInf.Invalidate();
  397. }
  398. //采集未通过的时候
  399. else
  400. {
  401. ErrorType.Clear();
  402. //如果自动采集采集未成功需要移动到下一行
  403. if (!AutoMatch.Checked)
  404. SetRowIndexToCollectRow();
  405. }
  406. //当前项目已采集完成,重置采集项目
  407. CurrentItemIndex = 0;
  408. //未勾选自动匹配,设置到下一个未采集的行
  409. if (!AutoMatch.Checked)
  410. SetRowIndexToCollectRow();
  411. }
  412. RemindUser();
  413. //提醒用户需要采集的数据
  414. MessageLog.AppendText(">>扫描到数据" + Input.Text + "\n", Color.Blue);
  415. //如果所采集的行的物料不一样的话,重新计算箱内容量
  416. if (CurrentRowIndex - 1 > 0)
  417. {
  418. string LastRowProd = LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_prodcode"].Value.ToString();
  419. string CurrentRowProd = LabelInf.Rows[CurrentRowIndex].Cells["pib_prodcode"].Value.ToString();
  420. }
  421. if (CleanInputAfterCollect.Checked)
  422. Input.Text = "";
  423. }
  424. //设置行的索引到当前需要采集的行
  425. private void SetRowIndexToCollectRow()
  426. {
  427. //获取当前需要采集的行
  428. for (int i = CurrentRowIndex; i < LabelInf.RowCount; i++)
  429. {
  430. if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
  431. {
  432. griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
  433. pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
  434. CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
  435. break;
  436. }
  437. }
  438. }
  439. /// <summary>
  440. /// 提醒用户当前采集的项目
  441. /// </summary>
  442. private void RemindUser()
  443. {
  444. SetRowIndexToCollectRow();
  445. if (ScanData.ToArray().Length > 0)
  446. {
  447. object[] arr = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
  448. string Inf = "";
  449. for (int i = 0; i < arr.Length; i++)
  450. {
  451. Inf += arr[i] + " ";
  452. }
  453. MessageLog.AppendText(">>当前采集行" + (CurrentRowIndex + 1) + ",请采集" + Inf + "\n", Color.Green);
  454. }
  455. }
  456. List<string> ErrorType = new List<string>();
  457. /// <summary>
  458. /// 自定义函数 将匹配之后的值设置到Cell中,传递引用,每次赋值之后从List中移除已使用过的
  459. /// </summary>
  460. /// <param name="data"></param>
  461. /// <param name="kind"></param>
  462. private void SetDataToCell(ref Dictionary<string, string> setdata, string kind)
  463. {
  464. int length = setdata.Count;
  465. for (int j = 0; j < length; j++)
  466. {
  467. string[] data = new string[setdata.Count];
  468. for (int i = 0; i < length; i++)
  469. {
  470. data[i] = setdata[kind];
  471. }
  472. for (int i = 0; i < data.Length; i++)
  473. {
  474. DataGridViewCell cell = null;
  475. string Matchstr = "";
  476. switch (kind.ToString().ToUpper())
  477. {
  478. case "DATECODE":
  479. cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"];
  480. Matchstr = MatchStr(data[j], "DATECODE");
  481. setdata.Remove("DATECODE");
  482. length--;
  483. break;
  484. case "LOTNO":
  485. cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"];
  486. Matchstr = MatchStr(data[j], "LOTNO");
  487. setdata.Remove("LOTNO");
  488. length--;
  489. break;
  490. case "MPN":
  491. cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_orispeccode"];
  492. Matchstr = MatchStr(data[j], "MPN");
  493. //采集的供应商号不匹配的话
  494. Console.WriteLine(Matchstr.Trim().Replace(" ", ""));
  495. if (cell.Value.ToString() == Matchstr || Matchstr.Trim().Replace(" ", "").Contains(cell.Value.ToString()) || Matchstr.Contains(cell.Value.ToString()))
  496. {
  497. ErrorType.Add("OK_MPN");
  498. BaseUtil.PlaySound("OK.wav");
  499. LabelInf.Refresh();
  500. CollectVeProdCodePass = true;
  501. }
  502. else
  503. {
  504. ErrorType.Add("NG_MPN");
  505. CollectVeProdCodePass = false;
  506. BaseUtil.PlaySound("NG.wav");
  507. //添加需要重绘的Cell
  508. LabelInf.Refresh();
  509. MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
  510. }
  511. setdata.Remove("MPN");
  512. length--;
  513. break;
  514. case "QTY":
  515. cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_qty"];
  516. Matchstr = MatchStr(data[j], "QTY");
  517. //如果采集的数量不相等的话
  518. if (cell.Value.ToString() != Matchstr)
  519. {
  520. CollectQTYPass = false;
  521. LabelInf.Refresh();
  522. MessageLog.AppendText(">>数量不匹配\n", Color.Red);
  523. }
  524. else
  525. {
  526. LabelInf.Refresh();
  527. CollectQTYPass = true;
  528. }
  529. setdata.Remove("QTY");
  530. length--;
  531. break;
  532. case "CPN":
  533. cell = LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"];
  534. Matchstr = MatchStr(data[j], "CPN");
  535. //如果采集的数量不相等的话
  536. if (cell.Value.ToString() != Matchstr)
  537. {
  538. ErrorType.Add("NG_CPN");
  539. BaseUtil.PlaySound("NG.wav");
  540. CollectQTYPass = false;
  541. LabelInf.Refresh();
  542. MessageLog.AppendText(">>CPN不匹配\n", Color.Red);
  543. }
  544. else
  545. {
  546. ErrorType.Add("OK_CPN");
  547. BaseUtil.PlaySound("OK.wav");
  548. LabelInf.Refresh();
  549. CollectQTYPass = true;
  550. }
  551. setdata.Remove("CPN");
  552. length--;
  553. break;
  554. default:
  555. break;
  556. }
  557. //如果数据为空或者数据不为空的时候但是和需要采集的数据不相等的情况下进行采集
  558. //MPN和QTY只做比较不需要赋值
  559. if (cell.Value.ToString() == "" || cell.Value.ToString() != Matchstr)
  560. {
  561. string MatchResult = "";
  562. if (kind != "MPN" && kind != "QTY" && kind != "CPN")
  563. {
  564. DataTable dt = (DataTable)MidSource.DataSource;
  565. cell.Value = Matchstr;
  566. MatchResult = "成功";
  567. }
  568. else
  569. MatchResult = "失败";
  570. switch (SiItem[kind]["si_kind"])
  571. {
  572. case "索引字符":
  573. LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",使用字符" + SiItem[kind]["si_indexstring"] + ",匹配后字符串" + Matchstr);
  574. break;
  575. case "起始位置":
  576. LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",从第" + SiItem[kind]["si_index"] + "位开始匹配,匹配后字符串" + Matchstr);
  577. break;
  578. case "二次解析":
  579. LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",匹配后字符串" + Matchstr);
  580. break;
  581. case "全部":
  582. LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",匹配后字符串" + Matchstr);
  583. break;
  584. default:
  585. break;
  586. }
  587. }
  588. else
  589. LogManager.DoLog("采集项" + kind + ",匹配结果:【成功】,匹配方式:" + SiItem[kind]["si_kind"] + ",,匹配后字符串" + Matchstr);
  590. }
  591. }
  592. }
  593. /// <summary>
  594. /// 自定义函数 根据匹配规则
  595. /// si_item的二维数组,str是需要赋值的字符串,item表示DateCode,LotNo等
  596. /// </summary>
  597. /// <param name="SiItem"></param>
  598. /// <param name="str"></param>
  599. /// <param name="item"></param>
  600. /// <returns></returns>
  601. private string MatchStr(string str, string item)
  602. {
  603. string kind = SiItem[item]["si_kind"];
  604. //起始字符不为空的时候
  605. switch (kind)
  606. {
  607. case "起始位置":
  608. if (SiItem[item]["si_index"] != "")
  609. {
  610. try
  611. {
  612. //长度不为空的时候按照指定的长度去取数据
  613. if (SiItem[item]["si_length"] != "")
  614. str = str.Substring(int.Parse(SiItem[item]["si_index"]), int.Parse(SiItem[item]["si_length"]));
  615. //长度为空的时候取index之后的全部数据
  616. else
  617. str = str.Substring(int.Parse(SiItem[item]["si_index"]));
  618. }
  619. catch (Exception e) { LogManager.DoLog(e.StackTrace); }
  620. }
  621. break;
  622. case "索引字符":
  623. try
  624. {
  625. if (SiItem[item]["si_indexstring"] != "")
  626. {
  627. //长度不为空的时候按照指定的长度去取数据
  628. if (SiItem[item]["si_length"] != "")
  629. str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1, int.Parse(SiItem[item]["si_length"]));
  630. //长度为空的时候取index之后的全部数据
  631. else
  632. str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1);
  633. }
  634. }
  635. catch (Exception e) { LogManager.DoLog(e.StackTrace); }
  636. break;
  637. case "全部":
  638. break;
  639. default:
  640. break;
  641. }
  642. if (SiItem[item]["si_expression"] != "")
  643. {
  644. string log = "使用正则表达式" + SiItem[item]["si_expression"] + "匹配数据" + str;
  645. reg = new Regex(SiItem[item]["si_expression"]);
  646. try
  647. {
  648. str = reg.Matches(str)[int.Parse(SiItem[item]["si_expressionitem"].ToString()) - 1].Value;
  649. }
  650. catch (Exception)
  651. {
  652. }
  653. log += ",匹配后数据" + str;
  654. LogManager.DoLog(log);
  655. }
  656. return str;
  657. }
  658. //关闭窗口前提示用户确认
  659. private void 贴标机条码打印_FormClosing(object sender, FormClosingEventArgs e)
  660. {
  661. //如果不是注销的话
  662. if (!logout)
  663. {
  664. string close = MessageBox.Show(this.ParentForm, "是否关闭", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  665. if (close.ToString() != "Yes")
  666. e.Cancel = true;
  667. else
  668. {
  669. LogManager.DoLog("关闭程序");
  670. }
  671. }
  672. }
  673. /// <summary>
  674. /// 出入库单录入框的回车事件
  675. /// </summary>
  676. /// <param name="sender"></param>
  677. /// <param name="e"></param>
  678. private void pi_inoutno_KeyDown(object sender, KeyEventArgs e)
  679. {
  680. if (e.KeyCode == Keys.Enter)
  681. {
  682. sql.Clear();
  683. sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date,nvl(cu_needrecheck,0)cu_needrecheck from prodinout left join customer on cu_code=pi_cardcode where pi_invoicecode='" + pi_invoicecode.Text + "' ");
  684. DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
  685. ErrorType.Clear();
  686. if (dt.Rows.Count > 0)
  687. {
  688. cu_code.Text = dt.Rows[0]["pi_cardcode"].ToString();
  689. cu_needrecheck.Text = dt.Rows[0]["cu_needrecheck"].ToString();
  690. pi_date.Text = dt.Rows[0]["pi_date"].ToString();
  691. PI_ID = dt.Rows[0]["pi_id"].ToString();
  692. dt = (DataTable)dh.ExecuteSql("select 1 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "select");
  693. if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "" && dt.Rows.Count == 0)
  694. {
  695. string Error = "";
  696. string[] param = new string[] { PI_ID, "", Error };
  697. dh.CallProcedure("GetCustBarcode", param);
  698. }
  699. LoadGridData(sender, e);
  700. //设置当前的最大箱号
  701. CurrentItemIndex = 0;
  702. LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
  703. }
  704. else
  705. MessageBox.Show("当前出入库单号不存在或者未审核!");
  706. }
  707. }
  708. private void CleanDetail_Click(object sender, EventArgs e)
  709. {
  710. ArrayList<string> DeleteID = new ArrayList<string>();
  711. for (int i = 0; i < LabelInf.RowCount; i++)
  712. {
  713. if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
  714. DeleteID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
  715. }
  716. //勾选了删除的明细之后
  717. if (DeleteID.ToArray().Length > 0)
  718. {
  719. string close = MessageBox.Show(this.ParentForm, "删除后不可恢复,是否确认删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  720. if (close.ToString() == "Yes")
  721. {
  722. dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
  723. MessageBox.Show("删除成功");
  724. LoadGridData(sender, e);
  725. }
  726. }
  727. else
  728. MessageBox.Show("尚未勾选需要删除的明细");
  729. }
  730. private void LoadGridData()
  731. {
  732. LoadGridData(new object(), new EventArgs());
  733. }
  734. /// <summary>
  735. /// 自定义函数 加载明细行的数据,多处使用添加进函数
  736. /// </summary>
  737. /// <param name="sender"></param>
  738. /// <param name="e"></param>
  739. private void LoadGridData(object sender, EventArgs e)
  740. {
  741. sql.Clear();
  742. sql.Append("select * from prodiobarcode_view1 where pib_piid='" + PI_ID + "'");
  743. dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
  744. MidSource.DataSource = dt;
  745. BaseUtil.FillDgvWithDataTable(LabelInf, (DataTable)MidSource.DataSource);
  746. //有数据的话默认取第一条的品牌去取采集策略
  747. TotalCount.Text = LabelInf.RowCount.ToString();
  748. if (LabelInf.RowCount > 0)
  749. {
  750. Brand = LabelInf.Rows[0].Cells["pib_brand"].FormattedValue.ToString();
  751. if (Brand != "")
  752. sg_brand.Text = Brand;
  753. }
  754. //绑定数据之后往下找到未采集的数据显示在当前采集的栏目
  755. for (int i = 0; i < LabelInf.RowCount; i++)
  756. {
  757. if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
  758. {
  759. griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
  760. pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
  761. pib_id.Text = LabelInf.Rows[i].Cells["pib_id1"].FormattedValue.ToString();
  762. CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
  763. break;
  764. }
  765. }
  766. }
  767. /// <summary>
  768. /// 重绘Cell的颜色
  769. /// </summary>
  770. /// <param name="sender"></param>
  771. /// <param name="e"></param>
  772. private void LabelInf_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
  773. {
  774. bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
  775. if (e.ColumnIndex > 0)
  776. {
  777. if (LabelInf.Columns[e.ColumnIndex].Name == "pib_custbarcode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_barcode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" || LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode1" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode2" || LabelInf.Columns[e.ColumnIndex].Name == "pib_brand")
  778. {
  779. SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
  780. e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
  781. Rectangle border = e.CellBounds;
  782. border.Width -= 1;
  783. e.Graphics.DrawRectangle(Pens.White, border);
  784. e.PaintContent(e.CellBounds);
  785. e.Handled = true;
  786. }
  787. if (e.RowIndex >= 0)
  788. {
  789. if (LabelInf.Rows[e.RowIndex].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
  790. {
  791. if (LabelInf.Columns[e.ColumnIndex].Name == "pr_orispeccode" || LabelInf.Columns[e.ColumnIndex].Name == "pd_custprodcode")
  792. {
  793. SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
  794. e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
  795. Rectangle border = e.CellBounds;
  796. border.Width -= 1;
  797. e.Graphics.DrawRectangle(Pens.Black, border);
  798. e.PaintContent(e.CellBounds);
  799. e.Handled = true;
  800. }
  801. }
  802. }
  803. if (e.RowIndex == CurrentRowIndex)
  804. {
  805. if (LabelInf.Columns[e.ColumnIndex].Name == "pr_orispeccode")
  806. {
  807. SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
  808. if (ErrorType.Count > 0)
  809. {
  810. if (ErrorType.Contains("OK_MPN"))
  811. {
  812. e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
  813. Rectangle border = e.CellBounds;
  814. border.Width -= 1;
  815. e.Graphics.DrawRectangle(Pens.Black, border);
  816. e.PaintContent(e.CellBounds);
  817. e.Handled = true;
  818. }
  819. else if (ErrorType.Contains("NG_MPN"))
  820. {
  821. e.Graphics.FillRectangle(Brushes.Red, e.CellBounds);
  822. Rectangle border = e.CellBounds;
  823. border.Width -= 1;
  824. e.Graphics.DrawRectangle(Pens.Black, border);
  825. e.PaintContent(e.CellBounds);
  826. e.Handled = true;
  827. }
  828. }
  829. }
  830. if (LabelInf.Columns[e.ColumnIndex].Name == "pd_custprodcode")
  831. {
  832. SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
  833. if (ErrorType.Count > 0)
  834. {
  835. if (ErrorType.Contains("OK_CPN"))
  836. {
  837. e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
  838. Rectangle border = e.CellBounds;
  839. border.Width -= 1;
  840. e.Graphics.DrawRectangle(Pens.Black, border);
  841. e.PaintContent(e.CellBounds);
  842. e.Handled = true;
  843. }
  844. else if (ErrorType.Contains("NG_CPN"))
  845. {
  846. e.Graphics.FillRectangle(Brushes.Red, e.CellBounds);
  847. Rectangle border = e.CellBounds;
  848. border.Width -= 1;
  849. e.Graphics.DrawRectangle(Pens.Black, border);
  850. e.PaintContent(e.CellBounds);
  851. e.Handled = true;
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. private void pr_code_SearchIconClick(object sender, EventArgs e)
  859. {
  860. pr_code.Condition = " pd_inoutno='" + pi_inoutno.Text + "'";
  861. }
  862. private void pr_code_UserControlTextChanged(object sender, EventArgs e)
  863. {
  864. //用户在重新勾选后重置采集项目的索引
  865. for (int i = 0; i < LabelInf.RowCount; i++)
  866. {
  867. if (pr_code.Text == LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
  868. {
  869. CurrentRowIndex = i;
  870. break;
  871. }
  872. }
  873. }
  874. private void Refresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  875. {
  876. KeyEventArgs e2 = new KeyEventArgs(Keys.Enter);
  877. pi_inoutno_KeyDown(sender, e2);
  878. }
  879. /// <summary>
  880. /// 采集明细切换
  881. /// </summary>
  882. /// <param name="sender"></param>
  883. /// <param name="e"></param>
  884. private void griddetno_KeyDown(object sender, KeyEventArgs e)
  885. {
  886. if (Keys.Enter == e.KeyData)
  887. {
  888. bool FindDetno = false;
  889. for (int i = 0; i < LabelInf.RowCount; i++)
  890. {
  891. if (LabelInf.Rows[i].Cells["pib_pdno"].Value.ToString() == griddetno.Text && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
  892. {
  893. FindDetno = true;
  894. CurrentItemIndex = 0;
  895. CurrentRowIndex = i;
  896. RemindUser();
  897. break;
  898. }
  899. }
  900. if (!FindDetno)
  901. {
  902. MessageBox.Show("不存在未采集的明细序号" + griddetno.Text);
  903. return;
  904. }
  905. }
  906. }
  907. private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  908. {
  909. string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  910. if (close.ToString() == "Yes")
  911. {
  912. Login login = new Login();
  913. //注销的时候需要将拼接的连接字符串置空
  914. DataHelper.DBConnectionString = null;
  915. logout = true;
  916. this.Hide();
  917. login.ShowDialog();
  918. this.Close();
  919. }
  920. }
  921. private void LabelInf_DataError(object sender, DataGridViewDataErrorEventArgs e) { }
  922. private void ChooseAll_Click(object sender, EventArgs e)
  923. {
  924. if (AllChecked)
  925. {
  926. foreach (DataGridViewRow dr in LabelInf.Rows)
  927. dr.Cells[0].Value = false;
  928. AllChecked = false;
  929. }
  930. else
  931. {
  932. foreach (DataGridViewRow dr in LabelInf.Rows)
  933. dr.Cells[0].Value = true;
  934. AllChecked = true;
  935. }
  936. }
  937. private void ExportData_Click(object sender, EventArgs e)
  938. {
  939. ExportFileDialog.Description = "选择导出的路径";
  940. DialogResult result = ExportFileDialog.ShowDialog();
  941. if (result == DialogResult.OK)
  942. {
  943. ExcelHandler eh = new ExcelHandler();
  944. DataTable dt = ((DataTable)MidSource.DataSource).Copy();
  945. for (int i = dt.Columns.Count - 1; i >= 0; i--)
  946. {
  947. for (int j = 0; j < LabelInf.Columns.Count; j++)
  948. {
  949. //去除ID列
  950. if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
  951. {
  952. dt.Columns.RemoveAt(i);
  953. break;
  954. }
  955. switch (dt.Columns[i].ColumnName.ToLower())
  956. {
  957. case "pib_lotno":
  958. dt.Columns[i].ColumnName = "批次号";
  959. break;
  960. case "pib_datecode":
  961. dt.Columns[i].ColumnName = "生产日期";
  962. break;
  963. case "pib_custbarcode":
  964. dt.Columns[i].ColumnName = "最小产品包装条码";
  965. break;
  966. default:
  967. break;
  968. }
  969. if (dt.Columns[i].ColumnName.ToLower() == LabelInf.Columns[j].DataPropertyName.ToLower())
  970. {
  971. dt.Columns[i].ColumnName = LabelInf.Columns[j].HeaderText;
  972. break;
  973. }
  974. }
  975. }
  976. eh.ExportExcel(dt, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text);
  977. string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  978. if (close.ToString() == "Yes")
  979. System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + ".xls");
  980. }
  981. }
  982. private void CleanBarCode_Click(object sender, EventArgs e)
  983. {
  984. string close = MessageBox.Show(this.ParentForm, "是否清除该出货单条码", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  985. if (close.ToString() == "Yes")
  986. {
  987. dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
  988. LoadGridData(sender, e);
  989. }
  990. }
  991. private void CollectAll_Click(object sender, EventArgs e)
  992. {
  993. int PickedCount = 0;
  994. for (int i = 0; i < LabelInf.Rows.Count; i++)
  995. {
  996. if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
  997. {
  998. LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
  999. }
  1000. else
  1001. {
  1002. PickedCount = PickedCount + 1;
  1003. }
  1004. }
  1005. if (PickedCount == LabelInf.Rows.Count)
  1006. {
  1007. for (int i = 0; i < LabelInf.Rows.Count; i++)
  1008. {
  1009. LabelInf.Rows[i].Cells["pib_ifpick"].Value = false;
  1010. }
  1011. }
  1012. }
  1013. private void CheckRecheckStatus()
  1014. {
  1015. if (cu_needrecheck.Text == "0")
  1016. {
  1017. dh.ExecuteSql("update customer set cu_needrecheck=-1 where cu_code='" + cu_code.Text + "'", "update");
  1018. }
  1019. if (dh.getRowCount("prodiobarcode", "nvl(pib_ifpick,0)<>0 and pib_inoutno='" + pi_inoutno.Text + "'") == LabelInf.Rows.Count)
  1020. {
  1021. dh.ExecuteSql("update prodinout set pi_recheckstatus='已复核' where pi_inoutno='" + pi_inoutno.Text + "'", "update");
  1022. }
  1023. }
  1024. }
  1025. }