Esempio n. 1
0
        public HttpResponseMessage AttendSession(int conferenceId, int roomId, string rfid)
        {
            var res      = new AttendResponse();
            var attendee = AttendeeRepository.Instance.GetAttendeeByCode(conferenceId, rfid);

            if (attendee == null)
            {
                res.Error = "Attendee not found";
            }
            else
            {
                res.DisplayName = attendee.DisplayName;
                var session = SessionRepository.Instance.GetSession(conferenceId, roomId, System.DateTime.Now.AddMinutes(15));
                if (session == null)
                {
                    session = SessionRepository.Instance.GetSession(conferenceId, roomId, System.DateTime.Now);
                }
                if (session == null)
                {
                    res.Error = "Session not found";
                }
                else
                {
                    SessionAttendeeRepository.Instance.SetSessionAttendee(session.SessionId, attendee.UserId, UserInfo.UserID);
                    res.SessionTitle = session.Title;
                }
            }
            return(Request.CreateResponse(HttpStatusCode.OK, res));
        }
 public HttpResponseMessage AttendSession(int conferenceId, int roomId, string rfid)
 {
     var res = new AttendResponse();
     var attendee = AttendeeRepository.Instance.GetAttendee(conferenceId, rfid);
     if (attendee == null)
     {
         res.Error = "Attendee not found";
     }
     else
     {
         res.DisplayName = attendee.DisplayName;
         var session = SessionRepository.Instance.GetSession(conferenceId, roomId, System.DateTime.Now.AddMinutes(15));
         if (session == null)
         {
             session = SessionRepository.Instance.GetSession(conferenceId, roomId, System.DateTime.Now);
         }
         if (session == null)
         {
             res.Error = "Session not found";
         }
         else
         {
             SessionAttendeeRepository.Instance.SetSessionAttendee(session.SessionId, attendee.UserId);
             res.SessionTitle = session.Title;
         }
     }
     return Request.CreateResponse(HttpStatusCode.OK, res);
 }