/// <summary>
 /// Initial form when start take order.
 /// (Call this method from outside)
 /// </summary>
 public override void UpdateForm()
 {
     LoadMenus();
     // Check for reserve mode
     takeOutMode = (tableInfo.TableID == 0);
     OrderService.OrderService service = new OrderService.OrderService();
     if (!takeOrderResume)
     {
         // Load old table order information (Web Services)
         if (!takeOutMode)
         {
             orderInfo = service.GetOrder(tableInfo.TableID);
             if (orderInfo != null)
             {
                 if (tableInfo.TableID != orderInfo.TableID)
                 {
                     TableService.TableService tabService = new TableService.TableService();
                     tableInfo = tabService.GetTableInformation(orderInfo.TableID);
                 }
                 tableIDList = service.GetTableReference(orderInfo.OrderID);
             }
             else
                 tableIDList = null;
         }
         else if (takeOutOrderID > 0)
         {
             orderInfo = service.GetOrderByOrderID(takeOutOrderID);
             tableIDList = null;
         }
         else
         {
             orderInfo = null;
             tableIDList = null;
         }
         // Reset input
         isChanged = false;
     }
     else
     {
         if (!takeOutMode)
             orderInfo = service.GetOrder(tableInfo.TableID);
     }
     // Check exist order information
     if (orderInfo != null)
     {
         // Found (Edit order)
         guestNumber = orderInfo.NumberOfGuest;
         billNumber = orderInfo.Bills.Length;
     }
     else if (guestNumber <= 0)
     {
         // Not found (New order)
         guestNumber = billNumber = 1;
     }
     // Check Demo version
     if (AppParameter.IsDemo())
     {
         ListOrderItem.ItemWidth = 240;
         ListOrderCount.Left = 248;
         ListOrderItemBy.Visible = true;
         LblGuest.Text = "Guest";
     }
     else
     {
         ListOrderItem.ItemWidth = 280;
         ListOrderCount.Left = 288;
         ListOrderItemBy.Visible = false;
         LblGuest.Text = "Seat";
     }
     ListOrderCount.Left = ListOrderItem.Left + ListOrderItem.ItemWidth;
     // Clear Input
     selectedBill = null;
     selectedItem = null;
     selectedType = null;
     if (orderInfo != null && orderInfo.Bills != null)
     {
         for (int i = 0;i < orderInfo.Bills.Length;i++)
             if (orderInfo.Bills[i].CloseBillDate == DateTime.MinValue)
             {
                 selectedBill = orderInfo.Bills[i];
                 break;
             }
     }
     // Update screen
     LblPageID.Text = "Employee ID:" + ((MainForm)MdiParent).UserID + " | ";
     if (takeOutMode)
         LblPageID.Text += "STTO021";
     else
         LblPageID.Text += "STTO011";
     PanCustName.Visible = takeOutMode;
     BtnSearch.Visible = takeOutMode;
     OptionPad.AutoRefresh = false;
     OptionPad.Red = OptionPad.Green = OptionPad.Blue = 1;
     OptionPad.AutoRefresh = true;
     ListOrderItem.Reset();
     ListOrderCount.Reset();
     ListOrderItemBy.Reset();
     UpdateTableInformation();
     StartInputMenu();
 }
 public override void UpdateForm()
 {
     this.LoadMenus();
     this.takeOutMode = this.tableInfo.TableID == 0;
     smartRestaurant.OrderService.OrderService service = new smartRestaurant.OrderService.OrderService();
     if (!this.takeOrderResume)
     {
         if (!this.takeOutMode)
         {
             this.orderInfo = service.GetOrder(this.tableInfo.TableID);
             if (this.orderInfo != null)
             {
                 if (this.tableInfo.TableID != this.orderInfo.TableID)
                 {
                     this.tableInfo = this.tabService.GetTableInformation(this.orderInfo.TableID);
                 }
                 this.tableIDList = service.GetTableReference(this.orderInfo.OrderID);
             }
             else
             {
                 this.tableIDList = null;
             }
         }
         else if (this.takeOutOrderID > 0)
         {
             this.orderInfo = service.GetOrderByOrderID(this.takeOutOrderID);
             this.tableIDList = null;
         }
         else
         {
             this.orderInfo = null;
             this.tableIDList = null;
         }
         this.isChanged = false;
     }
     else if (!this.takeOutMode)
     {
         this.orderInfo = service.GetOrder(this.tableInfo.TableID);
     }
     if (this.orderInfo != null)
     {
         this.guestNumber = this.orderInfo.NumberOfGuest;
         this.billNumber = this.orderInfo.Bills.Length;
     }
     else if (this.guestNumber <= 0)
     {
         this.guestNumber = this.billNumber = 1;
     }
     if (AppParameter.IsDemo())
     {
         this.ListOrderItem.ItemWidth = 240;
         this.ListOrderCount.Left = 0xf8;
         this.ListOrderItem.Row = 14;
         this.ListOrderCount.Row = 14;
         this.ListOrderItemBy.Row = 14;
         this.ListOrderItemBy.Visible = true;
         this.LblTotalText.Visible = false;
         this.LblTotalValue.Visible = false;
         this.LblGuest.Text = "Guest";
     }
     else
     {
         if (AppParameter.ShowOrderItemPrice)
         {
             this.ListOrderItem.ItemWidth = 240;
             this.ListOrderCount.Left = 0xf8;
             this.ListOrderCount.ItemWidth = 80;
             this.ListOrderItem.Row = 13;
             this.ListOrderCount.Row = 13;
             this.LblTotalText.Visible = true;
             this.LblTotalValue.Visible = true;
         }
         else
         {
             this.ListOrderItem.ItemWidth = 280;
             this.ListOrderCount.Left = 0x120;
             this.ListOrderCount.ItemWidth = 40;
             this.ListOrderItem.Row = 14;
             this.ListOrderCount.Row = 14;
             this.LblTotalText.Visible = false;
             this.LblTotalValue.Visible = false;
         }
         this.ListOrderItemBy.Visible = false;
         this.LblGuest.Text = "Seat";
     }
     this.ListOrderCount.Left = this.ListOrderItem.Left + this.ListOrderItem.ItemWidth;
     this.selectedBill = null;
     this.selectedItem = null;
     this.selectedType = null;
     if ((this.orderInfo != null) && (this.orderInfo.Bills != null))
     {
         for (int i = 0; i < this.orderInfo.Bills.Length; i++)
         {
             if (this.orderInfo.Bills[i].CloseBillDate == AppParameter.MinDateTime)
             {
                 this.selectedBill = this.orderInfo.Bills[i];
                 break;
             }
         }
     }
     this.LblPageID.Text = "Employee ID:" + ((MainForm) base.MdiParent).UserID + " | ";
     if (this.takeOutMode)
     {
         this.LblPageID.Text = this.LblPageID.Text + "STTO021";
     }
     else
     {
         this.LblPageID.Text = this.LblPageID.Text + "STTO011";
     }
     this.PanCustName.Visible = this.takeOutMode;
     this.BtnSearch.Visible = this.takeOutMode;
     this.OptionPad.AutoRefresh = false;
     this.OptionPad.Red = this.OptionPad.Green = this.OptionPad.Blue = 1f;
     this.OptionPad.AutoRefresh = true;
     this.ListOrderItem.Reset();
     this.ListOrderCount.Reset();
     this.ListOrderItemBy.Reset();
     this.UpdateTableInformation();
     this.StartInputMenu();
 }