Beispiel #1
0
        private void ConfirmButton_Click(object sender, EventArgs e)
        {
            Deal obj = new Deal();

            for (int i = 0; i < countdeal; i++)
            {
                obj.Quantity = 1;
                obj.Name_    = dealarr[i].name;
                obj.Price    = dealarr[i].price;
            }
            piz.Deals.InsertOnSubmit(obj);
            piz.SubmitChanges();
            ClassicPizza show1 = new ClassicPizza();

            this.Hide();
            show1.ShowDialog();
        }
        public void ConfirmOrder_Click(object sender, EventArgs e)
        {
            //Confirm for Pizza
            for (int i = 0; i < countpizza; i++)
            {
                PizzaFlavour obj = new PizzaFlavour();
                obj.Quantity      = pitza[i].qty;
                obj.Pizza_Flavour = pitza[i].itemname;
                obj.Size          = pitza[i].size;
                obj.Price         = pitza[i].price;

                piz.PizzaFlavours.InsertOnSubmit(obj);
                piz.SubmitChanges();
            }

            //Confirm for Burger
            for (int i = 0; i < countburger; i++)
            {
                BurgerNBrost obj = new BurgerNBrost();
                obj.Quantity   = burg[i].qty;
                obj.Item_Name_ = burg[i].name;
                obj.Price      = burg[i].price;

                piz.BurgerNBrosts.InsertOnSubmit(obj);
                piz.SubmitChanges();
            }

            //Confirm for Starters
            for (int i = 0; i < counstarter; i++)
            {
                Starter obj = new Starter();
                obj.Quantity     = start[i].qty;
                obj.Starter_Name = start[i].name;
                obj.Price        = start[i].price;

                piz.Starters.InsertOnSubmit(obj);
                piz.SubmitChanges();
            }

            //Confirm for Roll
            for (int i = 0; i < countroll; i++)
            {
                RollNSandwich obj = new RollNSandwich();
                obj.Quantity = roll[i].qty;
                obj.Item_No  = roll[i].name;
                obj.Price    = roll[i].price;

                piz.RollNSandwiches.InsertOnSubmit(obj);
                piz.SubmitChanges();
            }

            //Confirm for Salad N Pasta
            for (int i = 0; i < countsalad; i++)
            {
                SaladNPasta obj = new SaladNPasta();
                obj.Quantity  = salad[i].qty;
                obj.Item_Name = salad[i].name;
                obj.Price     = salad[i].price;

                piz.SaladNPastas.InsertOnSubmit(obj);
                piz.SubmitChanges();
            }

            Reciept();
        }