Ejemplo n.º 1
0
 //删除
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     chkLoginLevel("delArticle");
     DtCms.BLL.Article bll = new DtCms.BLL.Article();
     //批量删除
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptPrint("批量删除成功啦!", "List.aspx?" + CombUrlTxt(this.classId, this.keywords, this.property) + "page=0", "Success");
 }
Ejemplo n.º 2
0
        //删除
        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            chkLoginLevel("delArticle");
            DtCms.BLL.Article   bll = new DtCms.BLL.Article();
            DtCms.Model.Article model;
            //批量删除
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
                if (cb.Checked)
                {
                    model = bll.GetModel(id);
                    //删除图片
                    DeleteFile(model.ImgUrl);
                    //保存日志
                    SaveLogs("[资讯模块]删除文章:" + model.Title);
                    //删除记录
                    bll.Delete(kindId, id);
                }
            }

            JscriptPrint("批量删除成功啦!", "List.aspx?" + CombUrlTxt(this.classId, this.keywords, this.property) + "page=0", "Success");
        }