Пример #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            Model.wx_userweixin weixin = GetWeiXinCode();

            this.page = MXRequest.GetQueryInt("page", 1);

            this.txtKeywords.Text = this.keywords;
            //图表或列表显示
            BLL.wx_qp_base bll = new BLL.wx_qp_base();

            _strWhere = "wid=" + weixin.id + " and " + _strWhere;
            DataSet ds = bll.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     cout = ds.Tables[0].Rows.Count;
                for (int i = 0; i < cout; i++)
                {
                    dr             = ds.Tables[0].Rows[i];
                    dr["link_url"] = "<a href=\"javascript:;\">" + MyCommFun.getWebSite() + "/weixin/qiangpiao/index.aspx?wid=" + MyCommFun.ObjToStr(dr["wid"]) + "&aid=" + dr["id"].ToString() + "</a>";
                }
                ds.AcceptChanges();
            }
            this.rptList1.DataSource = ds;
            this.rptList1.DataBind();

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

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Пример #2
0
        private void TreeBind()
        {
            //Model.wx_userweixin weixin = GetWeiXinCode();
            BLL.wx_qp_base bll = new BLL.wx_qp_base();
            DataTable      dt  = bll.GetList("id>0").Tables[0];

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("请选择活动...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["bName"].ToString().Trim();
                this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
            }

            ddlCategoryId.SelectedValue = category_id.ToString();
        }