Пример #1
0
 private void DatePad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     int num = int.Parse(e.Value);
     this.selectedDate = this.startDate.AddDays((double) num).Add(new TimeSpan(this.selectedDate.Hour, this.selectedDate.Minute, 0));
     this.UpdateDateButton();
     this.UpdateSelectedTime();
     this.UpdateReserveButton();
 }
Пример #2
0
 private void MinutePad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     int num = int.Parse(e.Value);
     this.selectedDate = this.selectedDate.AddMinutes((double) (num - this.selectedDate.Minute));
     this.UpdateSelectedTime();
 }
Пример #3
0
        private void OptionPad_PadClick(object sender, ButtonListPadEventArgs e)
        {
            if ((((this.inputState == 0) || (this.inputState == 2)) && ((this.inputState != 0) || ((this.inputValue != null) && (this.inputValue.Length != 0)))) && (e.Value != null))
            {
                int num;
                int num2;
                int num3;
                smartRestaurant.MenuService.MenuItem menuItemFromID;
                try
                {
                    if (this.inputState == 2)
                    {
                        string[] strArray = e.Value.Split(new char[] { ':' });
                        num2 = int.Parse(strArray[0]);
                        num3 = int.Parse(strArray[1]);
                        num = 0;
                    }
                    else
                    {
                        num2 = num3 = 0;
                        num = int.Parse(e.Value);
                    }
                }
                catch (Exception exception)
                {
                    MessageForm.Show(exception.ToString(), "Exception");
                    return;
                }
                switch (this.inputState)
                {
                    case 0:
                        menuItemFromID = this.selectedType.MenuItems[num];
                        this.AddOrderBillItem(menuItemFromID);
                        return;

                    case 1:
                        return;

                    case 2:
                    {
                        string str = num2 + ":";
                        string str2 = num3.ToString();
                        if (this.selectedItem.ItemChoices == null)
                        {
                            menuItemFromID = MenuManagement.GetMenuItemFromID(this.selectedItem.MenuID);
                            this.selectedItem.ItemChoices = new OrderItemChoice[menuItemFromID.MenuDefaults.Length];
                            for (int k = 0; k < menuItemFromID.MenuDefaults.Length; k++)
                            {
                                this.selectedItem.ItemChoices[k] = new OrderItemChoice();
                                this.selectedItem.ItemChoices[k].OptionID = menuItemFromID.MenuDefaults[k].OptionID;
                                this.selectedItem.ItemChoices[k].ChoiceID = menuItemFromID.MenuDefaults[k].DefaultChoiceID;
                            }
                            this.selectedItem.DefaultOption = false;
                        }
                        for (int i = 0; i < this.OptionPad.Items.Count; i++)
                        {
                            ButtonItem item2 = (ButtonItem) this.OptionPad.Items[i];
                            if (item2.Value.Substring(0, str.Length) == str)
                            {
                                if (item2.Value.Substring(str.Length) == str2)
                                {
                                    this.OptionPad.SetMatrix(i, 2f, 1f, 2f);
                                }
                                else
                                {
                                    this.OptionPad.SetMatrix(i, 1f, 1f, 1f);
                                }
                            }
                        }
                        for (int j = 0; j < this.selectedItem.ItemChoices.Length; j++)
                        {
                            if (this.selectedItem.ItemChoices[j].OptionID == num2)
                            {
                                this.selectedItem.ItemChoices[j].ChoiceID = num3;
                                this.selectedItem.DefaultOption = false;
                                this.selectedItem.ChangeFlag = true;
                                this.isChanged = true;
                                return;
                            }
                        }
                        return;
                    }
                }
            }
        }
Пример #4
0
 private void CategoryPad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     if ((this.inputState == 1) || (this.inputState == 2))
     {
         this.StartInputMenu();
     }
     if ((this.inputState == 0) && (e.Value != null))
     {
         int num;
         try
         {
             num = int.Parse(e.Value);
         }
         catch (Exception exception)
         {
             MessageForm.Show(exception.ToString(), "Exception");
             return;
         }
         this.inputValue = e.Button.Text.Substring(0, 2);
         this.UpdateMonitor();
         this.selectedType = this.menuTypes[num];
         smartRestaurant.MenuService.MenuItem[] menuItems = this.selectedType.MenuItems;
         this.OptionPad.AutoRefresh = false;
         this.OptionPad.Items.Clear();
         this.OptionPad.ItemStart = 0;
         if (menuItems != null)
         {
             for (int i = 0; i < menuItems.Length; i++)
             {
                 this.OptionPad.Items.Add(new ButtonItem(MenuManagement.GetMenuLanguageName(menuItems[i]), i.ToString()));
             }
         }
         this.OptionPad.Red = e.Button.Red;
         this.OptionPad.Green = e.Button.Green;
         this.OptionPad.Blue = e.Button.Blue;
         this.OptionPad.AutoRefresh = true;
     }
 }
Пример #5
0
 private void DiscountPad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     if (e.Value != null)
     {
         Discount dis = Receipt.SearchDiscountByID(int.Parse(e.Value));
         if (this.discountSelected.Contains(e.Index))
         {
             this.discountSelected.Remove(e.Index);
             this.receipt.UseDiscountRemove(dis);
         }
         else
         {
             this.discountSelected.Add(e.Index);
             this.receipt.UseDiscountAdd(dis);
         }
         this.UpdateDiscountList();
         this.UpdateSummary();
     }
 }
Пример #6
0
 private void DiscountPad_PageChange(object sender, ButtonListPadEventArgs e)
 {
     this.UpdateDiscountList();
 }
Пример #7
0
 private void PaymentTypePad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     if (e.Value != null)
     {
         this.receipt.PaymentMethod = Receipt.SearchPaymentMethodByID(int.Parse(e.Value));
         int index = this.receipt.PaymentMethodList.IndexOf(this.receipt.PaymentMethod);
         if (index >= 0)
         {
             this.receipt.PayValue = (double) this.receipt.PayValueList[index];
         }
         else
         {
             this.receipt.PayValue = 0.0;
         }
         this.StartInputPayValue();
         this.UpdatePaymentTypeList();
         this.UpdateSummary();
     }
 }
Пример #8
0
 private void PaymentTypePad_PageChange(object sender, ButtonListPadEventArgs e)
 {
     this.UpdatePaymentTypeList();
 }
Пример #9
0
 private void TablePad_PageChange(object sender, ButtonListPadEventArgs e)
 {
     this.UpdateTableStatus();
 }
Пример #10
0
 private void TablePad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     if (e.ObjectValue != null)
     {
         TableStatus objectValue = (TableStatus) e.ObjectValue;
         for (int i = 0; i < this.tableInfo.Length; i++)
         {
             if (this.tableInfo[i].TableID == objectValue.TableID)
             {
                 ((MainForm) base.MdiParent).ShowTakeOrderForm(this.tableInfo[i]);
                 return;
             }
         }
         MessageForm.Show("Select Table", "Can't find table information.");
     }
 }
Пример #11
0
 private void BillItemPad_PadClick(object sender, ButtonListPadEventArgs e)
 {
     if (e.ObjectValue != null)
     {
         int objectValue = (int) e.ObjectValue;
         smartRestaurant.OrderService.OrderService service = new smartRestaurant.OrderService.OrderService();
         if (objectValue < 0)
         {
             objectValue = -objectValue;
             this.orderWaiting = service.ServeWaitingOrder(objectValue, 0);
         }
         else
         {
             this.orderWaiting = service.ServeWaitingOrder(0, objectValue);
         }
         this.AddTableButton();
         this.UpdateWaitingList();
     }
 }
Пример #12
0
 protected virtual void OnPageChange(ButtonListPadEventArgs e)
 {
     if (this.PageChange != null)
     {
         this.PageChange(this, e);
     }
 }
Пример #13
0
 protected virtual void OnPadClick(ButtonListPadEventArgs e)
 {
     if (this.PadClick != null)
     {
         this.PadClick(this, e);
     }
 }