private void PrintLabel(string docno) { try { lpt.Open(); string sql = "select box_label_uni" + " from pacsd_pm_box_gen " + " where doc_no ='" + docno + "' " + " and fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' " + " order by box_label_uni desc"; DataTable dtResult = OracleHelper.ExecuteDataTable(sql); DataView dvTree = new DataView(dtResult); if (dtResult.Rows.Count > 0) { foreach (DataRowView dr in dvTree) { lpt.Write(SetCmdText(dr[0].ToString())); } } lpt.Close(); } catch (Exception PrintLabel) { XtraMessageBox.Show(this, "System error[PrintLabel]: " + PrintLabel.Message); } }
public void Print() { string tmp = string.Empty; string[] tmpArray; string port = this.txtHotPort.Text.Trim(); for (int i = 0; i < config.Commands.Count; i++) { WindowFormDelegate.SetMainThreadHint(this.lbPrintHint, string.Format("正执行第{0}条命令", i)); //Thread.Sleep(500); tmp = config.Commands[i]; if (tmp.IndexOf("|") != -1) { tmpArray = tmp.Trim().Split('|'); if (tmpArray.Length > 0) { tmp = string.Empty; for (int j = 0; j < tmpArray.Length; j++) { tmp += (char)Convert.ToInt32(tmpArray[j]); } } } if (port.StartsWith("lpt")) { helper.Write(tmp); } else { helper2.Write(tmp); } } }