Пример #1
0
        public RedirectToActionResult RemoveFromSecondCart(int Id, string returnUrl)
        {
            SecondDishes secondDishes = mealRepository.SecondDishes
                                        .FirstOrDefault(p => p.Id == Id);

            if (secondDishes != null)
            {
                cart.RemoveLine(secondDishes);
            }
            return(RedirectToAction("Index", new { returnUrl }));
        }
Пример #2
0
        public RedirectToActionResult AddToSecondCart(int Id, string returnUrl)
        {
            SecondDishes secondDishes = mealRepository.SecondDishes
                                        .FirstOrDefault(x => x.Id == Id);

            if (secondDishes != null)
            {
                cart.AddItem(secondDishes, 1);
            }
            return(RedirectToAction("Index", new { returnUrl }));
        }