Exemple #1
0
        protected void BtnOrder_Click(object sender, EventArgs e)
        {
            OfferedPizza      offerPizza = HelperSession.GetOfferPizza(Session);
            List <Ingredient> listIngredientsSelected = HelperSession.GetListIngredientsSelected(Session);

            OrderPizza orderPizza = new OrderPizza(offerPizza.Id_Offered_Pizza, offerPizza.Price, listIngredientsSelected);

            List <OrderPizza> listOrdersPizza = HelperSession.GetListOrdersPizza(Session);

            listOrdersPizza.Add(orderPizza);

            HelperSession.SetListOrdersPizza(Session, listOrdersPizza);

            double partialSum = HelperSession.GetSumOrderedPizzas(Session);

            partialSum += orderPizza.Price;

            HelperSession.SetSumOrderedPizzas(Session, partialSum);

            double totalSum = Properties.Settings.Default.PriceDeliveryAndService + partialSum;

            HelperSession.SetTotalPriceOrderedPizzas(Session, totalSum);

            Response.Redirect("Basket.aspx");
        }