Example #1
0
        private void btnDeleteSelect_Click(object sender, EventArgs e)
        {
            IList <long> sendedMessageList = new List <long>();

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