Пример #1
0
 public ActionResult Edit(Country country)
 {
     try
     {
         coService.UpdateCountry(country);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Пример #2
0
 public bool UpdateCountry(Country country)
 {
     try
     {
         country.State = ObjectState.Modified;
         countryRep.UpdateOperation(country);
         return true;
     }
     catch (Exception ex)
     {
         var msg = ex.Message;
         return false;
     }
 }
Пример #3
0
 public bool CreateCountry(Country country)
 {
     try
     {
         country.State = ObjectState.Added;
         countryRep.AddOperation(country);
         return true;
     }
     catch (Exception ex)
     {
         var msg = ex.Message;
         return false;
     }
 }