예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DtCms.BLL.Products bll = new DtCms.BLL.Products();
            //查询分页绑定数据
            if (!string.IsNullOrEmpty(Request.QueryString["page"] + ""))
            {
                page = int.Parse(Request.QueryString["page"].ToString());

                back = page - 1;
                next = page + 1;

                if (back < 0)
                {
                    back = 0;
                }
            }


            if (!string.IsNullOrEmpty(Request.QueryString["title"] + ""))
            {
                title = " and Title like '%" + Request.QueryString["title"] + "%'";
            }

            if (!string.IsNullOrEmpty(Request.QueryString["type"] + ""))
            {
                type = Request.QueryString["type"].ToString();
                DataTable dt = bll.GetPageList(15, page, "ClassId not in(78,79) and ClassId=" + Request.QueryString["type"] + title, "  ID desc").Tables[0];
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();
            }
            else
            {
                DataTable dt = bll.GetPageList(15, page, "ClassId not in(78,79)" + title, "  ID desc").Tables[0];
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();
            }

            DataTable dt2 = DtCms.DBUtility.DbHelperOleDb.Query("select * from Channel where ClassList like '%,77,%' and ID not in(77)").Tables[0];

            this.Repeater2.DataSource = dt2;
            this.Repeater2.DataBind();
        }
예제 #2
0
        private void RptBind(string strWhere, string orderby)
        {
            if (!int.TryParse(Request.Params["page"] as string, out this.page))
            {
                this.page = 0;
            }
            DtCms.BLL.Products bll = new DtCms.BLL.Products();
            //获得总条数
            this.pcount = bll.GetCount(strWhere);
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            if (this.classId > 0)
            {
                this.ddlClassId.SelectedValue = this.classId.ToString();
            }
            this.txtKeywords.Text          = this.keywords;
            this.ddlProperty.SelectedValue = this.property;
            //图表或列表显示
            switch (this.prolistview)
            {
            case "Txt":
                this.rptList2.Visible    = false;
                this.rptList1.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby);
                this.rptList1.DataBind();
                break;

            default:
                this.rptList1.Visible    = false;
                this.rptList2.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby);
                this.rptList2.DataBind();
                break;
            }
        }