Ejemplo n.º 1
0
        protected void btndel_Click(object sender, EventArgs e)
        {
            int    i     = 0;
            string sysID = string.Empty;

            NCPEP.Bll.T_Wztou bll = new NCPEP.Bll.T_Wztou();

            foreach (RepeaterItem row in this.rep.Items)
            {
                if (row.ItemType == ListItemType.Item || row.ItemType == ListItemType.AlternatingItem)
                {
                    CheckBox chk  = (CheckBox)row.FindControl("cbx");
                    Label    lbid = (Label)row.FindControl("lbid");
                    if (chk.Checked)
                    {
                        i++;
                        sysID = lbid.Text;
                        bll.Delete(int.Parse(sysID));
                    }
                }
            }
            if (i == 0)
            {
                MessageBox.Show(this, "请选择需要删除的项!");
            }
            else
            {
                MessageBox.Show(this, "已成功删除所选项!");
                BindDate();
            }
        }