예제 #1
0
파일: inbox.aspx.cs 프로젝트: zxl881203/src
    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();
    }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack && base.Request["rid"] != null)
     {
         this._iMailID = Convert.ToInt32(base.Request["rid"]);
         this.RestoreMail(this._iMailID, this.Session["yhdm"].ToString());
         PTDBSJAction pTDBSJAction = new PTDBSJAction();
         pTDBSJAction.Delete(string.Concat(new object[]
         {
             " v_lxbm = '008' and v_YHDM = '",
             this.Session["yhdm"].ToString(),
             "' and i_XGID = '",
             this._iMailID,
             "'"
         }), 1);
         try
         {
             MailManage mailManage = new MailManage();
             mailManage.ReadMail(this._iMailID, this.Session["yhdm"].ToString());
         }
         catch
         {
         }
     }
 }
예제 #3
0
    protected void BtnToDraft_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (!mailManage.isAllowSize(this._strSenderCode))
        {
            this.Page.RegisterStartupScript("warn", "<script language=\"JavaScript\">alert('该邮件的附件总大小已经超过10M限制,请进行处理,否则该邮件无法保存到草稿箱!');</script>");
            return;
        }
        int    iSysID = int.Parse(this.Session["SysID"].ToString());
        string text   = this.TBoxTitle.Text.ToString();

        if (text.Length == 0)
        {
            text = "---";
        }
        string strContent  = this.TBoxContent.Text.ToString();
        string strUserCode = this.Session["HumanCode"].ToString();
        string strUserName = this.hf.Value.ToString();

        if (mailManage.SaveToDraft(iSysID, this._strSenderCode, this._strSenderName, text, strContent, strUserCode, strUserName, this.iMailType, this.Session["HumanName"].ToString(), this.Session["HumanName2"].ToString()))
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('保存到草稿箱成功!')</SCRIPT>");
            return;
        }
        this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('保存到草稿箱出错!')</SCRIPT>");
    }
예제 #4
0
    protected void BtnDelY_Click(object sender, EventArgs e)
    {
        int        num        = 0;
        MailManage mailManage = new MailManage();

        foreach (DataGridItem dataGridItem in this.DGridDraft.Items)
        {
            CheckBox checkBox = (CheckBox)dataGridItem.FindControl("cbSelSingle");
            if (checkBox.Checked)
            {
                int iMailID = int.Parse(this.DGridDraft.DataKeys[dataGridItem.ItemIndex].ToString());
                if (!mailManage.DelMail(iMailID, this._strSenderCode))
                {
                    this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('在移动部分邮件过程中出错!');</SCRIPT>");
                }
            }
        }
        if (num > 0)
        {
            if (this.DGridDraft.Items.Count > 0)
            {
                this.RegisterClientScriptBlock("Success", "<SCRIPT language=\"JavaScript\">alert('操作成功!');window.location.href=window.location.href;</SCRIPT>");
            }
        }
        else
        {
            this.RegisterClientScriptBlock("Success", "<SCRIPT language=\"JavaScript\">alert('请选择要删除的项!');window.location.href=window.location.href;</SCRIPT>");
        }
        this.DGridDraft_Bind(this.DGridDraft.CurrentPageIndex);
    }
예제 #5
0
    protected void BtnMove_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();
        string     a;

        if ((a = this.DDLtBox.SelectedValue.ToString()) != null)
        {
            if (a == "s")
            {
                foreach (DataGridItem dataGridItem in this.DGridDraft.Items)
                {
                    CheckBox checkBox = (CheckBox)dataGridItem.FindControl("cbSelSingle");
                    if (checkBox.Checked)
                    {
                        int iMailID = int.Parse(this.DGridDraft.DataKeys[dataGridItem.ItemIndex].ToString());
                        if (!mailManage.MoveToInBox(iMailID, this._iSysID, this._strSenderCode, "c"))
                        {
                            this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('在移动部分邮件过程中出错!');</SCRIPT>");
                        }
                    }
                }
                this.DGridDraft_Bind(this.DGridDraft.CurrentPageIndex);
                return;
            }
            if (a == "d")
            {
                foreach (DataGridItem dataGridItem2 in this.DGridDraft.Items)
                {
                    CheckBox checkBox = (CheckBox)dataGridItem2.FindControl("cbSelSingle");
                    if (checkBox.Checked)
                    {
                        int iMailID = int.Parse(this.DGridDraft.DataKeys[dataGridItem2.ItemIndex].ToString());
                        if (!mailManage.MoveToOutBox(iMailID, this._iSysID, this._strSenderCode, "c"))
                        {
                            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('在移动部分邮件过程中出错!');</SCRIPT>");
                        }
                    }
                }
                this.DGridDraft_Bind(this.DGridDraft.CurrentPageIndex);
                return;
            }
            if (!(a == "l"))
            {
                return;
            }
            foreach (DataGridItem dataGridItem3 in this.DGridDraft.Items)
            {
                CheckBox checkBox = (CheckBox)dataGridItem3.FindControl("cbSelSingle");
                if (checkBox.Checked)
                {
                    int iMailID = int.Parse(this.DGridDraft.DataKeys[dataGridItem3.ItemIndex].ToString());
                    if (!mailManage.MoveToRecycle(iMailID, this._strSenderCode))
                    {
                        this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('在移动部分邮件过程中出错!');</SCRIPT>");
                    }
                }
            }
            this.DGridDraft_Bind(this.DGridDraft.CurrentPageIndex);
        }
    }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Response.Cache.SetNoStore();
        SysManageDb sysManageDb = new SysManageDb();

        if (base.Request.QueryString.Count > 0)
        {
            try
            {
                this._iSysID = int.Parse(base.Request.QueryString["sysid"].ToString());
                goto IL_5F;
            }
            catch
            {
                goto IL_5F;
            }
        }
        this._iSysID = sysManageDb.GetDefault();
IL_5F:
        this.HdnSysID.Value = this._iSysID.ToString();
        if (!base.IsPostBack)
        {
            int num = 0;
            try
            {
                num = int.Parse(base.Request.QueryString["deptid"].ToString());
            }
            catch
            {
            }
            if (num > 1)
            {
                userManageDb userManageDb = new userManageDb();
                DataSet      dataSet      = userManageDb.DepUserQuaryForMail(num.ToString());
                DataTable    dataTable    = dataSet.Tables[0];
                this.LBoxHuman.Items.Clear();
                for (int i = 0; i < dataTable.Rows.Count; i++)
                {
                    ListItem item = new ListItem(dataTable.Rows[i]["v_xm"].ToString(), dataTable.Rows[i]["v_yhdm"].ToString());
                    this.LBoxHuman.Items.Add(item);
                }
            }
            else
            {
                if (num == -1)
                {
                    MailManage mailManage = new MailManage();
                    DataTable  dataTable2 = mailManage.SelLinkman(this.Session["yhdm"].ToString());
                    this.LBoxHuman.Items.Clear();
                    for (int j = 0; j < dataTable2.Rows.Count; j++)
                    {
                        ListItem item2 = new ListItem(dataTable2.Rows[j]["v_xm"].ToString(), dataTable2.Rows[j]["v_yhdm"].ToString());
                        this.LBoxHuman.Items.Add(item2);
                    }
                }
            }
            this.SelectedList_Restore();
        }
    }
예제 #7
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        mailManage.ReclaimMain(Convert.ToInt32(this.hdnKeyField.Value));
        mailManage.RecdeskTookip(this.HdnSJID.Value.ToString());
        this.gvReclaim.DataBind();
    }
예제 #8
0
    private void RestoreMail(int iMailID, string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  oneMail    = mailManage.GetOneMail(iMailID, strSenderCode);

        if (oneMail.Rows.Count > 0)
        {
            int num = int.Parse(oneMail.Rows[0]["i_SysID"].ToString());
            if (num != this._iSysID)
            {
                SysManageDb sysManageDb = new SysManageDb();
                DataTable   dataTable   = sysManageDb.QuerySys(num);
                string      str         = dataTable.Rows[0]["v_SysName"].ToString();
                dataTable.Rows[0]["v_Sys"].ToString();
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString() + "[来自:" + str + "]";
            }
            else
            {
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString();
            }
            this.LabConsignee.Text = oneMail.Rows[0]["v_jsrxm"].ToString();
            string strUserCode = oneMail.Rows[0]["v_jsrdm"].ToString();
            this.LabTitle.Text    = oneMail.Rows[0]["v_zt"].ToString();
            this.LabDateTime.Text = oneMail.Rows[0]["dtm_sjsj"].ToString();
            string text = oneMail.Rows[0]["txt_zw"].ToString();
            text = text.Replace("\r\n", "<BR>");
            text = text.Replace(" ", "&nbsp;");
            text = "&nbsp;&nbsp;&nbsp;&nbsp;" + text;
            this.contentBlock.InnerHtml = text;
            DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
            if (mailAnnex.Rows.Count > 0)
            {
                for (int i = 0; i < mailAnnex.Rows.Count; i++)
                {
                    string[] array = mailAnnex.Rows[i]["v_Lmc"].ToString().Split(new char[]
                    {
                        '-'
                    });
                    HtmlGenericControl expr_24F  = this.annexBlock;
                    string             innerHtml = expr_24F.InnerHtml;
                    expr_24F.InnerHtml = string.Concat(new string[]
                    {
                        innerHtml,
                        "<LI><A href=\"#\" onclick=\"javascript:download('",
                        mailAnnex.Rows[i]["v_fjlj"].ToString(),
                        mailAnnex.Rows[i]["v_Lmc"].ToString(),
                        "','",
                        array[1].ToString(),
                        "');\">",
                        array[1].ToString(),
                        "</A>"
                    });
                }
            }
            mailManage.ReadMail(iMailID, strUserCode);
        }
    }
예제 #9
0
    private string ShowWarn()
    {
        int        num        = 0;
        int        num2       = 0;
        string     text       = "";
        MailManage mailManage = new MailManage();
        DataTable  userSet    = mailManage.GetUserSet(this._strSenderCode);

        if (userSet.Rows.Count > 0)
        {
            num  = int.Parse(userSet.Rows[0]["i_MailNumber"].ToString());
            num2 = int.Parse(userSet.Rows[0]["i_DiskSpace"].ToString());
        }
        int mailNumber = mailManage.GetMailNumber(this._strSenderCode);
        int diskSpace  = mailManage.GetDiskSpace(this._strSenderCode);

        if (num < mailNumber || num2 < diskSpace)
        {
            text = "<FONT color=\"#FF0000\"><B>警告:</B></FONT>";
            string text2 = text;
            text = string.Concat(new string[]
            {
                text2,
                "你的邮箱中有",
                mailNumber.ToString(),
                "/",
                num.ToString(),
                "封邮件,"
            });
            string text3 = text;
            text = string.Concat(new string[]
            {
                text3,
                "磁盘空间占用",
                (Convert.ToSingle(diskSpace) / 1048576f).ToString("0.00"),
                "/",
                (num2 / 1048576).ToString("0.00"),
                "MB,"
            });
            if (num < mailNumber && num2 < diskSpace)
            {
                text += "<FONT color=\"#FF0000\"><B>邮件数量和磁盘空间</B></FONT>都超出设置,请清理邮箱,不然暂存区的邮件将无法收取!";
            }
            else
            {
                if (num < mailNumber)
                {
                    text += "<FONT color=\"#FF0000\"><B>邮件数量</B></FONT>超出设置,请清理邮箱!";
                }
                else
                {
                    text += "<FONT color=\"#FF0000\"><B>磁盘空间</B></FONT>超出设置,请清理邮箱!";
                }
            }
        }
        return(text);
    }
예제 #10
0
    protected void BtnDelN_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (mailManage.MoveToRecycle(this._iMailID, this._strHeaderCode))
        {
            base.Response.Redirect("MailSecretary.aspx?hcode" + this._strHeaderCode);
            return;
        }
        this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('将邮件移到垃圾箱失败!')</SCRIPT>");
    }
예제 #11
0
    private void RestoreMail(int iMailID, string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  oneMail    = mailManage.GetOneMail(iMailID, strSenderCode);

        if (oneMail.Rows.Count > 0)
        {
            int num = int.Parse(oneMail.Rows[0]["i_SysID"].ToString());
            if (num != this._iSysID)
            {
                SysManageDb sysManageDb = new SysManageDb();
                DataTable   dataTable   = sysManageDb.QuerySys(num);
                dataTable.Rows[0]["v_Sys"].ToString();
                string str = dataTable.Rows[0]["v_SysName"].ToString();
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString() + "[来自:" + str + "]";
            }
            else
            {
                this.LabSender.Text = oneMail.Rows[0]["v_fxrxm"].ToString();
            }
            this.LabConsignee.Text = this.sub(oneMail.Rows[0]["v_SJR"].ToString());
            this.LbCSR.Text        = this.sub(oneMail.Rows[0]["V_CSR"].ToString());
            this.LabTitle.Text     = oneMail.Rows[0]["v_zt"].ToString();
            this.LabDateTime.Text  = oneMail.Rows[0]["dtm_sjsj"].ToString();
            this.LblCon.Text       = oneMail.Rows[0]["txt_zw"].ToString();
            DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
            int       num2      = 20 * mailAnnex.Rows.Count;
            this.tr_fj.Attributes["height"] = num2.ToString() + "px";
            if (mailAnnex.Rows.Count > 0)
            {
                for (int i = 0; i < mailAnnex.Rows.Count; i++)
                {
                    string[] array = mailAnnex.Rows[i]["v_Lmc"].ToString().Split(new char[]
                    {
                        '-'
                    });
                    HtmlGenericControl expr_25A  = this.annexBlock;
                    string             innerHtml = expr_25A.InnerHtml;
                    expr_25A.InnerHtml = string.Concat(new string[]
                    {
                        innerHtml,
                        "<a href='",
                        mailAnnex.Rows[i]["v_fjlj"].ToString(),
                        mailAnnex.Rows[i]["v_Lmc"].ToString(),
                        "' target=_blank>",
                        array[1].ToString(),
                        "</a> "
                    });
                }
            }
            mailManage.ReadMail(iMailID, strSenderCode);
        }
    }
예제 #12
0
    public void exetimer()
    {
        MailManage mailManage    = new MailManage();
        int        newMailNumber = mailManage.GetNewMailNumber(this.Session["yhdm"].ToString());

        if (newMailNumber > 0)
        {
            this.PopupWin_Email.Visible  = true;
            this.PopupWin_Email.AutoShow = true;
            this.PopupWin_Email.Message  = "你有" + newMailNumber + "封新邮件!";
        }
    }
예제 #13
0
파일: annex.aspx.cs 프로젝트: zxl881203/src
    protected void BtnAddAnnex_Click(object sender, EventArgs e)
    {
        string     arg_10_0   = this.fileAnnex.PostedFile.FileName;
        MailManage mailManage = new MailManage();

        if (!mailManage.UpLoadAnnex(this.fileAnnex.PostedFile, this._strSenderCode))
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('" + mailManage.MessageString + "')</SCRIPT>");
            return;
        }
        this.GetTempAnnex();
    }
예제 #14
0
    private void GetMail(int iMailID)
    {
        MailManage mailManage = new MailManage();

        if (this._strOperType == "z" && !mailManage.ReEditAnnex(iMailID, this._strSenderCode))
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('还原邮件失败,请刷新试试!');</SCRIPT>");
            return;
        }
        DataTable oneMail = mailManage.GetOneMail(iMailID, this._strHeaderCode);

        if (oneMail.Rows.Count > 0)
        {
            if (this._strOperType == "r")
            {
                this.TBoxTitle.Text = "[回复]" + oneMail.Rows[0]["v_zt"].ToString();
            }
            else
            {
                if (this._strOperType == "z")
                {
                    this.TBoxTitle.Text = "[转发]" + oneMail.Rows[0]["v_zt"].ToString();
                }
                else
                {
                    this.TBoxTitle.Text = oneMail.Rows[0]["v_zt"].ToString();
                }
            }
            this.TBoxContent.Text = oneMail.Rows[0]["txt_zw"].ToString();
            if (this._strOperType == "z" && int.Parse(oneMail.Rows[0]["i_fjsl"].ToString()) > 0)
            {
                DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
                foreach (DataRow dataRow in mailAnnex.Rows)
                {
                    TextBox expr_18D = this.TBoxAnnex;
                    expr_18D.Text = expr_18D.Text + dataRow["v_Lmc"].ToString() + ",";
                }
            }
            if (oneMail.Rows[0]["i_MailType"].ToString() == "0")
            {
                this.RBtnMailType.Items[0].Selected = true;
            }
            else
            {
                this.RBtnMailType.Items[1].Selected = true;
            }
            this.Session["System"]    = oneMail.Rows[0]["i_SysID"].ToString() + ",";
            this.Session["HumanCode"] = oneMail.Rows[0]["i_SysID"].ToString() + ":" + oneMail.Rows[0]["v_fxrdm"].ToString() + "!";
            this.Session["HumanName"] = oneMail.Rows[0]["v_fxrxm"].ToString() + ",";
            this.TBoxConsignee.Text   = this.Session["HumanName"].ToString();
        }
    }
예제 #15
0
    private void DelTempAnnex(string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  tempAnnex  = mailManage.GetTempAnnex(strSenderCode);

        for (int i = 0; i < tempAnnex.Rows.Count; i++)
        {
            if (!mailManage.DelTempAnnex(int.Parse(tempAnnex.Rows[i]["i_fj_id"].ToString()), true))
            {
                this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('" + mailManage.MessageString + "');</SCRIPT>");
            }
        }
    }
예제 #16
0
    protected void btnSet_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt32(this.tbSet.Text.Trim()) <= 0)
        {
            this.js.Text = "alert('每页显示记录不能小于1');";
            return;
        }
        MailManage mailManage = new MailManage();

        mailManage.setPageSize(this.Session["yhdm"].ToString(), Convert.ToInt32(this.tbSet.Text.Trim()));
        this.Session["mailPageSize"] = this.tbSet.Text;
        this.DGridDraft_Bind(-1);
    }
예제 #17
0
파일: annex.aspx.cs 프로젝트: zxl881203/src
 protected void BtnDel_Click(object sender, EventArgs e)
 {
     if (this.LBoxAnnex.SelectedIndex > -1 && this.LBoxAnnex.Items.Count > 0)
     {
         int        iAnnexID   = int.Parse(this.LBoxAnnex.SelectedValue.ToString());
         MailManage mailManage = new MailManage();
         if (!mailManage.DelTempAnnex(iAnnexID, false))
         {
             this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('" + mailManage.MessageString + "')</SCRIPT>");
             return;
         }
         this.LBoxAnnex.Items.RemoveAt(this.LBoxAnnex.SelectedIndex);
     }
 }
예제 #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this._iSysID        = int.Parse(this.Session["SysID"].ToString());
     this._strSenderCode = this.Session["yhdm"].ToString();
     if (!base.IsPostBack)
     {
         MailManage mailManage = new MailManage();
         this.tbSet.Text = mailManage.getPageSize(this.Session["yhdm"].ToString()).ToString();
         this.Session["mailPageSize"] = this.tbSet.Text;
         this.DGridDraft_Bind(-1);
         this.BindBox(this.DDLtBox, "s,d,l");
         this.BtnDelY.Attributes["onclick"] = "return confirm('该操作不可恢复,你确认要删除?',1,0);";
     }
 }
예제 #19
0
    private void DGrdTrash_Bind(int iNewPage)
    {
        MailManage mailManage = new MailManage();
        DataTable  trashMail  = mailManage.GetTrashMail(this._strSenderCode);

        this.DGrdTrash.PageSize   = Convert.ToInt32(this.Session["mailPageSize"].ToString());
        this.DGrdTrash.DataSource = trashMail.DefaultView;
        if (trashMail.Rows.Count > 0 && iNewPage == (trashMail.Rows.Count + this.DGrdTrash.PageSize - 1) / this.DGrdTrash.PageSize)
        {
            this.DGrdTrash.CurrentPageIndex = iNewPage - 1;
        }
        this.DGrdTrash.DataBind();
        this.LabMail.Text = "垃圾箱共有邮件<FONT color=\"#ff0000\"><B>" + trashMail.Rows.Count.ToString() + "</B></FONT>封";
    }
예제 #20
0
    private bool DelTempAnnex(string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  tempAnnex  = mailManage.GetTempAnnex(strSenderCode);

        for (int i = 0; i < tempAnnex.Rows.Count; i++)
        {
            if (!mailManage.DelTempAnnex(int.Parse(tempAnnex.Rows[i]["i_fj_id"].ToString()), true))
            {
                return(false);
            }
        }
        return(true);
    }
예제 #21
0
    private void DGridDraft_Bind(int iNewPage)
    {
        MailManage mailManage = new MailManage();
        DataTable  draftMail  = mailManage.GetDraftMail(this._strSenderCode);

        this.DGridDraft.PageSize   = Convert.ToInt32(this.Session["mailPageSize"].ToString());
        this.DGridDraft.DataSource = draftMail.DefaultView;
        if (draftMail.Rows.Count > 0 && iNewPage == (draftMail.Rows.Count + this.DGridDraft.PageSize - 1) / this.DGridDraft.PageSize)
        {
            this.DGridDraft.CurrentPageIndex = iNewPage - 1;
        }
        this.DGridDraft.DataBind();
        this.LabMail.Text = "草稿箱邮件<FONT color=\"#ff0000\"><B>" + draftMail.Rows.Count + "</B></FONT>封";
    }
예제 #22
0
    protected void BtnDelN_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        foreach (DataGridItem dataGridItem in this.DGridDraft.Items)
        {
            CheckBox checkBox = (CheckBox)dataGridItem.FindControl("cbSelSingle");
            if (checkBox.Checked)
            {
                int iMailID = int.Parse(this.DGridDraft.DataKeys[dataGridItem.ItemIndex].ToString());
                if (!mailManage.MoveToRecycle(iMailID, this._strSenderCode))
                {
                    this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('在移动部分邮件过程中出错!');</SCRIPT>");
                }
            }
        }
        this.DGridDraft_Bind(this.DGridDraft.CurrentPageIndex);
    }
예제 #23
0
파일: annex.aspx.cs 프로젝트: zxl881203/src
    private void GetTempAnnex()
    {
        int num  = 0;
        int num2 = 2147483647;

        this.LBoxAnnex.Items.Clear();
        MailManage mailManage = new MailManage();
        DataTable  tempAnnex  = mailManage.GetTempAnnex(this._strSenderCode);

        foreach (DataRow dataRow in tempAnnex.Rows)
        {
            this.LBoxAnnex.Items.Add(new System.Web.UI.WebControls.ListItem(dataRow["v_AnnexName"].ToString(), dataRow["i_fj_id"].ToString()));
            num += int.Parse(dataRow["i_AnnexSize"].ToString());
        }
        if (num >= num2)
        {
            this.Page.RegisterStartupScript("warn", "<script language=\"JavaScript\">alert('该邮件的附件总大小已经超过10M限制,请进行处理,否则该邮件无法发送!');</script>");
        }
    }
예제 #24
0
    private void RestoreMail(int iMailID, string strSenderCode)
    {
        MailManage mailManage = new MailManage();
        DataTable  oneMail    = mailManage.GetOneMail(iMailID, strSenderCode);

        if (oneMail.Rows.Count > 0)
        {
            int.Parse(oneMail.Rows[0]["i_SysID"].ToString());
            this.LabSender.Text    = oneMail.Rows[0]["v_fxrxm"].ToString();
            this.LabConsignee.Text = this.sub(oneMail.Rows[0]["v_SJR"].ToString());
            this.LbCSR.Text        = this.sub(oneMail.Rows[0]["V_CSR"].ToString());
            this.LabTitle.Text     = oneMail.Rows[0]["v_zt"].ToString();
            this.LabDateTime.Text  = oneMail.Rows[0]["dtm_sjsj"].ToString();
            this.LblCon.Text       = oneMail.Rows[0]["txt_zw"].ToString();
            DataTable mailAnnex = mailManage.GetMailAnnex(iMailID);
            int       num       = 20 * mailAnnex.Rows.Count;
            this.tr_fj.Attributes["height"] = num.ToString() + "px";
            if (mailAnnex.Rows.Count > 0)
            {
                for (int i = 0; i < mailAnnex.Rows.Count; i++)
                {
                    string[] array = mailAnnex.Rows[i]["v_Lmc"].ToString().Split(new char[]
                    {
                        '-'
                    });
                    HtmlGenericControl expr_1C0  = this.annexBlock;
                    string             innerHtml = expr_1C0.InnerHtml;
                    expr_1C0.InnerHtml = string.Concat(new string[]
                    {
                        innerHtml,
                        "<LI><A href=\"#\" onclick=\"javascript:download('",
                        mailAnnex.Rows[i]["v_fjlj"].ToString(),
                        mailAnnex.Rows[i]["v_Lmc"].ToString(),
                        "','",
                        array[1].ToString(),
                        "');\">",
                        array[1].ToString(),
                        "</A>"
                    });
                }
            }
        }
    }
예제 #25
0
    protected void BtnDelN_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (mailManage.MoveToRecycle(this._iMailID, this._strSenderCode))
        {
            if (this._strMailBox == "s")
            {
                base.Response.Redirect("InBox.aspx");
                return;
            }
            if (this._strMailBox == "d")
            {
                base.Response.Redirect("OutBox.aspx");
                return;
            }
            if (this._strMailBox == "l")
            {
                base.Response.Redirect("TrashBox.aspx");
            }
        }
    }
예제 #26
0
    public void bindtree()
    {
        MailManage mailManage = new MailManage();
        DataTable  dataTable  = mailManage.getlatelyLinkman(this.Session["yhdm"].ToString());

        for (int i = 0; i < dataTable.Rows.Count; i++)
        {
            System.Web.UI.WebControls.TreeNode treeNode = new System.Web.UI.WebControls.TreeNode();
            if (dataTable.Rows[i][3].ToString().Trim() != "")
            {
                treeNode.Text = dataTable.Rows[i][3].ToString() + "[" + dataTable.Rows[i][4].ToString() + "]";
                if (dataTable.Rows[i][2].ToString().Trim().Length > 8)
                {
                    treeNode.Value = dataTable.Rows[i][2].ToString();
                }
                else
                {
                    treeNode.Value = "0:" + dataTable.Rows[i][2].ToString();
                }
                treeNode.Expanded = new bool?(true);
                this.TreeView1.Nodes.Add(treeNode);
            }
        }
    }
예제 #27
0
    protected void BtnToDraft_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (!mailManage.isAllowSize(this._strSenderCode))
        {
            this.Page.RegisterStartupScript("warn", "<script language=\"JavaScript\">alert('该邮件的附件总大小已经超过10M限制,请进行处理,否则该邮件无法保存到草稿箱!');</script>");
            return;
        }
        int    iMailType  = 0;
        string strTitle   = this.TBoxTitle.Text.ToString();
        string strContent = this.TBoxContent.Text.ToString();
        string text       = this.Session["HumanCode"].ToString();
        string text2      = this.Session["HumanName"].ToString();

        if (this._strMailBox == "c")
        {
            if (mailManage.UpdDraft(this._strSenderCode, this._iMailID, strTitle, strContent, text, text2, iMailType))
            {
                this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('成功更新草稿!');</SCRIPT>");
                return;
            }
            this.RegisterClientScriptBlock("warn", "<SCRIPT languange=\"JavaScript\">alert('更新草稿出错!');</SCRIPT>");
            return;
        }
        else
        {
            if (mailManage.SaveToDraft(this._iSysID, this._strSenderCode, this._strSenderName, strTitle, strContent, text, text2, iMailType))
            {
                this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('成功保存到草稿箱!')</SCRIPT>");
                return;
            }
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('保存到草稿箱出错!')</SCRIPT>");
            return;
        }
    }
예제 #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this._strSenderCode = this.Session["yhdm"].ToString();
     if (!base.IsPostBack)
     {
         int        num        = 0;
         float      num2       = 0f;
         MailManage mailManage = new MailManage();
         TableRow   tableRow   = new TableRow();
         TableCell  tableCell  = new TableCell();
         tableCell.Text            = "<A href=\"newmail.aspx\">收件箱</A>";
         tableCell.HorizontalAlign = HorizontalAlign.Center;
         tableRow.Cells.Add(tableCell);
         tableCell = new TableCell();
         int num3 = mailManage.GetInMailNumber(this._strSenderCode);
         num                      += num3;
         tableCell.Text            = num3.ToString();
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableCell = new TableCell();
         float num4 = (float)mailManage.GetInMailSize(this._strSenderCode);
         num4                     /= 1048576f;
         num2                     += num4;
         tableCell.Text            = num4.ToString("0.00");
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableRow.Height = Unit.Pixel(20);
         this.TabBox.Rows.Add(tableRow);
         tableRow                  = new TableRow();
         tableCell                 = new TableCell();
         tableCell.Text            = "<A href=\"outbox.aspx\">发件箱</A>";
         tableCell.HorizontalAlign = HorizontalAlign.Center;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num3                      = mailManage.GetOutMailNumber(this._strSenderCode);
         num                      += num3;
         tableCell.Text            = num3.ToString();
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num4                      = (float)mailManage.GetOutMailSize(this._strSenderCode);
         num4                     /= 1048576f;
         num2                     += num4;
         tableCell.Text            = num4.ToString("0.00");
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableRow.Height = Unit.Pixel(20);
         this.TabBox.Rows.Add(tableRow);
         tableRow                  = new TableRow();
         tableCell                 = new TableCell();
         tableCell.Text            = "<A href=\"draftbox.aspx\">草稿箱</A>";
         tableCell.HorizontalAlign = HorizontalAlign.Center;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num3                      = mailManage.GetDraftMailNumber(this._strSenderCode);
         num                      += num3;
         tableCell.Text            = num3.ToString();
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num4                      = (float)mailManage.GetDraftMailSize(this._strSenderCode);
         num4                     /= 1048576f;
         num2                     += num4;
         tableCell.Text            = num4.ToString("0.00");
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableRow.Height = Unit.Pixel(20);
         this.TabBox.Rows.Add(tableRow);
         tableRow                  = new TableRow();
         tableCell                 = new TableCell();
         tableCell.Text            = "<A href=\"trashbox.aspx\">垃圾箱</A>";
         tableCell.HorizontalAlign = HorizontalAlign.Center;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num3                      = mailManage.GetTrashMailNumber(this._strSenderCode);
         num                      += num3;
         tableCell.Text            = num3.ToString();
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         num4                      = (float)mailManage.GetTrashMailSize(this._strSenderCode);
         num4                     /= 1048576f;
         num2                     += num4;
         tableCell.Text            = num4.ToString("0.00");
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableRow.Height = Unit.Pixel(20);
         this.TabBox.Rows.Add(tableRow);
         tableRow                  = new TableRow();
         tableCell                 = new TableCell();
         tableCell.Text            = "当前状态";
         tableCell.HorizontalAlign = HorizontalAlign.Center;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         tableCell.Text            = num.ToString();
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableCell                 = new TableCell();
         tableCell.Text            = num4.ToString("0.00");
         tableCell.HorizontalAlign = HorizontalAlign.Right;
         tableRow.Cells.Add(tableCell);
         tableRow.Height = Unit.Pixel(20);
         this.TabBox.Rows.Add(tableRow);
         DataTable userSet = mailManage.GetUserSet(this._strSenderCode);
         if (userSet.Rows.Count > 0)
         {
             num3                      = int.Parse(userSet.Rows[0]["i_MailNumber"].ToString());
             num4                      = (float)int.Parse(userSet.Rows[0]["i_DiskSpace"].ToString());
             num4                     /= 1048576f;
             tableRow                  = new TableRow();
             tableCell                 = new TableCell();
             tableCell.Text            = "系统设置";
             tableCell.HorizontalAlign = HorizontalAlign.Center;
             tableRow.Cells.Add(tableCell);
             tableCell                 = new TableCell();
             tableCell.Text            = num3.ToString();
             tableCell.HorizontalAlign = HorizontalAlign.Right;
             tableRow.Cells.Add(tableCell);
             tableCell                 = new TableCell();
             tableCell.Text            = num4.ToString("0.00");
             tableCell.HorizontalAlign = HorizontalAlign.Right;
             tableRow.Cells.Add(tableCell);
             this.TabBox.Rows.Add(tableRow);
             tableRow             = new TableRow();
             tableCell            = new TableCell();
             tableCell.Text       = this.ShowWarn();
             tableCell.ColumnSpan = 3;
             tableRow.Cells.Add(tableCell);
             tableRow.Height = Unit.Pixel(20);
             this.TabBox.Rows.Add(tableRow);
         }
     }
 }
예제 #29
0
    protected void BtnSend_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (!mailManage.isAllowSize(this._strSenderCode))
        {
            this.Page.RegisterStartupScript("warn", "<script language=\"JavaScript\">alert('该邮件的附件总大小已经超过10M限制,请进行处理,否则该邮件无法发送!');</script>");
            return;
        }
        string text = this.Session["HumanCode"].ToString();

        if (text.Length == 0)
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('收件人不能为空!')</SCRIPT>");
            return;
        }
        string text2 = this.TBoxConsignee.Text.ToString();
        string text3 = this.TBoxTitle.Text.ToString();

        if (text3.Trim() == "")
        {
            text3 = "---";
        }
        string text4 = this.TBoxContent.Text.ToString();

        text4 = text4 + "<BR><B>本邮件是由" + this._strSenderName + "代为处理!</B>";
        int iMailType = int.Parse(this.RBtnMailType.SelectedValue.ToString());
        int iSms;

        if (this.CBoxSMS.Checked)
        {
            iSms = 1;
        }
        else
        {
            iSms = 0;
        }
        string text5 = "";

        string[] aryConsigneeCode = text.Split(new char[]
        {
            '!'
        });
        string[] aryConsigneeName = text2.Split(new char[]
        {
            ','
        });
        if (!mailManage.SendMail(this._iSysID, this._strHeaderCode, this._strHeaderName, DateTime.Now, text3, text4, iSms, aryConsigneeCode, aryConsigneeName, iMailType))
        {
            text5 += "向本系统发送邮件失败\\n";
        }
        if (this.CBoxSend.Checked && !mailManage.SaveToOut(this._iSysID, this._strSenderCode, this._strSenderName, text3, text4, text, text2, iMailType))
        {
            text5 += "将邮件保存到发件箱出错!";
        }
        mailManage.SetMailState(this._iMailID, this._strHeaderCode, this._strOperType);
        if (text5 != "")
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('" + text5 + "');</SCRIPT>");
            return;
        }
        this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('邮件发送成功!');</SCRIPT>");
    }
예제 #30
0
    protected void BtnSend_Click(object sender, EventArgs e)
    {
        MailManage mailManage = new MailManage();

        if (!mailManage.isAllowSize(this._strSenderCode))
        {
            this.Page.RegisterStartupScript("warn", "<script language=\"JavaScript\">alert('该邮件的附件总大小已经超过10M限制,请进行处理,否则该邮件无法发送!');</script>");
            return;
        }
        string text  = "";
        string text2 = this.Session["HumanCode"].ToString() + this.Session["HumanCode2"].ToString() + this.Session["HumanCode3"].ToString();

        if (this.Session["HumanCode"].ToString().Length == 0)
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('收件人不能为空!')</SCRIPT>");
            return;
        }
        string text3      = this.TBoxConsignee.Text.ToString();
        string strTitle   = this.TBoxTitle.Text.ToString();
        string strContent = this.TBoxContent.Text.ToString();
        int    iMailType  = 0;
        int    iSms;

        if (this.CBoxSMS.Checked)
        {
            iSms = 1;
        }
        else
        {
            iSms = 0;
        }
        text3 = this.Session["HumanName"].ToString() + this.Session["HumanName2"].ToString() + this.Session["HumanName3"].ToString();
        string[] aryConsigneeCode = text2.Split(new char[]
        {
            '!'
        });
        string[] aryConsigneeName = text3.Split(new char[]
        {
            ','
        });
        if (!mailManage.SendMail(this._iSysID, this._strSenderCode, this._strSenderName, DateTime.Now, strTitle, strContent, iSms, aryConsigneeCode, aryConsigneeName, iMailType, this.Session["HumanName"].ToString(), this.Session["HumanName2"].ToString(), 0))
        {
            text += "向本系统发送邮件失败\\n";
        }
        if (this.CBoxSend.Checked)
        {
            text3 = this.Session["HumanName"].ToString();
            text2 = this.Session["HumanCode"].ToString();
            if (!mailManage.SaveToOut(this._iSysID, this._strSenderCode, this._strSenderName, strTitle, strContent, text2, text3, iMailType, this.Session["HumanName"].ToString(), this.Session["HumanName2"].ToString()))
            {
                text += "将邮件保存到发件箱出错!";
            }
        }
        mailManage.SetMailState(this._iMailID, this._strSenderCode, this._strOperType);
        if (text != "")
        {
            this.RegisterClientScriptBlock("warn", "<SCRIPT language=\"JavaScript\">alert('" + text + "');</SCRIPT>");
            return;
        }
        base.Server.Transfer("viewmail_2.aspx");
    }