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

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