Пример #1
0
        public ActionResult Edit(RestaurantModel restaurantmodel)
        {
            log.InfoFormat("[RestaurantsController.Edit] RestaurantModel={0}", restaurantmodel.ToString());
            ModelState.Remove("Adress.BuildingNum");
            //ModelState.Remove("Phone");
            if (ModelState.IsValid)
            {

                RestaurantBasicData rest = restaurantmodel.ToRestaurantBasicModel();
                RestaurantBasicData dbRest = m_serviceLayer.GetRestaurantBasicById(restaurantmodel.Id);
                rest.Menu = dbRest.Menu; //save existed menu
                CuisineMapServices cuisineMapServ = new CuisineMapServices();
                cuisineMapServ.CuisineMapSearch(rest);
                m_serviceLayer.UpdateRestaurant(rest);
                return RedirectToAction("Details", new { id = rest.Id } );
            }
            return View(restaurantmodel);
        }