protected void Page_Load(object sender, EventArgs e) { CheckRole("sysmessage"); if (!Page.IsPostBack) { this.Button3.Attributes.Add("onclick", "Javascript:return adminmessage();"); if (Request.QueryString["M_ID"] != null && Request.QueryString["M_ID"].ToString() != "") { XYECOM.Business.Message m = new XYECOM.Business.Message(); XYECOM.Model.MessageInfo emy = new XYECOM.Model.MessageInfo(); emy = m.GetItem(Convert.ToInt64(Request.QueryString["M_ID"].ToString())); if (emy != null) { this.U_ID.Value = emy.U_ID.ToString(); this.username.InnerText = emy.M_UserName.ToString(); this.title.Text = "回复:" + emy.M_Title.ToString(); if (emy.M_PHMa.ToString() != "") { this.phone.InnerText = emy.M_PHMa.ToString(); } this.moblie.InnerText = emy.M_Moblie.ToString(); this.info.InnerHtml = emy.M_Content.ToString(); this.addtime.InnerText = emy.M_AddTime.ToShortDateString(); } m.Update(Convert.ToInt64(XYRequest.GetQueryString("M_ID"))); } } }
protected void Page_Load(object sender, EventArgs e) { CheckRole("sysmessage"); if (!IsPostBack) { if (Request.QueryString["M_ID"] != null && Request.QueryString["M_ID"].ToString() != "") { XYECOM.Business.Message m = new XYECOM.Business.Message(); XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo(); em = m.GetItem(Convert.ToInt64(Request.QueryString["M_ID"])); if (em != null) { this.username.InnerText = em.M_Title.ToString(); this.info.InnerHtml = em.M_Content.ToString(); this.addtime.InnerText = em.M_AddTime.ToShortDateString(); if (em.M_HasReply.ToString().ToLower() == "true") this.HasReply.InnerHtml = "已查看"; else this.HasReply.InnerHtml = "未查看"; } } } }
protected void Button3_Click(object sender, EventArgs e) { XYECOM.Business.UserInfo ui = new XYECOM.Business.UserInfo(); XYECOM.Model.UserInfo eui = new XYECOM.Model.UserInfo(); XYECOM.Business.Message m = new XYECOM.Business.Message(); XYECOM.Model.MessageInfo ems = new XYECOM.Model.MessageInfo(); int k = 0; ems.Area_ID =-1; ems.M_Adress =""; ems.M_CompanyName =""; ems.M_Content = this.content.Text; ems.M_Email = ""; ems.M_FHM = ""; ems.M_HasReply = true; ems.M_Moblie = ""; ems.M_PHMa = ""; ems.M_RecverType = "administrator"; ems.M_Restore = true; ems.M_SenderType = "user"; ems.M_Sex = false ; ems.M_Title = this.title.Text; ems.M_UserName =""; ems.M_UserType = true; ems.U_ID =-1; ems.UR_ID = XYECOM.Core.MyConvert.GetInt64(this.U_ID.Value); k = m.Insert(ems); if (k > 0) { if (Request.QueryString["M_ID"].ToString() != "") { m.UpdateMess(Convert.ToInt64(Request.QueryString["M_ID"].ToString())); } Alert("回复成功!", "ReceiveEmail.aspx"); } else { Alert("回复失败.", "ReceiveEmail.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { XYECOM.Model.MessageInfo ems = new XYECOM.Model.MessageInfo(); Message ms = new Message(); ems.M_Content = this.lbcontent.Value; ems.M_Email = ""; ems.M_SenderType = "user"; ems.M_UserName = ""; ems.M_Moblie = ""; ems.M_Adress =""; ems.M_CompanyName =""; ems.M_FHM =""; ems.M_HasReply =false ; ems.M_PHMa =""; ems.M_RContent =""; ems.M_RecverType ="administrator"; ems.M_Restore =false ; ems.M_RTitle =""; ems.M_Sex =false ; ems.M_Title =this.lbtitle.Text ; ems.M_UserType =false ; string ug_ids = ""; ems.U_ID=-1; //给用户组发 if (ug_ids.IndexOf(",") == 0) ug_ids = ug_ids.Substring(1); if (ug_ids.Length > 0) { DataTable dt = Function.GetDataTable(" where UG_ID in (" + ug_ids + ")", " order by U_ID desc ", "XYV_UserInfo"); for (int i = 0; i < dt.Rows.Count; i++) { ems.UR_ID = Convert.ToInt64(dt.Rows[i]["U_ID"].ToString()); ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt.Rows[i]["U_Name"].ToString()).Replace("{username}", dt.Rows[i]["UI_Name"].ToString()).Replace("{userid}", dt.Rows[i]["U_ID"].ToString()); ms.Insert(ems); } } //查询个人 String p = ""; String isAll = this.personall.Value; DataTable dt3 = new DataTable(); if (!isAll.Equals("1")) { foreach (GridViewRow row in this.gvlist.Rows) { if (((CheckBox)(row.FindControl("chkExport"))).Checked == true) { p += "," + gvlist.DataKeys[row.DataItemIndex].Value.ToString(); } } } if (isAll.Equals("1")) { dt3 = Function.GetDataTable(" where 1=1 ", "", " XYV_individual"); } else { if(p.Length > 0) dt3 = Function.GetDataTable(" where U_ID in (" + p.Substring(1) + ")", "", " XYV_individual"); } if (dt3.Rows.Count > 0) { for (int t = 0; t < dt3.Rows.Count; t++) { ems.UR_ID = Convert.ToInt64(dt3.Rows[t]["U_ID"].ToString()); ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt3.Rows[t]["U_Name"].ToString()).Replace("{username}", dt3.Rows[t]["UI_Name"].ToString()).Replace("{userid}", dt3.Rows[t]["U_ID"].ToString()); ms.Insert(ems); } } //查询企业 String c = ""; foreach(GridViewRow row in this.GridView1.Rows){ if (((CheckBox)(row.FindControl("chkExport1"))).Checked == true) { c += "," + GridView1.DataKeys[row.DataItemIndex].Value.ToString(); } } if (c.Length > 0) { DataTable dt2 = Function.GetDataTable(" where U_ID in (" + c.Substring(1) + ")", "", " xyv_userinfo"); if (dt2.Rows.Count > 0) { for (int t = 0; t < dt2.Rows.Count; t++) { ems.UR_ID = Convert.ToInt64(dt2.Rows[t]["U_ID"].ToString()); ems.M_Content = this.lbcontent.Value.Replace("{loginname}", dt2.Rows[t]["U_Name"].ToString()).Replace("{username}", dt2.Rows[t]["UI_Name"].ToString()).Replace("{userid}", dt2.Rows[t]["U_ID"].ToString()); ms.Insert(ems); } } } Alert("发送成功!", "SendMessageList.aspx"); }
private void SendMessage(long U_ID, string title, string content) { if (webInfo.IsAuditingUserMessage.ToString().ToLower() == "true") { XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo(); XYECOM.Business.Message m = new Message(); em.M_Adress = ""; em.M_CompanyName = ""; em.M_Email = ""; em.M_FHM = ""; em.M_HasReply = false; em.M_Moblie = ""; em.M_PHMa = ""; em.M_RecverType = "administrator"; em.M_Restore = false; em.M_SenderType = "user"; if (webInfo.AuditingUserMessageTitle.ToString() != "") { em.M_Title = webInfo.AuditingUserMessageTitle.ToString(); } else { em.M_Title = ""; } if (webInfo.AuditingUserMessageContent.ToString() != "") { em.M_Content = webInfo.AuditingUserMessageContent.ToString(); } else { em.M_Content = ""; } em.M_UserName = ""; em.M_UserType = false; em.U_ID = -1; em.UR_ID = U_ID; m.Insert(em); } }
private void SendMessage(long U_ID) { if (webInfo.IsAuditingUserMessage) { XYECOM.Model.MessageInfo em = new XYECOM.Model.MessageInfo(); XYECOM.Business.Message m = new Message(); em.M_Adress = ""; em.M_CompanyName = ""; em.M_Email = ""; em.M_FHM = ""; em.M_HasReply = false; em.M_Moblie = ""; em.M_PHMa = ""; em.M_RecverType = "administrator"; em.M_Restore = false; em.M_SenderType = "user"; em.M_Title = webInfo.AuditingUserMessageTitle; em.M_Content = webInfo.AuditingUserMessageContent; em.M_UserName = ""; em.M_UserType = false; em.U_ID = -1; em.UR_ID = U_ID; m.Insert(em); } }