コード例 #1
0
        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);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 public ActionResult _Edit(Role role)
 {
     if (ModelState.IsValid)
     {
         this.GenericMgr.Update(role);
         SaveSuccessMessage(Resources.ACC.Role.Role_Updated);
     }
     return PartialView(role);
 }