示例#1
0
        public ActionResult Delete(RestaurantsDeleteViewModel model)
        {
            RestaurantRepository repository = new RestaurantRepository();

            repository.Delete(model.ID);

            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Delete(int id)
        {
            RestaurantRepository repository = new RestaurantRepository();

            Restaurant restaurant = repository.GetByID(id);

            RestaurantsDeleteViewModel model = new RestaurantsDeleteViewModel();

            model.ID        = restaurant.ID;
            model.Name      = restaurant.Name;
            model.Address   = restaurant.Address;
            model.Phone     = restaurant.Phone;
            model.Capacity  = restaurant.Capacity;
            model.OpenHour  = restaurant.OpenHour;
            model.CloseHour = restaurant.CloseHour;

            return(View(model));
        }