protected void btnSave_Click3(object sender, EventArgs e) { MeetingsBLL meetingbll = new MeetingsBLL(); string Opera = Request.QueryString["Opera"]; if (CheckValue()) { if (Opera == "Add") { //新增陪同人员 MeetingModel.accompany accompany = new MeetingModel.accompany(); int MId = int.Parse(Request.QueryString["MId"]); int PARTICIPATORId = int.Parse(Request.QueryString["PARTICIPATORId"]); //int MId = 6; ; // int PARTICIPATORId = 1414; //int REId = int.Parse(Request.QueryString["REId"]); //meeting.m_id = meetingbll.GetMeetingCount(); //meeting.m_id = meetingbll.max(m_id); accompany.participator_id = PARTICIPATORId; accompany.m_id = MId; accompany.re_id = int.Parse(TxtID2.Text); accompany.h_name = TxtHotelName.Text; accompany.roomnumber = int.Parse(TxtRoomNumber.Text); if (meetingbll.AddAccompany(accompany) > 0) { Response.Write("<script>alert('添加成功')</script>"); } else { Response.Write("<script>alert('添加失败')</script>"); } } else { //更改陪同人员信息 int PARTICIPATORId = int.Parse(Request.QueryString["PARTICIPATORId"]); int MId = int.Parse(Request.QueryString["MId"]); int REId = int.Parse(Request.QueryString["REId"]); MeetingModel.accompany accompany = meetingbll.GetAccompanyInfo(PARTICIPATORId, MId, REId); //accompany.participator_id = int.Parse(TxtID1.Text); //accompany.m_id = int.Parse(TxtNumber.Text); //accompany.re_id = int.Parse(TxtID2.Text); accompany.h_name = TxtHotelName.Text; accompany.roomnumber = int.Parse(TxtRoomNumber.Text); if (meetingbll.UpdateAccompany(accompany) > 0) { Response.Write("<script>alert('修改成功')</script>"); } else { Response.Write("<script>alert('修改失败')</script>"); } } } }