private void btnPayMent_Click(object sender, EventArgs e) { //flags = WinAPI.AW_ACTIVATE | WinAPI.AW_HOR_POSITIVE; try { if (OrderMain.Status == 1) OrderCompleted(); else { if (OrderMain.ListOrderDetail.Count > 0) { frmse.BindOrder(OrderMain); frmPayMent frm = new frmPayMent(OrderMain, 1000, 131073); if (frmOpacity.ShowDialog(this, frm) == System.Windows.Forms.DialogResult.OK) { GetListPaymentPrinter(); int result = 0; OrderMain = frm.OrderMain; OrderMain.PrintType = 2; result = InvoiceService.InsertInvoice(OrderMain); if (result == 1) { if (OrderMain.isNoPrintBill == 1) { if (OrderMain.isTKA == 1) { this.Close(); frmTakeAway frmTKA = new frmTakeAway(); frmTKA.Show(); } else { CallBackStatusOrderCancel(); this.Close(); } } else { PrinterServer printServer = new PrinterServer(); printServer.PrintData(OrderMain, PrintData); if (OrderMain.isTKA == 1) { this.Close(); frmTakeAway frmTKA = new frmTakeAway(); frmTKA.Show(); } else { frmse.fullScreen(); CallBackStatusOrderCancel(); this.Close(); } } foreach(PrinterModel item in PrintData) { if (item.PrinterType == 4) Class.RawPrinterHelper.openCashDrawer(item.PrinterName); } } } } else { frmMessager frm = new frmMessager("PayMent", "Order empty"); frmOpacity.ShowDialog(this, frm); } } } catch (Exception ex) { LogPOS.WriteLog("frmOrder:::::::::::::::::::::::btnPayMent_Click::::::::::::::::;" + ex.Message); } }
private void btnReprint_Click(object sender, EventArgs e) { GetListPrinter(); if (OrderMain.isPrevOrder == 1) OrderCompleted(); else { OrderMain.PrintType = 1; OrderMain.IsPrePrint = true; OrderMain.IsLoadFromData = false; if (OrderMain.ListOrderDetail.Count > 0) { PrinterServer printServer = new PrinterServer(); printServer.PrintData(OrderMain, PrintData); } else { frmMessager frm = new frmMessager("Print Bill", "Order is empty"); frmOpacity.ShowDialog(this, frm); } } }
private void btnSendOrder_Click(object sender, EventArgs e) { try { if (OrderMain.isPrevOrder==1) { OrderCompleted(); } else { GetListPrinter(); if (OrderMain.Status == PRINTBILL) { OrderCompleted(); } else { if (OrderMain.ListOrderDetail.Count > 0) { int result = 0; OrderMain.PrintType = 1; result = OrderService.InsertOrder(OrderMain); if (result == 1) { PrinterServer printServer = new PrinterServer(); printServer.PrintData(OrderMain, PrintData); if (OrderMain.isTKA == 1) { frmTakeAway frm = new frmTakeAway(); //CallBackStatusOrderTKA(OrderMain); //frm.Show(); this.Close(); } else { //CallBackStatusOrder(OrderMain); CallBackStatusOrderCancel(); this.Close(); } } } } } } catch (Exception ex) { LogPOS.WriteLog("btnSendOrder_Click::::::::::::::::::::::::::::::::::::::::::" + ex.Message); } }
private void btnPrintBill_Click(object sender, EventArgs e) { GetListPaymentPrinter(); if (OrderMain.isPrevOrder == 1) { OrderMain.PrintType = 2; PrinterServer print = new PrinterServer(); print.PrintData(OrderMain, PrintData); } else { if (OrderMain.ListOrderDetail.Count > 0) { int result = OrderService.UpdateOrder(OrderMain); if (result == 1) { OrderMain.PrintType = 3; PrinterServer print = new PrinterServer(); print.PrintData(OrderMain, PrintData); CallBackStatusOrderCancel(); this.Close(); } } else { frmMessager frm = new frmMessager("Print Bill", "Order is empty"); frmOpacity.ShowDialog(this, frm); } } }