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

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

        if (inMailiss.Rows.Count > 0)
        {
            this.DGrdMail.PageSize   = System.Convert.ToInt32(this.Session["mailPageSize"].ToString());
            this.DGrdMail.DataSource = inMailiss.DefaultView;
            if (inMailiss.Rows.Count > 0 && iNewPage == (inMailiss.Rows.Count + this.DGrdMail.PageSize - 1) / this.DGrdMail.PageSize)
            {
                this.DGrdMail.CurrentPageIndex = iNewPage - 1;
            }
            decimal d             = System.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>封 容量:",
                System.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();
    }