Exemplo n.º 1
0
 public ActionResult Edit(FrameworkUserVM vm)
 {
     if (!ModelState.IsValid)
     {
         return(PartialView(vm));
     }
     else
     {
         vm.DoEdit();
         return(FFResult().CloseDialog().RefreshGridRow(typeof(FrameworkUserListVM), vm.Entity.ID));
     }
 }
Exemplo n.º 2
0
 public IActionResult Edit(FrameworkUserVM vm)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     else
     {
         vm.DoEdit(true);
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState));
         }
         else
         {
             return(Ok(vm.Entity));
         }
     }
 }
Exemplo n.º 3
0
 public IActionResult Put([FromBody] FrameworkUserVM vm)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     else
     {
         vm.DoEdit();
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState));
         }
         else
         {
             return(CreatedAtAction(nameof(Get), new { id = vm.Entity.ID }, vm));
         }
     }
 }
Exemplo n.º 4
0
 public IActionResult Edit(FrameworkUserVM vm)
 {
     ModelState.Remove("Entity.Password");
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState.GetErrorJson()));
     }
     else
     {
         vm.DoEdit(false);
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState.GetErrorJson()));
         }
         else
         {
             return(Ok(vm.Entity));
         }
     }
 }
Exemplo n.º 5
0
 public ActionResult Edit(FrameworkUserVM vm)
 {
     if (ModelState.Any(x => x.Key != "Entity.Password" && x.Value.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid))
     {
         return(PartialView(vm));
     }
     else
     {
         ModelState.Clear();
         vm.DoEdit();
         if (!ModelState.IsValid)
         {
             vm.DoReInit();
             return(PartialView(vm));
         }
         else
         {
             return(FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID));
         }
     }
 }