Ejemplo n.º 1
0
 public string CancelBookedRide(User user, int rideId)
 {
     try {
         var Riders = Dbrr.GetRidersByRideId(rideId);
         var rider  = Riders.FirstOrDefault(p => p.Id.Equals(user.Id));
         if (rider.IsBookingConfirm)
         {
             var ride = Dbr.GetRideById(rideId);
             ride.SeatAvailable += 1;
             Dbr.UpdateRide(ride);
         }
         Dbrr.DeleteRider(rider);
         return("Booking Cancelled Successfully...");
     }
     catch (Exception) {
         return("Booking Can't be Cancelled..");
     }
 }