Esempio n. 1
0
        public ActionResult AddDish(string name, string description, double price, double timeToCook, int specialtyId,
                                    int dishTypeId)
        {
            RestaurantService restaurantService = new RestaurantService();
            MenuService       menuService       = new MenuService();
            Specialty         specialty         = menuService.GetSpecialty(specialtyId);

            Dish dish = new Dish
            {
                Name        = name,
                Description = description,
                Price       = price,
                TimeToCook  = timeToCook,
                Specialty   = specialty,
                DishTypeId  = dishTypeId
            };

            restaurantService.AddDish(dish);

            return(RedirectToAction("ListDishes"));
        }