Пример #1
0
        public HttpResponseMessage CheckIn(HttpRequestMessage request, int guestId)
        {
            GuestDTO guest = guestService.Get(guestId);

            if (guest == null)
            {
                return(request.CreateResponse(HttpStatusCode.NotFound));
            }

            try
            {
                guestService.CheckIn(guest);
            }
            catch (NotPayedBookingException e)
            {
                return(request.CreateResponse(HttpStatusCode.PaymentRequired));
            }

            return(request.CreateResponse(HttpStatusCode.NoContent));
        }