Beispiel #1
0
        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);
        }
Beispiel #2
0
 private void btnSendToRank_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <MessageBoxInfo> list = new System.Collections.Generic.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(new char[]
         {
             '*'
         });
         for (int i = 0; i < array.Length; i++)
         {
             Member member = this.GetMember(array[i]);
             if (member != null)
             {
                 list.Add(new MessageBoxInfo
                 {
                     Accepter = array[i],
                     Sernder  = "admin",
                     Title    = this.MessageTitle,
                     Content  = this.Content
                 });
             }
         }
         if (list.Count <= 0)
         {
             this.ShowMsg("没有要发送的对象", false);
             return;
         }
         NoticeHelper.SendMessageToMember(list);
         //Messages.Messenger.SendXinGe(array, this.Content, this.MessageTitle, 3, 10, 0);
         this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true);
     }
     if (this.rdoRank.Checked)
     {
         System.Collections.Generic.IList <Member> list2 = new System.Collections.Generic.List <Member>();
         list2 = NoticeHelper.GetMembersByRank(this.rankList.SelectedValue);
         List <string> users = new List <string>();
         foreach (Member current in list2)
         {
             list.Add(new MessageBoxInfo
             {
                 Accepter = current.Username,
                 Sernder  = "admin",
                 Title    = this.MessageTitle,
                 Content  = this.Content
             });
             users.Add(current.Username);
         }
         if (list.Count > 0)
         {
             NoticeHelper.SendMessageToMember(list);
             this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true);
             //Messages.Messenger.SendXinGe(users.ToArray(), this.Content, this.MessageTitle, 3, 10, 0);
             return;
         }
         this.ShowMsg("没有要发送的对象", false);
     }
 }
Beispiel #3
0
        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");
                }
            }
        }
        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);
                }
            }
        }
Beispiel #5
0
        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.grdMemberList.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  = "Admin";
                            item.Accepter = name;
                            item.Title    = str2;
                            item.Content  = str;
                            messageBoxInfos.Add(item);
                        }
                    }
                }
                if (messageBoxInfos.Count > 0)
                {
                    NoticeHelper.SendMessageToMember(messageBoxInfos);
                    this.txtsitecontent.Value = "输入发送内容……";
                    this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", messageBoxInfos.Count), true);
                }
                else
                {
                    this.ShowMsg("没有要发送的对象", false);
                }
            }
        }
 protected void btnReplyReplyReceivedMessages_Click(object sender, System.EventArgs e)
 {
     if (NoticeHelper.SendMessageToMember(new System.Collections.Generic.List <MessageBoxInfo>
     {
         new MessageBoxInfo
         {
             Accepter = (string)this.ViewState["Sernder"],
             Sernder = "admin",
             Title = this.txtTitle.Text.Trim(),
             Content = this.txtContes.Text.Trim()
         }
     }) > 0)
     {
         this.ShowMsg("成功回复了会员的站内信.", true);
         return;
     }
     this.ShowMsg("回复会员的站内信失败.", false);
 }
        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("没有要发送的对象");
        }
Beispiel #8
0
        protected void btnReplyReplyReceivedMessages_Click(object sender, EventArgs e)
        {
            IList <MessageBoxInfo> messageBoxInfos = new List <MessageBoxInfo>();
            MessageBoxInfo         item            = new MessageBoxInfo();

            item.Accepter = (string)this.ViewState["Sernder"];
            item.Sernder  = "admin";
            item.Title    = this.txtTitle.Text.Trim();
            item.Content  = this.txtContes.Text.Trim();
            messageBoxInfos.Add(item);
            if (NoticeHelper.SendMessageToMember(messageBoxInfos) > 0)
            {
                this.ShowMsg("成功回复了会员的站内信.", true);
            }
            else
            {
                this.ShowMsg("回复会员的站内信失败.", false);
            }
        }
Beispiel #9
0
        private void btnsitecontent_Click(object sender, System.EventArgs e)
        {
            System.Collections.Generic.IList <MessageBoxInfo> list = new System.Collections.Generic.List <MessageBoxInfo>();
            string text = this.txtsitecontent.Value.Trim();

            if (string.IsNullOrEmpty(text) || text.Equals("输入发送内容……"))
            {
                this.ShowMsg("请输入要发送的内容信息", false);
                return;
            }
            string title = text;

            if (text.Length > 10)
            {
                title = text.Substring(0, 10) + "……";
            }
            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdMemberList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    string text2 = ((System.Web.UI.WebControls.Literal)gridViewRow.Controls[1].Controls[1]).Text.Trim();
                    if (this.IsMembers(text2))
                    {
                        list.Add(new MessageBoxInfo
                        {
                            Sernder  = "Admin",
                            Accepter = text2,
                            Title    = title,
                            Content  = text
                        });
                    }
                }
            }
            if (list.Count > 0)
            {
                NoticeHelper.SendMessageToMember(list);
                this.txtsitecontent.Value = "输入发送内容……";
                this.ShowMsg(string.Format("成功给{0}个用户发送了消息.", list.Count), true);
                return;
            }
            this.ShowMsg("没有要发送的对象", false);
        }
        protected void btnReplyReplyReceivedMessages_Click(object sender, EventArgs e)
        {
            IList <MessageBoxInfo> list           = new 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, 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)
            {
                NoticeHelper.PostManagerMessageIsRead(this.messageId);
                this.ShowMsg("成功回复了会员的站内信.", true);
            }
            else
            {
                this.ShowMsg("回复会员的站内信失败.", false);
            }
        }