Example #1
0
        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            Cms.DAL.Solutions bll = new DAL.Solutions();
            bool hasDeleted       = false;

            //批量删除
            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)
                {
                    //删除记录
                    hasDeleted = true;
                    bll.Delete(id);
                }
            }
            if (hasDeleted)
            {
                MessageBox.Show(this, "批量删除成功!");
            }
            else
            {
                MessageBox.Show(this, "没有选中记录!");
            }
            RptBind("");
        }
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     Cms.DAL.Solutions bll = new DAL.Solutions();
     bool hasDeleted = false;
     //批量删除
     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)
         {
             //删除记录
             hasDeleted = true;
             bll.Delete(id);
         }
     }
     if (hasDeleted)
         MessageBox.Show(this, "批量删除成功!");
     else
         MessageBox.Show(this, "没有选中记录!");
     RptBind("");
 }