diff --git a/Plattform/Plattform/IPlattformService.cs b/Plattform/Plattform/IPlattformService.cs index 7ad5200..f31a6af 100644 --- a/Plattform/Plattform/IPlattformService.cs +++ b/Plattform/Plattform/IPlattformService.cs @@ -21,5 +21,9 @@ namespace Plattform bool BookSpecialOffer(SpecialOffer offer); [OperationContract] bool CancelSpecialOffer(SpecialOffer offer); + [OperationContract] + List GetGenders(); + [OperationContract] + List GetSaluations(); } } diff --git a/Plattform/Plattform/PlattformService.svc.cs b/Plattform/Plattform/PlattformService.svc.cs index 7580650..88e4572 100644 --- a/Plattform/Plattform/PlattformService.svc.cs +++ b/Plattform/Plattform/PlattformService.svc.cs @@ -17,13 +17,15 @@ namespace Plattform // Explorer and start debugging. public class PlattformService : IPlattformService { - SpecialOfferDB db = new SpecialOfferDB(); + SpecialOfferDB offerDB = new SpecialOfferDB(); + GenderDB genderDB = new GenderDB(); + SalutationDB salutationDB = new SalutationDB(); AirlineServiceClient client = new AirlineServiceClient(); public List GetSpecialOffers() { try { - return db.GetAllSpecialOffers(); + return offerDB.GetAllSpecialOffers(); } catch(Exception e) { @@ -38,7 +40,7 @@ namespace Plattform client.BookFlight(offer.FlightTo, offer.Room.RoomType.Capacity); client.BookFlight(offer.FlightFrom, offer.Room.RoomType.Capacity); offer.Reserverd = true; - db.UpdateSpecialOffer(offer); + offerDB.UpdateSpecialOffer(offer); return true; } catch(Exception e) @@ -52,7 +54,7 @@ namespace Plattform try { offer.Booked = true; - db.UpdateSpecialOffer(offer); + offerDB.UpdateSpecialOffer(offer); return true; } catch(Exception e) @@ -68,7 +70,7 @@ namespace Plattform client.CancelFlight(offer.FlightTo, offer.Room.RoomType.Capacity); client.CancelFlight(offer.FlightFrom, offer.Room.RoomType.Capacity); offer.Reserverd = false; - db.UpdateSpecialOffer(offer); + offerDB.UpdateSpecialOffer(offer); return true; } catch(Exception e) @@ -77,5 +79,29 @@ namespace Plattform return false; } } + public List GetGender() + { + try + { + return genderDB.GetAllGenders(); + } + catch(Exception e) + { + System.Diagnostics.Trace.WriteLine(e); + return new List(); + } + } + public List GetSalutations() + { + try + { + return salutationDB.GetAllSalutations(); + } + catch(Exception e) + { + System.Diagnostics.Trace.WriteLine(e); + return new List(); + } + } } }