[chore:] delete alternative names from sport courses

This commit is contained in:
2026-03-02 10:55:38 +01:00
parent 8672b09ff0
commit af2ad3dab7
2 changed files with 27 additions and 1 deletions

View File

@@ -331,6 +331,27 @@ public partial class MainWindow : Window
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(TbSportAlternativeName.Text);
LbAlternativeNames.Items.Add(TbSportAlternativeName.Text);
TbSportAlternativeName.Text = "";
int curr_selected = LbSportCourses.SelectedIndex;
RefreshCoursesList();
LbSportCourses.SelectedIndex = curr_selected;
} catch {}
}
private void BtnAlternativeNameRemove_OnClick(object? sender, RoutedEventArgs e)
{
//try
//{
LbAlternativeNames.Items.Remove(LbAlternativeNames.SelectedItem);
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Clear();
foreach (string s in LbAlternativeNames.Items)
{
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(s);
}
int curr_selected = LbSportCourses.SelectedIndex;
RefreshCoursesList();
LbSportCourses.SelectedIndex = curr_selected;
//} catch (Exception ex) {}
}
}