Esempio n. 1
0
        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            CMS.DAL.CMS_Product dal = new CMS.DAL.CMS_Product();
            CMS.Model.CMS_Product model = new CMS.Model.CMS_Product();

            for (int i = 0; i < gvdataList.Rows.Count; i++)
            {
                Label label = (Label)gvdataList.Rows[i].FindControl("lb_id");
                int id = Convert.ToInt32(label.Text);
                CheckBox cb = (CheckBox)gvdataList.Rows[i].FindControl("cb_id");
                if (cb.Checked)
                {
                    model = dal.GetModel(id);
                    //删除图片
                    DeleteFile(model.CMS_ProductImg);
                    //保存日志
                   // SaveLogs("[资讯模块]删除文章:" + model.Title);
                    //删除记录
                    //bll.Delete(kindId, id);
                    dal.Delete(id);
                }
            }

            JscriptPrint("批量删除成功啦!", "ProductsList.aspx", "Success");
        }