示例#1
0
        //Lorsque le client a choisi son plat et la quantité, l'order_dish est crée et retourne la vue liste des Order_dish
        public ActionResult CreateOrder_Dish()
        {
            int quantite  = HttpContext.Session.GetInt32("Quantite").GetValueOrDefault();
            int idDish    = HttpContext.Session.GetInt32("IdDish").GetValueOrDefault();
            int idOrder   = HttpContext.Session.GetInt32("IdOrder").GetValueOrDefault();
            int priceDish = HttpContext.Session.GetInt32("DishPrice").GetValueOrDefault();
            int total     = quantite * priceDish;

            DTO.Order_Dish newOrder_Dish = new DTO.Order_Dish {
                FK_idDish = idDish, FK_idOrder = idOrder, Quantity = quantite, Total = total
            };
            Order_DishManager.AddOrder_Dish(newOrder_Dish);
            return(RedirectToAction("ListOrder_Dish", "Order_Dish"));
        }
示例#2
0
 public IActionResult GetQuantity(DTO.Order_Dish order_dish)
 {
     HttpContext.Session.SetInt32("Quantite", order_dish.Quantity);
     return(RedirectToAction("CreateOrder_Dish", "Order_Dish"));
 }