private void btnRefer_Click(object sender, System.EventArgs e) { string text = ""; if (string.IsNullOrEmpty(this.txtTitle.Text) || this.txtTitle.Text.Length > 60) { text += Formatter.FormatErrorMessage("标题不能为空,长度限制在1-60个字符内"); } if (string.IsNullOrEmpty(this.txtContent.Text) || this.txtContent.Text.Length > 300) { text += Formatter.FormatErrorMessage("内容不能为空,长度限制在1-300个字符内"); } if (!string.IsNullOrEmpty(text)) { this.ShowMessage(text, false); } else { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Sernder = HiContext.Current.User.Username; messageBoxInfo.Accepter = (HiContext.Current.SiteSettings.IsDistributorSettings ? Users.GetUser(HiContext.Current.SiteSettings.UserId.Value).Username : "******"); messageBoxInfo.Title = Globals.HtmlEncode(this.txtTitle.Text.Replace("~", "")); messageBoxInfo.Content = Globals.HtmlEncode(this.txtContent.Text.Replace("~", "")); this.txtTitle.Text = string.Empty; this.txtContent.Text = string.Empty; if (CommentsHelper.SendMessage(messageBoxInfo)) { this.ShowMessage("发送信息成功", true); } else { this.ShowMessage("发送信息失败", true); } } }
protected void btnReplyReplyReceivedMessages_Click(object sender, System.EventArgs e) { System.Collections.Generic.IList <MessageBoxInfo> list = new System.Collections.Generic.List <MessageBoxInfo>(); MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Accepter = (string)this.ViewState["Sernder"]; messageBoxInfo.Sernder = "admin"; messageBoxInfo.Title = this.txtTitle.Text.Trim(); string format = "\n\n时间:{0}\t发件人:{1}\n标题:{2}\n内容:{3}\n"; string str = string.Format(format, new object[] { System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), "管理员", messageBoxInfo.Title, this.txtContes.Value.Trim() }); messageBoxInfo.Content = str + this.txtContent.Value; list.Add(messageBoxInfo); if (NoticeHelper.SendMessageToMember(list) > 0) { this.ShowMsg("成功回复了会员的站内信.", true); return; } this.ShowMsg("回复会员的站内信失败.", false); }
private void btnRefer_Click(object sender, EventArgs e) { string text = ""; if (string.IsNullOrEmpty(this.txtTitle.Text) || this.txtTitle.Text.Length > 60) { text += Formatter.FormatErrorMessage("标题不能为空,长度限制在1-60个字符内"); } if (string.IsNullOrEmpty(this.txtContent.Text) || this.txtContent.Text.Length > 300) { text += Formatter.FormatErrorMessage("内容不能为空,长度限制在1-300个字符内"); } if (!string.IsNullOrEmpty(text)) { this.ShowMessage(text, false, "", 1); } else { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Sernder = HiContext.Current.User.UserName; messageBoxInfo.Accepter = "admin"; messageBoxInfo.Title = Globals.HtmlEncode(this.txtTitle.Text.Replace("~", "")); string text3 = messageBoxInfo.Content = Globals.HtmlEncode(this.txtContent.Text.Replace("~", "")); this.txtTitle.Text = string.Empty; this.txtContent.Text = string.Empty; if (CommentBrowser.SendMessage(messageBoxInfo)) { this.ShowMessage("发送信息成功", true, "", 1); } else { this.ShowMessage("发送信息失败", true, "", 1); } } }
private void btnReplyReceivedMessage_Click(object sender, EventArgs e) { string text = ""; if (string.IsNullOrEmpty(this.txtReplyTitle.Text) || this.txtReplyTitle.Text.Length > 60) { text += Formatter.FormatErrorMessage("标题不能为空,长度限制在1-60个字符内"); } if (string.IsNullOrEmpty(this.txtReplyContent.Text) || this.txtReplyContent.Text.Length > 300) { text += Formatter.FormatErrorMessage("内容不能为空,长度限制在1-300个字符内"); } if (!string.IsNullOrEmpty(text)) { this.ShowMessage(text, false, "", 1); } else { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Sernder = HiContext.Current.User.UserName; messageBoxInfo.Accepter = "admin"; messageBoxInfo.Title = this.txtReplyTitle.Text.Trim(); string format = "\n\n时间:{0}\t发件人:{1}\n标题:{2}\n内容:{3}\n"; string str = string.Format(format, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), messageBoxInfo.Sernder, messageBoxInfo.Title, this.txtReplyContent.Text.Trim()); messageBoxInfo.Content = str + this.txtReplyRecord.Value; if (CommentBrowser.SendMessage(messageBoxInfo)) { this.ShowMessage("回复成功", true, "", 1); } else { this.ShowMessage("回复失败", false, "", 1); } } }
public bool AddMessage(MessageBoxInfo messageBoxInfo, UserRole toRole) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("BEGIN TRAN "); stringBuilder.Append("DECLARE @ContentId int "); stringBuilder.Append("DECLARE @errorSun INT "); stringBuilder.Append("SET @errorSun=0 "); stringBuilder.Append("INSERT INTO [Ecshop_MessageContent]([Title],[Content],[Date]) "); stringBuilder.Append("VALUES(@Title,@Content,@Date) "); stringBuilder.Append("SET @ContentId = @@IDENTITY "); stringBuilder.Append("SET @errorSun=@errorSun+@@ERROR "); stringBuilder.AppendFormat("INSERT INTO [{0}]([ContentId],[Sernder],[Accepter],[IsRead]) ", "Ecshop_MemberMessageBox"); stringBuilder.Append("VALUES(@ContentId,@Sernder ,@Accepter,@IsRead) "); stringBuilder.Append("SET @errorSun=@errorSun+@@ERROR "); stringBuilder.Append("IF @errorSun<>0 "); stringBuilder.Append("BEGIN "); stringBuilder.Append("ROLLBACK TRANSACTION "); stringBuilder.Append("END "); stringBuilder.Append("ELSE "); stringBuilder.Append("BEGIN "); stringBuilder.Append("COMMIT TRANSACTION "); stringBuilder.Append("END "); DbCommand sqlStringCommand = this.database.GetSqlStringCommand(stringBuilder.ToString()); this.database.AddInParameter(sqlStringCommand, "Title", DbType.String, messageBoxInfo.Title); this.database.AddInParameter(sqlStringCommand, "Content", DbType.String, messageBoxInfo.Content); this.database.AddInParameter(sqlStringCommand, "Date", DbType.DateTime, DataHelper.GetSafeDateTimeFormat(DateTime.Now)); this.database.AddInParameter(sqlStringCommand, "Sernder", DbType.String, messageBoxInfo.Sernder); this.database.AddInParameter(sqlStringCommand, "Accepter", DbType.String, messageBoxInfo.Accepter); this.database.AddInParameter(sqlStringCommand, "IsRead", DbType.Boolean, messageBoxInfo.IsRead); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
/// <summary>リソースファイルによる表示言語切替.ViewModel</summary> public ResourceViewModel() { // 初期値取得 switch (Thread.CurrentThread.CurrentUICulture.Name) { case "en-US": SelectedLanguage = Languages.English; break; case "ja-JP": SelectedLanguage = Languages.Japanese; break; } MessageBoxCommand = new DelegateCommand( () => { // リソースファイルより表示内容を取得 MessageInfo = new MessageBoxInfo() { Message = LanguageSample.Message, Title = LanguageSample.Title }; CallPropertyChanged(nameof(MessageInfo)); }, () => true); }
protected override void AttachChildControls() { this.litAddresser = (Literal)this.FindControl("litAddresser"); this.litTitle = (Literal)this.FindControl("litTitle"); this.litDate = (FormatedTimeLabel)this.FindControl("litDate"); this.txtReplyTitle = (TextBox)this.FindControl("txtReplyTitle"); this.txtReplyContent = (TextBox)this.FindControl("txtReplyContent"); this.txtReplyRecord = (HtmlTextArea)this.FindControl("txtReplyRecord"); this.btnReplyReceivedMessage = (Button)this.FindControl("btnReplyReceivedMessage"); this.btnReplyReceivedMessage.Click += this.btnReplyReceivedMessage_Click; if (!string.IsNullOrEmpty(this.Page.Request.QueryString["MessageId"])) { this.messageId = long.Parse(this.Page.Request.QueryString["MessageId"]); } if (!this.Page.IsPostBack) { CommentBrowser.PostMemberMessageIsRead(this.messageId); MessageBoxInfo memberMessage = CommentBrowser.GetMemberMessage(this.messageId); if (memberMessage != null) { this.litAddresser.Text = "管理员"; this.litTitle.Text = memberMessage.Title; this.txtReplyRecord.Value = memberMessage.Content; this.litDate.Time = memberMessage.Date; } } }
private void btnReplyReceivedMessage_Click(object sender, EventArgs e) { string str = ""; if (string.IsNullOrEmpty(this.txtReplyTitle.Text) || (this.txtReplyTitle.Text.Length > 60)) { str = str + Formatter.FormatErrorMessage("标题不能为空,长度限制在1-60个字符内"); } if (string.IsNullOrEmpty(this.txtReplyContent.Text) || (this.txtReplyContent.Text.Length > 300)) { str = str + Formatter.FormatErrorMessage("内容不能为空,长度限制在1-300个字符内"); } if (!string.IsNullOrEmpty(str)) { this.ShowMessage(str, false); } else { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Sernder = HiContext.Current.User.Username; messageBoxInfo.Accepter = HiContext.Current.SiteSettings.IsDistributorSettings ? Users.GetUser(HiContext.Current.SiteSettings.UserId.Value).Username : "******"; messageBoxInfo.Title = this.txtReplyTitle.Text.Trim(); messageBoxInfo.Content = this.txtReplyContent.Text.Trim(); if (CommentsHelper.SendMessage(messageBoxInfo)) { this.ShowMessage("回复成功", true); } else { this.ShowMessage("回复失败", false); } } }
private void btnsitecontent_Click(object sender, EventArgs e) { IList <MessageBoxInfo> messageBoxInfos = new List <MessageBoxInfo>(); string str = this.txtsitecontent.Value.Trim(); if (string.IsNullOrEmpty(str) || str.Equals("输入发送内容……")) { this.ShowMsg("请输入要发送的内容信息", false); } else { string str2 = str; if (str.Length > 10) { str2 = str.Substring(0, 10) + "……"; } foreach (GridViewRow row in this.grdDistributorList.Rows) { CheckBox box = (CheckBox)row.FindControl("checkboxCol"); if (box.Checked) { string name = ""; foreach (object obj2 in row.Controls[1].Controls) { if (obj2 is Literal) { name = ((Literal)obj2).Text.Trim(); break; } if (obj2 is DataBoundLiteralControl) { name = ((DataBoundLiteralControl)obj2).Text.Trim(); break; } } if (this.IsMembers(name)) { MessageBoxInfo item = new MessageBoxInfo(); item.Sernder = "Admin"; item.Accepter = name; item.Title = str2; item.Content = str; messageBoxInfos.Add(item); } } } if (messageBoxInfos.Count > 0) { NoticeHelper.SendMessageToDistributor(messageBoxInfos); this.ShowMsg(string.Format("成功给{0}个分销商发送了消息.", messageBoxInfos.Count), true); } else { this.ShowMsg("没有要发送的对象", false); } } }
public static void Show(string mesaj, MesajTipleri mesajTipi) { MessageBoxInfo _mesaj = new MessageBoxInfo { Mesaj = mesaj, MesajTipi = mesajTipi }; Show(_mesaj); }
private void saveButton_Click(object sender, EventArgs e) { form.Group = (FormGroup)groupBindingSource.Current; form.Status = (FormStatus)statusComboBox.SelectedItem; form.Update(); //TODO Call Server Command to create dsl files according to Form Inputs/Outputs and apply a migration to create the database structures MessageBoxInfo.Show("Saved."); }
public static byte[] showMessageBox(Command command) { MessageBoxInfo info = (MessageBoxInfo)Util.Serialization.deserialize(command.data); MessageBox.Show(new Form() { TopMost = true }, info.message, info.title, info.buttons, info.icon); return(new byte[] { }); }
public static void Show(MessageBoxInfo mesaj) { string _mesaj = string.Format( @"notif({{ msg: ""{0}"", type: ""{1}"", autohide: {2}, timeout: {3}, position: ""center"", width: ""all"", heigt: 100 }});", mesaj.Mesaj, mesaj.MesajTipi.ToString().ToLower(CultureInfo.InvariantCulture), mesaj.OtoKapa ? "true" : "false", mesaj.Sure); Page page = HttpContext.Current.Handler as Page; bool async = false; try { async = ScriptManager.GetCurrent(page).IsInAsyncPostBack; } catch { } if (mesaj.OnDOMReady) { if (async) { ScriptManager.RegisterClientScriptBlock(page, page.GetType(), Guid.NewGuid().ToString(), _mesaj, true); } else { ClientScriptManager csm = page.Page.ClientScript; csm.RegisterClientScriptBlock(page.GetType(), Guid.NewGuid().ToString(), _mesaj, true); } } else { if (async) { ScriptManager.RegisterClientScriptBlock(page, page.GetType(), Guid.NewGuid().ToString(), _mesaj, true); } else { ClientScriptManager csm = page.Page.ClientScript; csm.RegisterClientScriptBlock(page.GetType(), Guid.NewGuid().ToString(), _mesaj, true); } } }
/// <summary> /// Shows the message. /// </summary> /// <param name="options">The options.</param> /// <param name="parentWindow">The parent window.</param> /// <returns>MessageBoxResult.</returns> /// <exception cref="System.NotImplementedException"></exception> public MessageBoxResult ShowMessage(MessageBoxInfo options, Window parentWindow) { return(parentWindow.Dispatcher.Invoke(() => { var win = new MessageBoxWindow(options); win.ShowModal(parentWindow); return win.MessageBoxResult; })); }
public static void Show(string mesaj, MesajTipleri mesajTipi, int sure) { MessageBoxInfo _mesaj = new MessageBoxInfo { Mesaj = mesaj, MesajTipi = mesajTipi, Sure = sure }; Show(_mesaj); }
private void btnSendToRank_Click(object sender, EventArgs e) { IList <MessageBoxInfo> list = new List <MessageBoxInfo>(); if (this.rdoName.Checked && !string.IsNullOrEmpty(this.txtMemberNames.Text.Trim())) { string text = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n"); string[] array = text.Replace("\n", "*").Split('*'); for (int i = 0; i < array.Length; i++) { MemberInfo memberInfo = MemberProcessor.FindMemberByUsername(array[i]); if (memberInfo != null) { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Accepter = array[i]; messageBoxInfo.Sernder = "admin"; messageBoxInfo.Title = this.MessageTitle; messageBoxInfo.Content = this.Content; list.Add(messageBoxInfo); } } if (list.Count > 0) { NoticeHelper.SendMessageToMember(list); this.ShowMsg($"成功给{list.Count}个用户发送了消息.", true, "SendMessageSelectUser.aspx"); } else { this.ShowMsg("没有要发送的对象", true, "SendMessageSelectUser.aspx"); } } if (this.rdoRank.Checked) { IList <string> membersByRank = NoticeHelper.GetMembersByRank(this.rankList.SelectedValue); foreach (string item in membersByRank) { MessageBoxInfo messageBoxInfo2 = new MessageBoxInfo(); messageBoxInfo2.Accepter = item; messageBoxInfo2.Sernder = "admin"; messageBoxInfo2.Title = this.MessageTitle; messageBoxInfo2.Content = this.Content; list.Add(messageBoxInfo2); } if (list.Count > 0) { NoticeHelper.SendMessageToMember(list); this.ShowMsg($"成功给{list.Count}个用户发送了消息.", true, "SendMessageSelectUser.aspx"); } else { this.ShowMsg("没有要发送的对象", true, "SendMessageSelectUser.aspx"); } } }
public static void Show(string mesaj, MesajTipleri mesajTipi, bool otoKapa) { MessageBoxInfo _mesaj = new MessageBoxInfo { Mesaj = mesaj, MesajTipi = mesajTipi, OtoKapa = otoKapa }; Show(_mesaj); }
public MessageBoxInfo GetManagerMessage(long messageId) { MessageBoxInfo result = null; DbCommand sqlStringCommand = base.database.GetSqlStringCommand("SELECT * FROM vw_Hishop_ManagerMessageBox WHERE MessageId=@MessageId;"); base.database.AddInParameter(sqlStringCommand, "MessageId", DbType.Int64, messageId); using (IDataReader objReader = base.database.ExecuteReader(sqlStringCommand)) { result = DataHelper.ReaderToModel <MessageBoxInfo>(objReader); } return(result); }
public MessageBoxWindow(MessageBoxInfo options) : base() { InitializeComponent(); Loaded += MessageBoxWindow_Loaded; DataContext = new MessageBoxViewModel(options, result => { MessageBoxResult = result; CloseModal(); }); }
private void btnSendToRank_Click(object sender, EventArgs e) { IList <MessageBoxInfo> messageBoxInfos = new List <MessageBoxInfo>(); if (this.rdoName.Checked && !string.IsNullOrEmpty(this.txtMemberNames.Text.Trim())) { string[] strArray = this.txtMemberNames.Text.Trim().Replace("\r\n", "\n").Replace("\n", "*").Split(new char[] { '*' }); for (int i = 0; i < strArray.Length; i++) { if (this.GetMember(strArray[i]) != null) { MessageBoxInfo item = new MessageBoxInfo(); item.Accepter = strArray[i]; item.Sernder = "admin"; item.Title = this.MessageTitle; item.Content = this.Content; messageBoxInfos.Add(item); } } if (messageBoxInfos.Count <= 0) { this.ShowMsg("没有要发送的对象", false); return; } NoticeHelper.SendMessageToMember(messageBoxInfos); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true); } if (this.rdoRank.Checked) { IList <Member> list2 = new List <Member>(); foreach (Member member2 in NoticeHelper.GetMembersByRank(this.rankList.SelectedValue)) { MessageBoxInfo info2 = new MessageBoxInfo(); info2.Accepter = member2.Username; info2.Sernder = "admin"; info2.Title = this.MessageTitle; info2.Content = this.Content; messageBoxInfos.Add(info2); } if (messageBoxInfos.Count > 0) { NoticeHelper.SendMessageToMember(messageBoxInfos); this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true); } else { this.ShowMsg("没有要发送的对象", false); } } }
public override MessageBoxInfo GetMemberMessage(long messageId) { MessageBoxInfo result = null; System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM vw_Hishop_MemberMessageBox WHERE MessageId=@MessageId;"); this.database.AddInParameter(sqlStringCommand, "MessageId", System.Data.DbType.Int64, messageId); using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { result = DataMapper.PopulateMessageBox(dataReader); } } return(result); }
public override MessageBoxInfo GetMessage(long messageId) { MessageBoxInfo info = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM vw_Hishop_DistributorMessageBox WHERE MessageId=@MessageId;"); this.database.AddInParameter(sqlStringCommand, "MessageId", DbType.Int64, messageId); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { if (reader.Read()) { info = DataMapper.PopulateMessageBox(reader); } } return(info); }
private void createDemoDataButton_Click(object sender, EventArgs e) { if (MessageBoxQuestion.PromptDefaultNo("Delete all data and insert demo data?")) { try { ServerCommand.DeleteAllAndInsertDemoData(); MessageBoxInfo.Show("Done."); } catch (Exception ex) { MessageBoxError.Show(ex.ToString()); } } }
public MessageBoxInfo GetManagerMessage(long messageId) { MessageBoxInfo result = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM vw_Ecshop_ManagerMessageBox WHERE MessageId=@MessageId;"); this.database.AddInParameter(sqlStringCommand, "MessageId", DbType.Int64, messageId); using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { result = DataMapper.PopulateMessageBox(dataReader); } } return(result); }
public MessageBoxViewModel(MessageBoxInfo info, Action <MessageBoxResult> closeAction) { _closeAction = closeAction; Caption = info.Caption; Text = info.Text; Button = info.Button; Icon = info.Icon; TimeoutMs = info.TimeoutMs; YesCommand = new RelayCommand(i => Close(MessageBoxResult.Yes)); NoCommand = new RelayCommand(i => Close(MessageBoxResult.No)); OKCommand = new RelayCommand(i => Close(MessageBoxResult.OK)); CancelCommand = new RelayCommand(i => Close(MessageBoxResult.Cancel)); }
protected void Page_Load(object sender, System.EventArgs e) { if (!long.TryParse(base.Request.QueryString["MessageId"], out this.messageId)) { base.GotoResourceNotFound(); return; } this.btnReplyReplyReceivedMessages.Click += new System.EventHandler(this.btnReplyReplyReceivedMessages_Click); if (!this.Page.IsPostBack) { SubsiteCommentsHelper.PostMessageIsRead(this.messageId); MessageBoxInfo message = SubsiteCommentsHelper.GetMessage(this.messageId); this.litTitle.Text = message.Title; this.litContent.Text = message.Content; } }
protected void Page_Load(object sender, System.EventArgs e) { if (!long.TryParse(this.Page.Request.QueryString["MessageId"], out this.messageId)) { base.GotoResourceNotFound(); return; } this.btnReplyReplyReceivedMessages.Click += new System.EventHandler(this.btnReplyReplyReceivedMessages_Click); if (!this.Page.IsPostBack) { NoticeHelper.PostManagerMessageIsRead(this.messageId); MessageBoxInfo managerMessage = NoticeHelper.GetManagerMessage(this.messageId); this.litTitle.Text = managerMessage.Title; this.txtContent.Value = managerMessage.Content; this.ViewState["Sernder"] = managerMessage.Sernder; } }
private void btnsitecontent_Click(object sender, EventArgs e) { IList <MessageBoxInfo> messageBoxInfos = new List <MessageBoxInfo>(); string str = this.txtsitecontent.Value.Trim(); if (string.IsNullOrEmpty(str) || str.Equals("输入发送内容……")) { this.ShowMsg("请输入要发送的内容信息", false); } else { string str2 = str; if (str.Length > 10) { str2 = str.Substring(0, 10) + "……"; } string username = HiContext.Current.User.Username; foreach (GridViewRow row in this.grdUnderlings.Rows) { CheckBox box = (CheckBox)row.FindControl("checkboxCol"); if (box.Checked) { string name = ((Literal)row.Controls[1].Controls[1]).Text.Trim(); if (this.IsMembers(name)) { MessageBoxInfo item = new MessageBoxInfo(); item.Sernder = username; item.Accepter = name; item.Title = str2; item.Content = str; messageBoxInfos.Add(item); } } } if (messageBoxInfos.Count > 0) { SubsiteCommentsHelper.SendMessageToMember(messageBoxInfos); this.txtsitecontent.Value = "输入发送内容……"; this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true); } else { this.ShowMsg("没有要发送的对象", false); } } }
private void CleanInfo() { _delOK = null; _delCancel = null; _delCountDownOver = null; _delDynamic = null; _delWaitTimeOut = null; _messageBoxInfo = null; _durationTime = _delayTime = -1.0f; _oneSecondTime = 0.0f; _isEnable = true; TitleText.text = ""; ContextText.text = ""; CancelBtnText.text = ""; OkBtnText.text = ""; DynamicBtnText.text = ""; }
private void SendSiteMsg(HttpContext context) { string text = base.GetParameter(context, "content", true).Trim(); string parameter = base.GetParameter(context, "ids", true); if (string.IsNullOrWhiteSpace(parameter)) { throw new HidistroAshxException("请先选择要删除的会员账号"); } if (string.IsNullOrEmpty(text)) { throw new HidistroAshxException("请先填写发送的内容信息"); } string title = text; if (text.Length > 10) { title = text.Substring(0, 10) + "……"; } int[] array = (from d in parameter.Split(',') where !string.IsNullOrWhiteSpace(d) select int.Parse(d)).ToArray(); parameter = string.Join(",", array); int num = array.Count(); IEnumerable <MemberInfo> membersById = MemberHelper.GetMembersById(parameter); IList <MessageBoxInfo> list = new List <MessageBoxInfo>(); foreach (MemberInfo item in membersById) { MessageBoxInfo messageBoxInfo = new MessageBoxInfo(); messageBoxInfo.Sernder = "Admin"; messageBoxInfo.Accepter = item.UserName; messageBoxInfo.Title = title; messageBoxInfo.Content = text; list.Add(messageBoxInfo); } if (list.Count > 0) { NoticeHelper.SendMessageToMember(list); base.ReturnSuccessResult(context, $"成功给{list.Count}个用户发送了消息.", 0, true); return; } throw new HidistroAshxException("没有要发送的对象"); }