예제 #1
0
        public ReceiptForm(Receipt newReceipt, Employee newEmployee)
        {
            InitializeComponent();
            rCurrentReceipt = newReceipt;
            eCurrentEmployee = newEmployee;

            ReceiptView.Text = rCurrentReceipt.printReceipt();
        }
예제 #2
0
        public MenuForm(Table curTable, FoodMenu menu)
        {
            InitializeComponent();

            //array of food prices
            this.FoodPrices = new TextBox[18]{priceAppetizer1, priceAppetizer2, priceAppetizer3,priceSoupSalad1, priceSoupSalad2, priceSoupSalad3,
            priceEntree1, priceEntree2, priceEntree3, priceDesserts1, priceDesserts2, priceDesserts3,  priceDrinkKid1, priceDrinkKid2, priceDrinkKid3,
            priceDrinkAdult1, priceDrinkAdult2, priceDrinkAdult3 };

            this.tbFoodNames = new TextBox[18] {appetizer1, appetizer2, appetizer3, soupSalad1,soupSalad2, soupSalad3,
                                            entree1,entree2,entree3,desserts1,desserts2,dessert3,
                                            drinkKid1, drinkKid2, drinkKid3, drinkAdult1, drinkAdult2,drinkAdult3 };

            this.nudSelectors = new NumericUpDown[18] {selectAppetizer1, selectAppetizer2, selectAppetizer3, selectSoupSalad1, selectSoupSalad2,
                selectSoupSalad3, selectEntree1, selectEntree2, selectEntree3, selectDesserts1, selectDesserts2, selectDesserts3, selectDrinkKid1,
                selectDrinkKid2, selectDrinkKid3, selectDrinkAdult1, selectDrinkAdult2, selectDrinkAdult3 };

            curMenu = menu;

            this.appetizer1avail.Visible = !(curMenu.getAvaliable(0));
            this.appetizer2avail.Visible = !(curMenu.getAvaliable(1));
            this.appetizer3avail.Visible = !(curMenu.getAvaliable(2));
            this.soupSalad1Avail.Visible = !(curMenu.getAvaliable(3));
            this.soupSalad2Avail.Visible = !(curMenu.getAvaliable(4));
            this.soupSalad3Avail.Visible = !(curMenu.getAvaliable(5));
            this.entree1Avail.Visible = !(curMenu.getAvaliable(6));
            this.entree2Avail.Visible = !(curMenu.getAvaliable(7));
            this.entree3Avail.Visible = !(curMenu.getAvaliable(8));
            this.dessert1Avail.Visible = !(curMenu.getAvaliable(9));
            this.dessert2Avail.Visible = !(curMenu.getAvaliable(10));
            this.dessert3Avail.Visible = !(curMenu.getAvaliable(11));
            this.drinkKid1Avail.Visible = !(curMenu.getAvaliable(12));
            this.drinkKid2Avail.Visible = !(curMenu.getAvaliable(13));
            this.drinkKid3Avail.Visible = !(curMenu.getAvaliable(14));
            this.drinkAdult1Avail.Visible = !(curMenu.getAvaliable(15));
            this.drinkAdult2Avail.Visible = !(curMenu.getAvaliable(16));
            this.drinkAdult3Avail.Visible = !(curMenu.getAvaliable(17));

            table = curTable;
            usingReceipt = curTable.getReceipt();

            //For setting the prices in the GUI
            for (int i= 0; i< FoodPrices.Length; i++){
                FoodPrices[i].Text = "" + curMenu.getFoodItem(i).getPrice();
            }

            //For setting the names in the GUI
            for (int j = 0; j < tbFoodNames.Length; j++)
            {
                tbFoodNames[j].Text = "" + curMenu.getFoodItem(j).getName();
            }

            //For setting if the food is available. if checked, the item is not available and value set to 0.
            for (int k = 0; k < nudSelectors.Length; k++)
            {
                /*if(checkBoxes[k].CheckState == CheckState.Checked){

                    nudSelectors[k].Value = 0;

                }*/

            }

            /*
            //Changes all the values of the int array to 0. Used for storing the amount of orders for each item
            for (int i = 0; i < menuValues.Length; i++)
            {
                menuValues[i] = 0;
            }
            */
        }