public IActionResult NewRestaurants(NewRestaurants appResponse)
 {
     //Validate no errors in the model
     if (ModelState.IsValid)
     {
         AllRestaurants.AddApplication(appResponse);
         return(View("Confirmation", appResponse));
     }
     else
     {
         return(View("NewRestaurants"));
     }
 }
예제 #2
0
        public JsonResult GetAllRestaurants()
        {
            var retModel = new AllRestaurants
            {
                Success = false
            };

            try
            {
                retModel.ListRestaurants = ListService.GetItemsForSearch_AdminPanel();
                retModel.Success         = true;
            }
            catch (Exception e)
            {
                retModel.Message = "could not get restaurants.";
                throw;
            }

            return(Json(retModel, JsonRequestBehavior.AllowGet));
        }