Esempio n. 1
0
    //显示数据
    private void BindData()
    {
        ZX_EmailBu email  = new ZX_EmailBu();
        bool       huizhi = email.getHuiZhi(Request.QueryString["id"]);

        if (huizhi)
        {
            this.hidHuiZhi.Value = Request.QueryString["id"];
        }

        DataSet ds1 = email.GetUserMail(Request.QueryString["id"]);

        this.mailForm1.DataSource = ds1;
        if (ds1.Tables[0].Rows[0]["remark"] != DBNull.Value)
        {
            ds1.Tables[0].Rows[0]["remark"] = ds1.Tables[0].Rows[0]["remark"].ToString();

            //if (huizhi == false)
            //{
            //    ds1.Tables[0].Rows[0]["remark"] = Util.ChangeToShow(ds1.Tables[0].Rows[0]["remark"].ToString());
            //}
            //else
            //{
            //    ds1.Tables[0].Rows[0]["remark"] = ds1.Tables[0].Rows[0]["remark"].ToString();
            //}
        }

        this.mailForm1.DataBind();
        email.Close();
    }
Esempio n. 2
0
    //向当前用户的直接领导发送邮件提醒功能
    public static void SendMailToLeader(string title, string remark, string url)
    {
        string user1  = HttpContext.Current.User.Identity.Name;
        string leader = null;

        if (String.IsNullOrEmpty(user1) == false)
        {
            U_UserNameBU userBU = new U_UserNameBU();
            leader = userBU.GetDirLeader();
            userBU.Close();
        }

        if (leader != null)
        {
            ZX_EmailBu email1 = new ZX_EmailBu();
            Hashtable  ht     = new Hashtable();
            ht["time0"]  = System.DateTime.Now.ToString();
            ht["title"]  = title;
            ht["remark"] = remark;
            ht["from1"]  = user1;
            ht["to1"]    = leader;
            ht["back"]   = "1";
            ht["url"]    = url;

            email1.AddMail(ht);
            email1.Close();
        }
    }
Esempio n. 3
0
    //提交批阅意见
    protected void Button1_Click(object sender, EventArgs e)
    {
        ZX_EmailBu email1 = new ZX_EmailBu();
        string     id     = Request.QueryString["id"];

        email1.setReplyEmail(id, this.TextBox1.Text);
        email1.Close();
        Response.Write("<br><br><br><br><br><br><center><font size='4'>您的信息已提交,请关闭窗口!<font></center>");
        Response.End();
    }
Esempio n. 4
0
    //得到最新的邮件ID信息
    private void GetNewEmail()
    {
        ZX_EmailBu email1 = new ZX_EmailBu();
        int        mailid = email1.GetNewMailID();

        if (mailid != 0)
        {
            this.NewEmailID.Value = mailid + "";
        }
        else
        {
            this.NewEmailID.Value = "";
        }
        email1.Close();
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            U_RolesBU role1    = new U_RolesBU();
            bool      isLeader = role1.isRole(new String[] { "公司领导", "综合管理", "评审部角色" });
            role1.Close();
            if (isLeader)
            {
                Response.Redirect("~/ZcMng1/ZongHeSearch.aspx", true);
            }
            else
            {
                this.BindData(null);
                //设置时效警告、邮件、最新信息的提示数据
                U_ZCTimeBU time1 = new U_ZCTimeBU();
                DataSet    ds1   = time1.GetMyTimeList(User.Identity.Name, null, 1);
                this.MyTimeCount.Value = ds1.Tables[0].Rows.Count + "";
                time1.Close();

                ZX_EmailBu email1 = new ZX_EmailBu();
                this.MyEmail.Value = email1.GetNewMailCount() + "";
                email1.Close();

                ZX_InfoBU info1 = new ZX_InfoBU();
                this.MyInfo.Value = info1.GetNewInfoCount() + "";
                info1.Close();


                if ((this.MyTimeCount.Value != "0" || this.MyEmail.Value != "0" || this.MyInfo.Value != "0") &&
                    Session["noReminder_" + User.Identity.Name] == null &&
                    Request.Cookies["noReminder_" + User.Identity.Name] == null)
                {
                    string js = "StartReminder();";
                    if (!Page.ClientScript.IsStartupScriptRegistered("StartJS"))
                    {
                        Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "StartJS", js, true);
                    }
                }
            }
        }
        this.AdvanceSearch1.SetDepartRow(false);
        this.AdvanceSearch1.OnMySearchClick += new EventHandler(AdvanceSearch1_OnMySearchClick);
        this.SearchControl1.SearchEvent     += new EventHandler(SearchControl1_SearchEvent);
    }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.QueryString["EmailID"] != null)
         {
             ZX_EmailBu email1 = new ZX_EmailBu();
             Hashtable  ht     = email1.GetMailDetailByID(Request.QueryString["EmailID"]);
             if (ht.Count > 0)
             {
                 this.from1.Text    = ht["from1"].ToString();
                 this.fromtime.Text = ht["time0"].ToString();
                 this.subject.Text  = ht["title"].ToString();
             }
             email1.Close();
         }
     }
 }
Esempio n. 7
0
    //bind data
    private void BindData()
    {
        ZX_EmailBu email1 = new ZX_EmailBu();

        int totalRow = 0;
        int curpage  = 1;

        if (ViewState["curpage"] != null)
        {
            curpage = (int)ViewState["curpage"];
        }
        string orderby = null;

        if (ViewState["orderby"] != null)
        {
            orderby = ((SqlOrderBy)(ViewState["orderby"])).OrderExpression;
        }

        DataSet ds1 = email1.GetUserMail(curpage, this.PageNavigator1.PageSize, orderby, out totalRow);

        this.GridView1.DataSource = ds1;
        this.GridView1.DataBind();

        this.PageNavigator1.TotalRows   = totalRow;
        this.PageNavigator1.CurrentPage = curpage;

        if (ds1.Tables[0].Rows.Count == 0 && curpage > 1)
        {
            ViewState["curpage"] = curpage - 1;
            this.BindData();
        }

        //隐藏删除等控件
        if (totalRow > 0)
        {
            this.info2.Visible = true;
        }
        else
        {
            this.info2.Visible = false;
        }

        email1.Close();
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZX_EmailBu email1 = new ZX_EmailBu();
            this.newmail.Text = email1.GetNewMailCount() + "";
            email1.Close();

            ZX_InfoBU info1 = new ZX_InfoBU();
            this.newinfo.Text = info1.GetNewInfoCount() + "";
            info1.Close();

            U_ZCTimeBU time1 = new U_ZCTimeBU();
            DataSet    ds1   = time1.GetMyTimeList(User.Identity.Name, null, 1);
            this.MyTime.Text = ds1.Tables[0].Rows.Count + "";
            ds1.Dispose();
            time1.Close();
        }
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //邮件提醒功能
            ZX_EmailBu email1 = new ZX_EmailBu();
            int        mailid = email1.GetNewMailID();
            if (mailid != 0)
            {
                this.NewEmailID.Value = mailid + "";
            }
            else
            {
                this.NewEmailID.Value = "";
            }
            email1.Close();

            this.GetNewMessage();
        }
    }
Esempio n. 10
0
    //设置邮件信息
    private void setMail()
    {
        DataSet ds1 = null;
        string  id  = null;

        if (Request.QueryString["tousers"] != null)
        {
            this.to1.Text = Server.UrlDecode(Request.QueryString["tousers"]);
        }

        if (Request.QueryString["sendid"] != null || Request.QueryString["inboxid"] != null)
        {
            //来自发件箱
            if (Request.QueryString["sendid"] != null)
            {
                id = Request.QueryString["sendid"];
                ZX_Email1BU email1 = new ZX_Email1BU();
                ds1 = email1.GetSendMail(id);
                email1.Close();
            }
            else
            {
                //来自收件箱
                id = Request.QueryString["inboxid"];
                ZX_EmailBu email2 = new ZX_EmailBu();
                ds1 = email2.GetUserMail(id);
                email2.Close();
            }
        }

        if (ds1 != null)
        {
            DataRow dr = ds1.Tables[0].Rows[0];
            if (Request["back"] != null)
            {
                this.Title      = "回复邮件"; //回复邮件
                this.title.Text = "回复:" + dr["title"].ToString();
                this.to1.Text   = dr["from1"].ToString();
                if (dr["remark"] != DBNull.Value)
                {
                    this.remark.Text = "<br><br><b>原邮件内容</b>:<br><hr>" + dr["remark"].ToString();
                }
            }
            else if (Request["transfer"] != null)
            {
                this.Title      = "转发邮件"; //转发邮件
                this.title.Text = "转发:" + dr["title"].ToString();
                if (dr["remark"] != DBNull.Value)
                {
                    this.remark.Text = dr["remark"].ToString();
                }

                //设置转发邮件列表(2008年6月1日)
                //编码:金寿吉 时间:2008年6月1日
                /*----设置转发邮件---------*/
                DataTable FileTable = ViewState["FileTable"] as DataTable;
                if (FileTable == null)
                {
                    FileTable = new DataTable();
                    FileTable.Columns.Add("FileName");
                    FileTable.Columns.Add("FileName1");
                    for (int i = 1; i <= 5; i++)
                    {
                        if (dr["file" + i].ToString().Trim() != String.Empty)
                        {
                            DataRow dr1 = FileTable.NewRow();
                            dr1["FileName"]  = dr["file" + i].ToString().Trim();
                            dr1["FileName1"] = dr["file" + i].ToString().Trim().Split('_')[2];
                            FileTable.Rows.Add(dr1);
                        }
                    }
                    ViewState["FileTable"] = FileTable;
                }
                if (FileTable.Rows.Count > 0)
                {
                    this.transRow.Visible         = true;
                    this.tranReapeater.DataSource = FileTable;
                    this.tranReapeater.DataBind();
                }
                /*----设置转发邮件---------*/
            }
            else if (Request["again"] != null)
            {
                this.Title      = "重发邮件"; //重发邮件
                this.title.Text = dr["title"].ToString();
                this.to1.Text   = dr["to1"].ToString();
                if (dr["remark"] != DBNull.Value)
                {
                    this.remark.Text = dr["remark"].ToString();
                }
            }
            else
            {
                ;
            }
        }
    }
Esempio n. 11
0
    //del mail
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string     id    = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
        ZX_EmailBu emal1 = new ZX_EmailBu();
        DataSet    ds1   = emal1.GetUserMail(id);
        string     file1 = ds1.Tables[0].Rows[0]["file1"].ToString();

        if (file1 != "" && file1 != null)
        {
            ZX_Email1BU email1 = new ZX_Email1BU();
            bool        Cunzai = email1.IfCzFile(file1, "1");
            if (Cunzai == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file1));
            }
            email1.Dispose();
        }
        string file2 = ds1.Tables[0].Rows[0]["file2"].ToString();

        if (file2 != "" && file2 != null)
        {
            ZX_Email1BU email2  = new ZX_Email1BU();
            bool        Cunzai2 = email2.IfCzFile(file2, "2");
            if (Cunzai2 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file2));
            }
            email2.Dispose();
        }
        string file3 = ds1.Tables[0].Rows[0]["file3"].ToString();

        if (file3 != "" && file3 != null)
        {
            ZX_Email1BU email3  = new ZX_Email1BU();
            bool        Cunzai3 = email3.IfCzFile(file3, "3");
            if (Cunzai3 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file3));
            }
            email3.Dispose();
        }
        string file4 = ds1.Tables[0].Rows[0]["file4"].ToString();

        if (file4 != "" && file4 != null)
        {
            ZX_Email1BU email4  = new ZX_Email1BU();
            bool        Cunzai4 = email4.IfCzFile(file4, "4");
            if (Cunzai4 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file4));
            }
            email4.Dispose();
        }
        string file5 = ds1.Tables[0].Rows[0]["file5"].ToString();

        if (file5 != "" && file5 != null)
        {
            ZX_Email1BU email5  = new ZX_Email1BU();
            bool        Cunzai5 = email5.IfCzFile(file5, "5");
            if (Cunzai5 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file5));
            }
            email5.Dispose();
        }
        emal1.DelMail(id);
        this.BindData();
        emal1.Close();
    }
Esempio n. 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request["kind"] != null && Request["kind"] == "1")
         {
             ZX_EmailBu Email = new ZX_EmailBu();
             DataSet    ds1   = Email.GetUserMail1(Request["id"].ToString());
             for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
             {
                 string file1 = ds1.Tables[0].Rows[i]["file1"].ToString();
                 if (file1 != "" && file1 != null)
                 {
                     ZX_Email1BU email1 = new ZX_Email1BU();
                     bool        Cunzai = email1.IfCzFile(file1, "1");
                     if (Cunzai == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file1));
                     }
                     email1.Dispose();
                 }
                 string file2 = ds1.Tables[0].Rows[i]["file2"].ToString();
                 if (file2 != "" && file2 != null)
                 {
                     ZX_Email1BU email2  = new ZX_Email1BU();
                     bool        Cunzai2 = email2.IfCzFile(file2, "2");
                     if (Cunzai2 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file2));
                     }
                     email2.Dispose();
                 }
                 string file3 = ds1.Tables[0].Rows[i]["file3"].ToString();
                 if (file3 != "" && file3 != null)
                 {
                     ZX_Email1BU email3  = new ZX_Email1BU();
                     bool        Cunzai3 = email3.IfCzFile(file3, "3");
                     if (Cunzai3 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file3));
                     }
                     email3.Dispose();
                 }
                 string file4 = ds1.Tables[0].Rows[i]["file4"].ToString();
                 if (file4 != "" && file4 != null)
                 {
                     ZX_Email1BU email4  = new ZX_Email1BU();
                     bool        Cunzai4 = email4.IfCzFile(file4, "4");
                     if (Cunzai4 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file4));
                     }
                     email4.Dispose();
                 }
                 string file5 = ds1.Tables[0].Rows[i]["file5"].ToString();
                 if (file5 != "" && file5 != null)
                 {
                     ZX_Email1BU email5  = new ZX_Email1BU();
                     bool        Cunzai5 = email5.IfCzFile(file5, "5");
                     if (Cunzai5 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file5));
                     }
                     email5.Dispose();
                 }
                 string id = ds1.Tables[0].Rows[i]["id"].ToString();
                 Email.DelMail(id);
                 Email.Close();
             }
             Response.Redirect("ReceiveMail.aspx", false);
         }
         else if (Request["kind"] != null && Request["kind"] == "2")
         {
             ZX_Email1BU emal1 = new ZX_Email1BU();
             DataSet     ds1   = emal1.GetSendMail1(Request["id"].ToString());
             for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
             {
                 string file1 = ds1.Tables[0].Rows[0]["file1"].ToString();
                 if (file1 != "" && file1 != null)
                 {
                     ZX_EmailBu email1 = new ZX_EmailBu();
                     bool       Cunzai = email1.IfCzFile(file1, "1");
                     if (Cunzai == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file1));
                     }
                     email1.Dispose();
                 }
                 string file2 = ds1.Tables[0].Rows[0]["file2"].ToString();
                 if (file2 != "" && file2 != null)
                 {
                     ZX_EmailBu email2  = new ZX_EmailBu();
                     bool       Cunzai2 = email2.IfCzFile(file2, "2");
                     if (Cunzai2 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file2));
                     }
                     email2.Dispose();
                 }
                 string file3 = ds1.Tables[0].Rows[0]["file3"].ToString();
                 if (file3 != "" && file3 != null)
                 {
                     ZX_EmailBu email3  = new ZX_EmailBu();
                     bool       Cunzai3 = email3.IfCzFile(file3, "3");
                     if (Cunzai3 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file3));
                     }
                     email3.Dispose();
                 }
                 string file4 = ds1.Tables[0].Rows[0]["file4"].ToString();
                 if (file4 != "" && file4 != null)
                 {
                     ZX_EmailBu email4  = new ZX_EmailBu();
                     bool       Cunzai4 = email4.IfCzFile(file4, "4");
                     if (Cunzai4 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file4));
                     }
                     email4.Dispose();
                 }
                 string file5 = ds1.Tables[0].Rows[0]["file5"].ToString();
                 if (file5 != "" && file5 != null)
                 {
                     ZX_EmailBu email5  = new ZX_EmailBu();
                     bool       Cunzai5 = email5.IfCzFile(file5, "5");
                     if (Cunzai5 == false)
                     {
                         File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file5));
                     }
                     email5.Dispose();
                 }
                 string id = ds1.Tables[0].Rows[i]["id"].ToString();
                 emal1.DelMail(id);
                 emal1.Close();
             }
             Response.Redirect("SendMail.aspx", false);
         }
     }
 }
Esempio n. 13
0
    //删除邮件
    protected void Button2_Click(object sender, EventArgs e)
    {
        ZX_EmailBu emal1 = new ZX_EmailBu();
        string     id    = Request.QueryString["id"];
        DataSet    ds1   = emal1.GetUserMail(id);
        string     file1 = ds1.Tables[0].Rows[0]["file1"].ToString();

        if (file1 != "" && file1 != null)
        {
            ZX_Email1BU email1 = new ZX_Email1BU();
            bool        Cunzai = email1.IfCzFile(file1, "1");
            if (Cunzai == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file1));
            }
            email1.Dispose();
        }
        string file2 = ds1.Tables[0].Rows[0]["file2"].ToString();

        if (file2 != "" && file2 != null)
        {
            ZX_Email1BU email2  = new ZX_Email1BU();
            bool        Cunzai2 = email2.IfCzFile(file2, "2");
            if (Cunzai2 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file2));
            }
            email2.Dispose();
        }
        string file3 = ds1.Tables[0].Rows[0]["file3"].ToString();

        if (file3 != "" && file3 != null)
        {
            ZX_Email1BU email3  = new ZX_Email1BU();
            bool        Cunzai3 = email3.IfCzFile(file3, "3");
            if (Cunzai3 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file3));
            }
            email3.Dispose();
        }
        string file4 = ds1.Tables[0].Rows[0]["file4"].ToString();

        if (file4 != "" && file4 != null)
        {
            ZX_Email1BU email4  = new ZX_Email1BU();
            bool        Cunzai4 = email4.IfCzFile(file4, "4");
            if (Cunzai4 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file4));
            }
            email4.Dispose();
        }
        string file5 = ds1.Tables[0].Rows[0]["file5"].ToString();

        if (file5 != "" && file5 != null)
        {
            ZX_Email1BU email5  = new ZX_Email1BU();
            bool        Cunzai5 = email5.IfCzFile(file5, "5");
            if (Cunzai5 == false)
            {
                File.Delete(Server.MapPath(Application["root"] + "/Common/MailFiles/" + file5));
            }
            email5.Dispose();
        }
        emal1.DelMail(id);
        Response.Redirect("ReceiveMail.aspx", true);
        emal1.Close();
    }