Exemple #1
0
        public static bool checkAvailability(GrpRoomReservation grpRoomReservation, int roomId)
        {
            bool result     = false;
            var  checkAvail = db.GrpRoomReservations.Where(x => x.TimeOut > grpRoomReservation.TimeIn && x.GroupRoomId == roomId && x.DateFor == grpRoomReservation.DateFor).Count();

            if (checkAvail > 0)
            {
                result = true;
            }
            return(result);
        }
Exemple #2
0
        public static bool checkTimeDifference(GrpRoomReservation grpRoomReservation)
        {
            bool result          = false;
            int  timeDiffrerence = grpRoomReservation.TimeOut.Hour - grpRoomReservation.TimeIn.Hour;

            if (timeDiffrerence > 2)
            {
                result = true;
            }
            return(result);
        }
Exemple #3
0
        public static bool checkTime(GrpRoomReservation grpRoomReservation)
        {
            bool result       = false;
            var  libraryTimes = db.LibraryTimes.ToList().FirstOrDefault();

            if (grpRoomReservation.TimeIn < libraryTimes.openingTime || grpRoomReservation.TimeIn > libraryTimes.closingTime)
            {
                result = true;
            }
            else if (grpRoomReservation.TimeOut > libraryTimes.closingTime || grpRoomReservation.TimeOut < libraryTimes.openingTime)
            {
                result = true;
            }
            return(result);
        }