private PrintResult Print(PrintConfigData printConfigData, Tbl_Scenic tbl_Scenic, Tbl_OrderDetail tbl_OrderDetail) { tbl_OrderDetail.UsedQuantity = tbl_OrderDetail.Quantity; tbl_OrderDetail.PrintCount++; if (tbl_OrderDetail.OrderStatus == (int)OrderDetailsDataStatus.Activate) { tbl_OrderDetail.OrderStatus = (int)OrderDetailsDataStatus.IsTaken; } _orderDetailService.Update(tbl_OrderDetail); var userInfo = _enterpriseUserService.LoginForSession(); var printOrderData = new PrintOrderData { OrderNo = tbl_OrderDetail.OrderNo, TicketName = tbl_OrderDetail.TicketName, Qunatity = tbl_OrderDetail.Quantity, Price = tbl_OrderDetail.Price, TotalAmount = tbl_OrderDetail.Quantity * tbl_OrderDetail.Price, CertificateNo = tbl_OrderDetail.CertificateNO, QRcode = SecurityExtension.DesEncrypt(tbl_OrderDetail.QRcode, DesKey.QrCodeKey), CreateTime = tbl_OrderDetail.ValidityDateStart.ToString("yyyy-MM-dd"), PrintCount = tbl_OrderDetail.PrintCount, RealName = userInfo.RealName, UserName = userInfo.UserName }; if (tbl_Scenic != null) { printOrderData.ScenicName = tbl_Scenic.ScenicName; printOrderData.ScenicPhone = tbl_Scenic.Tel; } return(_printGateway.Send(printOrderData, printConfigData)); }
private static string GetOrderContext(PrintOrderData data) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("<center>{0}{1}</center>", data.ScenicName, data.PrintCount > 1 ? "(补打)" : ""); sb.Append("................................\r\n"); sb.AppendFormat("\r\n收银员: {0} 牌号:{1}\r\n", data.RealName, data.UserName); sb.AppendFormat("\r\n下单时间: {0}\r\n", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); sb.AppendFormat("\r\n门票名称: {0}\r\n", data.TicketName); sb.AppendFormat("\r\n入园时间: {0}\r\n", data.CreateTime); //sb.AppendFormat("\r\n数量: {0}\r\n", data.Qunatity); //sb.AppendFormat("\r\n单价: {0}\r\n", data.Price); //sb.AppendFormat("\r\n总价: {0}\r\n", data.TotalAmount); sb.Append("................................\r\n"); sb.Append("<table>"); sb.Append("<tr><td>数量</td><td>单价</td><td>总价</td></tr>"); sb.AppendFormat("<tr><td>{0}人</td><td>{1}元</td><td>{2}元</td></tr>", data.Qunatity, data.Price, data.TotalAmount); sb.Append("</table>"); sb.Append("................................\r\n\r\n"); sb.AppendFormat("<QR>{0}</QR>", data.QRcode); sb.AppendFormat("\r\n凭证号: {0}\r\n", data.CertificateNo); sb.AppendFormat("\r\n订单号: {0}\r\n", data.OrderNo); sb.AppendFormat("\r\n注意事项: \r\n\r\n{0}\r\n", PrintManager.Considerations); sb.Append("\r\n<FB>请持票到景区入园处扫码入园</FB>\r\n"); sb.AppendFormat("\r\n如需协助请拨打: {0}\r\n", data.ScenicPhone); return(sb.ToString()); }
public static void Send(PrintOrderData data, List <PrintConfigData> list) { var text = GetOrderContext(data); foreach (var row in list) { Send(text, row); } }
public PrintResult Send(PrintOrderData data, PrintConfigData configData) { return(PrintHelper.Send(data, configData)); }
public static PrintResult Send(PrintOrderData data, PrintConfigData configData) { var text = GetOrderContext(data); return(Send(text, configData)); }