Exemple #1
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="QuickConditions"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public PagingEntity GetDataSource(Hashtable query, int pageindex, int pagesize)
        {
            string where = "";
            PagingEntity pe = db.Find(@"select uFunction_ID _ukid, iFunction_Number, cFunction_Name, cFunction_ByName, dFunction_CreateTime from [dbo].[T_Function]
                                                where 1=1 " + where + " order by  iFunction_Number ", pageindex, pagesize);

            return(new ToJson().GetPagingEntity(pe, new List <BaseEntity>()
            {
                new T_Function()
            }));
        }
Exemple #2
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="QuickConditions"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public PagingEntity GetDataSource(Hashtable query, int pageindex, int pagesize)
        {
            string where = "";
            where       += string.IsNullOrEmpty(Tools.getString(query[Tools.getAttrName(() => troles.cRoles_Name)])) ? "" : " and " + Tools.getAttrName(() => troles.cRoles_Name) + " like '%" + Tools.getString(query[Tools.getAttrName(() => troles.cRoles_Name)]) + "%' ";

            var pe = db.Find(@"select uRoles_ID _ukid, cRoles_Number, cRoles_Name, cRoles_Remark, dRoles_CreateTime from T_Roles where 1=1 " + where + " order by cRoles_Number ", pageindex, pagesize);

            return(new ToJson().GetPagingEntity(pe, new List <BaseEntity>()
            {
                new T_Roles()
            }));
        }
Exemple #3
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="QuickConditions"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public PagingEntity GetDataSource(Hashtable query, int pageindex, int pagesize)
        {
            string where = "";
            where       += string.IsNullOrEmpty(Tools.getString(query["Member_Name"])) ? "" : " and Member_Name like '%" + Tools.getString(query["Member_Name"]) + "%'";

            var pe = db.Find(@"select Member_Name,Member_Sex,Member_CreateTime,Member_ID _ukid from member where 1=1 " + where + " ", pageindex, pagesize);

            return(new ToJson().GetPagingEntity(pe, new List <BaseEntity>()
            {
                new MemberM()
            }));
        }
Exemple #4
0
    public DataTable GetMenuByRoleID()
    {
        if (Tools.getSession("RoleID").Equals("admin"))
        {
            return(db.Find(@"select uMenu_ID,cMenu_Name,cMenu_Url,cMenu_Icon,uMenu_ParentId,cMenu_Number from T_Menu order by cMenu_Number asc"));
        }
        else
        {
            return(db.Find(@"select a.uMenu_ID,a.cMenu_Name,a.cMenu_Url,a.cMenu_Icon,a.uMenu_ParentID,a.cMenu_Number  from (select * from T_Menu 
                         where (cMenu_Url is  null or cMenu_Url='') )a
                         join                                    
 (select cMenu_Number,uMenu_ParentID
                 from dbo.T_RoleMenuFunction join T_Menu on uMenu_ID=uRoleMenuFunction_MenuID and uRoleMenuFunction_RoleID='" + Tools.getSession("RoleID").To_Guid() + @"'
            group by uRoleMenuFunction_MenuID,uRoleMenuFunction_RoleID,cMenu_Number,uMenu_ParentID
                   ) b on charindex(a.cMenu_Number,b.cMenu_Number)>0 or b.uMenu_ParentID=a.uMenu_ID
               union select uMenu_ID,cMenu_Name,cMenu_Url,cMenu_Icon,uMenu_ParentID,cMenu_Number 
                from T_Menu
           join (select uRoleMenuFunction_MenuID,uRoleMenuFunction_RoleID 
           from dbo.T_RoleMenuFunction 
           group by uRoleMenuFunction_MenuID,uRoleMenuFunction_RoleID)a
            on uMenu_ID=a.uRoleMenuFunction_MenuID and a.uRoleMenuFunction_RoleID='" + Tools.getSession("RoleID").To_Guid() + @"'
              order by cMenu_Number asc"));
        }
    }
Exemple #5
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="QuickConditions"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public PagingEntity GetDataSource(Hashtable query, int pageindex, int pagesize)
        {
            string where = "";
            where       += string.IsNullOrEmpty(Tools.getString(query[Tools.getAttrName(() => tusers.cUsers_Name)])) ? "" : " and " + Tools.getAttrName(() => tusers.cUsers_Name) + " like '%" + Tools.getString(query[Tools.getAttrName(() => tusers.cUsers_Name)]) + "%' ";
            where       += string.IsNullOrEmpty(Tools.getString(query[Tools.getAttrName(() => tusers.cUsers_LoginName)])) ? "" : " and " + Tools.getAttrName(() => tusers.cUsers_LoginName) + " like '%" + Tools.getString(query[Tools.getAttrName(() => tusers.cUsers_LoginName)]) + "%' ";

            PagingEntity pe = db.Find(@"select cUsers_Name, cUsers_LoginName,cRoles_Name ,dUsers_CreateTime,uUsers_ID _ukid
				            from T_Users a
				            left join dbo.T_UsersRoles b on a.uUsers_ID=b.uUsersRoles_UsersID
				            left join dbo.T_Roles c on b.uUsersRoles_RoleID=c.uRoles_ID
                                                where 1=1 " + where + " ", pageindex, pagesize);

            return(new ToJson().GetPagingEntity(pe, new List <BaseEntity>()
            {
                new T_Users(),
                new T_Roles()
            }));
        }