//打印条码 protected void btnPrintBarcode_Click(object sender, EventArgs e) { foreach (int rowIndex in GridOrders.SelectedRowIndexArray) { GridRow row = GridOrders.Rows[rowIndex]; if (!(row.Values[5].Contains("已登记") || row.Values[5].Contains("条码已打印"))) { MessageBoxShow(string.Format("条码号:{0} 姓名:{1} 已打印过条码,条码补打模块可补打条码", row.Values[0], row.Values[1])); return; } } SetInitlocalsetting(hdMac.Text);//设置打印所需的客户端配置信息 string ordernums = GetSelectOrderNums(false); if (ordernums == string.Empty) { return; } DataTable dtSource = new OrderbarcodeService().GetPrintBarcodeData(new Hashtable() { { "ordernum", ordernums }, { "orderbarcode", null } }); for (int i = 0; i < dtSource.Rows.Count; i++) { string testnames = dtSource.Rows[i]["TESTNAMES"].ToString(); dtSource.Rows[i]["AGE"] = WebUI.GetAge(dtSource.Rows[i]["AGE"]);//处理年龄 dtSource.Rows[i]["COLLECTDATE"] = dtSource.Rows[i]["COLLECTDATE"].ToString(); dtSource.Rows[i]["TESTNAMES"] = testnames.TrimEnd(','); dtSource.Rows[i]["COUNT"] = String.Format("共{0}项", testnames.TrimEnd(',').Split(',').Length); } //修改订单状态为[条码已打印](已登记的才改) new OrdersService().EditStatusByOldStatus(new Hashtable() { { "ordernum", ordernums }, { "status", (int)ParamStatus.OrdersStatus.BarCodePrint }, { "oldstatus", (int)ParamStatus.OrdersStatus.Register }, }); //后续调用柯木朗方法打印 //.......................... commonReport.PrintBarCode(dtSource, Userinfo); ExtAspNet.PageContext.RegisterStartupScript(string.Format(" PrintBarCode(\'{0}\',\'{1}\');", CommonReport.printer, CommonReport.json)); //记录日志 JournalLog(ordernums, "打印条码"); }
//打印条码 protected void btnPrint_Click(object sender, EventArgs e) { SetInitlocalsetting(hdMac.Text);//设置打印所需的客户端配置信息 string ordernum = ""; string orderbarcodes = GetSelectBarcode(ref ordernum); if (orderbarcodes == string.Empty) { return; } DataTable dtSource = barcodeservice.GetPrintBarcodeData(new Hashtable() { { "ordernum", null }, { "orderbarcode", orderbarcodes } }); for (int i = 0; i < dtSource.Rows.Count; i++) { string testnames = dtSource.Rows[i]["TESTNAMES"].ToString(); dtSource.Rows[i]["AGE"] = WebUI.GetAge(dtSource.Rows[i]["AGE"]);//处理年龄 dtSource.Rows[i]["COLLECTDATE"] = dtSource.Rows[i]["COLLECTDATE"].ToString(); dtSource.Rows[i]["TESTNAMES"] = testnames.TrimEnd(','); dtSource.Rows[i]["COUNT"] = "共" + testnames.TrimEnd(',').Split(',').Length + "项"; } //修改订单状态为[条码已打印](已登记的才改) new OrdersService().EditStatusByOldStatus(new Hashtable() { { "ordernum", ordernum }, { "status", (int)ParamStatus.OrdersStatus.BarCodePrint }, { "oldstatus", (int)ParamStatus.OrdersStatus.Register }, }); //后续调用柯木朗方法打印 //.......................... commonReport.PrintBarCode(dtSource, Userinfo); ExtAspNet.PageContext.RegisterStartupScript(string.Format(" PrintBarCode(\'{0}\',\'{1}\');", CommonReport.printer, CommonReport.json)); //记录日志 JournalLog(ordernum, orderbarcodes, "条码补打"); }