protected void Save_Btn(object obj, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["pid"])) { PhoneBookInfo phoneBookInfo = this.ViewState["pi"] as PhoneBookInfo; phoneBookInfo.Person = this.Person.Value; phoneBookInfo.TagName = this.TagName.Value; phoneBookInfo.Phone = this.Phone.Value; phoneBookInfo.Notes = this.Notes.Value; PhoneBook.Init().Update(phoneBookInfo); } else { PhoneBookInfo phoneBookInfo = new PhoneBookInfo(); phoneBookInfo.Person = this.Person.Value; phoneBookInfo.Phone = this.Phone.Value; phoneBookInfo.Notes = this.Notes.Value; phoneBookInfo.RealName = this.RealName; phoneBookInfo.TagName = this.TagName.Value; phoneBookInfo.UserID = Convert.ToInt32(this.Uid); phoneBookInfo.DepName = this.DepName; phoneBookInfo.AddTime = DateTime.Now; PhoneBook.Init().Add(phoneBookInfo); } string str = HttpContext.Current.Server.HtmlEncode("您好!个人通讯录保存成功!"); base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/common/PrivateAddrBook.aspx&tip=" + str); }
protected void DownLoad(object sender, EventArgs e) { IList all = PhoneBook.Init().GetAll("userid=" + this.Uid, "order by TagName asc,id desc"); string text = this.RealName + " 的个人通讯录\r\n\r\n"; string str = "Personal ContactsBook"; foreach (object current in all) { PhoneBookInfo phoneBookInfo = current as PhoneBookInfo; string text2 = text; text = string.Concat(new string[] { text2, "姓名 (", phoneBookInfo.TagName, "):", phoneBookInfo.Person, " 电话:", phoneBookInfo.Phone, " \r\n" }); } base.Response.Clear(); base.Response.ClearHeaders(); base.Response.Buffer = false; base.Response.AppendHeader("Content-Disposition", "attachment;filename=" + str + ".txt"); base.Response.ContentType = "application/vnd.txt"; base.Response.Write(text); base.Response.Flush(); base.Response.End(); }
public void Delete(int id) { PhoneBookInfo phoneBookInfo = new PhoneBookInfo(); phoneBookInfo.id = id; this.control.DeleteEntity(phoneBookInfo); }
private void Show() { PhoneBookInfo byId = PhoneBook.Init().GetById(Convert.ToInt32(base.Request.QueryString["pid"])); if (byId != null) { this.Phone.Value = byId.Phone; this.TagName.Value = byId.TagName; this.Person.Value = byId.Person; this.Notes.Value = byId.Notes; this.ViewState["pi"] = byId; } }
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;'> 会议主题:</td><td>{0}</td></tr><tr><td style='color:#222;font-weight:bold;'> 时间/地点:</td><td>{1}</td></tr><tr><td style='color:#222;font-weight:bold;'> 会议主持:</td><td>{2}</td></tr><tr><td style='color:#222;font-weight:bold;'> 记录人员:</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;'> 会议纪要:</td><td>{6}</td></tr><tr><td style='color:#222;font-weight:bold;'> 备注:</td><td>{7}</td></tr></tbody></table><br>"; this.Bodys.Value = string.Format(format, new object[] { byId3.MainTopics, byId3.CTime + " " + 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;'> 记事主题:</td><td>{0}</td></tr><tr><td style='width:95px;color:#222;font-weight:bold;'> 记事时间:</td><td>{1}</td></tr><tr><td style='color:#222;font-weight:bold;'> 记事内容:</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;'> 姓名:</td><td>{0}</td></tr><tr><td style='color:#222;font-weight:bold;'> 标签:</td><td>{1}</td></tr><tr></tr><tr><td style='color:#222;font-weight:bold;'> 电话:</td><td>{2}</td></tr><tr></tr><tr><td style='color:#222;font-weight:bold;'> 备注:</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>"); } }
public void Update(PhoneBookInfo com) { PhoneBook.dal.Update(com); }
public void Add(PhoneBookInfo com) { PhoneBook.dal.Add(com); }
public void Update(PhoneBookInfo PhoneBook_) { this.control.UpdateEntity(PhoneBook_, PhoneBook_.id); }
public void Add(PhoneBookInfo PhoneBook_) { this.control.AddEntity(PhoneBook_); }