public ActionResult GetRestaurant(List <Restaurant> restaurantResults) { GetRestaurantViewModel getRestaurantModel = new GetRestaurantViewModel(); getRestaurantModel.Restaurant = restaurantResults[0]; return(View(getRestaurantModel)); }
public ActionResult AcceptFoodSuggestion(string restaurantId, string name, string url, string address, string locality, string city, string state, string latitude, string longitude, string zipcode, string country_id, string cuisines, string average_cost_for_two, string price_range) { GetRestaurantViewModel getRestaurantModel = new GetRestaurantViewModel(); int restaurantIdNumber; var result = Int32.TryParse(restaurantId, out restaurantIdNumber); FoodSuggestion foodSuggestionToRecord = new FoodSuggestion { RestaurantId = restaurantIdNumber, Name = name, Address = address, City = city, ZipCode = zipcode, Latitude = latitude, Longitude = longitude, IsChosenByUser = true }; db.FoodSuggestions.Add(foodSuggestionToRecord); db.SaveChanges(); Location location = new Location { Address = address, Locality = locality, City = city, State = state, Latitude = latitude, Longitude = longitude, Zipcode = zipcode, Country_Id = country_id }; Restaurant chosenRestaurant = new Restaurant { Id = restaurantId, Name = name, Url = url, Address = address, Locality = locality, City = city, State = state, Latitude = latitude, Longitude = longitude, Zipcode = zipcode, Country_Id = country_id, Cuisines = cuisines, Average_Cost_For_Two = average_cost_for_two, Price_Range = price_range }; getRestaurantModel.Restaurant = chosenRestaurant; return(View("GetRestaurant", getRestaurantModel)); }