コード例 #1
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        if (this.Request.QueryString["cid"] != null)
            this.txtcid_url.Text = this.Request.QueryString["cid"].ToString();

        //如果depid等于空,则返回按钮隐藏
        if (this.Request.QueryString["cid"] == null || this.Request.QueryString["cid"] == "")
        {
            this.fhsjlb.Visible = false;
        }

        //this.txtKeywords.Text = this.keywords;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.HyCategory HyCategory = new TPortalClass.HyCategory();
        DataTable dt = new DataTable();

        if (this.txtcid_url.Text == "")
        {
            //列出一级类别 0001
            dt = HyCategory.GetFirstlevCategory("0", page, pageSize);
            this.totalCount = HyCategory.GetFirstlevCategoryNum("0");
        }
        else
        {
            //列出子级类别 00010001....
            dt = HyCategory.GetSubCategory(this.txtcid_url.Text, "0", page, pageSize);
            this.totalCount = HyCategory.GetSubCategoryNum(this.txtcid_url.Text, "0");
        }

        rptList.DataSource = dt;
        rptList.DataBind();

        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        string pageUrl = HyCommon.CombUrlTxt("list_category.aspx", "page={0}&rnd={1}&cid={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtcid_url.Text + "");
        PageContent.InnerHtml = HyCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
コード例 #2
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtdate_s.Text = this.keyword_s;
        this.txtdate_e.Text = this.keyword_e;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.HySyslogs HySyslogs = new TPortalClass.HySyslogs();

        TPortalClass.HyCommon HyCommon = new TPortalClass.HyCommon();
        string ls_kssj = this.txtdate_s.Text;
        string ls_jssj = this.txtdate_e.Text;

        DataTable dt = HySyslogs.Getlogs_search(ls_kssj, ls_jssj);
        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();

        string pageUrl = HyCommon.CombUrlTxt("list_log.aspx", "page={0}&rnd={1}&keyword_s={2}&keyword_e={3}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtdate_s.Text + "", "" + this.txtdate_e.Text + "");
        PageContent.InnerHtml = HyCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }