Beispiel #1
0
 private async Task LoadAirplaneTypeAsync()
 {
     AirplaneTypeDtos.Clear();
     foreach (var airplaneType in await _airplaneTypeService.GetEntitiesAsync())
     {
         AirplaneTypeDtos.Add(airplaneType);
     }
 }
Beispiel #2
0
        public async void AddEntity(object sender, RoutedEventArgs e)
        {
            SelectedItem.Id           = Guid.NewGuid();
            SelectedItem.Name         = TextAirplaneName.Text;
            SelectedItem.AirplaneType = AirplaneTypeDtos
                                        .FirstOrDefault(airplaneType => airplaneType.Model == TextAirplaneName.Text);
            SelectedItem.DateOfIssue = DateTime.Parse(TextDateOfIssue.Text);
            SelectedItem.LifeTime    = TimeSpan.Parse(TextLifeTime.Text);

            await _airplaneService.CreateEntityAsync(SelectedItem);

            AddButton.Visibility = Visibility.Collapsed;
            TextId.IsReadOnly    = false;

            await LoadAirplaneAsync();
        }