public void updateCar(AutoDto car)
 {
     WriteActualMethod();
     try
     {
         Component.updateCar(DtoConverter.ConvertToEntity(car));
     }
     catch (LocalOptimisticConcurrencyException <Auto> ex)
     {
         throw new FaultException <LocalOptimisticConcurrencyException <Auto> >(ex, ex.Message);
     }
 }
 public void updateReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     try
     {
         Component.updateReservation(DtoConverter.ConvertToEntity(reservation));
     }
     catch (LocalOptimisticConcurrencyException <Reservation> ex)
     {
         throw new FaultException <LocalOptimisticConcurrencyException <Reservation> >(ex, ex.Message);
     }
 }
 public void updateCustomer(KundeDto customer)
 {
     WriteActualMethod();
     try
     {
         Component.updateCustomer(DtoConverter.ConvertToEntity(customer));
     }
     catch (LocalOptimisticConcurrencyException <Kunde> ex)
     {
         throw new FaultException <LocalOptimisticConcurrencyException <Kunde> >(ex, ex.Message);
     }
 }
 public ReservationDto UpdateReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(_businessLayer.UpdateReservation(DtoConverter.ConvertToEntity(reservation))));
     }
     catch (LocalOptimisticConcurrencyException <Reservation> e)
     {
         throw new FaultException <ReservationDto>(e.MergedEntity.ConvertToDto(), "Reservation update failed");
     }
 }
 public KundeDto UpdateKunde(KundeDto kunde)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(_businessLayer.UpdateKunde(DtoConverter.ConvertToEntity(kunde))));
     }
     catch (LocalOptimisticConcurrencyException <Kunde> )
     {
         throw new FaultException("Kunde Update failed");
     }
 }
 public AutoDto UpdateAuto(AutoDto auto)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(_businessLayer.UpdateAuto(DtoConverter.ConvertToEntity(auto))));
     }
     catch (LocalOptimisticConcurrencyException <Auto> )
     {
         throw new FaultException("Auto Update failed");
     }
 }
예제 #7
0
        public KundeDto UpdateKunde(KundeDto modifiedDto, KundeDto originalDto)
        {
            WriteActualMethod();
            Kunde modified = DtoConverter.ConvertToEntity(modifiedDto);
            Kunde original = DtoConverter.ConvertToEntity(originalDto);

            try {
                return(DtoConverter.ConvertToDto(autoReservationBusinessComponent.UpdateKunde(modified, original)));
            }
            catch (LocalOptimisticConcurrencyException <Kunde> e)
            {
                throw new FaultException <KundeDto>(modifiedDto);
            }
        }
예제 #8
0
        public void UpdateAuto(AutoDto auto)
        {
            WriteActualMethod();
            var autoEntity = DtoConverter.ConvertToEntity(auto);

            try {
                autoManager.Update(autoEntity);
            }
            catch (OptimisticConcurrencyException <Auto> )
            {
                throw new FaultException <DataManipulationFault>(new DataManipulationFault {
                    Message = "Das Auto wird momentan bearbeitet."
                });
            }
        }
예제 #9
0
        public void UpdateKunde(KundeDto kunde)
        {
            WriteActualMethod();
            var kundeEntity = DtoConverter.ConvertToEntity(kunde);

            try
            {
                kundeManager.Update(kundeEntity);
            }
            catch (OptimisticConcurrencyException <Kunde> )
            {
                throw new FaultException <DataManipulationFault>(new DataManipulationFault {
                    Message = "Der Kunde wird momentan bearbeitet."
                });
            }
        }
예제 #10
0
        public void DeleteReservation(ReservationDto reservation)
        {
            WriteActualMethod();
            var reservationEntity = DtoConverter.ConvertToEntity(reservation);

            try
            {
                reservationManager.Delete(reservationEntity);
            }
            catch (OptimisticConcurrencyException <Reservation> )
            {
                throw new FaultException <DataManipulationFault>(new DataManipulationFault {
                    Message = "Die Reservation wird momentan bearbeitet."
                });
            }
        }
 public KundeDto UpdateKunde(KundeDto kunde)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(kundeManager.UpdateKunde(DtoConverter.ConvertToEntity(kunde))));
     }
     catch (OptimisticConcurrencyException <Kunde> )
     {
         OptimisticConcurrencyFault <KundeDto> fault = new OptimisticConcurrencyFault <KundeDto>
         {
             FaultEntity   = kunde,
             CurrentEntity = DtoConverter.ConvertToDto(kundeManager.ReadKunde(kunde.Id))
         };
         throw new FaultException <OptimisticConcurrencyFault <KundeDto> >(fault);
     }
 }
 public AutoDto UpdateAuto(AutoDto auto)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(autoManager.UpdateAuto(DtoConverter.ConvertToEntity(auto))));
     }
     catch (OptimisticConcurrencyException <Auto> )
     {
         OptimisticConcurrencyFault <AutoDto> fault = new OptimisticConcurrencyFault <AutoDto>
         {
             FaultEntity   = auto,
             CurrentEntity = DtoConverter.ConvertToDto(autoManager.ReadAuto(auto.Id))
         };
         throw new FaultException <OptimisticConcurrencyFault <AutoDto> >(fault);
     }
 }
예제 #13
0
        public void modifyCar(AutoDto autoDto)
        {
            WriteActualMethod();
            Auto        auto        = DtoConverter.ConvertToEntity(autoDto);
            AutoManager autoManager = new AutoManager();

            try
            {
                autoManager.modifyCar(auto);
            }
            catch (OptimisticConcurrencyException <Auto> e) {
                OptimisticConcurrency <AutoDto> fault = new OptimisticConcurrency <AutoDto>();
                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "Occurrency Exception!";

                throw new FaultException <OptimisticConcurrency <AutoDto> >(fault);
            }
        }
예제 #14
0
        public void modifyCustomer(KundeDto kundeDto)
        {
            WriteActualMethod();
            Kunde        kunde        = DtoConverter.ConvertToEntity(kundeDto);
            KundeManager kundeManager = new KundeManager();

            try {
                kundeManager.modifyCustomer(kunde);
            }
            catch (OptimisticConcurrencyException <Kunde> e)
            {
                OptimisticConcurrency <KundeDto> fault = new OptimisticConcurrency <KundeDto>();
                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "Occurrency Exception!";

                throw new FaultException <OptimisticConcurrency <KundeDto> >(fault);
            }
        }
예제 #15
0
        public AutoDto ReadAutoDto(int autoId)
        {
            WriteActualMethod();

            try
            {
                return(DtoConverter.ConvertToDto(_autoManager.GetAutoById(autoId)));
            }

            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault()
                {
                    Operation = "Read"
                };

                throw  new FaultException <OutOfRangeFault>(fault);
            }
        }
예제 #16
0
        public KundeDto ReadKundeDto(int kundeId)
        {
            WriteActualMethod();

            try
            {
                return(DtoConverter.ConvertToDto(_kundenManager.GetKundeById(kundeId)));
            }

            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault()
                {
                    Operation = "Read"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
        }
예제 #17
0
        public void modifyRerservation(ReservationDto reservationDto)
        {
            WriteActualMethod();
            Reservation        reservation        = DtoConverter.ConvertToEntity(reservationDto);
            ReservationManager reservationManager = new ReservationManager();

            try {
                reservationManager.modifyReservation(reservation);
            }

            catch (OptimisticConcurrencyException <Reservation> e)
            {
                OptimisticConcurrency <ReservationDto> fault = new OptimisticConcurrency <ReservationDto>();
                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "Occurrency Exception!";

                throw new FaultException <OptimisticConcurrency <ReservationDto> >(fault);
            }
        }
예제 #18
0
        public void AddReservation(ReservationDto reservation)
        {
            WriteActualMethod();
            var reservationEntity = DtoConverter.ConvertToEntity(reservation);

            try
            {
                reservationManager.Add(reservationEntity);
            }
            catch (InvalidDateRangeException e)
            {
                throw new FaultException <InvalidDateRangeFault>(new InvalidDateRangeFault {
                    Message = "Ungültiger Datumsbereich eingegeben.", MessageDetails = e.Message
                });
            }
            catch (AutoUnavailableException)
            {
                throw new FaultException <AutoUnavailableFault>(new AutoUnavailableFault {
                    Message = "Das gewählte Fahrzeug ist zur Zeit nicht verfügbar."
                });
            }
        }
예제 #19
0
 public ReservationDto InsertReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(ServiceReservation.InstertReservation(DtoConverter.ConvertToEntity(reservation))));
     }
     catch (OptimisticConcurrencyException <Reservation> ex)
     {
         throw new FaultException <ReservationDto>(ex.MergedEntity.ConvertToDto(), ex.Message);
     }
     catch (BusinessLayer.Exceptions.InvalidDateRangeException ex)
     {
         var invEx = new Common.Interfaces.Faults.InvalidDateRangeException(ex.Message);
         throw new FaultException <Common.Interfaces.Faults.InvalidDateRangeException>(invEx);
     }
     catch (BusinessLayer.Exceptions.AutoUnavailableException ex)
     {
         var unavEx = new Common.Interfaces.Faults.AutoUnavailableException(ex.Message);
         throw new FaultException <Common.Interfaces.Faults.AutoUnavailableException>(unavEx);
     }
 }
 public ReservationDto InsertReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     try
     {
         return(DtoConverter.ConvertToDto(reservationManager.Insert(DtoConverter.ConvertToEntity(reservation))));
     }
     catch (InvalidDateException <Reservation> )
     {
         DateRangeFault fault = new DateRangeFault
         {
             reservation = reservation
         };
         throw new FaultException <DateRangeFault>(fault);
     }
     catch (AutoUnavailableException <Reservation> )
     {
         AutoUnavailableFault fault = new AutoUnavailableFault
         {
             reservation = reservation
         };
         throw new FaultException <AutoUnavailableFault>(fault);
     }
 }
 public void DeleteAuto(AutoDto auto)
 {
     WriteActualMethod();
     autoManager.RemoveAuto(DtoConverter.ConvertToEntity(auto));
 }
예제 #22
0
        public KundeDto FindKunde(int id)
        {
            WriteActualMethod();

            return(DtoConverter.ConvertToDto(autoReservationBusinessComponent.FindKunde(id)));
        }
 public KundeDto InsertKunde(KundeDto kunde)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(kundeManager.InsertKunde(DtoConverter.ConvertToEntity(kunde))));
 }
 public AutoDto InsertAuto(AutoDto auto)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(autoManager.InsertAuto(DtoConverter.ConvertToEntity(auto))));
 }
 public ReservationDto GetReservation(int id)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(reservationManager.GetById(id)));
 }
 public KundeDto GetKunde(int id)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(kundeManager.ReadKunde(id)));
 }
 public AutoDto GetAuto(int id)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(autoManager.ReadAuto(id)));
 }
 public void DeleteReservation(ReservationDto reservation)
 {
     WriteActualMethod();
     reservationManager.Remove(DtoConverter.ConvertToEntity(reservation));
 }
 public void DeleteKunde(KundeDto kunde)
 {
     WriteActualMethod();
     kundeManager.RemoveKunde(DtoConverter.ConvertToEntity(kunde));
 }
 public bool CheckAvailibility(ReservationDto reservation)
 {
     WriteActualMethod();
     return(reservationManager.AvailibilityCheck(DtoConverter.ConvertToEntity(reservation)));
 }