public bool SendInvoice(bool closed, bool print) { smartRestaurant.CheckBillService.CheckBillService service = new smartRestaurant.CheckBillService.CheckBillService(); Invoice invoice = this.CreateInvoice(); if (!closed) { invoice.totalReceive = 0.0; } string s = service.SendInvoice(invoice); try { this.invoiceID = int.Parse(s); } catch (Exception) { MessageBox.Show(s); return true; } if (!closed && (this.invoiceID == -1)) { return false; } if (print) { smartRestaurant.OrderService.OrderService service2 = new smartRestaurant.OrderService.OrderService(); if (closed) { service2.PrintBill(invoice.orderBillID); } else { service2.PrintReceipt(invoice.orderBillID); } } if (this.invoiceID == -1) { return false; } return true; }
public static void PrintReceiptAll(OrderInformation orderInfo) { smartRestaurant.OrderService.OrderService service = new smartRestaurant.OrderService.OrderService(); for (int i = 0; i < orderInfo.Bills.Length; i++) { if (((orderInfo.Bills[i].Items != null) && (orderInfo.Bills[i].Items.Length > 0)) && (orderInfo.Bills[i].CloseBillDate == AppParameter.MinDateTime)) { service.PrintReceipt(orderInfo.Bills[i].OrderBillID); } } }