Von der Datenbank bis zur Oberfläche mit .NET, Teil 2: Application Server und Webservices
Seite 7: Listing 3
Inhaltsverzeichnis
Listing 3: BuchungsService.cs
Weiterlesen nach der Anzeige
using System; using System.IO; using System.Reflection; using System.ServiceModel; using WWWings_GL; using WWWings_GO;
namespace WWWings_Dienste { /// <summary> /// Dienstimplementierug /// </summary> [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class BuchungsService : IBuchungsService, IDisposable { #region IBuchungsService Members
BuchungsManager bm = new BuchungsManager();
public GetFlugAntwort GetFlug(GetFlugAnfrage anfrage) { return new GetFlugAntwort() { Flug = bm.GetFlug(anfrage.FlugNummer) }; }
public GetPassagierAntwort GetPassagier(GetPassagierAnfrage anfrage) { return new GetPassagierAntwort() { Passagier = bm.GetPassagier(anfrage.PassagierNummer) }; }
public GetFluegeAntwort GetFluege(GetFluegeAnfrage anfrage) { return new GetFluegeAntwort() { Fluege = bm.GetFluege(anfrage.Abflugort, anfrage.Zielort) }; }
public GetPassagiereAntwort GetPassagiere(GetPassagiereAnfrage Anfrage) { return new GetPassagiereAntwort() { Passagiere = bm.GetPassagiere(Anfrage.Namensbestandteil) }; }
public SavePassagierSetAntwort SavePassagierSet(SavePassagierSetAnfrage anfrage) { var Antwort = new SavePassagierSetAntwort(); string statistik; Antwort.NeuePassagiere = bm.SavePassagierSet(anfrage.PassagierSet, out statistik); Antwort.Statistik = statistik; return Antwort; }
public CreateBuchungAntwort CreateBuchung(CreateBuchungAnfrage anfrage) { return new CreateBuchungAntwort() { Status = bm.CreateBuchung(anfrage.FlugID, anfrage.PassagierID) }; }
public GetFlughaefenAntwort GetFlughaefen(GetFlughaefenAnfrage Anfrage) { return new GetFlughaefenAntwort() { FlughaefenNamen = bm.GetFlughaefen() }; }