Ejemplo n.º 1
0
        public static async Task <Booking> RequestCheckOut(Employee employee, Booking bookingInDatabase,
                                                           HouseKeeping houseKeeping)
        {
            await Database.WriteAsync(realm =>
            {
                bookingInDatabase.EmployeeCheckOut = employee;
                bookingInDatabase.Status           = (int)Booking.StatusEnum.RequestedCheckOut;

                HouseKeepingDataAccess.Add(realm, houseKeeping);
            });

            return(bookingInDatabase);
        }
Ejemplo n.º 2
0
        public static async Task <Booking> CheckIn(Employee employee, Booking bookingInDatabase,
                                                   HouseKeeping houseKeeping)
        {
            await Database.WriteAsync(realm =>
            {
                bookingInDatabase.EmployeeCheckIn = employee;
                bookingInDatabase.RealCheckInTime = DateTimeOffset.Now;
                bookingInDatabase.Status          = (int)Booking.StatusEnum.CheckedIn;

                HouseKeepingDataAccess.Add(realm, houseKeeping);
            });

            return(bookingInDatabase);
        }
Ejemplo n.º 3
0
        public static Booking BookAndCheckIn(Realm realm, Booking booking)
        {
            booking.Id              = NextId;
            booking.CreateTime      = DateTimeOffset.Now;
            booking.BookCheckInTime = DateTimeOffset.Now;
            booking.RealCheckInTime = DateTimeOffset.Now;
            booking.Status          = (int)Booking.StatusEnum.CheckedIn;

            booking = realm.Add(booking);

            var houseKeeping = new HouseKeeping();

            houseKeeping.Type    = (int)HouseKeeping.TypeEnum.ExpectedArrival;
            houseKeeping.Status  = (int)HouseKeeping.StatusEnum.Pending;
            houseKeeping.Booking = booking;

            HouseKeepingDataAccess.Add(realm, houseKeeping);

            return(booking);
        }