Beispiel #1
0
        public DbQueryResult GetUserRedPagerList(UserRedPagerQuery userredpagerquery)
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendFormat(" UserId={0} ", userredpagerquery.UserID);
            switch (userredpagerquery.Type)
            {
            case UserRedPagerType.All:
                builder.Append(" AND IsUsed=0  ");
                break;

            case UserRedPagerType.Usable:
                builder.Append(" AND IsUsed=0 and ExpiryTime>getdate() ");
                break;

            case UserRedPagerType.Expiry:
                builder.Append(" AND IsUsed=0 and ExpiryTime<getdate() ");
                break;

            default:
                builder.Append(" AND IsUsed=0 and ExpiryTime>getdate()  ");
                break;
            }
            return(DataHelper.PagingByRownumber(userredpagerquery.PageIndex, userredpagerquery.PageSize, userredpagerquery.SortBy, userredpagerquery.SortOrder, userredpagerquery.IsCount, "vshop_UserRedPager", "RedPagerID", builder.ToString(), "*"));
        }
Beispiel #2
0
        protected override void AttachChildControls()
        {
            int    num2;
            int    num3;
            string url = this.Page.Request.QueryString["returnUrl"];

            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"]))
            {
                this.Page.Response.Redirect(url);
            }
            string str2 = this.Page.Request.QueryString["status"];

            if (string.IsNullOrEmpty(str2))
            {
                str2 = "1";
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();
            int        num           = 0;

            int.TryParse(str2, out num);
            this.rptRedPagerList = (VshopTemplatedRepeater)this.FindControl("rptRedPagerList");
            this.txtTotal        = (HtmlInputHidden)this.FindControl("txtTotal");
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num2))
            {
                num2 = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num3))
            {
                num3 = 20;
            }
            UserRedPagerQuery userredpagerquery = new UserRedPagerQuery {
                UserID    = currentMember.UserId,
                IsCount   = true,
                PageIndex = num2,
                PageSize  = num3,
                SortBy    = "RedPagerID",
                SortOrder = SortAction.Desc,
                Type      = (UserRedPagerType)num
            };
            DbQueryResult userRedPagerList = UserRedPagerBrower.GetUserRedPagerList(userredpagerquery);

            this.rptRedPagerList.DataSource = userRedPagerList.Data;
            this.rptRedPagerList.DataBind();
            this.txtTotal.SetWhenIsNotNull(userRedPagerList.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("我的代金券");
        }
Beispiel #3
0
 public static DbQueryResult GetUserRedPagerList(UserRedPagerQuery userredpagerquery)
 {
     return(new UserRedPagerDao().GetUserRedPagerList(userredpagerquery));
 }