public ActionResult Create(Restaurant restaurant)
 {
     try
     {
         restaurant.AddRestaurant(restaurant);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #2
0
 public ActionResult Create([Bind(Include = "name, address, city, state, zipCode, phoneNumber")] Restaurant newRestaurant)
 {
     try
     {
         // TODO: Add insert logic here
         restaurant.AddRestaurant(newRestaurant);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #3
0
 public ActionResult Create(Restaurant restaurant)
 {
     try
     {
         restaurant.AddRestaurant(restaurant);
         // log that it worked
         return(RedirectToAction("Index"));
     }
     catch
     {
         // log some problem
         return(View());
     }
 }
예제 #4
0
 public ActionResult Add(string sRestName, string sAddress)
 {
     Restaurant.AddRestaurant(sRestName, sAddress);
     return(View());
 }