Beispiel #1
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 #2
0
 private void btnDeleteSelect_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <long> list = new System.Collections.Generic.List <long>();
     foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.messagesList.Rows)
     {
         System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
         if (checkBox != null && checkBox.Checked)
         {
             long item = (long)this.messagesList.DataKeys[gridViewRow.RowIndex].Value;
             list.Add(item);
         }
     }
     if (list.Count > 0)
     {
         NoticeHelper.DeleteManagerMessages(list);
         this.ShowMsg("成功删除了选择的消息.", true);
     }
     else
     {
         this.ShowMsg("请选择需要删除的消息.", false);
     }
     this.BindData();
 }
        private void btnDeleteSelect_Click(object sender, EventArgs e)
        {
            IList <long> messageList = new List <long>();

            foreach (GridViewRow row in this.messagesList.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if ((box != null) && box.Checked)
                {
                    long item = (long)this.messagesList.DataKeys[row.RowIndex].Value;
                    messageList.Add(item);
                }
            }
            if (messageList.Count > 0)
            {
                NoticeHelper.DeleteManagerMessages(messageList);
                this.ShowMsg("成功删除了选择的消息.", true);
            }
            else
            {
                this.ShowMsg("请选择需要删除的消息.", false);
            }
            this.BindData();
        }