Beispiel #1
0
        public ActionResult AddSpecialty(string name, string description, string image)
        {
            Specialty specialty = new Specialty
                                      {
                                          Name = name,
                                          Description = description,
                                          IsActive = false,
                                          Image = image
                                      };

            MenuService menuService = new MenuService();
            menuService.AddSpecialty(specialty);

            return RedirectToAction("ListDishes");
        }
Beispiel #2
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");
        }
Beispiel #3
0
 //
 // GET: /Home/
 public ActionResult Index()
 {
     MenuService menuService = new MenuService();
     Specialty specialty = menuService.GetCurrentSpecialty();
     return View(specialty);
 }
Beispiel #4
0
        public ActionResult SetSpecialty(int specialtyId)
        {
            MenuService menuService = new MenuService();
            menuService.SetSpecialty(specialtyId);

            return RedirectToAction("Index");
        }
Beispiel #5
0
        public ActionResult ListDishes()
        {
            MenuService menuService = new MenuService();
            List<Dish> dishes = menuService.GetAllDishes();

            return View(dishes);
        }