Beispiel #1
0
        /// <summary>
        /// 获取分页列表
        /// </summary>
        /// <param name="request">查询参数</param>
        /// <returns>会分页列表</returns>
        public PagedList <CrAgency> GetAdminPager(CrAgencyQueryRequest request)
        {
            var dataCount = DBContext.Select <int>("count(0)").From("agent_cragency");
            var dataList  = DBContext.Select <CrAgency>("*").From("agent_cragency");

            Action <string, string, object> setWhere = (@where, name, value) =>
            {
                dataCount.AndWhere(where).Parameter(name, value);
                dataList.AndWhere(where).Parameter(name, value);
            };

            //if (request.CustomerSysNo.HasValue)
            //{
            //setWhere(string.Format("CONCAT(',',LevelCustomerStr,',') like '%,{0},%'", request.LevelCustomerSysNo.Value), "", "");
            //}

            return(new PagedList <CrAgency>
            {
                TData = dataList.Paging(request.CurrentPageIndex.GetHashCode(), request.PageSize.GetHashCode()).OrderBy("SysNo desc").QueryMany(),
                CurrentPageIndex = request.CurrentPageIndex.GetHashCode(),
                TotalCount = dataCount.QuerySingle()
            });
        }
Beispiel #2
0
 /// <summary>
 /// 获取奖金记录分页列表
 /// </summary>
 /// <param name="request">查询参数</param>
 /// <returns>奖金记录分页列表</returns>
 public PagedList <CrAgency> GetPagerList(CrAgencyQueryRequest request)
 {
     return(Using <ICrAgency>().GetPagerList(request));
 }