示例#1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            int aid = MyCommFun.RequestInt("id");

            _strWhere        = "actid=" + aid + " " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = ubll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr;
                int     count = ds.Tables[0].Rows.Count;
                var     table = ds.Tables[0];
                table.Columns.Add("nickName");
                table.Columns.Add("headimgurl");
                for (int i = 0; i < count; i++)
                {
                    dr = table.Rows[i];
                    var openid = dr["openid"].ToString();
                    if (!string.IsNullOrEmpty(openid))
                    {
                        var userDto = _userService.Get(openid);
                        if (userDto != null)
                        {
                            var headImg = MyCommFun.getWebSite() + "/images/weichatDefaultHeadImg.jpg";
                            if (!string.IsNullOrEmpty(userDto.headimgurl))
                            {
                                headImg = userDto.headimgurl;
                            }
                            dr["nickName"]   = userDto.nickname;
                            dr["headimgurl"] = headImg;
                        }
                    }
                }
                ds.AcceptChanges();
            }
            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("luckyMoneyAwardUser.aspx", "id={0}&keywords={1}&page={2}", MyCommFun.RequestInt("id").ToString(), this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
        private void RptBind(string _strWhere, string _orderby)
        {
            int aid = MyCommFun.RequestInt("id");

            _strWhere        = "actid=" + aid + " " + _strWhere;
            this.page        = MXRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            DataSet ds = ubll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);

            this.rptList.DataSource = ds;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("dzpAwardUser.aspx?id=" + MyCommFun.RequestInt("id"), "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }