コード例 #1
0
    //绑定记录
    public void binddr()
    {
        ps_manager bll       = new ps_manager();
        string     sqlstr    = "";
        string     _strWhere = "";

        if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) == 0)
        {
            _strWhere = "id>0 ";
        }
        else if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) > 0)
        {
            _strWhere = "depot_category_id=" + Convert.ToInt32(Session["DepotCatID"]);
        }
        else if (Convert.ToInt32(Session["DepotID"]) > 0 && Convert.ToInt32(Session["DepotCatID"]) > 0)
        {
            _strWhere = "depot_id=" + Convert.ToInt32(Session["DepotID"]) + " and depot_category_id=" + Convert.ToInt32(Session["DepotCatID"]);
        }

        sqlstr = _strWhere + CombSqlTxt(this.status, this.category_id, this.depot_id, this.keywords);
        sqlstr = sqlstr + " order by add_time desc,id desc ";
        DataView dv = bll.GetList(sqlstr).Tables[0].DefaultView;

        repCategory.DataSource = dv;
        repCategory.DataBind();
    }
コード例 #2
0
    private void RptBind(string _strWhere, string _orderby)
    {
        this.page = AXRequest.GetQueryInt("page", 1);
        if (this.status > 0)
        {
            this.ddlStatus.SelectedValue = this.status.ToString();
        }
        if (this.category_id > 0)
        {
            this.ddlCategoryId.SelectedValue = this.category_id.ToString();
        }
        if (this.depot_id > 0)
        {
            this.ddlDepotId.SelectedValue = this.depot_id.ToString();
        }
        if (this.role_id > 0)
        {
            this.ddlRoleId.SelectedValue = this.role_id.ToString();
        }
        txtKeywords.Text = this.keywords;
        ps_manager bll = new ps_manager();

        this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
        this.rptList.DataBind();

        //绑定页码
        txtPageNum.Text = this.pageSize.ToString();
        string pageUrl = Utils.CombUrlTxt("manager_list.aspx", "status={0}&category_id={1}&depot_id={2}&keywords={3}&role_id={4}&page={5}", this.status.ToString(), this.category_id.ToString(), this.depot_id.ToString(), this.keywords, this.role_id.ToString(), "__id__");

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