示例#1
0
        public void SeatBookingReject(Guid bookingId)
        {
            Ride    ride    = this.CurrentUser.Rides.FirstOrDefault(a => a.RequestBookerId.Contains(bookingId));
            Booking booking = AppDataServices.GetBooking(bookingId);

            booking.Status = BookingStatus.Rejected;
            ride.RequestBookerId.Remove(bookingId);
        }
示例#2
0
        public bool SeatBookingConfirm(Guid bookingId)
        {
            Ride    ride    = this.CurrentUser.Rides.FirstOrDefault(a => a.RequestBookerId.Contains(bookingId));
            Booking booking = AppDataServices.GetBooking(bookingId);

            if (ride.Car.VacantSeat > 0)
            {
                ride.AcceptedBookerId.Add(bookingId);
                ride.RequestBookerId.Remove(bookingId);
                booking.Status = BookingStatus.Confirm;
                ride.Car.VacantSeat--;
                return(true);
            }
            else
            {
                booking.Status = BookingStatus.Rejected;
                return(false);
            }
        }