示例#1
0
 public ActionResult Create(Flight flight)
 {
     if (ModelState.IsValid)
     {
         try
         {
             db.AddNewFlight(flight);
         }
         catch (Exception e)
         {
             return(RedirectToAction("Error", new { message = e.Message }));
         }
         return(RedirectToAction("Index"));
     }
     return(View());
 }