Ejemplo n.º 1
0
        protected void btnSave_Click2(object sender, EventArgs e)
        {
            MeetingsBLL meetingbll = new MeetingsBLL();
            string      Opera      = Request.QueryString["Opera"];

            if (CheckValue())
            {
                if (Opera == "Add")
                {
                    //新增与会人员
                    MeetingModel.attend attend = new MeetingModel.attend();
                    //int PARTICIPATORId = int.Parse(Request.QueryString["PARTICIPATORId"]);
                    int MId = int.Parse(Request.QueryString["MId"]);
                    //meeting.m_id = meetingbll.GetMeetingCount();
                    //meeting.m_id = meetingbll.max(m_id);
                    attend.m_id            = MId;
                    attend.participator_id = int.Parse(TxtID.Text);
                    //attend.m_id=int.Parse(TxtNumber.Text);
                    attend.arrive_date = DateTime.Parse(TxtArriveTime.Text);
                    attend.arrive_way  = TxtArriveWay.Text;
                    attend.leave_date  = DateTime.Parse(TxtLeaveTime.Text);
                    attend.leave_way   = TxtLeaveWay.Text;
                    attend.h_name      = TxtHotelName.Text;
                    attend.room_number = int.Parse(TxtRoomNumber.Text);

                    if (meetingbll.AddAttend(attend) > 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"]);
                    MeetingModel.attend attend = meetingbll.GetAttendInfo(PARTICIPATORId, MId);

                    //attend.participator_id = int.Parse(TxtID.Text);
                    //attend.m_id=int.Parse(TxtNumber.Text);
                    attend.arrive_date = DateTime.Parse(TxtArriveTime.Text);
                    attend.arrive_way  = TxtArriveWay.Text;
                    attend.leave_date  = DateTime.Parse(TxtLeaveTime.Text);
                    attend.leave_way   = TxtLeaveWay.Text;
                    attend.h_name      = TxtHotelName.Text;
                    attend.room_number = int.Parse(TxtRoomNumber.Text);
                    if (meetingbll.UpdateAttend(attend) > 0)
                    {
                        Response.Write("<script>alert('修改成功')</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('修改失败')</script>");
                    }
                }
            }
        }