Beispiel #1
0
        public ActionResult EditOrg(string id, string parentCode, string parentName)
        {
            Organization Org;

            if (!string.IsNullOrEmpty(id))
            {
                Org = sysManageService.GetOrgInfo(id);
                if (Org == null)
                {
                    throw new Exception("参数错误,不存在对应的角色");
                }
            }
            else
            {
                Org = new Organization();
                if (parentCode == "-1")
                {
                    Organization root = sysManageService.GetRootOrganization();
                    Org.ParentCode = root.OrgCode;
                    Org.ParentName = root.OrgName;
                    Org.OrgType    = 0;
                }
                else
                {
                    Org.ParentCode = parentCode;
                    Org.ParentName = parentName;
                    Org.OrgType    = 1;
                }
            }
            return(View(Org));
        }