/// <summary>
        /// Get Room details for DashBoard
        /// </summary>
        /// <returns></returns>
        public dynamic GetDashBoard(DateTime startDate, DateTime endDate)
        {
            RoomDL  room   = new RoomDL();
            dynamic result = room.GetBookingDashboard(startDate, endDate);

            return(result);
        }
Example #2
0
        public bool BookingDetails(BookingVM bookingVM)
        {
            //check hotel name and room name

            HotelDL hotelDL = new HotelDL();
            RoomDL  roomDL  = new RoomDL();

            bool isExistHotelName = hotelDL.CheckHotelName(bookingVM.HotelName);
            bool isExistRoomName  = roomDL.CheckRoomName(bookingVM.RoomName);

            if (isExistHotelName == true && isExistRoomName == true)
            {
                int hotelId = hotelDL.GetHotelAscending()
                              .Where(x => x.HotelName == bookingVM.HotelName)
                              .Select(x => x.HotelId)
                              .FirstOrDefault();;

                int roomId = roomDL.GetRooms()
                             .Where(x => x.RoomName == bookingVM.RoomName && x.HotelId == hotelId)
                             .Select(x => x.RoomId)
                             .FirstOrDefault();;

                bookingVM.HotelId = hotelId;
                bookingVM.RoomId  = roomId;

                List <BookingVM> bookingVMs = new List <BookingVM>();
                bookingVMs.Add(bookingVM);
                bool saveStatus = bookingDL.SaveBookings(bookingVM);
                return(saveStatus);
            }
            return(false);
        }
        /// <summary>
        /// Add Booking Details
        /// </summary>
        /// <param name="roomBookingDetails"></param>
        /// <returns></returns>
        public bool AddRoomBookingDetails(RoomBookingModel roomBookingDetails)
        {
            bool   result = false;
            RoomDL room   = new RoomDL();

            result = room.AddRoomBookingDetails(roomBookingDetails);
            return(result);
        }
        /// <summary>
        /// Add Room details
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public List <RoomModel> GetRoom()
        {
            List <RoomModel> result = null;
            RoomDL           roomDA = new RoomDL();

            result = roomDA.GetRoom();
            return(result);
        }
        /// <summary>
        /// Add Room details
        /// </summary>
        /// <param name="room"></param>
        /// <returns></returns>
        public bool AddRoom(RoomModel room)
        {
            bool   result = false;
            RoomDL roomDA = new RoomDL();

            result = roomDA.AddRoom(room);
            return(result);
        }
        /// <summary>
        /// Get location details
        /// </summary>
        /// <returns></returns>
        public List <LocationModel> GetLocation()
        {
            List <LocationModel> result = null;
            RoomDL room = new RoomDL();

            result = room.GetLocation();
            return(result);
        }
        /// <summary>
        /// Add location details
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public bool AddLocation(LocationModel location)
        {
            bool   result = false;
            RoomDL room   = new RoomDL();

            result = room.AddLocation(location);
            return(result);
        }