Beispiel #1
0
    protected void btn_Draft_Click(object sender, EventArgs e)
    {
        //草稿
        ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();

        MyModel.EmailTitle = this.TextBox1.Text;
        MyModel.EmailContent = this.TxtContent.Text;
        MyModel.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        MyModel.FromUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyModel.EmailState = "草稿";
        string[] ToWhoList = this.UserName_Input.Value.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();
        Response.Write("<script>alert('新增记录成功!');window.location.href='" + ReturnInput.Value + "'</script>");
    }
Beispiel #2
0
    protected void ImageButton4_Click(object sender, EventArgs e)
    {
        //草稿
        ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();

        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;
        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");
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            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.ToUser.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());
                }
            }
        }
    }
Beispiel #4
0
    /// <summary>
    /// 发送内部短信和手机短信
    /// </summary>
    /// <param name="MailChk">内部短信选择框</param>
    /// <param name="SmsChk">手机短信选择框</param>
    /// <param name="ContentStr">发送消息内容</param>
    /// <param name="ToUserList">接收人列表</param>
    public static void SendMessage(CheckBox MailChk,CheckBox SmsChk,string ContentStr,string ToUserList)
    {
        if (SmsChk.Checked == true)
        {
            //发送手机信息
            //Mobile.SendSMS("系统消息", ToUserList, ContentStr);
            string WrongUser = Mobile.UserToTel(ToUserList, ContentStr);    //发送人名,发送内容
        }

        string[] UserListStr = ToUserList.Split(',');
        for (int i = 0; i < UserListStr.Length; i++)
        {
            if (MailChk.Checked == true)
            {
                //发送内部信息
                ZWL.BLL.ERPLanEmail MyMail = new ZWL.BLL.ERPLanEmail();
                MyMail.EmailContent = ContentStr;
                MyMail.EmailState = "未读";
                MyMail.EmailTitle = ContentStr;
                MyMail.FromUser = "******";
                MyMail.FuJian = "";
                MyMail.TimeStr = DateTime.Now;
                MyMail.ToUser = UserListStr[i].ToString();
                MyMail.Add();
            }
        }
    }
Beispiel #5
0
 public void DataBindToGridview()
 {
     DataEntityDataContext context = new DataEntityDataContext();
     ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();
     var T = context.ERPLanEmail.Where(p => p.FromUser == ZWL.Common.PublicMethod.GetSessionValue("UserName") && p.EmailState == "草稿").OrderByDescending(p => p.ID);
     EmailList = T.ToList();
 }
Beispiel #6
0
    public void DataBindToGridview()
    {
        string XiaShuUser = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'");
        string SSTempSTR = "";
        if (XiaShuUser != "全部")
        {
            SSTempSTR = "and ToUser in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")";
        }

        ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();
        GVData.DataSource = MyLanEmail.GetList("EmailTitle like '%" + this.TextBox1.Text.Trim() + "%' and ToUser like '%" + this.TextBox2.Text.Trim() + "%'  and EmailState like '%" + this.TextBox3.Text.Trim() + "%' " + SSTempSTR + " 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();
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            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 = ZWL.DBUtility.DbHelperSQL.GetSHSL("select [TrueName] from ERPUser where [UserName]='" + MyLanEmail.FromUser + "'");
            string ToUser = "";
            foreach(string C in MyLanEmail.ToUser.Split(',')) {
                string CTrueName = ZWL.DBUtility.DbHelperSQL.GetSHSL("select [TrueName] from ERPUser where [UserName]='" + C + "'");
                if(!string.IsNullOrEmpty(CTrueName)) {
                    ToUser += ToUser == "" ? CTrueName : "," + CTrueName;
                }
                else {
                    ToUser += ToUser == "" ? C : "," + C;
                }
            }
            this.Label3.Text = 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.ToUser.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());
                }
            }
            ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../LanEmail/LanEmailShou.aspx" : Request.UrlReferrer.ToString();
            if(ReturnInput.Value.IndexOf("LanEmailAdd") != -1) { //若上级是新增页面
                iframeid.Value = Request.QueryString["iframeid"].ToString();
            }
        }
    }
Beispiel #8
0
 protected void CheckChaoShi()
 {
     DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPNWorkToDo where getdate()>LateTime and StateNow='���ڰ���' and  ','+ShenPiUserList+',' like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%' and ','+OKUserList+',' not like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%' order by ID asc");
     for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
     {
         ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
         MyModel.EmailContent = "���д��칤��δ�����ʱ���ѳ�ʱ����(" + MyDataSet.Tables[0].Rows[j]["WorkName"].ToString() + "-������ˮ�ţ�" + MyDataSet.Tables[0].Rows[j]["ID"].ToString() + ")";
         MyModel.EmailState = "�";
         MyModel.EmailTitle = "���д��칤��δ�����ʱ���ѳ�ʱ��(" + MyDataSet.Tables[0].Rows[j]["WorkName"].ToString() + "-������ˮ�ţ�" + MyDataSet.Tables[0].Rows[j]["ID"].ToString() + ")";
         MyModel.FromUser = "******";
         MyModel.FuJian = "";
         MyModel.TimeStr = DateTime.Now;
         MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
         if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
         {
             MyModel.Add();
         }
     }
 }
Beispiel #9
0
    protected void CheckRiCheng()
    {
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPAnPai where UserName='******' and datediff(minute,getdate(),TimeTiXing)<2 and datediff(minute,getdate(),TimeTiXing)>0");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您所制定的日程安排提醒时间到。(" + MyDataSet.Tables[0].Rows[j]["TitleStr"].ToString() + ")";
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您所制定的日程安排提醒时间到。(" + MyDataSet.Tables[0].Rows[j]["TitleStr"].ToString() + ")";
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #10
0
 protected void CheckFK()
 {
     string ToDayStr = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
     DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPRecive where CreateUser='******' and NowState='F' and TiXingDate='" + ToDayStr + "'");
     for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
     {
         ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
         MyModel.EmailContent = "�����ƶ��ĸ���ƻ�����ʱ���ѵ���(" + MyDataSet.Tables[0].Rows[j]["HeTongName"].ToString() + "--" + MyDataSet.Tables[0].Rows[j]["QianYueKeHu"].ToString() + ")";
         MyModel.EmailState = "�";
         MyModel.EmailTitle = "�����ƶ��ĸ���ƻ�����ʱ���ѵ���(" + MyDataSet.Tables[0].Rows[j]["HeTongName"].ToString() + "--" + MyDataSet.Tables[0].Rows[j]["QianYueKeHu"].ToString() + ")";
         MyModel.FromUser = "******";
         MyModel.FuJian = "";
         MyModel.TimeStr = DateTime.Now;
         MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
         if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
         {
             MyModel.Add();
         }
     }
 }
Beispiel #11
0
    //检测产品库存
    protected void CheckKuCun()
    {
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPProduct  where NowKuCun<=KuCunBaoJing  order by ID asc");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您的产品库存不足,请及时处理!(" + MyDataSet.Tables[0].Rows[j]["ProductName"].ToString() + ")";
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您的产品库存不足,请及时处理!(" + MyDataSet.Tables[0].Rows[j]["ProductName"].ToString() + ")";
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #12
0
    protected void CheckChaoShi()
    {
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPNWorkToDo where getdate()>LateTime and StateNow='正在办理' and  ','+ShenPiUserList+',' like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%' and ','+OKUserList+',' not like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%' order by ID asc");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您有待办工作未办理,时间已超时!。(" + MyDataSet.Tables[0].Rows[j]["WorkName"].ToString() + "-工作流水号:" + MyDataSet.Tables[0].Rows[j]["ID"].ToString() + ")";
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您有待办工作未办理,时间已超时!(" + MyDataSet.Tables[0].Rows[j]["WorkName"].ToString() + "-工作流水号:" + MyDataSet.Tables[0].Rows[j]["ID"].ToString() + ")";
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #13
0
    protected void CheckYiQi()
    {
        string  ToDayStr  = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPSheBei where ','+TiXingUser+',' like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%'  and TiXingDate='" + ToDayStr + "'");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您所制定的仪器设备溯源提醒时间到。(" + MyDataSet.Tables[0].Rows[j]["SheBeiName"].ToString() + ")";
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您所制定的仪器设备溯源提醒时间到。(" + MyDataSet.Tables[0].Rows[j]["SheBeiName"].ToString() + ")";
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #14
0
    protected void CheckFK()
    {
        string  ToDayStr  = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPRecive where CreateUser='******' and NowState='F' and TiXingDate='" + ToDayStr + "'");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您所制定的付款计划提醒时间已到。(" + MyDataSet.Tables[0].Rows[j]["HeTongName"].ToString() + "--" + MyDataSet.Tables[0].Rows[j]["QianYueKeHu"].ToString() + ")";
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您所制定的付款计划提醒时间已到。(" + MyDataSet.Tables[0].Rows[j]["HeTongName"].ToString() + "--" + MyDataSet.Tables[0].Rows[j]["QianYueKeHu"].ToString() + ")";
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #15
0
    protected void CheckXiangMu()
    {
        string  ToDayStr  = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPProject where UserName='******' and TiXingDate='" + ToDayStr + "'");

        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
            MyModel.EmailContent = "您在项目管理模块中安排的提醒时间到。项目名称:" + MyDataSet.Tables[0].Rows[j]["ProjectName"].ToString();
            MyModel.EmailState   = "未读";
            MyModel.EmailTitle   = "您在项目管理模块中安排的提醒时间到。项目名称:" + MyDataSet.Tables[0].Rows[j]["ProjectName"].ToString();
            MyModel.FromUser     = "******";
            MyModel.FuJian       = "";
            MyModel.TimeStr      = DateTime.Now;
            MyModel.ToUser       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
            {
                MyModel.Add();
            }
        }
    }
Beispiel #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();

            //获得最新的一个未读ID
            int NewMailID = int.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 ID from ERPLanEmail where ToUser='******' 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 ERPLanEmail where ToUser='******' and EmailState='未读'");

            this.HyperLink1.NavigateUrl = "../LanEmail/EmailView.aspx?ID=" + NewMailID.ToString();
        }
    }
Beispiel #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();

            //获得最新的一个未读ID
            int NewMailID = int.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 ID from ERPLanEmail where ToUser='******' 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 ERPLanEmail where ToUser='******' and EmailState='未读'");

            this.HyperLink1.NavigateUrl = "../LanEmail/EmailView.aspx?ID=" + NewMailID.ToString();
        }
    }
Beispiel #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            //设置上传的附件为空
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", "");

            try
            {
                this.TextBox2.Text = Request.QueryString["UserName"].ToString();
            }
            catch
            { }

            //检测是回复或者转发
            try
            {
                if (Request.QueryString["Type"].ToString().Trim() == "HuiFu")
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text = "Re:" + MyModel.EmailTitle;
                    this.TextBox2.Text = MyModel.FromUser;
                }
            }
            catch
            { }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            try
            {
                if (Request.QueryString["Type"].ToString().Trim() == "ZhuanFa")
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text = "RW:" + MyModel.EmailTitle;
                    this.TxtContent.Value = MyModel.EmailContent;
                    ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
                    ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
                }
            }
            catch
            { }
        }
    }
Beispiel #19
0
 //����Ʒ���
 protected void CheckKuCun()
 {
     DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPProduct  where NowKuCun<=KuCunBaoJing  order by ID asc");
     for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
     {
         ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
         MyModel.EmailContent = "���IJ�Ʒ��治�㣬�뼰ʱ�����(" + MyDataSet.Tables[0].Rows[j]["ProductName"].ToString() + ")";
         MyModel.EmailState = "�";
         MyModel.EmailTitle = "���IJ�Ʒ��治�㣬�뼰ʱ�����(" + MyDataSet.Tables[0].Rows[j]["ProductName"].ToString() + ")";
         MyModel.FromUser = "******";
         MyModel.FuJian = "";
         MyModel.TimeStr = DateTime.Now;
         MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
         if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
         {
             MyModel.Add();
         }
     }
 }
Beispiel #20
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));
        if (FileNameStr.Trim().Length > 0)
        {
            string PiShiStr = "<font color=#0000FF>" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "&nbsp;&nbsp;" + DateTime.Now.ToString() + "&nbsp;&nbsp;</font><BR>" + this.TextBox1.Text.ToString() + "<br>审批附件:<a href=../UploadFile/" + FileNameStr + ">[右键下载]</a><hr>" + this.Label5.Text;
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPNWorkToDo set FuJianList='" + ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "',ShenPiYiJian='" + PiShiStr + "',StateNow='已被驳回' where ID=" + Request.QueryString["ID"].ToString());

            ZWL.BLL.ERPNWorkToDo Mymodel = new ZWL.BLL.ERPNWorkToDo();
            Mymodel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            Mymodel.ID = int.Parse(Request.QueryString["ID"].ToString());
            Mymodel.FormContent = this.TextBox3.Text;

            //发邮件通知发文拟稿人
            ZWL.BLL.ERPLanEmail MyMail = new ZWL.BLL.ERPLanEmail();
            MyMail.EmailContent = "您的工作已经被驳回!(" + this.Label3.Text + ")";
            MyMail.EmailState = "未读";
            MyMail.EmailTitle = "您的工作已经被驳回!(" + this.Label3.Text + ")"; ;
            MyMail.FromUser = "******";
            MyMail.FuJian = "";
            MyMail.TimeStr = DateTime.Now;
            MyMail.ToUser = Mymodel.UserName;
            MyMail.Add();

            Mymodel.UpdateBD();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户审批工作信息(" + this.Label3.Text + ")";
            MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "审批操作完成!", "../Main.aspx");
        }
        else if (FileUpload1.PostedFile.FileName.Trim().Length <= 0)
        {
            string PiShiStr = "<font color=#0000FF>" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "&nbsp;&nbsp;" + DateTime.Now.ToString() + "&nbsp;&nbsp;</font><BR>" + this.TextBox1.Text.ToString() + "<hr>" + this.Label5.Text;
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPNWorkToDo set FuJianList='" + ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "',ShenPiYiJian='" + PiShiStr + "',StateNow='已被驳回' where ID=" + Request.QueryString["ID"].ToString());

            ZWL.BLL.ERPNWorkToDo Mymodel = new ZWL.BLL.ERPNWorkToDo();
            Mymodel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            Mymodel.ID = int.Parse(Request.QueryString["ID"].ToString());
            Mymodel.FormContent = this.TextBox3.Text;

            //发邮件通知发文拟稿人
            ZWL.BLL.ERPLanEmail MyMail = new ZWL.BLL.ERPLanEmail();
            MyMail.EmailContent = "您的工作已经被驳回!(" + this.Label3.Text + ")";
            MyMail.EmailState = "未读";
            MyMail.EmailTitle = "您的工作已经被驳回!(" + this.Label3.Text + ")"; ;
            MyMail.FromUser = "******";
            MyMail.FuJian = "";
            MyMail.TimeStr = DateTime.Now;
            MyMail.ToUser = Mymodel.UserName;
            MyMail.Add();

            Mymodel.UpdateBD();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户审批工作信息(" + this.Label3.Text + ")";
            MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "审批操作完成!", "../Main.aspx");
        }
    }
Beispiel #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            //设置上传的附件为空
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", "");
            try {
                string UserNames = "'" + Request.QueryString["UserName"].ToString().Replace(",", "','") + "'";
                this.UserName_Input.Value = Request.QueryString["UserName"].ToString();
                DataTable dt       = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [TrueName] from ERPUser where [UserName] in (" + UserNames + ")");
                string    UserName = "";
                foreach (DataRow R in dt.Rows)
                {
                    UserName += UserName == "" ? R["TrueName"] : "," + R["TrueName"];
                }
                this.TextBox2.Text = UserName;
            }
            catch {
            }            //检测是回复或者转发
            try {
                if (Request.QueryString["Type"].ToString().Trim() == "HuiFu")
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text        = "Re:" + MyModel.EmailTitle;
                    this.UserName_Input.Value = MyModel.FromUser;

                    string FromUser = "";
                    foreach (string C in MyModel.FromUser.Split(','))
                    {
                        string CTrueName = ZWL.DBUtility.DbHelperSQL.GetSHSL("select [TrueName] from ERPUser where [UserName]='" + C + "'");
                        if (!string.IsNullOrEmpty(CTrueName))
                        {
                            FromUser += FromUser == "" ? CTrueName : "," + CTrueName;
                        }
                        else
                        {
                            FromUser += FromUser == "" ? C : "," + C;
                        }
                    }
                    this.TextBox2.Text = FromUser;
                }
            }
            catch {
            }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            try {
                if (Request.QueryString["Type"].ToString().Trim() == "ZhuanFa")
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text   = "RW:" + MyModel.EmailTitle;
                    this.TxtContent.Text = MyModel.EmailContent;

                    ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
                    ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, MyModel.FuJian);
                }
            }
            catch {
            }
            if (Request.UrlReferrer.ToString().IndexOf("Main.aspx") == -1)
            {
                ReturnInput.Value = Request.UrlReferrer == null ? "../LanEmail/LanEmailShou.aspx" : Request.UrlReferrer.ToString();
            }
            else
            {
                ReturnInput.Value = "../LanEmail/LanEmailShou.aspx";
            }
        }
    }
Beispiel #22
0
 protected void CheckYiQi()
 {
     string ToDayStr = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
     DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from ERPSheBei where ','+TiXingUser+',' like '%," + ZWL.Common.PublicMethod.GetSessionValue("UserName") + ",%'  and TiXingDate='" + ToDayStr + "'");
     for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
     {
         ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
         MyModel.EmailContent = "�����ƶ��������豸��Դ����ʱ�䵽��(" + MyDataSet.Tables[0].Rows[j]["SheBeiName"].ToString() + ")";
         MyModel.EmailState = "�";
         MyModel.EmailTitle = "�����ƶ��������豸��Դ����ʱ�䵽��(" + MyDataSet.Tables[0].Rows[j]["SheBeiName"].ToString() + ")";
         MyModel.FromUser = "******";
         MyModel.FuJian = "";
         MyModel.TimeStr = DateTime.Now;
         MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
         if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
         {
             MyModel.Add();
         }
     }
 }
Beispiel #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack) {
            ZWL.Common.PublicMethod.CheckSession();
            //设置上传的附件为空
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", "");
            try {

                string UserNames = "'"+Request.QueryString["UserName"].ToString().Replace(",","','")+"'";
                this.UserName_Input.Value = Request.QueryString["UserName"].ToString();
                DataTable dt= ZWL.DBUtility.DbHelperSQL.GetDataTable("select [TrueName] from ERPUser where [UserName] in (" +UserNames + ")");
                string UserName ="";
                foreach(DataRow R in dt.Rows)
                {
                    UserName += UserName == "" ? R["TrueName"] : "," + R["TrueName"];
                }
                this.TextBox2.Text = UserName;

            }
            catch {
            }            //检测是回复或者转发
            try {
                if(Request.QueryString["Type"].ToString().Trim() == "HuiFu") {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text = "Re:" + MyModel.EmailTitle;
                    this.UserName_Input.Value = MyModel.FromUser;

                    string FromUser = "";
                    foreach(string C in MyModel.FromUser.Split(',')) {
                        string CTrueName = ZWL.DBUtility.DbHelperSQL.GetSHSL("select [TrueName] from ERPUser where [UserName]='" + C + "'");
                        if(!string.IsNullOrEmpty(CTrueName)) {
                            FromUser += FromUser == "" ? CTrueName : "," + CTrueName;
                        }
                        else {
                            FromUser += FromUser == "" ? C : "," + C;
                        }
                    }
                    this.TextBox2.Text = FromUser;

                }
            }
            catch {
            }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            try {
                if(Request.QueryString["Type"].ToString().Trim() == "ZhuanFa") {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
                    //设置页面数据
                    this.TextBox1.Text = "RW:" + MyModel.EmailTitle;
                    this.TxtContent.Text = MyModel.EmailContent;

                    ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
                    ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, MyModel.FuJian);
                }
            }
            catch {
            }
            if(Request.UrlReferrer.ToString().IndexOf("Main.aspx") == -1) {
                ReturnInput.Value = Request.UrlReferrer == null ? "../LanEmail/LanEmailShou.aspx" : Request.UrlReferrer.ToString();
            }
            else {
                ReturnInput.Value = "../LanEmail/LanEmailShou.aspx";
            }

        }
    }
Beispiel #24
0
    //����ͳһ�Ե������ʼ�
    protected void SendTXMail(string TableName, string LieName, string TitleLieName, string IFOnlyDate, string MailContent)
    {
        string ToDayStr = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();

        DataSet MyDataSet = ZWL.DBUtility.DbHelperSQL.GetDataSet("select * from " + TableName);
        for (int j = 0; j < MyDataSet.Tables[0].Rows.Count; j++)
        {
            if (IFOnlyDate == "��")
            {
                ToDayStr = DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();
                if (ZWL.Common.PublicMethod.LongToShortStr(MyDataSet.Tables[0].Rows[j][LieName].ToString(), 5) == ToDayStr)
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.EmailContent = MailContent + "(" + MyDataSet.Tables[0].Rows[j][TitleLieName].ToString() + ")";
                    MyModel.EmailState = "�";
                    MyModel.EmailTitle = MailContent + "(" + MyDataSet.Tables[0].Rows[j][TitleLieName].ToString() + ")";
                    MyModel.FromUser = "******";
                    MyModel.FuJian = "";
                    MyModel.TimeStr = DateTime.Now;
                    MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
                    if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
                    {
                        MyModel.Add();
                    }
                }
            }
            else
            {
                if (MyDataSet.Tables[0].Rows[j][LieName].ToString() == ToDayStr)
                {
                    ZWL.BLL.ERPLanEmail MyModel = new ZWL.BLL.ERPLanEmail();
                    MyModel.EmailContent = MailContent + "(" + MyDataSet.Tables[0].Rows[j][TitleLieName].ToString() + ")";
                    MyModel.EmailState = "�";
                    MyModel.EmailTitle = MailContent + "(" + MyDataSet.Tables[0].Rows[j][TitleLieName].ToString() + ")";
                    MyModel.FromUser = "******";
                    MyModel.FuJian = "";
                    MyModel.TimeStr = DateTime.Now;
                    MyModel.ToUser = ZWL.Common.PublicMethod.GetSessionValue("UserName");
                    if (ZWL.Common.PublicMethod.IFExists("EmailTitle", "ERPLanEmail", 0, MyModel.EmailTitle) == true)
                    {
                        MyModel.Add();
                    }
                }
            }
        }
    }
Beispiel #25
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));

        if (FileNameStr.Trim().Length > 0)
        {
            string PiShiStr = "<font color=#0000FF>" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "&nbsp;&nbsp;" + DateTime.Now.ToString() + "&nbsp;&nbsp;</font><BR>" + this.TextBox1.Text.ToString() + "<br>审批附件:<a href=../UploadFile/" + FileNameStr + ">[右键下载]</a><hr>" + this.Label5.Text;
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPNWorkToDo set FuJianList='" + ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "',ShenPiYiJian='" + PiShiStr + "',StateNow='已被驳回' where ID=" + Request.QueryString["ID"].ToString());

            ZWL.BLL.ERPNWorkToDo Mymodel = new ZWL.BLL.ERPNWorkToDo();
            Mymodel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            Mymodel.ID          = int.Parse(Request.QueryString["ID"].ToString());
            Mymodel.FormContent = this.TextBox3.Text;

            //发邮件通知发文拟稿人
            ZWL.BLL.ERPLanEmail MyMail = new ZWL.BLL.ERPLanEmail();
            MyMail.EmailContent = "您的工作已经被驳回!(" + this.Label3.Text + ")";
            MyMail.EmailState   = "未读";
            MyMail.EmailTitle   = "您的工作已经被驳回!(" + this.Label3.Text + ")";;
            MyMail.FromUser     = "******";
            MyMail.FuJian       = "";
            MyMail.TimeStr      = DateTime.Now;
            MyMail.ToUser       = Mymodel.UserName;
            MyMail.Add();


            Mymodel.UpdateBD();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户审批工作信息(" + this.Label3.Text + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "审批操作完成!", "../Main.aspx");
        }
        else if (FileUpload1.PostedFile.FileName.Trim().Length <= 0)
        {
            string PiShiStr = "<font color=#0000FF>" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "&nbsp;&nbsp;" + DateTime.Now.ToString() + "&nbsp;&nbsp;</font><BR>" + this.TextBox1.Text.ToString() + "<hr>" + this.Label5.Text;
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPNWorkToDo set FuJianList='" + ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "',ShenPiYiJian='" + PiShiStr + "',StateNow='已被驳回' where ID=" + Request.QueryString["ID"].ToString());

            ZWL.BLL.ERPNWorkToDo Mymodel = new ZWL.BLL.ERPNWorkToDo();
            Mymodel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            Mymodel.ID          = int.Parse(Request.QueryString["ID"].ToString());
            Mymodel.FormContent = this.TextBox3.Text;

            //发邮件通知发文拟稿人
            ZWL.BLL.ERPLanEmail MyMail = new ZWL.BLL.ERPLanEmail();
            MyMail.EmailContent = "您的工作已经被驳回!(" + this.Label3.Text + ")";
            MyMail.EmailState   = "未读";
            MyMail.EmailTitle   = "您的工作已经被驳回!(" + this.Label3.Text + ")";;
            MyMail.FromUser     = "******";
            MyMail.FuJian       = "";
            MyMail.TimeStr      = DateTime.Now;
            MyMail.ToUser       = Mymodel.UserName;
            MyMail.Add();


            Mymodel.UpdateBD();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户审批工作信息(" + this.Label3.Text + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "审批操作完成!", "../Main.aspx");
        }
    }
Beispiel #26
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());
                    }
                }
            }
        }
    }