コード例 #1
0
    protected void Replay_Btn(object sender, EventArgs e)
    {
        string text = base.Request.Form["replay"];

        if (!string.IsNullOrEmpty(text.Trim()) && text.Trim() != "在这里输入快捷回复")
        {
            MailsInfo        mailsInfo        = new MailsInfo();
            Mails_DetailInfo mails_DetailInfo = new Mails_DetailInfo();
            mailsInfo.Subject              = "快捷回复:" + this.ViewState["retitle"];
            mailsInfo.ReceiverID           = Convert.ToInt32(this.ViewState["sid"]);
            mails_DetailInfo.Bodys         = text;
            mailsInfo.SenderID             = Convert.ToInt32(this.Uid);
            mailsInfo.SenderRealName       = this.RealName;
            mailsInfo.SenderDepName        = this.DepName;
            mailsInfo.SendType             = 5;
            mailsInfo.SendTime             = DateTime.Now;
            mails_DetailInfo.SendIDs       = string.Concat(mailsInfo.ReceiverID);
            mails_DetailInfo.SendRealNames = string.Concat(new object[]
            {
                this.ViewState["snames"],
                " (",
                this.ViewState["sdep"],
                ")"
            });
            Mails_Detail.Init().Add(mails_DetailInfo);
            mailsInfo.did = mails_DetailInfo.id;
            Mails.Init().Add(mailsInfo);
            string str = HttpContext.Current.Server.HtmlEncode("您好!邮件已成功回复!");
            base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
        }
        else
        {
            base.Response.Write("<script>alert('您还没输入任何内容');window.location='" + base.Request.Url.AbsoluteUri + "'</script>");
        }
    }
コード例 #2
0
ファイル: SendMail.aspx.cs プロジェクト: a532367171/WC
 private void AddMail(int type, int sendtype, int ReceiverID, string uid, string realname, string depname, string sendids, string sendnames, string ccids, string ccnames, string bccids, string bccnames, string attachments)
 {
     if (this.ct == 0)
     {
         Mails_DetailInfo mails_DetailInfo = new Mails_DetailInfo();
         mails_DetailInfo.Attachments   = attachments;
         mails_DetailInfo.Bodys         = this.Bodys.Value;
         mails_DetailInfo.SendIDs       = sendids;
         mails_DetailInfo.SendRealNames = sendnames;
         mails_DetailInfo.CcIDs         = ccids;
         mails_DetailInfo.CcRealNames   = ccnames;
         mails_DetailInfo.BccIDs        = bccids;
         mails_DetailInfo.BccRealNames  = bccnames;
         this.ct++;
         Mails_Detail.Init().Add(mails_DetailInfo);
         this.tobj = mails_DetailInfo;
     }
     if (this.tobj.GetType().ToString().Contains("fo"))
     {
         Mails_DetailInfo mails_DetailInfo = this.tobj as Mails_DetailInfo;
         MailsInfo        mailsInfo        = new MailsInfo();
         mailsInfo.ReceiverID     = ReceiverID;
         mailsInfo.SenderID       = Convert.ToInt32(uid);
         mailsInfo.SenderRealName = realname;
         mailsInfo.SenderDepName  = depname;
         mailsInfo.SendType       = sendtype;
         mailsInfo.Subject        = this.Subject.Value;
         mailsInfo.FolderType     = type;
         mailsInfo.SendTime       = DateTime.Now;
         mailsInfo.did            = mails_DetailInfo.id;
         mailsInfo.SenderGUID     = "";
         Mails.Init().Add(mailsInfo);
     }
 }
コード例 #3
0
    protected void Replay_Btn(object sender, EventArgs e)
    {
        string text = base.Request.Form["replay"];

        if (!string.IsNullOrEmpty(text.Trim()) && text.Trim() != "在这里输入快捷回复")
        {
            MailsInfo        mailsInfo        = new MailsInfo();
            Mails_DetailInfo mails_DetailInfo = new Mails_DetailInfo();
            mailsInfo.Subject              = "快捷回复:" + this.ViewState["retitle"];
            mailsInfo.ReceiverID           = Convert.ToInt32(this.ViewState["sid"]);
            mails_DetailInfo.Bodys         = text;
            mailsInfo.SenderID             = Convert.ToInt32(this.Uid);
            mailsInfo.SenderRealName       = this.RealName;
            mailsInfo.SenderDepName        = this.DepName;
            mailsInfo.SendType             = 5;
            mailsInfo.SendTime             = DateTime.Now;
            mails_DetailInfo.SendIDs       = string.Concat(mailsInfo.ReceiverID);
            mails_DetailInfo.SendRealNames = string.Concat(new object[]
            {
                this.ViewState["snames"],
                " (",
                this.ViewState["sdep"],
                ")"
            });
            Mails_Detail.Init().Add(mails_DetailInfo);
            mailsInfo.did = mails_DetailInfo.id;
            Mails.Init().Add(mailsInfo);
            MessageBox.ShowAndRedirect(this, "已经成功回复!", "MailList.aspx?fid=0");
        }
        else
        {
            MessageBox.ShowAndRedirect(this, "快捷回复没有任何内容!", "MailList.aspx?fid=0");
        }
    }
コード例 #4
0
    protected void Del_All(object sender, EventArgs e)
    {
        foreach (RepeaterItem repeaterItem in this.rpt.Items)
        {
            HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
            if (htmlInputCheckBox.Checked)
            {
                int id = Convert.ToInt32(htmlInputCheckBox.Value);
                Mails.Init().Delete(id);
            }
        }
        string str = HttpContext.Current.Server.HtmlEncode("您好!邮件已彻底删除!");

        base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
    }
コード例 #5
0
ファイル: Help.cs プロジェクト: a532367171/WC
        public static void AdminSendMail(string title, string content, int receiverid, string userlist, string namelist)
        {
            MailsInfo        mailsInfo        = new MailsInfo();
            Mails_DetailInfo mails_DetailInfo = new Mails_DetailInfo();

            mails_DetailInfo.Bodys         = content;
            mails_DetailInfo.SendIDs       = userlist;
            mails_DetailInfo.SendRealNames = namelist;
            Mails_Detail.Init().Add(mails_DetailInfo);
            mailsInfo.ReceiverID     = receiverid;
            mailsInfo.SenderDepName  = "系统通知";
            mailsInfo.SenderID       = 31;
            mailsInfo.SenderRealName = "系统管理员";
            mailsInfo.SendTime       = DateTime.Now;
            mailsInfo.SendType       = -1;
            mailsInfo.Subject        = title;
            mailsInfo.did            = mails_DetailInfo.id;
            Mails.Init().Add(mailsInfo);
        }
コード例 #6
0
    private void Show(string id)
    {
        this.mid = id;
        MailsInfo byId = Mails.Init().GetById(Convert.ToInt32(this.mid));

        if (byId.ReceiverID == Convert.ToInt32(this.Uid) || byId.SenderID == Convert.ToInt32(this.Uid))
        {
            Mails_DetailInfo byId2 = Mails_Detail.Init().GetById(byId.did);
            this.Subject.InnerText = byId.Subject;
            this.Sender.InnerText  = byId.SenderRealName + " (" + byId.SenderDepName + ")";
            this.bet = byId.ReceiverID + ";" + byId.SenderID;
            this.Sendtime.InnerText = Utils.ConvertDate2(byId.SendTime) + " (" + Utils.GetDayOfWeek(byId.SendTime) + ")";
            this.sjr.InnerText      = Utils.GetSubString2(byId2.SendRealNames, 250, "...");
            if (!string.IsNullOrEmpty(byId2.CcRealNames))
            {
                this.csr = "<br><span style='font-weight:bold; color:#006600;'>抄送人</span>:" + Utils.GetSubString2(byId2.CcRealNames, 250, "...");
            }
            if (!string.IsNullOrEmpty(byId2.Attachments))
            {
                this.fjs = "<br><span style='font-weight:bold; color:#006600;'>附 &nbsp;&nbsp;&nbsp;件</span>:";
                string[] array = byId2.Attachments.Split(new char[]
                {
                    '|'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    if (array[i].Trim() != "")
                    {
                        int    num = array[i].LastIndexOf('/') + 1;
                        string arg = array[i].Substring(num, array[i].Length - num);
                        string s   = array[i].Replace("~", "");
                        this.fjs += string.Format(this.fj, base.Server.UrlEncode(s), arg);
                    }
                }
            }
            byId2.Bodys = (byId2.Bodys ?? "");
            if (byId2.Bodys.ToLower().Contains("script"))
            {
                this.bodys.InnerHtml = byId2.Bodys.ToLower().Replace("script", "scrript");
            }
            else
            {
                this.bodys.InnerHtml = byId2.Bodys;
            }
            if (byId.IsRead == 0)
            {
                byId.IsRead = 1;
                Mails.Init().Update(byId);
                if (byId.SenderGUID == "1" && byId.ReceiverID == Convert.ToInt32(this.Uid) && byId.FolderType == 0)
                {
                    string title   = "[系统通知] : 收件人(" + this.RealName + ")已查看您发送的邮件!";
                    string content = string.Concat(new string[]
                    {
                        "您好! 您撰写发送的的邮件<br>“<strong>",
                        byId.Subject,
                        "</strong>” (发送于 ",
                        Utils.ConvertDate3(byId.SendTime),
                        ") <br><br>收件人<strong>(",
                        this.RealName,
                        ")</strong>已于 ",
                        Utils.ConvertDate3(DateTime.Now),
                        " 拆启查阅。<br>"
                    });
                    int    senderID = byId.SenderID;
                    string userlist = string.Concat(new object[]
                    {
                        byId.SenderRealName,
                        "#",
                        byId.SenderID,
                        "#",
                        byId.SenderDepName,
                        ","
                    });
                    string namelist = byId.SenderRealName + "(" + byId.SenderDepName + "),";
                    Help.AdminSendMail(title, content, senderID, userlist, namelist);
                }
            }
            this.ViewState["retitle"] = byId.Subject;
            this.ViewState["sid"]     = byId.SenderID;
            this.ViewState["snames"]  = byId.SenderRealName;
            this.ViewState["sdep"]    = byId.SenderDepName;
        }
        else
        {
            base.Response.Write("<script>alert('您没有查看权限');window.location='Mail_List.aspx?fid=0';</script>");
        }
    }
コード例 #7
0
		private void Show()
		{
			if (!string.IsNullOrEmpty(this.Uid))
			{
				SqlParameter sqlParameter = new SqlParameter();
				sqlParameter.ParameterName = "@uid";
				sqlParameter.Size = 4;
				sqlParameter.Value = Convert.ToInt32(this.Uid);
				SqlParameter sqlParameter2 = new SqlParameter();
				sqlParameter2.Direction = ParameterDirection.Output;
				sqlParameter2.ParameterName = "@pt0";
				sqlParameter2.Size = 4;
				SqlParameter sqlParameter3 = new SqlParameter();
				sqlParameter3.Direction = ParameterDirection.Output;
				sqlParameter3.ParameterName = "@pt1";
				sqlParameter3.Size = 4;
				SqlParameter sqlParameter4 = new SqlParameter();
				sqlParameter4.Direction = ParameterDirection.Output;
				sqlParameter4.ParameterName = "@pt2";
				sqlParameter4.Size = 4;
				SqlParameter sqlParameter5 = new SqlParameter();
				sqlParameter5.Direction = ParameterDirection.Output;
				sqlParameter5.ParameterName = "@pt3";
				sqlParameter5.Size = 4;
				SqlParameter sqlParameter6 = new SqlParameter();
				sqlParameter6.Direction = ParameterDirection.Output;
				sqlParameter6.ParameterName = "@pt4";
				sqlParameter6.Size = 4;
				SqlParameter[] cmdParms = new SqlParameter[]
				{
					sqlParameter2,
					sqlParameter3,
					sqlParameter4,
					sqlParameter5,
					sqlParameter6,
					sqlParameter
				};
				MsSqlOperate.ExecuteNonQuery(CommandType.StoredProcedure, "Mails_GetAllMailBoxCount", cmdParms);
				this.sjx.InnerText = sqlParameter2.Value + "/" + sqlParameter6.Value;
				this.cgx.InnerText = string.Concat(sqlParameter3.Value);
				this.fjx.InnerText = string.Concat(sqlParameter4.Value);
				this.ljx.InnerText = string.Concat(sqlParameter5.Value);
				if (!string.IsNullOrEmpty(base.Request.QueryString["mid"]))
				{
					string value = base.Request.QueryString["mid"];
					MailsInfo byId = Mails.Init().GetById(Convert.ToInt32(value));
					if (byId.ReceiverID == Convert.ToInt32(this.Uid) || byId.SenderID == Convert.ToInt32(this.Uid))
					{
						Mails_DetailInfo byId2 = Mails_Detail.Init().GetById(byId.did);
						this.Subject.Value = "回复:" + byId.Subject;
						this.userlist.Value = string.Concat(new object[]
						{
							byId.SenderRealName,
							"#",
							byId.SenderID,
							"#",
							byId.SenderDepName,
							","
						});
						this.namelist.Value = byId.SenderRealName + "(" + byId.SenderDepName + "),";
						this.Bodys.Value = string.Concat(new string[]
						{
							"<br><br><br><span style='font-weight:bold;color:#999999'>",
							byId.SenderRealName,
							" (",
							byId.SenderDepName,
							") 在 ",
							Utils.ConvertDate2(byId.SendTime),
							" 写道: </span><br>",
							byId2.Bodys
						});
						if (!string.IsNullOrEmpty(byId2.Attachments) && byId2.Attachments.Contains("|"))
						{
							this.Attachword.Visible = true;
							List<TmpInfo> list = new List<TmpInfo>();
							string[] array = byId2.Attachments.Split(new char[]
							{
								'|'
							});
							for (int i = 0; i < array.Length; i++)
							{
								if (array[i].Trim() != "")
								{
									TmpInfo tmpInfo = new TmpInfo();
									int num = array[i].LastIndexOf('/') + 1;
									string tmp = array[i].Substring(num, array[i].Length - num);
									string tmp2 = array[i].Replace("~", "");
									tmpInfo.Tmp1 = array[i];
									tmpInfo.Tmp2 = tmp;
									tmpInfo.Tmp3 = tmp2;
									list.Add(tmpInfo);
								}
							}
							this.rpt.DataSource = list;
							this.rpt.DataBind();
						}
					}
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["cid"]))
				{
					string value2 = base.Request.QueryString["cid"];
					MailsInfo byId = Mails.Init().GetById(Convert.ToInt32(value2));
					if (byId.ReceiverID == Convert.ToInt32(this.Uid) || byId.SenderID == Convert.ToInt32(this.Uid))
					{
						Mails_DetailInfo byId2 = Mails_Detail.Init().GetById(byId.did);
						this.Subject.Value = byId.Subject;
						if (!string.IsNullOrEmpty(byId2.SendIDs) && !string.IsNullOrEmpty(byId2.SendRealNames))
						{
							this.userlist.Value = byId2.SendIDs;
							this.namelist.Value = byId2.SendRealNames;
						}
						if (!string.IsNullOrEmpty(byId2.CcIDs) && !string.IsNullOrEmpty(byId2.CcRealNames))
						{
							this.userlist_cc.Value = byId2.CcIDs;
							this.namelist_cc.Value = byId2.CcRealNames;
						}
						if (!string.IsNullOrEmpty(byId2.BccIDs) && !string.IsNullOrEmpty(byId2.BccRealNames))
						{
							this.userlist_bcc.Value = byId2.BccIDs;
							this.namelist_bcc.Value = byId2.BccRealNames;
						}
						this.Bodys.Value = byId2.Bodys;
						if (!string.IsNullOrEmpty(byId2.Attachments) && byId2.Attachments.Contains("|"))
						{
							this.Attachword.Visible = true;
							List<TmpInfo> list = new List<TmpInfo>();
							string[] array = byId2.Attachments.Split(new char[]
							{
								'|'
							});
							for (int i = 0; i < array.Length; i++)
							{
								if (array[i].Trim() != "")
								{
									TmpInfo tmpInfo = new TmpInfo();
									int num = array[i].LastIndexOf('/') + 1;
									string tmp = array[i].Substring(num, array[i].Length - num);
									string tmp2 = array[i].Replace("~", "");
									tmpInfo.Tmp1 = array[i];
									tmpInfo.Tmp2 = tmp;
									tmpInfo.Tmp3 = tmp2;
									list.Add(tmpInfo);
								}
							}
							this.rpt.DataSource = list;
							this.rpt.DataBind();
						}
					}
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["zid"]))
				{
					string value2 = base.Request.QueryString["zid"];
					MailsInfo byId = Mails.Init().GetById(Convert.ToInt32(value2));
					if (byId.ReceiverID == Convert.ToInt32(this.Uid) || byId.SenderID == Convert.ToInt32(this.Uid))
					{
						Mails_DetailInfo byId2 = Mails_Detail.Init().GetById(byId.did);
						this.Subject.Value = "转发:" + byId.Subject;
						this.Bodys.Value = "<br><br>" + byId2.Bodys;
						if (!string.IsNullOrEmpty(byId2.Attachments) && byId2.Attachments.Contains("|"))
						{
							this.Attachword.Visible = true;
							List<TmpInfo> list = new List<TmpInfo>();
							string[] array = byId2.Attachments.Split(new char[]
							{
								'|'
							});
							for (int i = 0; i < array.Length; i++)
							{
								if (array[i].Trim() != "")
								{
									TmpInfo tmpInfo = new TmpInfo();
									int num = array[i].LastIndexOf('/') + 1;
									string tmp = array[i].Substring(num, array[i].Length - num);
									string tmp2 = array[i].Replace("~", "");
									tmpInfo.Tmp1 = array[i];
									tmpInfo.Tmp2 = tmp;
									tmpInfo.Tmp3 = tmp2;
									list.Add(tmpInfo);
								}
							}
							this.rpt.DataSource = list;
							this.rpt.DataBind();
						}
					}
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["meeting"]))
				{
					MeetingInfo byId3 = Meeting.Init().GetById(Convert.ToInt32(base.Request.QueryString["meeting"]));
					string format = "<br><br><table style='width:95%;' border='1' cellspacing='0' bordercolor='#c0bdbd' cellpadding='2'><tbody><tr><td style='width:95px;color:#222;font-weight:bold;'>&nbsp;会议主题:</td><td>{0}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;时间/地点:</td><td>{1}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;会议主持:</td><td>{2}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;记录人员:</td><td>{3}</td></tr><tr><td style='color:#222;font-weight:bold;'>会议参加者:</td><td>{4}</td></tr><tr><td style='color:#222;font-weight:bold;'>会议缺席者:</td><td>{5}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;会议纪要:</td><td>{6}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;备注:</td><td>{7}</td></tr></tbody></table><br>";
					this.Bodys.Value = string.Format(format, new object[]
					{
						byId3.MainTopics,
						byId3.CTime + " &nbsp; &nbsp; &nbsp; " + byId3.Address,
						byId3.Chaired,
						byId3.Recorder,
						byId3.ListPerson,
						byId3.AbsencePerson,
						byId3.Bodys,
						byId3.Remarks
					});
					if (!string.IsNullOrEmpty(byId3.FilePath) && byId3.FilePath.Contains("|"))
					{
						this.Attachword.Visible = true;
						List<TmpInfo> list = new List<TmpInfo>();
						string[] array = byId3.FilePath.Split(new char[]
						{
							'|'
						});
						for (int i = 0; i < array.Length; i++)
						{
							if (array[i].Trim() != "")
							{
								TmpInfo tmpInfo = new TmpInfo();
								int num = array[i].LastIndexOf('/') + 1;
								string tmp = array[i].Substring(num, array[i].Length - num);
								string tmp2 = array[i].Replace("~", "");
								tmpInfo.Tmp1 = array[i];
								tmpInfo.Tmp2 = tmp;
								tmpInfo.Tmp3 = tmp2;
								list.Add(tmpInfo);
							}
						}
						this.rpt.DataSource = list;
						this.rpt.DataBind();
					}
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["notebook"]))
				{
					NoteBookInfo byId4 = NoteBook.Init().GetById(Convert.ToInt32(base.Request.QueryString["notebook"]));
					string format2 = "<br><br><table style='width:95%;' border='1' cellspacing='0' bordercolor='#c0bdbd' cellpadding='2'><tbody><tr><td style='width:95px;color:#222;font-weight:bold;'>&nbsp;记事主题:</td><td>{0}</td></tr><tr><td style='width:95px;color:#222;font-weight:bold;'>&nbsp;记事时间:</td><td>{1}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;记事内容:</td><td>{2}</td></tr><tr></tr></tbody></table><br>";
					this.Bodys.Value = string.Format(format2, byId4.Subject, Utils.ConvertDate3(byId4.AddTime), byId4.Bodys.Replace("\r\n", "<br>"));
				}
				if (!string.IsNullOrEmpty(base.Request.QueryString["privateaddr"]))
				{
					PhoneBookInfo byId5 = PhoneBook.Init().GetById(Convert.ToInt32(base.Request.QueryString["privateaddr"]));
					string format3 = "<br><br><table style='width:95%;' border='1' cellspacing='0' bordercolor='#c0bdbd' cellpadding='2'><tbody><tr><td style='width:95px;color:#222;font-weight:bold;'>&nbsp;姓名:</td><td>{0}</td></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;标签:</td><td>{1}</td></tr><tr></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;电话:</td><td>{2}</td></tr><tr></tr><tr><td style='color:#222;font-weight:bold;'>&nbsp;备注:</td><td>{3}</td></tr><tr></tr></tbody></table><br>";
					this.Bodys.Value = string.Format(format3, new object[]
					{
						byId5.Person,
						byId5.TagName,
						byId5.Phone,
						byId5.Notes.Replace("\r\n", "<br>")
					});
				}
			}
			else
			{
				base.Response.Write("<script>alert('会话已过期,请重新登录!');window.location='/InfoTip/Operate_Nologin.aspx?ReturnUrl=" + base.Request.Url.AbsoluteUri + "'</script>");
			}
		}