//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("channel_" + this.channel_name + "_comment", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.article_comment bll = new BLL.article_comment(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除" + this.channel_name + "频道评论成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("comment_list.aspx", "channel_id={0}&keywords={1}&property={2}", this.channel_id.ToString(), this.keywords, this.property)); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("sys_comment", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.article_comment bll = new BLL.article_comment(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { bll.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&keywords={1}&property={2}", this.channel_id.ToString(), this.keywords, this.property), "Success"); }