示例#1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string           adminid     = Request.QueryString["AdminID"];
        List <M_Popedom> listpopedom = new List <M_Popedom>();

        foreach (GridViewRow gvr in gvPopedom.Rows)
        {
            if (((CheckBox)(gvr.FindControl("Popedom"))).Checked)
            {
                M_Popedom popedom = new M_Popedom();
                popedom.Admin_ID = Convert.ToInt32(adminid);
                popedom.Class_ID = Convert.ToInt32(gvr.Cells[0].Text);
                listpopedom.Add(popedom);
            }
        }
        if (B_Popedom.InsertPopedom(adminid, listpopedom))
        {
            Response.Write("<script>alert('修改成功!')</script>");
        }
        else
        {
            Response.Write("<script>alert('修改失败!')</script>");
        }
    }