UIL010020.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.IO;
  10. using System.Windows.Forms;
  11. using CoreFS.CA06;
  12. using PrintSolution.LabelPrinter;
  13. using INI;
  14. using Infragistics.Win.UltraWinGrid;
  15. using System.Reflection;
  16. namespace Core.LZMes.Client.UIL.UIL01
  17. {
  18. public partial class UIL010020 : FrmBase
  19. {
  20. private ZebraPrinter printer = new ZebraPrinter();
  21. private string iniVersions = "2"; //初始化从配置文件中加载的打印版本号
  22. public UIL010020()
  23. {
  24. InitializeComponent();
  25. }
  26. public override void ToolBar_Click(object sender, string ToolbarKey)
  27. {
  28. switch (ToolbarKey)
  29. {
  30. case "Query":
  31. this.DoQuery();
  32. break;
  33. case "Export":
  34. this.DoExport();
  35. break;
  36. case "Print":
  37. this.DoPrint();
  38. break;
  39. case "Save":
  40. this.DoSave();
  41. break;
  42. case "Exit":
  43. this.Close();
  44. break;
  45. }
  46. }
  47. /// <summary>
  48. /// 查询原料库库存数据
  49. /// </summary>
  50. private void DoQuery()
  51. {
  52. try
  53. {
  54. switch (CustomInfo)
  55. {
  56. case "1":
  57. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CHK_Y"].Hidden = true;
  58. break;
  59. case "2":
  60. break;
  61. case "3":
  62. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CHK_Y"].Hidden = true;
  63. break;
  64. }
  65. this.dataSet1.Tables[0].Clear();
  66. string startTime = this.ultraDateTimeEditor1.Value != null ? this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";//生产开始时间
  67. string endTime = this.ultraDateTimeEditor2.Value != null ? this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";//生产结束时间
  68. string coilWthMin = this.textBox4.Text;//宽度最小值
  69. string coilWthMax = this.textBox5.Text;//宽度最大值
  70. string coilThkMin = this.textBox6.Text;//厚度最小值
  71. string coilThkMax = this.textBox7.Text;//厚度最大值
  72. string coilNo = this.textBox9.Text;//钢卷号
  73. string ordNo = this.textBox11.Text;//合同号
  74. string ordSeq = this.textBox3.Text;//订单号
  75. ArrayList list = new ArrayList();
  76. list.Add(startTime);
  77. list.Add(endTime);
  78. list.Add(coilThkMin);
  79. list.Add(coilThkMax);
  80. list.Add(coilWthMin);
  81. list.Add(coilWthMax);
  82. list.Add(ordNo);
  83. list.Add(ordSeq);
  84. list.Add(coilNo);
  85. list.Add(CustomInfo);
  86. CoreClientParam ccp = new CoreClientParam();
  87. ccp.ServerName = "UIL.UIL01.UIL010020";
  88. ccp.MethodName = "queryCoilList";
  89. ccp.ServerParams = new object[] { list };
  90. ccp.SourceDataTable = this.dataSet1.Tables[0];
  91. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  92. //打印标签后颜色区分 20131017
  93. //DataRowCollection drs = dataSet1.Tables[0].Rows; 存在漏洞不是每行都能选中!!!!!!
  94. Infragistics.Win.UltraWinGrid.RowsCollection drs = this.ultraGrid1.Rows;
  95. for (int i = 0; i < drs.Count; i++)
  96. {
  97. if (drs[i].Cells["PRINT_TP"].Value.ToString().Trim().Equals("Y".ToString()))
  98. {
  99. ultraGrid1.Rows[i].Appearance.BackColor = Color.FromArgb(192, 255, 192);
  100. }
  101. }
  102. //打印标签后颜色区分 20131017
  103. }
  104. catch (Exception EX)
  105. {
  106. MessageBox.Show(EX.ToString());
  107. }
  108. }
  109. private void DoSave() {
  110. try {
  111. string coilNo = string.Empty;
  112. string prog = string.Empty;
  113. switch (CustomInfo)
  114. {
  115. case "2":
  116. Hashtable paramHsmp = new Hashtable();
  117. this.ultraGrid1.UpdateData();
  118. string regID = this.UserInfo.GetUserID();
  119. if (regID == "")
  120. {
  121. System.Windows.Forms.MessageBox.Show("!");
  122. return;
  123. }
  124. Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
  125. if (rs.Count > 0)
  126. {
  127. for (int i = 0; i < rs.Count; i++)
  128. {
  129. if (rs[i].Cells["CHK_Y"].Text.Trim() == "FALSE")
  130. {
  131. continue;
  132. }
  133. //else if (rs[i].Cells["CUR_PROG_CD"].Text.Trim() != "")
  134. //{
  135. // continue;
  136. //}
  137. else
  138. {
  139. paramHsmp = new Hashtable();
  140. coilNo = rs[i].Cells["COIL_NO"].Text.Trim();
  141. if (rs[i].Cells["CUR_PROG_CD"].Text.Trim().Equals("综合判定待机")) {
  142. prog="DED";
  143. }
  144. else if (rs[i].Cells["CUR_PROG_CD"].Text.Trim().Equals("重卷指示待机"))
  145. {
  146. prog = "DBA";
  147. }
  148. paramHsmp.Add("i1", coilNo);
  149. paramHsmp.Add("i2", prog);
  150. paramHsmp.Add("i3", regID);
  151. paramHsmp.Add("o4", "");
  152. CoreClientParam ccp = new CoreClientParam();
  153. ccp.ServerName = "UIB.COM.ComDBProcedure";
  154. ccp.MethodName = "doXmlProcedure";
  155. ccp.ServerParams = new Object[] { "UIL010020_01_CALL.CALL", paramHsmp };
  156. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  157. //提示
  158. ArrayList all = ccp.ReturnObject as ArrayList;
  159. if (all[0].ToString() != "YY")//确认是否存在问题
  160. {
  161. MessageBox.Show(all[0].ToString(), "提示");
  162. return;
  163. }
  164. }
  165. }
  166. }
  167. this.DoQuery();
  168. break;
  169. }
  170. }
  171. catch (Exception Ey)
  172. {
  173. MessageBox.Show(Ey.ToString());
  174. }
  175. }
  176. private void DoExport()
  177. {
  178. try
  179. {
  180. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  181. {
  182. string fileName = this.saveFileDialog1.FileName;
  183. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  184. System.Diagnostics.Process.Start(fileName);
  185. }
  186. }
  187. catch (Exception EX)
  188. {
  189. MessageBox.Show(EX.ToString());
  190. }
  191. }
  192. private void DoPrint()
  193. {
  194. //酸轧功能条上的标签打印功能
  195. if (CustomInfo == "1")
  196. {
  197. //若目前打印版本为3则改成配置文件版本号
  198. if (3 == printer.LableVersion)
  199. printer.LableVersion = int.Parse(iniVersions);
  200. printComFunc();
  201. }
  202. else //连退、重卷功能条上的打印功能
  203. {
  204. printLTCOM();
  205. }
  206. }
  207. // 公共打印调用方法
  208. private void printComFunc()
  209. {
  210. try
  211. {
  212. ultraGrid1.UpdateData();
  213. //----20131018
  214. Hashtable param = new Hashtable();
  215. string line = string.Empty;
  216. string printid = this.UserInfo.GetUserID();
  217. string flag = string.Empty;
  218. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in ultraGrid1.Rows)
  219. {
  220. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  221. {
  222. //----20131018
  223. param = new Hashtable();
  224. ColdCoilLable coilLabel = new ColdCoilLable();
  225. coilLabel.rollNo = string.Empty;
  226. coilLabel.specification = row.Cells["SPEC_ABBSYM"].Value.ToString();
  227. coilLabel.steelGrade = string.Empty;
  228. //if(Convert.ToBoolean(row.Cells["CHK_SIZE"].Value)){
  229. //coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  230. //}else{
  231. //coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  232. //}
  233. coilLabel.dimension = string.Empty;
  234. coilLabel.coilNo = row.Cells["COIL_NO"].Value.ToString();
  235. coilLabel.weight = row.Cells["ACT_WGT"].Value.ToString();
  236. coilLabel.heatNo = row.Cells["HEAT_NO"].Value.ToString();
  237. coilLabel.prodDate = row.Cells["MILL_DTIME"].Value.ToString();
  238. coilLabel.contractNo = string.Empty;
  239. coilLabel.licenseNo = string.Empty;
  240. coilLabel.licenseMark = string.Empty;
  241. coilLabel.checker = string.Empty;
  242. coilLabel.barcode = coilLabel.coilNo;
  243. if (row.Cells["PRINT_TP"].Text == "Y")
  244. {
  245. if (MessageBox.Show(row.Cells["COIL_NO"].Value.ToString() + "已打印,需要再次打印?",
  246. "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  247. {
  248. switch (CustomInfo)
  249. {
  250. case "1":
  251. if (Convert.ToBoolean(row.Cells["CHK_SIZE"].Value))
  252. {
  253. coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  254. }
  255. else
  256. {
  257. coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  258. }
  259. coilLabel.steelGrade = row.Cells["SPEC_STL_GRD"].Value.ToString();
  260. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  261. //coilLabel.contractNo = row.Cells["ORD_NO"].Value.ToString() + "-" + row.Cells["ORD_SEQ"].Value.ToString();
  262. // coilLabel.contractNo = string.Empty;
  263. line = "S";
  264. flag = "A";
  265. break;
  266. case "2":
  267. //printer.printLable(coilLabel);
  268. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  269. line = "L";
  270. flag = "B";
  271. break;
  272. case "3":
  273. //coilLabel.dimension = string.Empty;
  274. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  275. line = "C";
  276. flag = "D";
  277. break;
  278. }
  279. string coilno = row.Cells["COIL_NO"].Value.ToString();
  280. printer.printLable(coilLabel);
  281. UpdateColor(coilno, flag);
  282. //----20131018
  283. param.Add("i1", line);
  284. param.Add("i2", coilno);
  285. param.Add("i3", printid);
  286. param.Add("i4", "标签打印");
  287. param.Add("i5", "UIL010020");
  288. param.Add("i6", "打印后");
  289. param.Add("o7", "");
  290. PrintHistory(param);
  291. }
  292. }
  293. else if (row.Cells["PRINT_TP"].Text == "N")
  294. {
  295. switch (CustomInfo)
  296. {
  297. case "1":
  298. if (Convert.ToBoolean(row.Cells["CHK_SIZE"].Value))
  299. {
  300. coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  301. }
  302. else
  303. {
  304. coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  305. }
  306. coilLabel.steelGrade = row.Cells["SPEC_STL_GRD"].Value.ToString();
  307. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  308. //coilLabel.contractNo = row.Cells["ORD_NO"].Value.ToString() + "-" + row.Cells["ORD_SEQ"].Value.ToString();
  309. //coilLabel.contractNo = string.Empty;
  310. line = "S";
  311. flag = "A";
  312. break;
  313. case "2":
  314. //printer.printLable(coilLabel);
  315. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  316. line = "L";
  317. flag = "B";
  318. break;
  319. case "3":
  320. // coilLabel.dimension = string.Empty;
  321. coilLabel.labelHeadName = "FULL HARD COIL OF XINSTEEL";
  322. line = "C";
  323. flag = "D";
  324. break;
  325. }
  326. string coilno = row.Cells["COIL_NO"].Value.ToString();
  327. printer.printLable(coilLabel);
  328. UpdateColor(coilno, flag);
  329. //----20131018
  330. param.Add("i1", line);
  331. param.Add("i2", coilno);
  332. param.Add("i3", printid);
  333. param.Add("i4", "标签打印");
  334. param.Add("i5", "UIL010020");
  335. param.Add("i6", "打印后");
  336. param.Add("o7", "");
  337. PrintHistory(param);
  338. }
  339. }
  340. }
  341. this.DoQuery();
  342. }
  343. catch (Exception EX)
  344. {
  345. MessageBox.Show("打印异常:连接打印机失败,请点击\"打印\"按钮重新打印!");
  346. }
  347. }
  348. private void UpdateColor(string coilno,string flag) {
  349. CoreClientParam ccp1 = new CoreClientParam();
  350. ccp1.ServerName = "UIL.UIL01.UIL010020";
  351. ccp1.MethodName = "dateColor";
  352. ccp1.ServerParams = new object[] { coilno ,flag};
  353. ccp1.SourceDataTable = this.dataSet1.Tables[0];
  354. this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
  355. }
  356. //标签打印记录增加
  357. private void PrintHistory(Hashtable param)
  358. {
  359. CoreClientParam ccp4 = new CoreClientParam();
  360. ccp4.ServerName = "UIB.COM.ComDBProcedure";
  361. ccp4.MethodName = "doXmlProcedure";
  362. ccp4.ServerParams = new Object[] { "UIL010020_02_CALL.CALL", param };
  363. this.ExecuteNonQuery(ccp4, CoreInvokeType.Internal);
  364. //提示
  365. ArrayList all = ccp4.ReturnObject as ArrayList;
  366. if (all[0].ToString() != "YY")//确认是否存在问题
  367. {
  368. MessageBox.Show(all[0].ToString(), "提示");
  369. return;
  370. }
  371. }
  372. //初始化加载版本号,打印ip地址
  373. private void UIL010020_Load(object sender, EventArgs e)
  374. {
  375. try
  376. {
  377. string Current = Directory.GetCurrentDirectory();//获取当前根目录
  378. Ini ini = new Ini(Current + "/CoreFS.ini");
  379. // 读取ini
  380. string labPrinterAddr = ini.ReadValue("LABPRINTERADDR", CustomInfo);
  381. //if (labPrinterAddr == "") labPrinterAddr = "172.16.50.207";
  382. printer.Addr = labPrinterAddr;
  383. iniVersions = ini.ReadValue("LABPRINTERADDR", "Version");
  384. printer.LableVersion = int.Parse(iniVersions);
  385. //MessageBox.Show(labPrinterAddr);
  386. if (CustomInfo == "1")
  387. {
  388. liantuiPrint_button.Visible = false;
  389. }
  390. }
  391. catch (Exception ej)
  392. {
  393. System.Diagnostics.Debug.WriteLine(ej.ToString());
  394. }
  395. }
  396. private void ultraButton1_Click(object sender, EventArgs e)
  397. {
  398. try
  399. {
  400. string directoryPath = "C:\\Temp\\ZBS\\";
  401. int indexFlag = 0;
  402. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  403. {
  404. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
  405. {
  406. indexFlag++;
  407. CoreClientParam ccp = new CoreClientParam();
  408. ccp.ServerName = "UIB.UIB03.TestPrint";
  409. ccp.MethodName = "print";
  410. ccp.ServerParams = new object[] { "G00001", ugr.Cells["COIL_NO"].Text };
  411. CoreClientParam cx = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  412. byte[] byData = (byte[])cx.ReturnObject;
  413. System.DateTime dt = System.DateTime.Now;
  414. string TimeNow = string.Format("{0:yyyyMMddHHmmssffff}", dt);
  415. string sFile = directoryPath + "ABC" + ".xls";
  416. FileStream fs = new FileStream(sFile, FileMode.OpenOrCreate, FileAccess.Write);
  417. fs.Write(byData, 0, byData.Length);
  418. fs.Close();
  419. Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
  420. Microsoft.Office.Interop.Excel.Workbook workbook = app.Application.Workbooks.Add(sFile);
  421. Microsoft.Office.Interop.Excel._Worksheet ws = (Microsoft.Office.Interop.Excel._Worksheet)workbook.Worksheets[1];
  422. ws.PrintOut(1, 1, 1, false, Missing.Value, false, false, Missing.Value);//"HP LaserJet P1505"
  423. workbook.Saved = true;
  424. workbook.Close(Missing.Value, Missing.Value, Missing.Value);
  425. app.Quit();
  426. System.Runtime.InteropServices.Marshal.ReleaseComObject(ws);
  427. System.Runtime.InteropServices.Marshal.ReleaseComObject(app);
  428. app = null;
  429. GC.Collect();
  430. }
  431. }
  432. }
  433. catch (Exception ex)
  434. {
  435. System.Diagnostics.Debug.WriteLine(ex.ToString());
  436. }
  437. }
  438. //酸轧标签打印第三个版本,纸张纵向,数据横向
  439. private void ultraButton_print3_Click(object sender, EventArgs e)
  440. {
  441. printer.LableVersion = 3;
  442. printComFunc();
  443. }
  444. //连退标签打印功能
  445. private void liantuiPrint_button_Click(object sender, EventArgs e)
  446. {
  447. printLTCOM();
  448. }
  449. //连退标签打印功能
  450. private void printLTCOM()
  451. {
  452. printer.LableVersion = 3;
  453. try
  454. {
  455. ultraGrid1.UpdateData();
  456. //----20131018
  457. Hashtable param = new Hashtable();
  458. string line = string.Empty;
  459. string printid = this.UserInfo.GetUserID();
  460. string flag = string.Empty;
  461. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in ultraGrid1.Rows)
  462. {
  463. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  464. {
  465. //----20131018
  466. param = new Hashtable();
  467. ColdCoilLable coilLabel = new ColdCoilLable();
  468. coilLabel.rollNo = string.Empty;
  469. coilLabel.specification = row.Cells["SPEC_ABBSYM"].Value.ToString();
  470. coilLabel.steelGrade = string.Empty;
  471. //if(Convert.ToBoolean(row.Cells["CHK_SIZE"].Value)){
  472. //coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  473. //}else{
  474. //coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  475. //}
  476. coilLabel.dimension = string.Empty;
  477. coilLabel.coilNo = row.Cells["COIL_NO"].Value.ToString();
  478. coilLabel.weight = row.Cells["ACT_WGT"].Value.ToString();
  479. coilLabel.heatNo = row.Cells["HEAT_NO"].Value.ToString();
  480. coilLabel.prodDate = row.Cells["MILL_DTIME"].Value.ToString();
  481. coilLabel.contractNo = string.Empty;
  482. coilLabel.licenseNo = string.Empty;
  483. coilLabel.licenseMark = string.Empty;
  484. coilLabel.checker = string.Empty;
  485. coilLabel.barcode = coilLabel.coilNo;
  486. if (row.Cells["PRINT_TP"].Text == "Y")
  487. {
  488. if (MessageBox.Show(row.Cells["COIL_NO"].Value.ToString() + "已打印,需要再次打印?",
  489. "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
  490. {
  491. switch (CustomInfo)
  492. {
  493. case "1":
  494. if (Convert.ToBoolean(row.Cells["CHK_SIZE"].Value))
  495. {
  496. coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  497. }
  498. else
  499. {
  500. coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  501. }
  502. coilLabel.steelGrade = row.Cells["SPEC_STL_GRD"].Value.ToString();
  503. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  504. //coilLabel.contractNo = row.Cells["ORD_NO"].Value.ToString() + "-" + row.Cells["ORD_SEQ"].Value.ToString();
  505. // coilLabel.contractNo = string.Empty;
  506. line = "S";
  507. flag = "A";
  508. break;
  509. case "2":
  510. //printer.printLable(coilLabel);
  511. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  512. line = "L";
  513. flag = "B";
  514. break;
  515. case "3":
  516. //coilLabel.dimension = string.Empty;
  517. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  518. line = "C";
  519. flag = "D";
  520. break;
  521. }
  522. string coilno = row.Cells["COIL_NO"].Value.ToString();
  523. printer.printLable(coilLabel);
  524. UpdateColor(coilno, flag);
  525. //----20131018
  526. param.Add("i1", line);
  527. param.Add("i2", coilno);
  528. param.Add("i3", printid);
  529. param.Add("i4", "标签打印");
  530. param.Add("i5", "UIL010020");
  531. param.Add("i6", "打印后");
  532. param.Add("o7", "");
  533. PrintHistory(param);
  534. }
  535. }
  536. else if (row.Cells["PRINT_TP"].Text == "N")
  537. {
  538. switch (CustomInfo)
  539. {
  540. case "1":
  541. if (Convert.ToBoolean(row.Cells["CHK_SIZE"].Value))
  542. {
  543. coilLabel.dimension = row.Cells["COIL_SIZE"].Value.ToString();
  544. }
  545. else
  546. {
  547. coilLabel.dimension = row.Cells["ORD_SIZE"].Value.ToString();
  548. }
  549. coilLabel.steelGrade = row.Cells["SPEC_STL_GRD"].Value.ToString();
  550. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  551. //coilLabel.contractNo = row.Cells["ORD_NO"].Value.ToString() + "-" + row.Cells["ORD_SEQ"].Value.ToString();
  552. //coilLabel.contractNo = string.Empty;
  553. line = "S";
  554. flag = "A";
  555. break;
  556. case "2":
  557. //printer.printLable(coilLabel);
  558. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  559. line = "L";
  560. flag = "B";
  561. break;
  562. case "3":
  563. // coilLabel.dimension = string.Empty;
  564. coilLabel.labelHeadName = "ANNEALED COIL OF XINSTEEL";
  565. line = "C";
  566. flag = "D";
  567. break;
  568. }
  569. string coilno = row.Cells["COIL_NO"].Value.ToString();
  570. printer.printLable(coilLabel);
  571. UpdateColor(coilno, flag);
  572. //----20131018
  573. param.Add("i1", line);
  574. param.Add("i2", coilno);
  575. param.Add("i3", printid);
  576. param.Add("i4", "标签打印");
  577. param.Add("i5", "UIL010020");
  578. param.Add("i6", "打印后");
  579. param.Add("o7", "");
  580. PrintHistory(param);
  581. }
  582. }
  583. }
  584. this.DoQuery();
  585. }
  586. catch (Exception EX)
  587. {
  588. MessageBox.Show("打印异常:连接打印机失败,请点击\"打印\"按钮重新打印!");
  589. }
  590. }
  591. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  592. {
  593. if (this.ultraCheckEditor1.Checked == true)
  594. {
  595. this.liantuiPrint_button.Enabled = true;
  596. this.ultraButton_print3.Enabled = true;
  597. }
  598. if (this.ultraCheckEditor1.Checked == false)
  599. {
  600. this.liantuiPrint_button.Enabled = false;
  601. this.ultraButton_print3.Enabled = false;
  602. }
  603. }
  604. }
  605. }