コード例 #1
0
        protected void OrgTreeData()
        {
            string        TreeNodeID = Request["TreeNodeID"] + "";
            List <string> SltIds     = new List <string>();

            if (!string.IsNullOrEmpty(TreeNodeID))
            {
                var Ents = SysOrgRefGroupOrRole.FindAllByProperty("GroupOrRoleID", TreeNodeID);
                foreach (var item in Ents)
                {
                    SltIds.Add(item.OrgID);
                }
            }

            var list = SysOrganization.FindAll().OrderBy(ten => ten.SortIndex).ToArray();
            List <NodeObject> NodeList = GetOrgTree(list.ToArray(), SltIds, "root");
            string            TreeJson = Razor.DynamicJson.DynamicJsonConvert.SerializeObject(NodeList);

            TreeJson = TreeJson.Replace("check", "checked");
            Response.Write(TreeJson);
            Response.End();
        }
コード例 #2
0
        public string DeleteData(string ID)
        {
            var Ent = SysGroupOrRole.Find(ID);
            //删除相关联的数据
            var GUEnts  = SysGroupUser.FindAllByProperties(SysGroupUser.Prop_SysGroupID, Ent.ID);
            var OrgEnts = SysOrgRefGroupOrRole.FindAllByProperty(SysOrgRefGroupOrRole.Prop_GroupOrRoleID, Ent.ID);

            if (GUEnts.Length > 0)
            {
                foreach (var item in GUEnts)
                {
                    item.DoDelete();
                }
            }
            if (OrgEnts.Length > 0)
            {
                foreach (var item in OrgEnts)
                {
                    item.DoDelete();
                }
            }
            Ent.DoDelete();
            return("1");
        }