Beispiel #1
0
        protected string FormatSendTo(object sendto, object id)
        {
            string str = string.Empty;

            switch (Globals.ToNum(sendto))
            {
            case 0:
                return("所有用户");

            case 1:
                return("分销商");

            case 2:
            {
                str = "指定用户";
                int selectedUser = NoticeHelper.GetSelectedUser(Globals.ToNum(id));
                if (selectedUser > 0)
                {
                    object obj2 = str;
                    str = string.Concat(new object[] { obj2, "(<span style='color:green'>", selectedUser, "</span>)" });
                }
                return(str);
            }
            }
            return(str);
        }
Beispiel #2
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 #3
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string commandName = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "delete"))
                {
                    if (!(commandName == "pub"))
                    {
                        return;
                    }
                }
                else
                {
                    NoticeHelper.DelNotice(Globals.ToNum(e.CommandArgument.ToString()));
                    this.ShowMsg("成功删除了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                    this.BindData(this.pageno, this.sendType);
                    return;
                }
                NoticeHelper.NoticePub(Globals.ToNum(e.CommandArgument.ToString()));
                this.ShowMsg("成功发布了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                this.BindData(this.pageno, this.sendType);
            }
        }
Beispiel #4
0
        private void GetDistributorsByNames(Dictionary <int, IList <string> > distributorIds)
        {
            IList <Distributor>        list               = new List <Distributor>();
            IList <SendMessageInfo>    sendMessageList    = new List <SendMessageInfo>();
            IList <ReceiveMessageInfo> receiveMessageList = new List <ReceiveMessageInfo>();
            IList <int> userids = new List <int>();

            foreach (int num in distributorIds.Keys)
            {
                userids.Add(num);
            }
            foreach (Distributor distributor in NoticeHelper.GetDistributorsByNames(userids))
            {
                int            count = distributorIds[distributor.UserId].Count;
                IList <string> list5 = distributorIds[distributor.UserId];
                string         str   = "尊敬各位分销商,有如下商品已被取消铺货: ";
                foreach (string str2 in list5)
                {
                    str = str + str2 + " ";
                }
                SendMessageInfo    item  = new SendMessageInfo();
                ReceiveMessageInfo info2 = new ReceiveMessageInfo();
                item.Addressee      = info2.Addressee = distributor.Username;
                item.Addresser      = info2.Addresser = "admin";
                item.Title          = info2.Title = "取消了" + count + "个商品的铺货";
                item.PublishContent = info2.PublishContent = str;
                sendMessageList.Add(item);
                receiveMessageList.Add(info2);
            }
            if (sendMessageList.Count > 0)
            {
                NoticeHelper.SendMessage(sendMessageList, receiveMessageList);
            }
        }
        protected void btnDel_Click(object sender, EventArgs e)
        {
            string[] strArray = Globals.RequestFormStr("cbNoticeGroup").Trim().Split(new char[] { ',' });
            int      noticeid = 0;
            int      num2     = 0;

            foreach (string str2 in strArray)
            {
                noticeid = Globals.ToNum(str2);
                if (noticeid > 0)
                {
                    NoticeHelper.DelNotice(noticeid);
                    num2++;
                }
            }
            if (num2 > 0)
            {
                this.ShowMsg("成功删除了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                this.BindData(this.pageno, this.sendType);
            }
            else
            {
                this.ShowMsg("请选择要删除的" + ((this.sendType == 1) ? "消息" : "公告"), false);
            }
        }
Beispiel #6
0
        protected void btnReplyReplyReceivedMessages_Click(object sender, EventArgs e)
        {
            SendMessageInfo    target         = new SendMessageInfo();
            ReceiveMessageInfo receiveMessage = NoticeHelper.GetReceiveMessage(receiveMessageId);

            target.Title            = txtTitle.Text;
            target.PublishContent   = txtContes.Text;
            target.ReceiveMessageId = new long?(receiveMessageId);
            target.Addresser        = "admin";
            target.Addressee        = receiveMessage.Addresser;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <SendMessageInfo>(target, new string[] { "ValSendMessage" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                ShowMsg(msg, false);
            }
            else if (NoticeHelper.ReplyMessage(target))
            {
                txtTitle.Text  = "";
                txtContes.Text = "";
                ShowMsg("成功回复客户消息", true);
                BindReplyReceivedMessages();
                txtTitle.Text  = string.Empty;
                txtContes.Text = string.Empty;
            }
            else
            {
                ShowMsg("回复客户消息失败", false);
            }
        }
Beispiel #7
0
        protected string FormatOper(object userid, object adminname, object frompage = null)
        {
            string result = string.Empty;

            if (frompage == null)
            {
                if (NoticeHelper.GetUserIsSel(Globals.ToNum(userid), adminname.ToString(), ""))
                {
                    result = "<input type='button' class='btn btn-success btn-xs' value='已选' issel='1' userid='" + userid.ToString() + "' onclick='seluser(this)'/>";
                }
                else
                {
                    result = "<input type='button' class='btn btn-primary btn-xs' value='选择' issel='0' userid='" + userid.ToString() + "' onclick='seluser(this)'/>";
                }
            }
            else
            {
                if (NoticeHelper.GetUserIsSel(Globals.ToNum(userid), adminname.ToString(), frompage.ToString()))
                {
                    result = "<input type='button' class='btn btn-success btn-xs' value='已选' issel='1' userid='" + userid.ToString() + "' onclick='seluser(this)'/>";
                }
                else
                {
                    result = "<input type='button' class='btn btn-primary btn-xs' value='选择' issel='0' userid='" + userid.ToString() + "' onclick='seluser(this)'/>";
                }
            }

            return(result);
        }
        private void BindData()
        {
            int num;
            ReceivedMessageQuery query = new ReceivedMessageQuery();

            query.PageIndex = pager.PageIndex;
            query.PageSize  = pager.PageSize;
            query.SortBy    = messagesList.SortOrderBy;

            if (!string.IsNullOrEmpty(base.Request.QueryString["MessageStatus"]))
            {
                query.MessageStatus      = (MessageStatus)int.Parse(base.Request.QueryString["MessageStatus"]);
                statusList.SelectedValue = query.MessageStatus;
            }
            if (int.TryParse(base.Request.QueryString["IsRead"], out num))
            {
                query.IsRead = new bool?(Convert.ToBoolean(num));
            }
            query.UserName = "******";
            if (messagesList.SortOrder.ToLower() == "desc")
            {
                query.SortOrder = SortAction.Desc;
            }
            DbQueryResult distributorReceivedMessages = NoticeHelper.GetDistributorReceivedMessages(query);

            messagesList.DataSource = distributorReceivedMessages.Data;
            messagesList.DataBind();
            pager.TotalRecords  = distributorReceivedMessages.TotalRecords;
            pager1.TotalRecords = distributorReceivedMessages.TotalRecords;
        }
Beispiel #9
0
        private void Delete(HttpContext context)
        {
            string     text = context.Request["ids"];
            List <int> list = new List <int>();
            bool       flag = false;

            if (text.Length < 0)
            {
                throw new HidistroAshxException("错误的参数!");
            }
            string[] array = text.Split(',');
            foreach (string text2 in array)
            {
                if (!string.IsNullOrEmpty(text2))
                {
                    list.Add(text2.ToInt(0));
                }
            }
            int num = NoticeHelper.DeleteAffiches(list);

            if (num > 0)
            {
                base.ReturnSuccessResult(context, $"成功删除了选择的{num}条公告!", 0, true);
                return;
            }
            throw new HidistroAshxException("请选择要删除的公告!");
        }
Beispiel #10
0
        private string ReadNoticeHandle(ref ushort flib, string para)
        {
            string message = null;

            var res = new List <ReadNoticeResultItemModel>();

            var ret = new NoticeHelper().ReadNoticeRange(flib, ref res);

            if (ret.Item1 == -16)
            {
                var ret_conn = ConnectHelper.BuildConnect(ref flib, m_ip, m_port, m_timeout);

                if (ret_conn == 0)
                {
                    ret = new NoticeHelper().ReadNoticeRange(flib, ref res);
                }
            }

            if (ret.Item1 != 0)
            {
                message = ret.Item2;
            }
            GetResultEvent?.Invoke(new BaseCNCResultModel <ReadNoticeResultItemModel>()
            {
                Value = res, Id = para
            });

            return(message);
        }
Beispiel #11
0
        protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
        {
            string commandName;

            if ((commandName = e.CommandName) != null)
            {
                int noticeid;
                if (commandName == "delete")
                {
                    noticeid = Globals.ToNum(e.CommandArgument.ToString());
                    NoticeHelper.DelNotice(noticeid);
                    this.ShowMsg("成功删除了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                    this.BindData(this.pageno, this.sendType);
                    return;
                }
                if (!(commandName == "pub"))
                {
                    return;
                }
                noticeid = Globals.ToNum(e.CommandArgument.ToString());
                NoticeHelper.NoticePub(noticeid);
                this.ShowMsg("成功发布了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                this.BindData(this.pageno, this.sendType);
            }
        }
        private void DeleteSelect()
        {
            int        item     = 0;
            List <int> affiches = new List <int>();
            int        num2     = 0;

            foreach (GridViewRow row in this.grdAfficheList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if (box.Checked)
                {
                    num2++;
                    item = Convert.ToInt32(this.grdAfficheList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture);
                    affiches.Add(item);
                }
            }
            if (num2 != 0)
            {
                int num3 = NoticeHelper.DeleteAffiches(affiches);
                this.BindAffiche();
                this.ShowMsg(string.Format("成功删除了选择的{0}条公告", num3), true);
            }
            else
            {
                this.ShowMsg("请先选择要删除的公告", false);
            }
        }
Beispiel #13
0
        private void btnAddAffiche_Click(object sender, EventArgs e)
        {
            AfficheInfo target = new AfficheInfo();

            target.Title     = txtAfficheTitle.Text.Trim();
            target.Content   = fcContent.Text;
            target.AddedDate = DateTime.Now;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <AfficheInfo>(target, new string[] { "ValAfficheInfo" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                ShowMsg(msg, false);
            }
            else if (NoticeHelper.CreateAffiche(target))
            {
                txtAfficheTitle.Text = string.Empty;
                fcContent.Text       = string.Empty;
                ShowMsg("成功发布了一条公告", true);
            }
            else
            {
                ShowMsg("添加公告失败", false);
            }
        }
Beispiel #14
0
        public JsonResult SaveNotice(Notice notice)
        {
            Activity a = new Activity
            {
                Title       = notice.Title,
                Description = notice.Description,
                Date        = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")
            };

            Notice n = new Notice()
            {
                StartDateNotice = notice.StartDateNotice,
                EndDateNotice   = notice.EndDateNotice,
            };

            NoticeHelper nh = new NoticeHelper();

            if ((nh.CreateActivity(a, n)) == 1)
            {
                model = (SessionModel)this.Session["SessionData"];

                LogManager.Configuration.Variables["userid"]   = model.UserID;
                LogManager.Configuration.Variables["username"] = model.UserName;
                logger.Info("Notice created VTIntranet for username: "******"Noticia creada correctamente" }));
            }
            else
            {
                logger.Error("Error al intentar al crear una noticia en la db. " + Environment.NewLine + DateTime.Now);
                return(Json(new { success = false, msg = "Hubo un error al crear la noticia" }));
            }
        }
Beispiel #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["afficheId"], out this.afficheId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnEditAffiche.Click += this.btnEditAffiche_Click;
         if (!this.Page.IsPostBack)
         {
             AfficheInfo affiche = NoticeHelper.GetAffiche(this.afficheId);
             if (affiche == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 Globals.EntityCoding(affiche, false);
                 this.txtAfficheTitle.Text = affiche.Title;
                 this.fcContent.Text       = affiche.Content;
             }
         }
     }
 }
Beispiel #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.adminname = ManagerHelper.GetCurrentManager().UserName;
     if (Globals.RequestFormStr("posttype") == "sel")
     {
         base.Response.ContentType = "application/json";
         string s      = "{\"success\":\"1\",\"tips\":\"操作成功!\"}";
         int    userid = Globals.RequestFormNum("userid");
         if (Globals.RequestFormNum("issel") == 1)
         {
             NoticeHelper.DelUser(userid, this.adminname);
         }
         else
         {
             NoticeHelper.AddUser(userid, this.adminname);
         }
         base.Response.Write(s);
         base.Response.End();
     }
     if (!base.IsPostBack)
     {
         this.searchName  = Globals.RequestQueryStr("key");
         this.txtKey.Text = this.searchName;
         this.BindData(this.searchName);
     }
 }
Beispiel #17
0
        private void btnEditAffiche_Click(object sender, EventArgs e)
        {
            AfficheInfo afficheInfo = new AfficheInfo();

            afficheInfo.AfficheId = this.afficheId;
            afficheInfo.Title     = this.txtAfficheTitle.Text.Trim();
            afficheInfo.Content   = this.fcContent.Text;
            afficheInfo.AddedDate = DateTime.Now;
            ValidationResults validationResults = Validation.Validate(afficheInfo, "ValAfficheInfo");
            string            text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult item in (IEnumerable <ValidationResult>)validationResults)
                {
                    text += Formatter.FormatErrorMessage(item.Message);
                }
                this.ShowMsg(text, false);
            }
            else
            {
                afficheInfo.AfficheId = this.afficheId;
                if (NoticeHelper.UpdateAffiche(afficheInfo))
                {
                    this.ShowMsg("成功修改了当前公告信息", true);
                }
                else
                {
                    this.ShowMsg("修改公告信息错误", false);
                }
            }
        }
Beispiel #18
0
        private void Delete(HttpContext context)
        {
            string parameter = base.GetParameter(context, "ids", false);

            if (string.IsNullOrWhiteSpace(parameter))
            {
                throw new HidistroAshxException("请选要删除的消息");
            }
            List <long> list = (from d in parameter.Split(',')
                                where !string.IsNullOrWhiteSpace(d)
                                select long.Parse(d)).ToList();
            int num  = list.Count();
            int num2 = 0;

            if (list.Count < 1)
            {
                throw new HidistroAshxException("请选要删除的消息");
            }
            if (list.Count > 0)
            {
                num2 = NoticeHelper.DeleteManagerMessages(list);
                base.ReturnSuccessResult(context, "成功删除了选择的消息!", 0, true);
                return;
            }
            throw new HidistroAshxException("请选择需要删除的消息");
        }
Beispiel #19
0
        private void btnEditAffiche_Click(object sender, EventArgs e)
        {
            AfficheInfo target = new AfficheInfo();

            target.AfficheId = this.afficheId;
            target.Title     = this.txtAfficheTitle.Text.Trim();
            target.Content   = this.fcContent.Text;
            target.AddedDate = DateTime.Now;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <AfficheInfo>(target, new string[] { "ValAfficheInfo" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else
            {
                target.AfficheId = this.afficheId;
                if (NoticeHelper.UpdateAffiche(target))
                {
                    this.ShowMsg("成功修改了当前公告信息", true);
                }
                else
                {
                    this.ShowMsg("修改公告信息错误", false);
                }
            }
        }
Beispiel #20
0
        protected void btnDel_Click(object sender, System.EventArgs e)
        {
            string text = Globals.RequestFormStr("cbNoticeGroup").Trim();

            string[] array = text.Split(new char[]
            {
                ','
            });
            int num = 0;

            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string s    = array2[i];
                int    num2 = Globals.ToNum(s);
                if (num2 > 0)
                {
                    NoticeHelper.DelNotice(num2);
                    num++;
                }
            }
            if (num > 0)
            {
                this.ShowMsg("成功删除了指定的" + ((this.sendType == 1) ? "消息" : "公告"), true);
                this.BindData(this.pageno, this.sendType);
                return;
            }
            this.ShowMsg("请选择要删除的" + ((this.sendType == 1) ? "消息" : "公告"), false);
        }
Beispiel #21
0
        private void GetDistributorsByNames(IList <string> distributorIds, string productIds)
        {
            string productNameByProductIds = "";
            int    sumcount = 0;

            if (!string.IsNullOrEmpty(productIds))
            {
                productNameByProductIds = ProductHelper.GetProductNameByProductIds(productIds, out sumcount);
                IList <Distributor>        list               = new List <Distributor>();
                IList <SendMessageInfo>    sendMessageList    = new List <SendMessageInfo>();
                IList <ReceiveMessageInfo> receiveMessageList = new List <ReceiveMessageInfo>();
                IList <int> userids = new List <int>();
                foreach (string str2 in distributorIds)
                {
                    userids.Add(Convert.ToInt32(str2));
                }
                foreach (Distributor distributor in NoticeHelper.GetDistributorsByNames(userids))
                {
                    SendMessageInfo    item  = new SendMessageInfo();
                    ReceiveMessageInfo info2 = new ReceiveMessageInfo();
                    item.Addressee      = info2.Addressee = distributor.Username;
                    item.Addresser      = info2.Addresser = "admin";
                    item.Title          = info2.Title = "供应商转移了" + sumcount + "个商品的产品线";
                    item.PublishContent = info2.PublishContent = "尊敬各位分销商,有如下商品已被供应商转移了产品线:" + productNameByProductIds;
                    sendMessageList.Add(item);
                    receiveMessageList.Add(info2);
                }
                if (sendMessageList.Count > 0)
                {
                    NoticeHelper.SendMessage(sendMessageList, receiveMessageList);
                }
            }
        }
Beispiel #22
0
        private void btnEditAffiche_Click(object sender, System.EventArgs e)
        {
            AfficheInfo afficheInfo = new AfficheInfo();

            afficheInfo.AfficheId = this.afficheId;
            afficheInfo.Title     = this.txtAfficheTitle.Text.Trim();
            afficheInfo.Content   = this.fcContent.Text;
            afficheInfo.AddedDate = System.DateTime.Now;
            ValidationResults validationResults = Validation.Validate <AfficheInfo>(afficheInfo, new string[]
            {
                "ValAfficheInfo"
            });
            string text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults)
                {
                    text += Formatter.FormatErrorMessage(current.Message);
                }
                this.ShowMsg(text, false);
                return;
            }
            afficheInfo.AfficheId = this.afficheId;
            if (NoticeHelper.UpdateAffiche(afficheInfo))
            {
                this.ShowMsg("成功修改了当前公告信息", true);
                return;
            }
            this.ShowMsg("修改公告信息错误", false);
        }
Beispiel #23
0
        protected string FormatSendTo(object sendto, object id)
        {
            string text = string.Empty;

            switch (Globals.ToNum(sendto))
            {
            case 0:
                text = "所有用户";
                break;

            case 1:
                text = "分销商";
                break;

            case 2:
            {
                text = "指定用户";
                int selectedUser = NoticeHelper.GetSelectedUser(Globals.ToNum(id));
                if (selectedUser > 0)
                {
                    object obj = text;
                    text = string.Concat(new object[]
                        {
                            obj,
                            "(<span style='color:green'>",
                            selectedUser,
                            "</span>)"
                        });
                }
                break;
            }
            }
            return(text);
        }
Beispiel #24
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 #25
0
 protected string FormatOper(object userid, object adminname)
 {
     if (NoticeHelper.GetUserIsSel(Globals.ToNum(userid), adminname.ToString()))
     {
         return("<input type='button' class='btn btn-success btn-xs' value='已选' issel='1' userid='" + userid.ToString() + "' onclick='seluser(this)'/>");
     }
     return("<input type='button' class='btn btn-primary btn-xs' value='选择' issel='0' userid='" + userid.ToString() + "' onclick='seluser(this)'/>");
 }
Beispiel #26
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.grdDistributorList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    string text2 = "";
                    foreach (object current in gridViewRow.Controls[1].Controls)
                    {
                        if (!(current is System.Web.UI.WebControls.Literal))
                        {
                            if (!(current is System.Web.UI.DataBoundLiteralControl))
                            {
                                continue;
                            }
                            text2 = ((System.Web.UI.DataBoundLiteralControl)current).Text.Trim();
                        }
                        else
                        {
                            text2 = ((System.Web.UI.WebControls.Literal)current).Text.Trim();
                        }
                        break;
                    }
                    if (this.IsMembers(text2))
                    {
                        list.Add(new MessageBoxInfo
                        {
                            Sernder  = "Admin",
                            Accepter = text2,
                            Title    = title,
                            Content  = text
                        });
                    }
                }
            }
            if (list.Count > 0)
            {
                NoticeHelper.SendMessageToDistributor(list);
                this.ShowMsg(string.Format("成功给{0}个分销商发送了消息.", list.Count), true);
                return;
            }
            this.ShowMsg("没有要发送的对象", false);
        }
Beispiel #27
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.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);
                }
            }
        }
        private void SetControl(long leaveId)
        {
            LeaveCommentInfo leaveComment = NoticeHelper.GetLeaveComment(leaveId);

            Globals.EntityCoding(leaveComment, false);
            litTitle.Text          = leaveComment.Title;
            lblUserName.Text       = leaveComment.UserName;
            litLeaveDate.Time      = leaveComment.PublishDate;
            litPublishContent.Text = leaveComment.PublishContent;
        }
Beispiel #29
0
        protected override Tuple <short, string> PollRead(string item)
        {
            var ret = new NoticeHelper().ReadNoticeRange(flib, ref temp);

            if (ret.Item1 != 0)
            {
                message = ret.Item2;
            }
            return(ret);
        }
Beispiel #30
0
 private void grdAfficheList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
 {
     if (NoticeHelper.DeleteAffiche((int)this.grdAfficheList.DataKeys[e.RowIndex].Value))
     {
         this.BindAffiche();
         this.ShowMsg("成功删除了选择的公告", true);
         return;
     }
     this.ShowMsg("删除失败", false);
 }