Ejemplo n.º 1
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public SPagintion <SysUser> FindByPagination(int pageNum, int pageSize, string username, string fullName)
        {
            List <object> listParam = new List <object>();
            String        whereSql  = "";

            if (username != null && username.Length > 0)
            {
                whereSql += " and username like ? ";
                listParam.Add("%" + username + "%");
            }
            if (fullName != null && fullName.Length > 0)
            {
                whereSql += " and fullName like ? ";
                listParam.Add("%" + fullName + "%");
            }

            SPagintion <SysUser> page = SysUserDao.FindByPagintion(whereSql, listParam.ToArray(), "id desc", pageSize, pageNum);

            return(page);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public SPagintion <SysUser> FindByPagination(int pageNum, int pageSize, string code, string name)
        {
            List <object> listParam = new List <object>();
            String        whereSql  = "";

            if (code != null && code.Length > 0)
            {
                whereSql += " and code like ? ";
                listParam.Add("%" + code + "%");
            }
            if (name != null && name.Length > 0)
            {
                whereSql += " and name like ? ";
                listParam.Add("%" + name + "%");
            }

            SPagintion <SysUser> page = SysUserDao.FindByPagintion(whereSql, listParam.ToArray(), "id desc", pageSize, pageNum);

            return(page);
        }