Beispiel #1
0
    private void DGrdMail_Bind(int iNewPage)
    {
        MailManage mailManage = new MailManage();
        DataTable  inMail     = mailManage.GetInMail(this._strSenderCode, -1);

        this.DGrdMail.DataSource = inMail.DefaultView;
        int count = inMail.Rows.Count;

        if (inMail.Rows.Count > 0)
        {
            this.DGrdMail.PageSize   = Convert.ToInt32(this.Session["mailPageSize"].ToString());
            this.DGrdMail.DataSource = inMail.DefaultView;
            if (inMail.Rows.Count > 0 && iNewPage == (inMail.Rows.Count + this.DGrdMail.PageSize - 1) / this.DGrdMail.PageSize)
            {
                this.DGrdMail.CurrentPageIndex = iNewPage - 1;
            }
            decimal d             = Convert.ToDecimal(mailManage.getAllAnnexSize(this.Session["yhdm"].ToString()));
            int     userMailSpace = mailManage.getUserMailSpace(this.Session["yhdm"].ToString());
            this.LabMail.Text = string.Concat(new object[]
            {
                "收件箱邮件<FONT color=\"#ff0000\"><B>",
                count.ToString(),
                "</B></FONT>封 容量:",
                Convert.ToDecimal(d / 1024m / 1024m).ToString("0.00"),
                "M/",
                userMailSpace,
                "M"
            });
        }
        else
        {
            this.LabMail.Text = "收件箱邮件<FONT color=\"#ff0000\"><B>0</B></FONT>封";
        }
        this.DGrdMail.DataBind();
    }