Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Andreas Zweili | beda602ee5 | |
Andreas Zweili | d680164f3a |
|
@ -86,13 +86,13 @@ namespace Plattform
|
|||
FreeFrom = CalendarFrom.SelectedDate,
|
||||
FreeUntil = CalendarTo.SelectedDate
|
||||
};
|
||||
Dictionary<string, List<Flight>> flights =
|
||||
new Dictionary<string, List<Flight>>();
|
||||
Dictionary < string, Flight[]> flights =
|
||||
new Dictionary<string, Flight[]>();
|
||||
List<SpecialOffer> offers = new List<SpecialOffer>();
|
||||
var flightsx = client.GetFlights(room.FreeFrom, room.FreeUntil,
|
||||
flights = client.GetFlights(room.FreeFrom, room.FreeUntil,
|
||||
room.Hotel.City.Name,
|
||||
room.RoomType.Capacity);
|
||||
foreach (var flight in flightsx["To"])
|
||||
foreach (var flight in flights["To"])
|
||||
{
|
||||
SpecialOffer offer = new SpecialOffer();
|
||||
offer.FlightTo = flight;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
Title="MainWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
<ComboBox x:Name="DropDownOrigin" HorizontalAlignment="Left" Margin="64,72,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="DropDownOrigin_SelectionChanged"/>
|
||||
<ComboBox x:Name="DropDownDestination" HorizontalAlignment="Left" Margin="64,112,0,0" VerticalAlignment="Top" Width="120"/>
|
||||
<ComboBox x:Name="DropDownDestination" HorizontalAlignment="Left" Margin="64,112,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="DropDownDestination_SelectionChanged"/>
|
||||
<ListView x:Name="ListSpecialOffers" HorizontalAlignment="Left" Height="296" Margin="223,72,0,0" VerticalAlignment="Top" Width="241" SelectionChanged="ListSpecialOffers_SelectionChanged">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
|
|
|
@ -22,10 +22,31 @@ namespace WPFClient
|
|||
public partial class MainWindow : Window
|
||||
{
|
||||
List<City> Cities { get; set; }
|
||||
List<SpecialOffers> Offers { get; set; }
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
PlattformServiceClient client = new PlattformServiceClient();
|
||||
this.Cities = client.GetCities();
|
||||
this.Offers = client.GetSpecialOffers();
|
||||
|
||||
this.DropDownDestination.ItemsSource = this.Cities;
|
||||
this.DropDownOrigin.ItemsSource = this.Cities;
|
||||
|
||||
this.ListSpecialOffers.ItemsSource = this.Offers;
|
||||
GridView gridView = new GridView();
|
||||
this.ListSpecialOffers.View = gridView;
|
||||
gridView.Columns.Add(new GridViewColumn {
|
||||
Header = "Origin", DisplayMemberBinding = new Binding("FlightFrom") });
|
||||
gridView.Columns.Add(new GridViewColumn {
|
||||
Header = "Destination", DisplayMemberBinding = new Binding("FlightTo") });
|
||||
gridView.Columns.Add(new GridViewColumn {
|
||||
Header = "From", DisplayMemberBinding = new Binding("FlightTo") });
|
||||
gridView.Columns.Add(new GridViewColumn {
|
||||
Header = "Until", DisplayMemberBinding = new Binding("FlightTo") });
|
||||
gridView.Columns.Add(new GridViewColumn {
|
||||
Header = "Price", DisplayMemberBinding = new Binding("Price") });
|
||||
}
|
||||
|
||||
private void ButtonReserve_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -37,5 +58,15 @@ namespace WPFClient
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private void DropDownOrigin_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void DropDownDestination_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue