Esempio n. 1
0
    private void DGrdNew_Bind(int iNewPage)
    {
        MailManage mailManage = new MailManage();
        DataTable  newMail    = mailManage.GetNewMail(this._strSenderCode);
        int        count      = newMail.Rows.Count;

        this.LabMail.Text       = "新邮件<FONT color=\"#ff0000\"><B>" + count.ToString() + "</B></FONT>封";
        this.DGrdNew.PageSize   = Convert.ToInt32(this.Session["mailPageSize"].ToString());
        this.DGrdNew.DataSource = newMail.DefaultView;
        if (newMail.Rows.Count > 0 && iNewPage == (newMail.Rows.Count + this.DGrdNew.PageSize - 1) / this.DGrdNew.PageSize)
        {
            this.DGrdNew.CurrentPageIndex = iNewPage - 1;
        }
        this.DGrdNew.DataBind();
    }