Exemple #1
0
        /// <summary>
        /// This method returns earliest check-in date for a given hotel id.
        /// </summary>
        public string Get_Earliest_CheckInDate_For_HotelId(long hotel_id)
        {
            try
            {
                var earliestCheckInDate = string.Empty;
                var allBookingIds       = RDM.Get_AllBookingIds_For_HotelId(hotel_id.ToString());

                if (null != allBookingIds && allBookingIds.Count() > 0)
                {
                    var allCheckInDate = RDM.Get_AllCheckInDate_For_BookingIds(allBookingIds);
                    if (null != allCheckInDate && allCheckInDate.Count() > 0)
                    {
                        earliestCheckInDate = allCheckInDate.Max().ToString();
                    }
                }
                return(earliestCheckInDate);
            }
            catch (FormatException ex1)
            {
                throw new Exception(C.DATA_CONVERSION_EXP + ex1.Message);
            }
            catch (Exception ex2)
            {
                throw new Exception(ex2.Message);
            }
        }