/// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="filter">筛选条件</param>
        /// <returns>分页查询数据</returns>
        /// <remarks>2014-01-08  朱成果 创建</remarks>
        public override Pager <SpCouponCardType> Query(ParaCouponCardType filter)
        {
            string sql   = @"
              (
              select * from SpCouponCardType t where (@0 is null or t.Status=@0) and (@1 is null or charindex(t.TypeName,@1)>0)
              ) tb";
            var    paras = new object[]
            {
                filter.Status,
                filter.TypeName
            };
            var dataList  = Context.Select <SpCouponCardType>("tb.*").From(sql);
            var dataCount = Context.Select <int>("count(0)").From(sql);

            dataList.Parameters(paras);
            dataCount.Parameters(paras);
            var pager = new Pager <SpCouponCardType>
            {
                PageSize    = filter.PageSize,
                CurrentPage = filter.Id,
                TotalRows   = dataCount.QuerySingle(),
                Rows        = dataList.OrderBy("tb.sysNo desc").Paging(filter.Id, filter.PageSize).QueryMany()
            };

            return(pager);
        }
Example #2
0
 /// <summary>
 /// 分页获取优惠卡类型
 /// </summary>
 /// <param name="filter">筛选条件</param>
 /// <returns>优惠卡类型分页数据</returns>
 /// <remarks>2014-01-08 朱成果 创建</remarks>
 public Pager <SpCouponCardType> GetCouponCardTypePageList(ParaCouponCardType filter)
 {
     return(DataAccess.Promotion.ISpCouponCardTypeDao.Instance.Query(filter));
 }
Example #3
0
 /// <summary>
 /// 分页查询
 /// </summary>
 /// <param name="filter">筛选条件</param>
 /// <returns>分页查询数据</returns>
 /// <remarks>2014-01-08  朱成果 创建</remarks>
 public abstract Pager <SpCouponCardType> Query(ParaCouponCardType filter);