public ActionResult New(Role role) { if (ModelState.IsValid) { ////判断描述不能重复 if (this.genericMgr.FindAll<long>(roleDuiplicateVerifyStatement, new object[] { role.Code })[0] > 0) { SaveErrorMessage(Resources.ACC.Role.Errors_Existing_Role, role.Code); } else { this.genericMgr.CreateWithTrim(role); SaveSuccessMessage(Resources.ACC.Role.Role_Added); return RedirectToAction("Edit/" + role.Id); } } return View(role); }
public ActionResult _Edit(Role role) { if (string.IsNullOrWhiteSpace(role.Code ) ) { SaveErrorMessage(Resources.EXT.ControllerLan.Con_TheRoleCodeCanNotBeEmpty); return PartialView(role); } if (ModelState.IsValid) { this.genericMgr.UpdateWithTrim(role); SaveSuccessMessage(Resources.ACC.Role.Role_Updated); } return PartialView(role); }
public ActionResult _Edit(Role role) { if (ModelState.IsValid) { this.GenericMgr.Update(role); SaveSuccessMessage(Resources.ACC.Role.Role_Updated); } return PartialView(role); }