private void lkbtnDeleteCheck_Click(object sender, System.EventArgs e) { int num = 0; foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdBundlingList.Rows) { System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol"); if (checkBox.Checked) { num++; int bundlingID = System.Convert.ToInt32(this.grdBundlingList.DataKeys[gridViewRow.RowIndex].Value, System.Globalization.CultureInfo.InvariantCulture); SubsitePromoteHelper.DeleteBundlingProduct(bundlingID); } } if (num != 0) { this.ShowMsg(string.Format(System.Globalization.CultureInfo.InvariantCulture, "成功删除\"{0}\"个捆绑商品", new object[] { num }), true); this.BindBundlingProducts(); return; } this.ShowMsg("请先选择需要删除的捆绑商品", false); }
private void grdBundlingList_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e) { if (SubsitePromoteHelper.DeleteBundlingProduct((int)this.grdBundlingList.DataKeys[e.RowIndex].Value)) { this.BindBundlingProducts(); this.ShowMsg("成功删除了选择的捆绑商品!", true); return; } this.ShowMsg("删除失败", false); }
private void lkbtnDeleteCheck_Click(object sender, EventArgs e) { int num2 = 0; foreach (GridViewRow row in this.grdBundlingList.Rows) { CheckBox box = (CheckBox)row.FindControl("checkboxCol"); if (box.Checked) { num2++; SubsitePromoteHelper.DeleteBundlingProduct(Convert.ToInt32(this.grdBundlingList.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture)); } } if (num2 != 0) { this.ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除\"{0}\"个捆绑商品", new object[] { num2 }), true); this.BindBundlingProducts(); } else { this.ShowMsg("请先选择需要删除的捆绑商品", false); } }