Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public IList<saRoleInfo> GetPageList(QueryRoleParams param)
        {
            string fields = @" * ";
            string table = @" saRole A with(nolock) ";
            StringBuilder where = new StringBuilder();
            where.Append(" 1=1 ");

            if (!param.sRoleName.IsNullOrWhiteSpace())
            {
                where.Append(" and A.sName like '%{0}%'".FormatEx(param.sRoleName.Trim()));
            }

            string order = "A.iSort Asc ";

            int pages = 0;
            int records = 0;
            DataTable dt = new DbServer().PageQuery(table, fields.ToString(), order.ToString(), where.ToString(), string.Empty, string.Empty, param.PageControl.PageSize, param.PageControl.PageIndex, 0, out pages, out records);
            param.PageControl.TotalPageCount = pages;
            param.PageControl.TotalRecordCount = records;

            IList<saRoleInfo> list = new List<saRoleInfo>();

            foreach (DataRow row in dt.Rows)
            {
                list.Add(DataRowBind(row));
            }

            return list;
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public DataTable GetPageList(QueryUserParams param)
        {
            string fields = @" * ";
            string table = @" saUser A with(nolock) ";
            StringBuilder where = new StringBuilder();
            where.Append(" 1=1 ");


            if (!param.sUserNo.IsNullOrWhiteSpace())
            {
                where.Append(" and A.sUserNo like '%{0}%'".FormatEx(param.sUserNo.Trim()));
            }

            if (!param.sUserName.IsNullOrWhiteSpace())
            {
                where.Append(" and A.sUserName like '%{0}%'".FormatEx(param.sUserName.Trim()));
            }

            string order = "A.sUserNo Asc ";

            int pages = 0;
            int records = 0;
            DataTable dt = new DbServer().PageQuery(table, fields.ToString(), order.ToString(), where.ToString(), string.Empty, string.Empty, param.PageControl.PageSize, param.PageControl.PageIndex, 0, out pages, out records);
            param.PageControl.TotalPageCount = pages;
            param.PageControl.TotalRecordCount = records;
            return dt;
        }