private void BtnPrintKitchen_Click(object sender, System.EventArgs e) { OrderService.OrderService service = new OrderService.OrderService(); string result; WaitingForm.Show("Print to Kitchen"); this.Enabled = false; if (!takeOutMode) { result = service.SendOrder(orderInfo, null); int orderID = 0; try { orderID = int.Parse(result); service.SetTableReference(orderID, tableIDList); } catch (Exception ex) { MessageBox.Show(ex.ToString()); orderID = 0; } } else result = service.SendOrder(orderInfo, FieldCustName.Text); this.Enabled = true; WaitingForm.HideForm(); try { orderInfo.OrderID = Int32.Parse(result); } catch (Exception) { MessageBox.Show(result); return; } ((MainForm)MdiParent).ShowMainMenuForm(); }
private void BtnPrintKitchen_Click(object sender, EventArgs e) { string str; smartRestaurant.OrderService.OrderService service = new smartRestaurant.OrderService.OrderService(); WaitingForm.Show("Print to Kitchen"); base.Enabled = false; if (!this.takeOutMode) { str = service.SendOrder(this.orderInfo, 0, null); int orderID = 0; try { orderID = int.Parse(str); service.SetTableReference(orderID, this.tableIDList); } catch (Exception exception) { MessageBox.Show(exception.ToString()); orderID = 0; } } else { str = service.SendOrder(this.orderInfo, this.takeOutCustID, this.FieldCustName.Text); } base.Enabled = true; WaitingForm.HideForm(); try { this.orderInfo.OrderID = int.Parse(str); } catch (Exception) { MessageBox.Show(str); return; } if (this.orderInfo.TableID > 0) { this.tabService.UpdateTableLockInuse(this.orderInfo.TableID, false); } ((MainForm) base.MdiParent).ShowMainMenuForm(); }
private void BtnCancel_Click(object sender, System.EventArgs e) { if (selectedTakeOut == null) { MessageBox.Show("Please select order first."); return; } // Get bill from database OrderService.OrderService service = new OrderService.OrderService(); OrderInformation orderInfo = service.GetOrderByOrderID(selectedTakeOut.OrderID); if (orderInfo == null) { MessageBox.Show("Can't load order information for this order."); return; } if (orderInfo.Bills == null || orderInfo.Bills.Length <= 0) { MessageBox.Show("No order item in this order."); return; } // Cancel Order OrderManagement.CancelOrder(orderInfo, employeeID); service.SendOrder(orderInfo, null); selectedTakeOut = null; UpdateTakeOutList(); UpdateOrderButton(); }
private void BtnCancel_Click(object sender, EventArgs e) { if (this.selectedTakeOut == null) { MessageForm.Show("Cancel", "Please select order first."); } else { smartRestaurant.OrderService.OrderService service = new smartRestaurant.OrderService.OrderService(); OrderInformation orderByOrderID = service.GetOrderByOrderID(this.selectedTakeOut.OrderID); if (orderByOrderID == null) { MessageBox.Show("Can't load order information for this order."); } else if ((orderByOrderID.Bills == null) || (orderByOrderID.Bills.Length <= 0)) { MessageBox.Show("No order item in this order."); } else if (OrderManagement.CancelOrder(orderByOrderID, this.employeeID)) { service.SendOrder(orderByOrderID, 0, null); this.selectedTakeOut = null; this.UpdateTakeOutList(); this.UpdateOrderButton(); } } }