protected void btnDelete_Click(object sender, EventArgs e) { Cms.BLL.C_type bll = new Cms.BLL.C_type(); 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) { Cms.Model.C_type model = bll.GetModel(id); if (model != null) { //int count = Cms.DBUtility.DbHelperSQL.ExecuteSql("delete from C_article where parentId=" + id);//删除文章 adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.title); //记录日志 bll.Delete(id); } } } JscriptMsg("删除数据成功!", "list.aspx", "Success"); }
public void Del() { if (Request.QueryString["action"] != null) { if (Request.QueryString["action"].ToString() == "del") { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); string name = Request.QueryString["name"].ToString(); Cms.BLL.C_type bllcolumn = new Cms.BLL.C_type(); Cms.Model.C_type model = bllcolumn.GetModel(id); adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.title); //记录日志 if (model != null && bllcolumn.Delete(id)) { JscriptMsg("删除栏目信息成功!", "Column_list.aspx", "Success"); } else { JscriptMsg("删除栏目信息失败!", "Column_list.aspx", "Error"); } } } }