Пример #1
0
    protected void ImageButton1_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();

        ZWL.BLL.ERPLanEmailShou MyModelShou = new ZWL.BLL.ERPLanEmailShou();

        MyModel .EmailTitle = this.TextBox1.Text;
        MyModel.EmailContent = this.TxtContent.Value;
        MyModel.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        MyModel.FromUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyModel.EmailState = "未读";
        MyModel.TimeStr = DateTime.Now;
        MyModelShou.TimeStr = MyModel.TimeStr;

          string[] ToWhoList = this.TextBox2.Text.Trim().Split(',');
        for (int i = 0; i < ToWhoList.Length; i++)
        {
            if (ToWhoList[i].Trim().Length > 0)
            {
                MyModel.ToUser = ToWhoList[i].Trim();
                MyModel.Add();
            }
        }

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户添加新邮件(" + this.TextBox1.Text + ")";
        MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "内部邮件发送成功!", "LanEmailShou.aspx");
    }
Пример #2
0
    protected void ImageButton1_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();

        ZWL.BLL.ERPLanEmailShou MyModelShou = new ZWL.BLL.ERPLanEmailShou();

        MyModel.EmailTitle   = this.TextBox1.Text;
        MyModel.EmailContent = this.TxtContent.Value;
        MyModel.FuJian       = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        MyModel.FromUser     = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyModel.EmailState   = "未读";
        MyModel.TimeStr      = DateTime.Now;
        MyModelShou.TimeStr  = MyModel.TimeStr;

        string[] ToWhoList = this.TextBox2.Text.Trim().Split(',');
        for (int i = 0; i < ToWhoList.Length; i++)
        {
            if (ToWhoList[i].Trim().Length > 0)
            {
                MyModel.ToUser = ToWhoList[i].Trim();
                MyModel.Add();
            }
        }

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户添加新邮件(" + this.TextBox1.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "内部邮件发送成功!", "LanEmailShou.aspx");
    }
Пример #3
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPLanEmailShou MyLanEmail = new ZWL.BLL.ERPLanEmailShou();
     GVData.DataSource = MyLanEmail.GetList("EmailTitle like '%" + this.TextBox1.Text.Trim() + "%' and FromUser like '%" + this.TextBox2.Text.Trim() + "%'  and EmailState like '%" + this.TextBox3.Text.Trim() + "%' and ShouUser='******' and (EmailState='未读' or EmailState='已读')  order by ID desc");
     GVData.DataBind();
     LabPageSum.Text     = Convert.ToString(GVData.PageCount);
     LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
     this.GoPage.Text    = LabCurrentPage.Text.ToString();
 }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            ZWL.BLL.ERPLanEmailShou MyLanEmail = new ZWL.BLL.ERPLanEmailShou();

            //获得最新的一个未读ID
            int NewMailID = int.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 ID from ERPLanEmailShou where ShouUser='******' and EmailState='未读' order by ID desc"));
            MyLanEmail.GetModel(NewMailID);
            this.Label5.Text = MyLanEmail.EmailTitle;
            this.Label2.Text = MyLanEmail.FromUser;
            this.Label4.Text = MyLanEmail.ToUser;
            this.Label3.Text = MyLanEmail.TimeStr.ToString();
            this.Label6.Text = MyLanEmail.EmailContent + "<br>" + ZWL.Common.PublicMethod.GetWenJian(MyLanEmail.FuJian, "../UploadFile/");
            this.Label7.Text = NewMailID.ToString();
            //新邮件个数
            this.Label1.Text = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select count(*) from ERPLanEmailShou where ShouUser='******' and EmailState='未读'");

            this.HyperLink1.NavigateUrl = "../LanEmail/EmailView.aspx?ID=" + NewMailID.ToString();
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["fromurl"] != null && Request.QueryString["fromurl"].ToString() == "0")
            {
                ZWL.Common.PublicMethod.CheckSession();

                ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();

                MyLanEmail.GetModel(int.Parse(Request.QueryString["ID"].ToString().Trim()));
                this.Label1.Text = MyLanEmail.EmailTitle;
                this.Label2.Text = MyLanEmail.FromUser;
                this.Label3.Text = MyLanEmail.ToUser;
                this.Label4.Text = MyLanEmail.TimeStr.ToString();
                this.Label5.Text = ZWL.Common.PublicMethod.GetWenJian(MyLanEmail.FuJian, "../UploadFile/");
                this.Label6.Text = MyLanEmail.EmailContent;

                //写系统日志
                ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
                MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
                MyRiZhi.DoSomething = "用户查看邮件(" + this.Label1.Text + ")";
                MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
                MyRiZhi.Add();

                ////设置为已读
                //if (MyLanEmail.ShouUser != null && MyLanEmail.ShouUser.Trim() == ZWL.Common.PublicMethod.GetSessionValue("UserName").Trim())
                //{
                //    if (MyLanEmail.EmailState == "未读")
                //    {
                //        ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPLanEmail set EmailState='已读' where ID=" + Request.QueryString["ID"].ToString().Trim());
                //    }
                //}
            }
            else
            {
                ZWL.Common.PublicMethod.CheckSession();

                ZWL.BLL.ERPLanEmailShou MyLanEmail = new ZWL.BLL.ERPLanEmailShou();

                MyLanEmail.GetModel(int.Parse(Request.QueryString["ID"].ToString().Trim()));
                this.Label1.Text = MyLanEmail.EmailTitle;
                this.Label2.Text = MyLanEmail.FromUser;
                this.Label3.Text = MyLanEmail.ToUser;
                this.Label4.Text = MyLanEmail.TimeStr.ToString();
                this.Label5.Text = ZWL.Common.PublicMethod.GetWenJian(MyLanEmail.FuJian, "../UploadFile/");
                this.Label6.Text = MyLanEmail.EmailContent;

                //写系统日志
                ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
                MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
                MyRiZhi.DoSomething = "用户查看邮件(" + this.Label1.Text + ")";
                MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
                MyRiZhi.Add();

                //设置为已读
                if (MyLanEmail.ShouUser != null && MyLanEmail.ShouUser.Trim() == ZWL.Common.PublicMethod.GetSessionValue("UserName").Trim())
                {
                    if (MyLanEmail.EmailState == "未读")
                    {
                        ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPLanEmail set EmailState='已读' where ID=" + Request.QueryString["ID"].ToString().Trim());
                    }
                }
            }
        }
    }