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();
 }
 public override void UpdateForm()
 {
     selectedTakeOut = null;
     // Update Screen
     LblPageID.Text = "Employee ID:" + ((MainForm)MdiParent).UserID + " | STTO020";
     UpdateTakeOutList();
     if (FieldFName.Text == "")
         BtnCustList_Click(null, null);
     else
         BtnCustSearch_Click(null, null);
 }
 private void ListOrderQueue_ItemClick(object sender, smartRestaurant.Controls.ItemsListEventArgs e)
 {
     if (e.Item.Value is TakeOutInformation)
         selectedTakeOut = (TakeOutInformation)e.Item.Value;
     UpdateOrderButton();
 }
Exemple #4
0
 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();
         }
     }
 }
Exemple #5
0
 public override void UpdateForm()
 {
     if (AppParameter.DeliveryModeOnly)
     {
         this.BtnMain.Visible = false;
         this.BtnManager.Visible = ((MainForm) base.MdiParent).User.IsManager() || ((MainForm) base.MdiParent).User.IsAuditor();
         this.BtnExit.Visible = true;
     }
     else
     {
         this.BtnMain.Visible = true;
         this.BtnManager.Visible = false;
         this.BtnExit.Visible = false;
     }
     if (this.tableInfo == null)
     {
         smartRestaurant.TableService.TableService service = new smartRestaurant.TableService.TableService();
         TableInformation[] tableList = service.GetTableList();
         while (tableList == null)
         {
             if (MessageBox.Show("Can't load table information.", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Hand) == DialogResult.Cancel)
             {
                 ((MainForm) base.MdiParent).Exit();
             }
             else
             {
                 tableList = service.GetTableList();
             }
         }
         for (int i = 0; i < tableList.Length; i++)
         {
             if (tableList[i].TableID == 0)
             {
                 this.tableInfo = tableList[i];
                 break;
             }
         }
         if (this.tableInfo == null)
         {
             ((MainForm) base.MdiParent).Exit();
         }
     }
     this.selectedTakeOut = null;
     this.selectedRoad = null;
     this.roadIgnoreFlag = false;
     this.roadLstIgnoreFlag = false;
     this.LblPageID.Text = "Employee ID:" + ((MainForm) base.MdiParent).UserID + " | STTO020";
     this.UpdateTakeOutList();
     if (this.FieldFName.Text == "")
     {
         this.BtnCustList_Click(null, null);
     }
     else
     {
         this.BtnCustSearch_Click(null, null);
     }
     this.FieldPhone.Focus();
 }
Exemple #6
0
 private void ListOrderQueue_ItemClick(object sender, ItemsListEventArgs e)
 {
     if (e.Item.Value is TakeOutInformation)
     {
         this.selectedTakeOut = (TakeOutInformation) e.Item.Value;
     }
     this.UpdateOrderButton();
 }