Пример #1
0
        protected override void AttachChildControls()
        {
            int    num;
            int    num2;
            string url = this.Page.Request.QueryString["returnUrl"];

            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"]))
            {
                this.Page.Response.Redirect(url);
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            this.rptStoreMessage = (VshopTemplatedRepeater)this.FindControl("rptStoreMessage");
            this.rptStoreMessage.ItemDataBound += new RepeaterItemEventHandler(this.rptStoreMessage_ItemDataBound);
            this.rptStoreMessage.ItemCommand   += new RepeaterCommandEventHandler(this.rptStoreMessage_ItemCommond);
            this.txtMsgCon      = (TextBox)this.FindControl("txtMsgCon");
            this.btnSave        = (Button)this.FindControl("btnSave");
            this.btnSave.Click += new EventHandler(this.btnSave_Click);
            this.txtTotalPages  = (HtmlInputHidden)this.FindControl("txtTotal");
            this.txtt           = (HtmlInputHidden)this.FindControl("txtt");
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 20;
            }

            StoreMessageQuery query = new StoreMessageQuery();

            if (this.Page.Request.QueryString["t"] != null)
            {
                query.MsgUserID = currentMember.UserId;
                t          = Convert.ToInt32(this.Page.Request.QueryString["t"]);
                txtt.Value = t + "";;
            }
            query.PageSize  = num2;
            query.PageIndex = num;
            query.SortBy    = "MsgTime";
            query.SortOrder = SortAction.Desc;
            DbQueryResult res = StoreMessageBrowser.GetMsgList(query);

            this.rptStoreMessage.DataSource = res.Data;
            this.rptStoreMessage.DataBind();
            this.txtTotalPages.SetWhenIsNotNull(res.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("我的留言");
        }
Пример #2
0
        private void BindSearch()
        {
            StoreMessageQuery query = new StoreMessageQuery
            {
                UserName  = this.txtUserName.Text.Trim(),
                StoreName = this.txtStoreName.Text,
                PageIndex = this.pager.PageIndex,
                PageSize  = this.pager.PageSize,
                SortBy    = "MsgTime",
                SortOrder = SortAction.Desc
            };
            DbQueryResult res = StoreMessageBrowser.GetMsgList(query);

            this.grdStoreMessage.DataSource = res.Data;
            this.grdStoreMessage.DataBind();
            this.pager.TotalRecords  = res.TotalRecords;
            this.pager1.TotalRecords = res.TotalRecords;
        }