[feat:] voting numbers (total count) visible after importing
This commit is contained in:
@@ -122,6 +122,32 @@ public partial class MainWindow : Window
|
|||||||
LblStudentAmount.Content = Settings.Instance.Students.Count.ToString();
|
LblStudentAmount.Content = Settings.Instance.Students.Count.ToString();
|
||||||
LblSelectedAmount.Content = count_selected.ToString();
|
LblSelectedAmount.Content = count_selected.ToString();
|
||||||
|
|
||||||
|
List<(Sport, List<string>)> initial_sportlist = new();
|
||||||
|
foreach (var sp in Settings.Instance.Sports)
|
||||||
|
{
|
||||||
|
initial_sportlist.Add((sp, new()));
|
||||||
|
}
|
||||||
|
foreach (Student s in Settings.Instance.Students)
|
||||||
|
{
|
||||||
|
foreach (var sp in s.SelectedCourseNames)
|
||||||
|
{
|
||||||
|
foreach (var item in initial_sportlist)
|
||||||
|
{
|
||||||
|
if (item.Item1.AlternativeNames.Contains(sp))
|
||||||
|
{
|
||||||
|
item.Item2.Add(s.ID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LblNumVoted.Content = "";
|
||||||
|
foreach (var s in initial_sportlist)
|
||||||
|
{
|
||||||
|
LblNumVoted.Content += $"{s.Item1.Name}: {s.Item2.Count}\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnCraftCourses_OnClick(object? sender, RoutedEventArgs e)
|
private void BtnCraftCourses_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user