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); } }
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("请选择要删除的公告!"); }
private void DeleteSelect() { System.Collections.Generic.List <int> list = new System.Collections.Generic.List <int>(); int num = 0; foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdAfficheList.Rows) { System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol"); if (checkBox.Checked) { num++; int item = System.Convert.ToInt32(this.grdAfficheList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture); list.Add(item); } } if (num != 0) { int num2 = NoticeHelper.DeleteAffiches(list); this.BindAffiche(); this.ShowMsg(string.Format("成功删除了选择的{0}条公告", num2), true); return; } this.ShowMsg("请先选择要删除的公告", false); }