示例#1
0
        public List <SalaryDto> ListSalary()
        {
            SQLExecuteParam param = new SQLExecuteParam();

            param.sql = XMLHelper.GetNodeString("Report", "SQL/ListSalary");
            return(DBAgent.SQLExecuteReturnList <SalaryDto>(param));
        }
示例#2
0
        public List <RoleDto> ListRole()
        {
            SQLExecuteParam param = new SQLExecuteParam();

            param.sql = "select id, roleName from tbRole ";
            return(DBAgent.SQLExecuteReturnList <RoleDto>(param));
        }
示例#3
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <returns></returns>
        public List <UserDto> GetUserList()
        {
            SQLExecuteParam param = new SQLExecuteParam();

            param.sql = @"
                        select * from tb_user order by id desc
                        ";
            return(DBAgent.SQLExecuteReturnList <UserDto>(param));
        }
示例#4
0
        public List <AchievementDto> getAchievementDtoList()
        {
            SQLExecuteParam param = new SQLExecuteParam();

            param.sql = @"SELECT
                        tb_achievement.id,
                        tb_achievement.title,
                        tb_achievement.content,
                        tb_achievement.`status`,
                        tb_achievement.is_deleted,
                        tb_achievement.creator,
                        tb_achievement.create_time,
                        tb_achievement.pass_time
                        FROM
                        tb_achievement order by id desc
                        ";
            return(DBAgent.SQLExecuteReturnList <AchievementDto>(param));
        }
示例#5
0
        /// <summary>
        /// 根据角色ID获取权限列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List <PageTreeDto> GetPowerList(int id)
        {
            List <PageTreeDto> paglist = new List <PageTreeDto>();

            SQLExecuteParam SQL = new SQLExecuteParam();

            SQL.dict.Add("id", id);
            SQL.sql = @"SELECT
	                        A.id,
	                        A.fId,
	                        A.name AS text,
	                        A.type,
	                        B.id AS powerId,
                            A.controller,
                            A.param,
                            A.url,
                            A.icon
                        FROM tbPage AS A
                        LEFT JOIN (SELECT
	                        ROW_NUMBER() OVER (PARTITION BY pageId ORDER BY id) AS No,
	                        *
                        FROM tbPower WHERE roleId = @id) AS B
	                        ON A.id = B.pageId AND B.No = 1
	                        
                        WHERE A.isDeleted = 0 ORDER BY A.sort ASC";

            List <PagePowerDto> powerlist = DBAgent.SQLExecuteReturnList <PagePowerDto>(SQL);

            foreach (PagePowerDto item in powerlist)
            {
                if (item.type == 0)
                {
                    PageTreeDto dto = new PageTreeDto();
                    dto.pageId         = item.id;
                    dto.state.@checked = item.powerId > 0 ? true : false;
                    dto.text           = item.text;
                    dto.faicon         = item.icon;
                    dto.url            = item.url;
                    dto.controller     = item.controller;
                    dto.param          = item.param;
                    List <PageTreeMdDto> subpaglist = new List <PageTreeMdDto>();
                    foreach (PagePowerDto subitem in powerlist)
                    {
                        if (subitem.type == 1 && subitem.fId == item.id)
                        {
                            PageTreeMdDto subDto = new PageTreeMdDto();
                            subDto.pageId         = subitem.id;
                            subDto.state.@checked = subitem.powerId > 0 ? true : false;
                            subDto.text           = subitem.text;
                            subDto.url            = subitem.url;
                            subDto.controller     = subitem.controller;
                            subDto.param          = subitem.param;
                            List <PageTreeEndDto> thrdlist = new List <PageTreeEndDto>();
                            foreach (PagePowerDto thrditem in powerlist)
                            {
                                if (thrditem.type == 2 && thrditem.fId == subitem.id)
                                {
                                    PageTreeEndDto thrdDto = new PageTreeEndDto();
                                    thrdDto.pageId         = thrditem.id;
                                    thrdDto.state.@checked = thrditem.powerId > 0 ? true : false;
                                    thrdDto.text           = thrditem.text;
                                    thrdDto.url            = thrditem.url;
                                    thrdDto.controller     = thrditem.controller;
                                    thrdDto.param          = thrditem.param;
                                    thrdlist.Add(thrdDto);
                                }
                            }
                            subDto.nodes = thrdlist;
                            subpaglist.Add(subDto);
                        }
                    }
                    dto.nodes = subpaglist;
                    paglist.Add(dto);
                }
            }

            return(paglist);
        }