public static async Task <Models.BookingStatus> BookingRooms(BookingReq value, string SessionID, string BN)
        {
            BookingRes    hotels  = new BookingRes();
            BookingStatus booking = new BookingStatus();

            try
            {
                //yyyy-mm-dd

                BookingMapping.MapRequestToDB(value, SessionID, BN);
                hotels = await BookingService.BookingRoomsService(value, SessionID);

                if (hotels == null)
                {
                    booking.status = 2;
                    return(booking);
                }
                BookingMapping.MapResponseToDB(hotels, SessionID, BN);
                booking.status  = 0;
                booking.booking = hotels.booking;
                return(booking);
            }
            catch (Exception ex)
            {
                var requestData = JsonConvert.SerializeObject(ex);

                LoggingHelper.WriteToFile("HBLogs/BookingException", "BookingException_" + SessionID, "BookingException", requestData);
                if (hotels != null)
                {
                    booking.status  = 1;
                    booking.booking = hotels.booking;
                    return(booking);
                }

                booking.status  = 2;
                booking.booking = null;
                return(booking);
            }
        }
Beispiel #2
0
        public static async Task <Models.Booking> BookingRooms(BookingReq value, string SessionID)
        {
            try
            {
                //yyyy-mm-dd
                BookingMapping.MapRequestToDB(value, SessionID);
                var hotels = await BookingService.BookingRoomsService(value, SessionID);

                if (hotels == null)
                {
                    return(new Models.Booking());
                }
                BookingMapping.MapResponseToDB(hotels, SessionID);
                return(hotels.booking);
            }
            catch (Exception ex)
            {
                var requestData = JsonConvert.SerializeObject(ex);

                LogData.WriteToFile("c:/HotelsB2C/Logs/HBLogs/BookingException", "BookingException_" + SessionID, "BookingException", requestData);
                return(new Models.Booking());
            }
        }