Exemplo n.º 1
0
 public bool DeleteOfferRides(string offerId)
 {
     try
     {
         var bookings = GetOfferBookings(offerId);
         foreach (var bookingView in bookings)
         {
             var booking = _context.Bookings.Where(s => s.RentalOfferID == bookingView.RentalOfferID).FirstOrDefault();
             _context.Remove(booking);
             _context.SaveChanges();
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public bool DeleteRatingById(string id)
 {
     try
     {
         var rating = _context.Ratings.Where(s => s.BookingID == id).FirstOrDefault();
         _context.Remove(rating);
         _context.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 3
0
 public bool RemoveRentalOffer(string rentalOfferId)
 {
     try
     {
         var rentalOffer = _context.RentalOffers.Where(s => s.RentalOfferID == rentalOfferId).FirstOrDefault();
         _context.Remove(rentalOffer);
         _context.SaveChanges();
         var IsSucess = bookingRequest.DeleteOfferRides(rentalOfferId);
         return(IsSucess);
     }
     catch (Exception e)
     {
         return(false);
     }
 }