예제 #1
0
        public void deleteReservation(int id)
        {
            WriteActualMethod();
            try
            {
                _reservationManager.DeleteReservation(id);
            }
            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault()
                {
                    Operation = "delete"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
        }
예제 #2
0
        public ReservationDto ReadReservationDto(int id)
        {
            WriteActualMethod();

            try
            {
                return(_reservationManager.GetReservationById(id).ConvertToDto());
            }

            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault()
                {
                    Operation = "Read"
                };
                throw new FaultException <OutOfRangeFault>(fault);
            }
        }
예제 #3
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);
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
        public void updateReservation(ReservationDto reservation)
        {
            WriteActualMethod();
            try
            {
                _reservationManager.UpdateReservation(reservation.ConvertToEntity());
            }
            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault
                {
                    Operation = "update"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
            catch (DbUpdateConcurrencyException)
            {
                ConcurrencyFault fault = new ConcurrencyFault();
                throw new FaultException <ConcurrencyFault>(fault);
            }
            catch (AutoUnavailableException)
            {
                AutoUnavailableFault fault = new AutoUnavailableFault()
                {
                    Operation = "update"
                };

                throw new FaultException <AutoUnavailableFault>(fault);
            }
            catch (InvalidDateRangeException)
            {
                InvalidDateRangeFault fault = new InvalidDateRangeFault()
                {
                    Operation = "update"
                };

                throw new FaultException <InvalidDateRangeFault>(fault);
            }
        }
예제 #6
0
        public void updateKunde(KundeDto kunde)
        {
            WriteActualMethod();
            try
            {
                _kundenManager.UpdateKunde(kunde.ConvertToEntity());
            }
            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault
                {
                    Operation = "update"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
            catch (DbUpdateConcurrencyException)
            {
                ConcurrencyFault fault = new ConcurrencyFault();

                throw new FaultException <ConcurrencyFault>(fault);
            }
        }
예제 #7
0
        public void UpdateAuto(AutoDto auto)
        {
            WriteActualMethod();

            try
            {
                _autoManager.UpdateAuto(auto.ConvertToEntity());
            }
            catch (InvalidOperationException)
            {
                OutOfRangeFault fault = new OutOfRangeFault
                {
                    Operation = "update"
                };

                throw new FaultException <OutOfRangeFault>(fault);
            }
            catch (DbUpdateConcurrencyException)
            {
                ConcurrencyFault fault = new ConcurrencyFault();
                throw new FaultException <ConcurrencyFault>(fault);
            }
        }