Beispiel #1
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();
        }
    }
Beispiel #2
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());
                    }
                }
            }
        }
    }