Beispiel #1
0
 public ActionResult EditCountry(int id, CountryOperator country)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.ErrorMessage = "Form data is not proper.";
         return(View(country));
     }
     country.Update();
     return(RedirectToAction("CountryList"));
 }
Beispiel #2
0
 public ActionResult AddCountry(CountryOperator model)
 {
     ViewBag.ErrorMessage = String.Empty;
     if (!ModelState.IsValid)
     {
         ViewBag.ErrorMessage = "Form data is not proper.";
         return(View(model));
     }
     model.Update();
     return(RedirectToAction("CountryList"));
 }