Example #1
0
        /// <summary>
        /// 获取单一树节点下的所有子节点,用于动态加载
        /// </summary>
        /// <returns></returns>
        public string GetSingleTreeNode()
        {
            List <TreeEntityForLayui> returnValue = new List <TreeEntityForLayui>();

            if (string.IsNullOrEmpty(Request["ParentID"]))
            {
                TreeEntityForLayui topNode = new TreeEntityForLayui()
                {
                    name     = "所有系统功能定义",
                    id       = "0",
                    pid      = "",
                    open     = true,
                    children = funInfoService.GetSingleTreeNode("0", Request["RoleID"])
                };
                topNode.@checked = topNode.children.Where(f => f.@checked).Count() > 0;
                returnValue.Add(topNode);
            }
            else if (Request["ParentID"].Contains("MODULE_"))
            {
                returnValue = funInfoService.GetSingleTreeNodeBySYSID(Request["ParentID"].Replace("MODULE_", ""));
            }
            else
            {
                //string parentid = string.IsNullOrEmpty(Request["PARENTID"]) ? "0" : Request["PARENTID"];
                returnValue = funInfoService.GetSingleTreeNode(Request["ParentID"], Request["RoleID"]);
            }
            return(new JavaScriptSerializer().Serialize(returnValue));
        }
Example #2
0
        /// <summary>
        /// 获取与用户分组相关的系统功能定义树结构
        /// </summary>
        /// <returns></returns>
        public string GetRoleTreeNode()
        {
            return(base.ExecuteActionJsonResult("获取系统功能定义树结构", () =>
            {
                List <GI_FunInfo> list = EntityOperate <GI_FunInfo> .GetEntityList("", "DISPLAYSORT").Where(f => f.IsCance != 1).ToList();
                List <TreeEntityForLayui> returnValue = new List <TreeEntityForLayui>();

                List <GI_RoleRight> listROLERIGHT = new List <GI_RoleRight>();
                if (!string.IsNullOrWhiteSpace(Request["RoleID"]))
                {
                    listROLERIGHT = EntityOperate <GI_RoleRight> .GetEntityList("RoleID = '" + Request["RoleID"] + "'");
                }
                var childrenNode = new List <TreeEntityForLayui>();
                List <GI_SYSAPPINFO> listSYSAPPINFO = EntityOperate <GI_SYSAPPINFO> .GetEntityList("", "DISPLAYSORT").Where(f => f.IsCance != 1).ToList();
                listSYSAPPINFO.ForEach((f) =>
                {
                    TreeEntityForLayui treeEntity = new TreeEntityForLayui()
                    {
                        name = f.SYSName, id = "MODULE_" + f.SYSID, pid = "MODULE_0", open = true, children = funInfoService.GetRoleTreeNodeBySYSID(list, listROLERIGHT, f.SYSID), @checked = listROLERIGHT.Where(e => e.FUNID == "MODULE_" + f.SYSID).Count() > 0
                    };
                    childrenNode.Add(treeEntity);
                });
                returnValue.Add(new TreeEntityForLayui()
                {
                    name = "所有系统功能定义", id = "0", pid = "", open = true, children = childrenNode
                });
                return new WebApi_Result()
                {
                    data = returnValue, count = list.Count
                };
            }));
        }
Example #3
0
        /// <summary>
        /// 根据系统模块ID,获取与用户分组相关的系统功能定义树结构
        /// </summary>
        /// <param name="listFUNINFO">系统功能定义数据列表</param>
        /// <param name="listROLERIGHT">用户权限数据列表</param>
        /// <param name="SYSID">系统模块ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetRoleTreeNodeBySYSID(List <GI_FunInfo> listFUNINFO, List <GI_RoleRight> listROLERIGHT, string SYSID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();

            listFUNINFO.Where(f => f.ParentID == "0" && f.SYSID == SYSID).ToList().ForEach((f) =>
            {
                TreeEntityForLayui tree = new TreeEntityForLayui()
                {
                    name = f.FUNName, id = f.FUNID, pid = f.ParentID, remark = f.SYSID
                };
                tree.children = CreateRoleTreeNode(listFUNINFO, listROLERIGHT, f.FUNID);
                retValue.Add(tree);
            });
            if (listROLERIGHT != null && listROLERIGHT.Count > 0)
            {
                retValue.ForEach(e =>
                {
                    if (listROLERIGHT.Where(f => f.FUNID == e.id).Count() > 0)
                    {
                        e.@checked = true;
                    }
                });
            }
            return(retValue);
        }
Example #4
0
        /// <summary>
        /// 获取单一树节点下的所有子节点,用于动态加载
        /// </summary>
        /// <param name="parentID">父级ID</param>
        /// <param name="roleID">用户分组ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string parentID, string roleID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <GI_FunInfo>         list     = EntityOperate <GI_FunInfo> .GetEntityList(" PARENTID = '" + parentID + "'", "DISPLAYSORT").Where(f => f.IsCance != 1).ToList();

            list.Where(s => s.ParentID == parentID).ToList().ForEach((f) =>
            {
                TreeEntityForLayui tree = new TreeEntityForLayui()
                {
                    name = f.FUNName, id = f.FUNID, pid = f.ParentID, remark = f.SYSID
                };
                if (f.IsLast != 1)//如果不是末级,则加子级
                {
                    tree.children = new List <TreeEntityForLayui>();
                }
                retValue.Add(tree);
            });
            if (!string.IsNullOrWhiteSpace(roleID))
            {
                List <GI_RoleRight> list_ROLERIGHT = EntityOperate <GI_RoleRight> .GetEntityList("ROLEID = '" + roleID + "'");

                if (list_ROLERIGHT != null && list_ROLERIGHT.Count > 0)
                {
                    retValue.ForEach(e =>
                    {
                        if (list_ROLERIGHT.Where(f => f.FUNID == e.id).Count() > 0)
                        {
                            e.@checked = true;
                        }
                    });
                }
            }
            return(retValue);
        }
Example #5
0
        /// <summary>
        /// 生成树结构节点
        /// </summary>
        /// <param name="list">数据列表</param>
        /// <param name="PARENTID">父级ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> CreateTreeNode(List <V_FormEmrTemplate> list, string ParentID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();

            list.Where(s => s.ParentId == ParentID).ToList().ForEach((f) =>
            {
                TreeEntityForLayui treeNode = new TreeEntityForLayui()
                {
                    name = f.TemplateName, id = f.TemplateId, pid = f.ParentId, children = CreateTreeNode(list, f.TemplateId)
                };
                retValue.Add(treeNode);
            });
            return(retValue);
        }
Example #6
0
        /// <summary>
        /// 生成树结构节点
        /// </summary>
        /// <param name="list">医生分组数据列表</param>
        /// <param name="PARENTID">父级ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> CreateTreeNode(List <AI_DoctorGroup> list, string DeptId)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();

            list.Where(s => s.DeptId == DeptId).ToList().ForEach((f) =>
            {
                TreeEntityForLayui treeNode = new TreeEntityForLayui()
                {
                    name = f.GroupName, id = f.DoctorGroupId, pid = f.DeptId, children = CreateTreeNode(list, f.DoctorGroupId)
                };
                retValue.Add(treeNode);
            });
            return(retValue);
        }
Example #7
0
        /// <summary>
        /// 生成树结构节点
        /// </summary>
        /// <param name="list">公用代码字典数据列表</param>
        /// <param name="PARENTID">父级ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> CreateTreeNode(List <GI_CodeDict> list, string ParentID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();

            list.Where(s => s.ParentID == ParentID).ToList().ForEach((f) =>
            {
                TreeEntityForLayui treeNode = new TreeEntityForLayui()
                {
                    name = f.DictName, id = f.DictID, pid = f.ParentID, children = CreateTreeNode(list, f.DictID)
                };
                retValue.Add(treeNode);
            });
            return(retValue);
        }
Example #8
0
        /// <summary>
        /// 根据系统模块ID,获取单一树节点下的所有子节点,用于动态加载
        /// </summary>
        /// <param name="SYSID">系统模块ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNodeBySYSID(string SYSID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <GI_FunInfo>         list     = EntityOperate <GI_FunInfo> .GetEntityList(" parentid='0' and SYSID = '" + SYSID + "'", "DISPLAYSORT").Where(f => f.IsCance != 1).ToList();

            list.ToList().ForEach((f) =>
            {
                TreeEntityForLayui tree = new TreeEntityForLayui()
                {
                    name = f.FUNName, id = f.FUNID, pid = f.ParentID, remark = f.SYSID
                };
                if (f.IsLast != 1)//如果不是末级,则加子级
                {
                    tree.children = new List <TreeEntityForLayui>();
                }
                retValue.Add(tree);
            });
            return(retValue);
        }
Example #9
0
        /// <summary>
        /// 获取树数据
        /// </summary>
        /// <param name="ParentID">父类ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string ParentID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <V_FormEmrTemplate>  list     = EntityOperate <V_FormEmrTemplate> .GetEntityList(" ParentId = '" + ParentID + "'", "TemplateId").Where(f => f.Del != 1).ToList();

            if (list != null && list.Count > 0)
            {
                list.Where(s => s.ParentId == ParentID).ToList().ForEach((f) =>
                {
                    TreeEntityForLayui tree = new TreeEntityForLayui()
                    {
                        name = f.TemplateName, id = f.TemplateId, pid = f.ParentId
                    };
                    //if (f.ISLAST != 1)//如果不是末级,则加子级
                    //    tree.children = new List<TreeEntityForLayui>();
                    retValue.Add(tree);
                });
            }
            return(retValue);
        }
Example #10
0
        /// <summary>
        /// 获取单一树节点下的所有子节点,用于动态加载
        /// </summary>
        /// <param name="PARENTID">父级ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string DeptId)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <AI_DoctorGroup>     list     = EntityOperate <AI_DoctorGroup> .GetEntityList(" DEPTID = '" + DeptId + "'", "DISPLAYSORT").Where(f => f.Del != 1).ToList();

            if (list != null && list.Count > 0)
            {
                list.Where(s => s.DeptId == DeptId).ToList().ForEach((f) =>
                {
                    TreeEntityForLayui tree = new TreeEntityForLayui()
                    {
                        name = f.GroupName, id = f.DoctorGroupId, pid = f.DeptId
                    };
                    //if (f.ISLast != 1)//如果不是末级,则加子级
                    //    tree.children = new List<TreeEntityForLayui>();
                    retValue.Add(tree);
                });
            }
            return(retValue);
        }
Example #11
0
        /// <summary>
        /// 获取树数据
        /// </summary>
        /// <param name="ParentID">父类ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string ParentID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <AI_DeptInfo>        list     = EntityOperate <AI_DeptInfo> .GetEntityList(" ParentID = '" + ParentID + "'", "DeptID").Where(f => f.IsCance != 1).ToList();

            if (list != null && list.Count > 0)
            {
                list.Where(s => s.ParentID == ParentID).ToList().ForEach((f) =>
                {
                    TreeEntityForLayui tree = new TreeEntityForLayui()
                    {
                        name = f.DeptName, id = f.DeptID, pid = f.ParentID
                    };
                    //if (f.ISLAST != 1)//如果不是末级,则加子级
                    //    tree.children = new List<TreeEntityForLayui>();
                    retValue.Add(tree);
                });
            }
            return(retValue);
        }
Example #12
0
        /// <summary>
        /// 获取树数据
        /// </summary>
        /// <param name="ParentID">父类ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string ParentID, string InpatientId, int TemplateType)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <V_FormEmr>          list     = EntityOperate <V_FormEmr> .GetEntityList("InpatientId = '" + InpatientId + "' and TemplateType = " + TemplateType).ToList();

            if (list != null && list.Count > 0)
            {
                list.ForEach((f) =>
                {
                    TreeEntityForLayui tree = new TreeEntityForLayui()
                    {
                        name = f.TemplateName, id = f.FormEmrId, pid = ParentID
                    };
                    //if (f.ISLAST != 1)//如果不是末级,则加子级
                    //    tree.children = new List<TreeEntityForLayui>();
                    retValue.Add(tree);
                });
            }
            return(retValue);
        }
Example #13
0
        /// <summary>
        /// 获取单一树节点下的所有子节点,用于动态加载
        /// </summary>
        /// <param name="PARENTID">父级ID</param>
        /// <returns></returns>
        public List <TreeEntityForLayui> GetSingleTreeNode(string ParentID)
        {
            List <TreeEntityForLayui> retValue = new List <TreeEntityForLayui>();
            List <GI_CodeDict>        list     = EntityOperate <GI_CodeDict> .GetEntityList(" PARENTID = '" + ParentID + "'", "DISPLAYSORT").Where(f => f.IsCance != 1).ToList();

            if (list != null && list.Count > 0)
            {
                list.Where(s => s.ParentID == ParentID).ToList().ForEach((f) =>
                {
                    TreeEntityForLayui tree = new TreeEntityForLayui()
                    {
                        name = f.DictName, id = f.DictID, pid = f.ParentID
                    };
                    if (f.ISLast != 1)//如果不是末级,则加子级
                    {
                        tree.children = new List <TreeEntityForLayui>();
                    }
                    retValue.Add(tree);
                });
            }
            return(retValue);
        }