Ejemplo n.º 1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh     = new Model.Helpcate();
        BLL.Helpcate   bh     = new BLL.Helpcate();
        int            result = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                mh.ID  = Convert.ToInt32(GridView1.DataKeys[i].Value);
                result = bh._delete(mh);
            }
        }
        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='helpcatelist.aspx'</script>");
        }
    }
Ejemplo n.º 2
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.Helpcate mh = new Model.Helpcate();
        BLL.Helpcate bh = new BLL.Helpcate();
        int result = 0;
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                mh.ID = Convert.ToInt32(GridView1.DataKeys[i].Value);
                result = bh._delete(mh);
            }
        }
        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='helpcatelist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='helpcatelist.aspx'</script>");
        }
    }