Пример #1
0
 public ActionResult Edit(RestaurantWeb toEdit)
 {
     if (ModelState.IsValid)
     {
         restaurantRepo.UpdateRestaurant(toEdit.ToLibLayer());
         return(RedirectToAction("Index"));
     }
     return(View(toEdit));
 }
Пример #2
0
 public ActionResult Create(RestaurantWeb newRest)
 {
     try
     {
         if (ModelState.IsValid)
         {
             restaurantRepo.CreateRestaurant(newRest.ToLibLayer());
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View(newRest));
         }
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
        // GET: Restaurants/Edit/5
        public ActionResult Edit(int id)
        {
            RestaurantWeb toEdit = restaurantsWeb.GetById(id);

            return(View(toEdit));
        }