/// <summary> /// Edits the privilege. /// </summary> /// <param name="id">The id.</param> /// <param name="parentCode">The parent code.</param> /// <param name="parentName">Name of the parent.</param> /// <returns></returns> public ActionResult EditPrivilege(string id, string parentCode, string parentName) { Privilege p = null; if (string.IsNullOrEmpty(id)) { p = new Privilege(); if (string.IsNullOrEmpty(parentCode)) { p.ParentName = "根权限"; } else { p.ParentID = parentCode; p.ParentName = parentName; } } else { p = sysManageService.GetPrivilege(id); if (p == null) { throw new ArgumentException("参数错误", "Privilege"); } } return(View(p)); }