public ActionResult Password(FrameworkUserVM vm) { var keys = ModelState.Keys.ToList(); foreach (var item in keys) { if (item != "Entity.Password") { ModelState.Remove(item); } } if (ModelState.IsValid == false) { return(PartialView(vm)); } else { vm.ChangePassword(); if (!ModelState.IsValid) { vm.DoReInit(); return(PartialView(vm)); } else { return(FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID)); } } }
public ActionResult Create(FrameworkUserVM vm) { if (!ModelState.IsValid) { return(PartialView(vm)); } else { vm.DoAdd(); if (!ModelState.IsValid) { vm.DoReInit(); return(PartialView(vm)); } else { return(FFResult().CloseDialog().RefreshGrid()); } } }
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)); } } }