Пример #1
0
    protected void Save_Btn(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(base.Request.QueryString["nid"]))
        {
            NoteBookInfo noteBookInfo = new NoteBookInfo();
            noteBookInfo.AddTime  = DateTime.Now;
            noteBookInfo.Bodys    = this.Bodys.Value;
            noteBookInfo.DepName  = this.DepName;
            noteBookInfo.RealName = this.RealName;
            noteBookInfo.UserID   = Convert.ToInt32(this.Uid);
            noteBookInfo.Subject  = this.Subject.Value;
            NoteBook.Init().Add(noteBookInfo);
        }
        else
        {
            NoteBookInfo noteBookInfo = this.ViewState["ni"] as NoteBookInfo;
            noteBookInfo.AddTime = DateTime.Now;
            noteBookInfo.Bodys   = this.Bodys.Value;
            noteBookInfo.Subject = this.Subject.Value;
            NoteBook.Init().Update(noteBookInfo);
        }
        string str = HttpContext.Current.Server.HtmlEncode("您好!记事便笺保存成功!");

        base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/Common/NoteBook_List.aspx&tip=" + str);
    }
Пример #2
0
    private void Show()
    {
        NoteBookInfo byId = NoteBook.Init().GetById(Convert.ToInt32(base.Request.QueryString["nid"]));

        this.Bodys.Value     = byId.Bodys;
        this.Subject.Value   = byId.Subject;
        this.ViewState["ni"] = byId;
    }
Пример #3
0
    protected void Del_Btn(object obj, EventArgs e)
    {
        LinkButton        linkButton        = obj as LinkButton;
        RepeaterItem      repeaterItem      = linkButton.Parent as RepeaterItem;
        HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
        int id = Convert.ToInt32(htmlInputCheckBox.Value);

        NoteBook.Init().Delete(id);
        this.Show();
    }
Пример #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);
             NoteBook.Init().Delete(id);
         }
     }
     this.Show();
 }
Пример #5
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>");
			}
		}