public ActionResult Create(string cuisineName) { CuisineClass current = new CuisineClass(cuisineName); current.Save(); List <CuisineClass> cuisineList = CuisineClass.GetAll(); return(View("NewRestaurant", cuisineList)); }
public ActionResult Index() { Dictionary <string, object> restaurantCuisine = new Dictionary <string, object>(); List <RestaurantClass> restaurantList = RestaurantClass.GetAll(); List <CuisineClass> cuisineList = CuisineClass.GetAll(); restaurantCuisine.Add("restaurant", restaurantList); restaurantCuisine.Add("cuisine", cuisineList); return(View(restaurantCuisine)); }
public ActionResult Create(string restaurantName, string restaurantLocation, string restaurantCuisine) { int restaurantCuisineNew = int.Parse(restaurantCuisine); RestaurantClass restaurant = new RestaurantClass(restaurantName, restaurantLocation, restaurantCuisineNew); restaurant.Save(); Dictionary <string, object> model = new Dictionary <string, object>(); List <RestaurantClass> restaurantList = RestaurantClass.GetAll(); List <CuisineClass> cuisineList = CuisineClass.GetAll(); model.Add("restaurant", restaurantList); model.Add("cuisine", cuisineList); return(View("Index", model)); }
public ActionResult Show() { List <CuisineClass> cuisineList = CuisineClass.GetAll(); return(View("NewRestaurant", cuisineList)); }