Example #1
0
 public IActionResult Add(CityVM vm)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState.GetErrorJson()));
     }
     else
     {
         vm.DoAdd();
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState.GetErrorJson()));
         }
         else
         {
             return(Ok(vm.Entity));
         }
     }
 }
Example #2
0
 public ActionResult Create(CityVM vm)
 {
     if (!ModelState.IsValid)
     {
         return(PartialView(vm));
     }
     else
     {
         vm.DoAdd();
         if (!ModelState.IsValid)
         {
             vm.DoReInit();
             return(PartialView(vm));
         }
         else
         {
             return(FFResult().CloseDialog().RefreshGrid());
         }
     }
 }