Пример #1
0
        public async void AddEntity(object sender, RoutedEventArgs e)
        {
            SelectedItem.Id          = Guid.NewGuid();
            SelectedItem.Name        = TextName.Text;
            SelectedItem.Surname     = TextSurname.Text;
            SelectedItem.DateOfBirth = DateTime.Parse(TextDeteOfBirth.Text);
            SelectedItem.Experience  = TimeSpan.Parse(TextExperience.Text);

            await _pilotService.CreateEntityAsync(SelectedItem);

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

            await ReloadEntitiesAsync();
        }