Compare commits

...

2 Commits
master ... WIP

Author SHA1 Message Date
Andreas Zweili beda602ee5 Extend the WPF client 2018-09-01 16:00:02 +02:00
Andreas Zweili d680164f3a fix the workaround
appearantly a List can't be sent through the service
2018-09-01 15:56:54 +02:00
3 changed files with 36 additions and 5 deletions

View File

@ -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;

View File

@ -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>

View File

@ -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)
{
}
}
}