예제 #1
0
 public override bool Delete(HotelBooking toDelete)
 {
     try
     {
         toDelete = SimbaToursEastAfricaDbContext.HotelBookings.SingleOrDefault(p => p.HotelBookingId == toDelete.HotelBookingId);
         SimbaToursEastAfricaDbContext.Remove(toDelete);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #2
0
 public override bool Delete(TourClientExtraCharge toDelete)
 {
     try
     {
         toDelete = SimbaToursEastAfricaDbContext.TourClientExtraCharges.SingleOrDefault(p => p.TourClientExtraChargesId == toDelete.TourClientExtraChargesId);
         SimbaToursEastAfricaDbContext.Remove(toDelete);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #3
0
 public override bool Delete(Invoice toDelete)
 {
     try
     {
         toDelete = SimbaToursEastAfricaDbContext.Invoices.SingleOrDefault(p => p.InvoiceId == toDelete.InvoiceId);
         SimbaToursEastAfricaDbContext.Remove(toDelete);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public SimbaToursEastAfricaUnitOfWork(
     AbstractRepository <Address> addressRepository,
     AbstractRepository <Destination> destinationRepository,
     AbstractRepository <Driver> driverRepository,
     AbstractRepository <HotelBooking> hotelBookingRepository,
     AbstractRepository <InAndOutBoundAirTravel> inAndOutBoundAirTravelRepository,
     AbstractRepository <InternalVehicleTravel> internalVehicleTravelRepository,
     AbstractRepository <Invoice> invoiceRepository,
     AbstractRepository <Item> itemRepository,
     AbstractRepository <Itinary> itinaryRepository,
     AbstractRepository <Laguage> laguageRepository,
     AbstractRepository <Location> locationRepository,
     AbstractRepository <Meal> mealRepository,
     AbstractRepository <Schedule> scheduleRepository,
     AbstractRepository <TourClient> tourClientRepository,
     AbstractRepository <Vehicle> vehicleRepository,
     AbstractRepository <SchedulesPricing> schedulesPricingRepository,
     AbstractRepository <MealPricing> mealPricingRepository,
     AbstractRepository <DealsPricing> dealsPricingRepository,
     AbstractRepository <LaguagePricing> laguagePricingRepository,
     AbstractRepository <HotelPricing> hotelPricingRepostory,
     AbstractRepository <Hotel> hotelRepostory,
     AbstractRepository <TransportPricing> transportPricingRepository,
     Microsoft.EntityFrameworkCore.DbContext simbaToursEastAfricaDbContext)
 {
     SimbaToursEastAfricaDbContext = simbaToursEastAfricaDbContext as SimbaToursEastAfricaDbContext;
     _addressRepository            = addressRepository as AddressRepository;
     _addressRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _destinationRepository = destinationRepository as DestinationRepository;
     _destinationRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _driverRepository = driverRepository as DriverRepository;
     _driverRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _hotelBookingRepository = hotelBookingRepository as HotelBookingRepository;
     _hotelBookingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _inAndOutBoundAirTravelRepository = inAndOutBoundAirTravelRepository as InAndOutBoundAirTravelRepository;
     _inAndOutBoundAirTravelRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _internalVehicleTravelRepository = internalVehicleTravelRepository as InternalVehicleTravelRepository;
     _internalVehicleTravelRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _invoiceRepository = invoiceRepository as InvoiceRepository;
     _invoiceRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _itemRepository = itemRepository as ItemRepository;
     _itemRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _itinaryRepository = itinaryRepository as ItinaryRepository;
     _itinaryRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _laguageRepository = laguageRepository as LaguageRepository;
     _laguageRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _locationRepository = locationRepository as LocationRepository;
     _locationRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _mealRepository = mealRepository as MealRepository;
     _mealRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _scheduleRepository = scheduleRepository as ScheduleRepository;
     _scheduleRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _tourClientRepository = tourClientRepository as TourClientRepository;
     _tourClientRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _vehicleRepository = vehicleRepository as VehicleRepository;
     _vehicleRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _mealsPricingRepository = mealPricingRepository as MealsPricingRepository;
     _mealsPricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _dealsPricingRepository = dealsPricingRepository as DealsPricingRepository;
     _dealsPricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _laguagePricingRepository = laguagePricingRepository as LaguagePricingRepository;
     _laguagePricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _schedulesPricingRepository = schedulesPricingRepository as SchedulesPricingRepository;
     _schedulesPricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _hotelPricingRepository = hotelPricingRepostory as HotelPricingRepository;
     _hotelPricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _hotelRepository = hotelRepostory as HotelRepository;
     _hotelRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
     _transportPricingRepository = transportPricingRepository as TransportPricingRepository;
     _transportPricingRepository.SimbaToursEastAfricaDbContext = SimbaToursEastAfricaDbContext;
 }