Batch_Generation_CodeDetail.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. using NPOI.SS.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using 优软MES.DataOperate;
  8. using 优软MES.PublicMethod;
  9. namespace 优软MES
  10. {
  11. public partial class Batch_Generation_CodeDetail : Form
  12. {
  13. DataHelper dh = new DataHelper();
  14. DataTable dt = new DataTable();
  15. //string caller = "ProdInOut!BarcodeIn";
  16. string PD_ID;
  17. string PI_ID;
  18. string[] field = { "pd_inoutno","pd_pdno","pd_prodcode","pr_detail","pr_unit","pd_inqty", "pr_tracekind" ,"pi_cardcode","pi_title", "pd_inqty-nvl(pd_barcodeinqty,0)" , "pr_zxbzs","pr_unit" };
  19. string table = "prodiodetail left join product on pr_code=pd_prodcode left join prodinout on pi_id=pd_piid";
  20. //明细行需要隐藏的字段
  21. string[] hiddenfield = {"bi_pdid","bi_pdaget"};
  22. string[] EditAbleField = {"bi_location","bi_madedate", "bi_vendbarcode","bi_inqty" };
  23. public Batch_Generation_CodeDetail()
  24. {
  25. InitializeComponent();
  26. }
  27. public Batch_Generation_CodeDetail(string pd_id) {
  28. if (pd_id != null && pd_id != "")
  29. {
  30. InitializeComponent();
  31. //设置只能输入数字的TextBox的委托事件
  32. NumOnly();
  33. PD_ID = pd_id;
  34. //初始的时候设置timepicker为空
  35. bi_madedate.Format = DateTimePickerFormat.Custom;
  36. bi_madedate.CustomFormat = " ";
  37. string sql = BaseUtil.AddField(field);
  38. sql = "select " + sql + " from "+table+" where pd_id=" + pd_id;
  39. dt = (DataTable)dh.ExecuteSql(sql, "select");
  40. //加载数据
  41. LoadData();
  42. //通过控件名称和列的描述相同时赋值,由于表格上部分的控件是装在一个panel里面的,所以需要通过controls[0]从panel中获取
  43. BaseUtil.SetFormValue(Controls["Panel0"].Controls, dt);
  44. //从configs表中取数据
  45. string Data = dh.GetConfig("UseLocationOrNot", "BarCodeSetting").ToString();
  46. //如果配置的数据为1或者Y,说明启用这个配置
  47. if (Data == "1" || Data == "Y")
  48. {
  49. bi_location.Visible = true;
  50. bi_location_label.Visible = true;
  51. }
  52. BaseUtil.HideField(dataGridView1, hiddenfield);
  53. BaseUtil.SetDataGridViewReadOnly(dataGridView1,EditAbleField);
  54. //手动转换批总量
  55. ValueTransform();
  56. }
  57. }
  58. private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
  59. {
  60. bi_madedate.Format = DateTimePickerFormat.Long;
  61. }
  62. private void bi_prodate_ValueChanged(object sender, EventArgs e)
  63. {
  64. bi_madedate.Format = DateTimePickerFormat.Long;
  65. }
  66. private void GenerateCode_Click(object sender, EventArgs e)
  67. {
  68. //检查生成条码之前的逻辑
  69. CheckBeforeGenCode();
  70. //计算打包的数量num表示包数
  71. //restqty表示不足整包之后的数量,单独作为一个包
  72. int num = int.Parse(pd_qty.Text) / int.Parse(pr_zxbzs.Text);
  73. int restqty = int.Parse(pd_qty.Text) - (num * int.Parse(pr_zxbzs.Text));
  74. string ve_id = GetVendorID(PD_ID);
  75. string pr_code = dh.getFieldDataByCondition("prodiodetail", "pd_prodcode","pd_id="+PD_ID).ToString();
  76. //如果用为未选择日期则将日期置为空,否则选择日期的值
  77. string madedate = bi_madedate.Text;
  78. if (madedate.Trim() == "")
  79. {
  80. madedate = null;
  81. }
  82. else {
  83. madedate = bi_madedate.Value.ToString();
  84. }
  85. //用于拼接SQl的StringBulider对象
  86. StringBuilder sql = new StringBuilder();
  87. //用于存放条码的数组
  88. string[] barcode = new string[num];
  89. for (int i = 0; i < num; i++)
  90. {
  91. barcode[i] = BarcodeMethod(pr_code, ve_id);
  92. }
  93. BaseUtil.CleanDataTable(dt);
  94. //通过pd_id查询出需要插入的数据
  95. dt = dh.getFieldsDataByCondition("prodiodetail left join prodinout on pd_piid=pi_id", new string[] { "pd_pdno", "pi_class", "pd_prodmadedate", "pi_date", "pd_whcode", "pi_whcode" }, "pd_id=" + PD_ID);
  96. object pd_pdno = dt.Rows[0]["pd_pdno"];
  97. object pi_class = dt.Rows[0]["pi_class"];
  98. object pi_date = dt.Rows[0]["pi_date"];
  99. object pd_prodmadedate = dt.Rows[0]["pd_prodmadedate"];
  100. object pi_whcode = dt.Rows[0]["pi_whcode"];
  101. object pd_whcode = dt.Rows[0]["pd_whcode"];
  102. sql.Append("insert into barcodeio (");
  103. sql.Append("bi_id,bi_piid,bi_pdid,bi_pdno,bi_inoutno,bi_piclass,bi_barcode,bi_prodcode,bi_whcode,bi_inqty,");
  104. sql.Append("bi_madedate,bi_vendbarcode,bi_location,bi_status,bi_printstatus)");
  105. sql.Append(" values (barcodeio_seq.nextval," + PI_ID + "," + PD_ID + ",'" + pd_pdno + "','" + pd_inoutno.Text + "','" + pi_class + "',:barcode,'" + pd_prodcode.Text + "',nvl('" + pd_whcode + "','" + pi_whcode + "'),'");
  106. sql.Append(pr_zxbzs.Text + "',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')),'" + bi_vendbarcode.Text + "','仓位', 0, 0)");
  107. if (num > 0) {
  108. dh.BatchInsert(sql.ToString(),new string[] {"barcode"},barcode);
  109. }
  110. //有余数的话单独生成一条
  111. if (restqty != 0) {
  112. dh.BatchInsert(sql.ToString(), new string[] { "barcode" },new string[] { BarcodeMethod(pr_code, ve_id) } );
  113. }
  114. MessageBox.Show("生成条码成功");
  115. LoadData();
  116. }
  117. private static string lpad(int length, string number)
  118. {
  119. while (number.Length < length)
  120. {
  121. number = "0" + number;
  122. }
  123. number = number.Substring(number.Length - length,length);
  124. return number;
  125. }
  126. //生成条码的方法
  127. public static string BarcodeMethod(string pr_code, string ve_id) {
  128. StringBuilder code = new StringBuilder();
  129. DataTable dt1 = new DataTable();
  130. DataHelper dh = new DataHelper();
  131. string date = "0";
  132. dt1 =(DataTable) dh.ExecuteSql("select pr_id,pr_tracekind,pr_exbarcode from product where pr_code='"+pr_code+"'","select");
  133. if (dt1.Rows.Count > 0) {
  134. if (dt1.Rows[0]["pr_tracekind"].ToString() != "") {
  135. if (int.Parse(dt1.Rows[0]["pr_tracekind"].ToString()) == 2)
  136. { //批量管控
  137. string pr_id = dt1.Rows[0]["pr_id"].ToString();
  138. //清掉dt1的数据和结构
  139. BaseUtil.CleanDataTable(dt1);
  140. string[] field = { "bs_lenprid", "bs_datestr", "bs_lennum", "bs_maxnum", "bs_maxdate", "bs_lenveid" };
  141. dt1 = dh.getFieldsDataByCondition("barcodeSet", field, "bs_type='BATCH'");
  142. code.Append(lpad(int.Parse(dt1.Rows[0][0].ToString()), pr_id));
  143. code.Append(lpad(int.Parse(dt1.Rows[0][5].ToString()), ve_id));
  144. if (dt1.Rows[0][1].Equals("YYMMDD"))
  145. {
  146. SimpleDateFormat YMD = new SimpleDateFormat("yyMMdd");
  147. date = YMD.Format(new DateTime());
  148. }
  149. else if (dt1.Rows[0][1].Equals("YYMM"))
  150. {
  151. SimpleDateFormat YM = new SimpleDateFormat("yyMM");
  152. date = YM.Format(new DateTime());
  153. }
  154. else if (dt1.Rows[0][1].Equals("MMDD"))
  155. {
  156. SimpleDateFormat MD = new SimpleDateFormat("MMdd");
  157. date = MD.Format(new DateTime());
  158. }
  159. code.Append(date);
  160. dh.UpdateByCondition("barcodeSet", "bs_maxdate='" + date + "'", "bs_type='BATCH'");
  161. if (!("").Equals(dt1.Rows[0][4]) && null != dt1.Rows[0][4] && (!date.Equals("0")) && (int.Parse(dt1.Rows[0][4].ToString()) > int.Parse(date)))
  162. {
  163. code.Append(lpad(int.Parse(dt1.Rows[0][2].ToString()), "1"));// 流水重新开始
  164. dh.UpdateByCondition("barcodeSet", "bs_maxnum=2", "bs_type='BATCH'");
  165. }
  166. else
  167. {
  168. code.Append(lpad(int.Parse(dt1.Rows[0][2].ToString()), dt1.Rows[0][3].ToString()));// 当前流水号
  169. dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='BATCH'");// 流水号增加1
  170. }
  171. }
  172. else
  173. {
  174. BaseUtil.ShowError("管控类型错误!");
  175. }
  176. }
  177. }
  178. return code.ToString();
  179. }
  180. public static string outboxMethod(string pr_id, string kind) {
  181. StringBuilder code = new StringBuilder();
  182. DataHelper dh = new DataHelper();
  183. object pr_kind= dh.getFieldDataByCondition("product", "pr_tracekind", "pr_id=" + pr_id );
  184. if (pr_kind.ToString()!="") {
  185. if ((kind.Equals("1") && pr_kind.ToString() == "1") || (kind.Equals("2") && pr_kind.ToString() == "2"))
  186. {// 单间管控或者批管控
  187. DataTable dt= dh.getFieldsDataByCondition("barcodeSet",new string[] { "bs_id ,bs_lenprid,bs_lennum,bs_maxnum" } ,"bs_type='PACK'");
  188. if (dt.Rows.Count>0)
  189. {
  190. code.Append(lpad(int.Parse(dt.Rows[0]["bs_lenprid"].ToString()), pr_id));// PR_ID物料ID的长度
  191. code.Append(lpad(int.Parse(dt.Rows[0]["bs_lennum"].ToString()),dt.Rows[0]["bs_maxnum"].ToString()));// 当前流水号
  192. dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='PACK' and bs_id=" + dt.Rows[0]["bs_id"]);// 流水号增加1
  193. }
  194. else
  195. {
  196. BaseUtil.ShowError("未定义包装箱号产生规则或规则为审核");
  197. }
  198. }
  199. else
  200. {
  201. BaseUtil.ShowError("管控类型错误!");
  202. }
  203. }
  204. return code.ToString();
  205. }
  206. private void PrintCode_Click(object sender, EventArgs e)
  207. {
  208. }
  209. private void PrintAllBoxNum_Click(object sender, EventArgs e)
  210. {
  211. }
  212. private void deleteDetailButton1_Click(object sender, EventArgs e)
  213. {
  214. }
  215. private void saveButton1_Click(object sender, EventArgs e)
  216. {
  217. DataTable dt = (DataTable)dataGridView1.DataSource;
  218. dh.UpDateTableByCondition(dt.GetChanges(), "barcodeio", "bi_id");
  219. }
  220. private void deleteDetailButton1_Click_1(object sender, EventArgs e)
  221. {
  222. //新建一个和grid长度一样的数组
  223. string pd_status = dh.getFieldDataByCondition("prodiodetail", "pd_status", "pd_id=" +PD_ID).ToString();
  224. if (pd_status=="99") {
  225. BaseUtil.ShowError("单据已过账,不允许删除明细");
  226. }
  227. string[] deleteID = new string[dataGridView1.Rows.Count];
  228. foreach (DataGridViewRow dgvc in dataGridView1.Rows) {
  229. deleteID[dataGridView1.Rows.IndexOf(dgvc)] = dgvc.Cells["ID"].Value.ToString();
  230. }
  231. string bi_pdid=dh.getFieldDataByCondition("barcodeio", "bi_pdid", "bi_id=" + deleteID[0]).ToString();
  232. //删除PackageDetail表信息
  233. dh.ExecuteSql("delete from packagedetail where pd_outboxcode in (select bi_outboxcode from barcodeio where bi_pdid=" + bi_pdid + ")", "delete");
  234. //删除Package表的信息
  235. dh.ExecuteSql("delete from package where pa_outboxcode in (select bi_outboxcode from barcodeio where bi_pdid=" + bi_pdid + ")", "delete");
  236. //删除BarcodeIO表信息
  237. dh.DeleteDataByID("barcodeio", "bi_id", deleteID);
  238. MessageBox.Show("清除明细成功");
  239. LoadData();
  240. }
  241. /// <summary>
  242. /// 生成条码和箱号按钮
  243. /// </summary>
  244. /// <param name="sender"></param>
  245. /// <param name="e"></param>
  246. private void GenerateCodeAndBoxNum_Click(object sender, EventArgs e)
  247. {
  248. //调用生成条码的方法
  249. CheckBeforeGenCode();
  250. if (bi_boxnum.Text == "")
  251. {
  252. BaseUtil.ShowError("箱内总数必须填写");
  253. }
  254. else
  255. {
  256. int rest = int.Parse(bi_boxnum.Text) % int.Parse(pr_zxbzs.Text);
  257. if (rest != 0)
  258. {
  259. BaseUtil.ShowError("箱内总是必须是最小包装量的整数倍");
  260. }
  261. }
  262. string ve_id = GetVendorID(PD_ID);
  263. DataTable dt = dh.getFieldsDataByCondition("prodiodetail", new string[] { "pd_prodcode,pd_prodid" }, "pd_id=" + PD_ID);
  264. string pr_code = dt.Rows[0]["pd_prodcode"].ToString();
  265. string pr_id = dt.Rows[0]["pd_prodid"].ToString();
  266. //箱内件数
  267. int numinpack = int.Parse(bi_boxnum.Text) / int.Parse(pr_zxbzs.Text);
  268. //装箱的数量和条码的数量
  269. int packnum = int.Parse(pd_qty.Text) / int.Parse(bi_boxnum.Text);
  270. int codenum = int.Parse(pd_qty.Text) / int.Parse(pr_zxbzs.Text);
  271. //是否有剩余的最小包
  272. int restcode = int.Parse(pd_qty.Text) -(codenum* int.Parse(pr_zxbzs.Text)) ;
  273. //是否有剩余的尾箱
  274. int restpack = int.Parse(pd_qty.Text) -(packnum * int.Parse(bi_boxnum.Text));
  275. //记录箱号的数组
  276. //根据pd_id选出需要插入的数据
  277. dt = dh.getFieldsDataByCondition("prodiodetail left join prodinout on pd_piid=pi_id", new string[] { "pd_pdno", "pi_class", "pd_prodmadedate", "pi_date", "pd_whcode", "pi_whcode" }, "pd_id=" + PD_ID);
  278. object pd_pdno = dt.Rows[0]["pd_pdno"];
  279. object pi_class = dt.Rows[0]["pi_class"];
  280. object pi_date = dt.Rows[0]["pi_date"];
  281. object pd_prodmadedate = dt.Rows[0]["pd_prodmadedate"];
  282. object pi_whcode = dt.Rows[0]["pi_whcode"];
  283. object pd_whcode = dt.Rows[0]["pd_whcode"];
  284. string madedate = bi_madedate.Text;
  285. if (madedate.Trim() == "")
  286. {
  287. madedate = null;
  288. }
  289. else
  290. {
  291. madedate = bi_madedate.Value.ToString();
  292. }
  293. StringBuilder sql = new StringBuilder();
  294. //
  295. //如果剩余的箱数量大于0,则箱号+1
  296. if (restpack != 0) {
  297. packnum = packnum + 1;
  298. }
  299. string[] pa_id = new string[packnum];
  300. string[] packNum = new string[packnum];
  301. if (packnum > 0)
  302. {
  303. for (int i = 0; i < packnum; i++)
  304. {
  305. packNum[i] = outboxMethod(pr_id, "2");
  306. //通过序列获取到ID
  307. pa_id[i] = dh.GetSEQ("PACKAGE_SEQ");
  308. }
  309. sql.Append("insert into package (");
  310. sql.Append("pa_id,pa_outboxcode,pa_prodcode, pa_packdate,pa_packageqty, pa_totalqty, pa_status, pa_indate)");
  311. sql.Append("values (:pa_id,:packnum,'" + pr_code + "', sysdate," + numinpack + "," + bi_boxnum.Text + ",'0',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')))");
  312. dh.BatchInsert(sql.ToString(), new string[] { "pa_id", "packnum" }, pa_id, packNum);
  313. }
  314. sql.Clear();
  315. //记录条码号的数组
  316. //如果有余数则条码数量+1
  317. if (restcode != 0){
  318. codenum=codenum+1;
  319. }
  320. string[] codeNum = new string[codenum];
  321. string[] bi_outboxid = new string[codenum];
  322. string[] bi_outboxcode = new string[codenum];
  323. if (codenum > 0){
  324. for (int i = 0; i < codenum; i++)
  325. {
  326. codeNum[i] = BarcodeMethod(pr_code, ve_id);
  327. }
  328. //包装数-1*箱内数量,先处理整箱的
  329. int k = 0;
  330. for (int i = 0; i < packnum-1; i++) {
  331. for (int j = 0; j < numinpack; j++) {
  332. bi_outboxid[k] = pa_id[i];
  333. bi_outboxcode[k] = packNum[i];
  334. k=k+1;
  335. }
  336. }
  337. //最后单独处理剩余的一箱的条码,不论整箱还是有零件都可以
  338. //最后一箱的条码数量
  339. int remain = codenum - k;
  340. for (int i = 0; i <remain; i++) {
  341. bi_outboxid[k] = pa_id[pa_id.Length - 1];
  342. bi_outboxcode[k] = packNum[packNum.Length - 1];
  343. k=k+1;
  344. }
  345. //每个条码需要存对应的箱号的ID
  346. sql.Append("insert into barcodeio (");
  347. sql.Append("bi_id,bi_piid,bi_pdid,bi_pdno,bi_inoutno,bi_piclass,bi_barcode,bi_prodcode,bi_whcode,bi_inqty,");
  348. sql.Append("bi_madedate,bi_vendbarcode,bi_location,bi_status,bi_printstatus,bi_outboxcode,bi_outboxid)");
  349. sql.Append(" values (barcodeio_seq.nextval," + PI_ID + "," + PD_ID + ",'" + pd_pdno + "','" + pd_inoutno.Text + "','" + pi_class + "',:barcode,'" + pd_prodcode.Text + "',nvl('" + pd_whcode + "','" + pi_whcode + "'),'");
  350. sql.Append(pr_zxbzs.Text + "',nvl( to_date('" + madedate + "', 'YYYY-MM-DD HH24:MI:SS'),to_date('" + pd_prodmadedate + "', 'YYYY-MM-DD HH24:MI:SS')),'" + bi_vendbarcode.Text + "','仓位',0,0,:packcode,:pa_id)");
  351. dh.BatchInsert(sql.ToString(), new string[] { "barcode","packcode","pa_id" },codeNum, bi_outboxcode,bi_outboxid);
  352. }
  353. sql.Clear();
  354. //insert into packageDetail(pd_id, pd_paid, pd_outboxcode, pd_barcode, pd_innerqty)values(PACKAGEDETAIL_SEQ, pd_id, 箱号, 条码号, 条码数量);
  355. sql.Append("insert into packageDetail(pd_id, pd_paid, pd_outboxcode, pd_barcode, pd_innerqty) values (");
  356. sql.Append("PACKAGEDETAIL_SEQ.nextval,:pd_paid,:packcode,:barcode,"+pd_qty.Text+")");
  357. dh.BatchInsert(sql.ToString(), new string[] { "pd_paid","packcode", "barcode" },bi_outboxid,bi_outboxcode, codeNum);
  358. MessageBox.Show("成功生成条码和箱号");
  359. LoadData();
  360. }
  361. /// <summary>
  362. /// 通过pd_id获取供应商的ID
  363. /// </summary>
  364. /// <param name="pd_id"></param>
  365. /// <returns></returns>
  366. public string GetVendorID(string pd_id) {
  367. DataHelper dh = new DataHelper();
  368. string pi_id=dh.getFieldDataByCondition("prodiodetail", "pd_piid", "pd_id=" + pd_id).ToString() ;
  369. PI_ID = pi_id;
  370. object ve_id=dh.getFieldDataByCondition("Vendor left join ProdInOut on pi_cardcode=ve_code", "ve_id", "pi_id=" + pi_id);
  371. if (ve_id != null)
  372. {
  373. return ve_id.ToString();
  374. }
  375. else {
  376. return "0";
  377. }
  378. }
  379. private void ValueTransform() {
  380. switch (pr_tracekind.Text) {
  381. case "":
  382. pr_tracekind.Text = "不管控";
  383. break;
  384. case "0":
  385. pr_tracekind.Text = "不管控";
  386. break;
  387. case "1":
  388. pr_tracekind.Text = "单间管控";
  389. break;
  390. case "2":
  391. pr_tracekind.Text = "批量管控";
  392. break;
  393. }
  394. }
  395. private void CheckBeforeGenCode() {
  396. if (pr_tracekind.Text == "单件管控")
  397. {
  398. BaseUtil.ShowError("管控类型为单件管控时不允许生成条码");
  399. }
  400. if (pd_qty.Text != "")
  401. {
  402. if (!(int.Parse(pd_qty.Text) > 0) || !(int.Parse(pr_zxbzs.Text) > 0))
  403. {
  404. BaseUtil.ShowError("批总量,最小包装数必须大于0");
  405. }
  406. if (int.Parse(pd_qty.Text) > int.Parse(pd_inqty.Text))
  407. {
  408. BaseUtil.ShowError("批总量不允许大于来料总量!");
  409. }
  410. }
  411. else
  412. {
  413. BaseUtil.ShowError("请填写批总量!");
  414. }
  415. //判断是否已经入库,状态为99表示已经入库
  416. if (dh.getFieldDataByCondition("prodiodetail", "pd_status", "pd_id=" + PD_ID).ToString().Equals("99"))
  417. {
  418. BaseUtil.ShowError("该批次已入库,不允许生成条码");
  419. }
  420. object checknum = dh.getFieldDataByCondition("barcodeio", "sum(bi_inqty)", "bi_pdid=" + PD_ID);
  421. if (checknum != null && checknum.ToString() != "")
  422. {
  423. if (int.Parse(pd_qty.Text) > int.Parse(pd_inqty.Text) - int.Parse(checknum.ToString()))
  424. {
  425. BaseUtil.ShowError("批总量不能大于未生成条码数");
  426. }
  427. }
  428. }
  429. private void LoadData() {
  430. dataGridView1.DataSource = dh.GetConfigureData("ProdInOut!BarcodeIn", "detailgrid", "bi_pdid=" + PD_ID);
  431. }
  432. private void NumOnly()
  433. {
  434. bi_boxnum.KeyPress += BaseUtil.NumOnly;
  435. pr_zxbzs.KeyPress += BaseUtil.NumOnly;
  436. pd_qty.KeyPress += BaseUtil.NumOnly;
  437. }
  438. }
  439. }