Пример #1
0
 public ActionResult AddTrip(Trip NewTrip)
 {
     if (NewTrip.Name != null && NewTrip.Name.Length > 0)
     {
         _repo.AddTrip(NewTrip);
         TempData["Success"] = "Trip was saved!";
         return(RedirectToAction("Trip", new { id = NewTrip.Id }));
     }
     {
         TempData["WarningMessage"] = "yes";
         return(RedirectToAction("Index"));
     }
 }