protected void btnSave_Click(object sender, EventArgs e) { MeetingsBLL meetingbll = new MeetingsBLL(); string Opera = Request.QueryString["Opera"]; if (CheckValue()) { if (Opera == "Add") { //新增子管理员 MeetingModel.Admin admin = new MeetingModel.Admin(); admin.id = int.Parse(Txtid.Text); admin.psw = Txtpsw.Text; admin.dept_id = Txtdept_id.Text; if (meetingbll.AddAdmin(admin) > 0) { Response.Write("<script>alert('添加成功')</script>"); } else { Response.Write("<script>alert('添加失败')</script>"); } } else { //更改子管理员信息 int AId = int.Parse(Request.QueryString["AId"]); MeetingModel.Admin admin = meetingbll.GetAdminInfo(AId); admin.id = int.Parse(Txtid.Text); admin.psw = Txtpsw.Text; admin.dept_id = Txtdept_id.Text; if (meetingbll.UpdateAdmin(admin) > 0) { Response.Write("<script>alert('修改成功')</script>"); } else { Response.Write("<script>alert('修改失败')</script>"); } } } }