This commit is contained in:
Andreas Zweili 2018-08-05 15:26:22 +02:00
parent 353baf8e01
commit 010129243e
7 changed files with 65 additions and 6 deletions

View File

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using Plattform.Models;
using Plattform.AirlineService;
namespace Plattform.DB
{

View File

@ -1,7 +1,6 @@
using System.Data.Entity;
using Plattform.Models;
using Plattform.Helper;
using Plattform.AirlineService;
namespace Plattform.DB
{

View File

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using Plattform.Models;
using Plattform.AirlineService;
namespace Plattform.DB
{

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using Plattform;
namespace Plattform.Models
{
[DataContract]
public class Airline
{
[DataMember]
public int AirlineID { get; set; }
[DataMember]
public string Name { get; set; }
public Airline(AirlineService.Airline airline)
{
this.Name = airline.Name;
}
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Linq;
using System.Web;
using Plattform;
namespace Plattform.Models
{
[DataContract]
public class Flight
{
[DataMember]
public int FlightID { get; set; }
[DataMember]
public Airline Airline { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public DateTime StartTime { get; set; }
[DataMember]
public float Duration { get; set; }
[DataMember]
public string FromCityShortName { get; set; }
[DataMember]
public string ToCityShortName { get; set; }
public Flight (AirlineService.Flight flight)
{
this.Airline = new Airline(flight.Airline);
this.Name = flight.Name;
this.StartTime = flight.StartTime;
this.Duration = flight.Duration;
this.FromCityShortName = flight.FromCityShortName;
this.ToCityShortName = flight.ToCityShortName;
}
}
}

View File

@ -140,8 +140,10 @@
<DependentUpon>home.aspx</DependentUpon>
</Compile>
<Compile Include="IPlattformService.cs" />
<Compile Include="Models\Airline.cs" />
<Compile Include="Models\Availability.cs" />
<Compile Include="Models\City.cs" />
<Compile Include="Models\Flight.cs" />
<Compile Include="Models\Hotel.cs" />
<Compile Include="Models\Room.cs" />
<Compile Include="Models\RoomAvailability.cs" />

View File

@ -6,13 +6,13 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using Plattform.Models;
using Plattform.DB;
using Plattform.AirlineService;
using Plattform;
namespace Plattform
{
public partial class home : System.Web.UI.Page
{
public AirlineServiceClient service = new AirlineServiceClient();
public Plattform.AirlineService.AirlineServiceClient service = new Plattform.AirlineService.AirlineServiceClient();
protected void Page_Load(object sender, EventArgs e)
{
@ -27,7 +27,7 @@ namespace Plattform
var flights = this.service.GetFreeFlights();
foreach (var item in flights)
{
dataccess.CreateFlight(item);
dataccess.CreateFlight(new Flight(item));
}
}