Esempio n. 1
0
 public void RemoveBooking(string bookingId)
 {
     try
     {
         Rentals.RemoveBooking(bookingId);
     }
     catch
     {
         DoesNotExistFault fault = new DoesNotExistFault();
         fault.Operation   = "Remove Booking";
         fault.Description = "Booking does not exist";
         throw new FaultException <DoesNotExistFault>(fault);
     }
 }
Esempio n. 2
0
 public void RemoveCustomer(string firstName, string lastName, int id)
 {
     try
     {
         Rentals.RemoveCustomer(firstName, lastName, id);
     }
     catch
     {
         DoesNotExistFault fault = new DoesNotExistFault();
         fault.Operation   = "Remove customer";
         fault.Description = "Customer does not exist";
         throw new FaultException <DoesNotExistFault>(fault);
     }
 }
Esempio n. 3
0
 public void RemoveCar(string regNumber)
 {
     try
     {
         Rentals.RemoveCar(regNumber);
     }
     catch
     {
         DoesNotExistFault fault = new DoesNotExistFault();
         fault.Operation   = "Remove car";
         fault.Description = "Car does not exist";
         throw new FaultException <DoesNotExistFault>(fault);
     }
 }
Esempio n. 4
0
 public void EditCustomer(Customer customer)
 {
     try
     {
         Rentals.EditCustomer(customer);
     }
     //would add specific catch after reading message, but this is the idea.
     catch
     {
         DoesNotExistFault fault = new DoesNotExistFault();
         fault.Operation   = "Edit customer";
         fault.Description = "Customer does not exist";
         throw new FaultException <DoesNotExistFault>(fault);
     }
 }