Namelist to navbar

This commit is contained in:
Natlinux
2023-02-04 19:00:42 +01:00
parent b6a427ca29
commit 7ac59d15b3
12 changed files with 61 additions and 35 deletions

View File

@@ -8,7 +8,7 @@ namespace Apollon.Domain.Models
{ {
public class NameList public class NameList
{ {
public NameList(Guid id, string firstName, string lastName, int passNumber, string society, int societyNumber, string birthday, string country, int qualification) public NameList(Guid id, string firstName, string lastName, int passNumber, string society, int societyNumber, DateTime birthday, string country, int qualification)
{ {
Id = id; Id = id;
FirstName = firstName; FirstName = firstName;
@@ -27,7 +27,7 @@ namespace Apollon.Domain.Models
public int PassNumber { get; } public int PassNumber { get; }
public string Society { get; } public string Society { get; }
public int SocietyNumber { get; } public int SocietyNumber { get; }
public string Birthday { get; } public DateTime Birthday { get; }
public string Country { get; } public string Country { get; }
public int Qualification { get; } public int Qualification { get; }
} }

View File

@@ -14,7 +14,7 @@ namespace Apollon.EntityFramework.DTOs
public int PassNumber { get; set; } public int PassNumber { get; set; }
public string Society { get; set; } public string Society { get; set; }
public int SocietyNumber { get; set; } public int SocietyNumber { get; set; }
public string Birthday { get; set; } public DateTime Birthday { get; set; }
public string Country { get; set; } public string Country { get; set; }
public int Qualification { get; set; } public int Qualification { get; set; }
} }

View File

@@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<None Remove="images\3d.png" /> <None Remove="images\3d.png" />
<None Remove="images\Archery.png" />
<None Remove="images\targetField.png" /> <None Remove="images\targetField.png" />
<None Remove="images\targetHall.png" /> <None Remove="images\targetHall.png" />
<None Remove="images\targetOutdoor.png" /> <None Remove="images\targetOutdoor.png" />
@@ -25,14 +26,13 @@
<ProjectReference Include="..\Apollon.EntityFramework\Apollon.EntityFramework.csproj" /> <ProjectReference Include="..\Apollon.EntityFramework\Apollon.EntityFramework.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Images\Logos\" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="images\3d.png"> <Resource Include="images\3d.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource> </Resource>
<Resource Include="images\Archery.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="images\targetField.png"> <Resource Include="images\targetField.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource> </Resource>

View File

@@ -51,7 +51,8 @@ namespace Apollon.WPF
_navBarPreparationViewModel = new NavBarPreparationViewModel(CreateOverviewNavigationService(), _navBarPreparationViewModel = new NavBarPreparationViewModel(CreateOverviewNavigationService(),
CreateGroupsNavigationService(), CreateGroupsNavigationService(),
CreateClassesNavigationService(), CreateNamelistNavigationService(),
CreateClassesNavigationService(),
CreateArchersNavigationService()); CreateArchersNavigationService());
} }
@@ -105,6 +106,12 @@ namespace Apollon.WPF
_navigationStore, ()=> new ClassesViewModel(_navBarPreparationViewModel, _selectedTournamentStore)); _navigationStore, ()=> new ClassesViewModel(_navBarPreparationViewModel, _selectedTournamentStore));
} }
private NavigationService<NameListViewModel> CreateNamelistNavigationService()
{
return new NavigationService<NameListViewModel>(
_navigationStore, () => new NameListViewModel());
}
private NavigationService<ArchersViewModel> CreateArchersNavigationService() private NavigationService<ArchersViewModel> CreateArchersNavigationService()
{ {
return new NavigationService<ArchersViewModel>( return new NavigationService<ArchersViewModel>(

View File

@@ -134,16 +134,16 @@ namespace Apollon.WPF.ViewModels
} }
} }
private int _rounds; private int _groups;
public int Groups public int Groups
{ {
get get
{ {
return _rounds; return _groups;
} }
set set
{ {
_rounds = value; _groups = value;
OnPropertyChanged(nameof(Groups)); OnPropertyChanged(nameof(Groups));
} }
} }

View File

@@ -78,8 +78,8 @@ namespace Apollon.WPF.ViewModels
} }
} }
private string _birthday; private DateTime _birthday;
public string Birthday public DateTime Birthday
{ {
get get
{ {
@@ -119,5 +119,19 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(Qualification)); OnPropertyChanged(nameof(Qualification));
} }
} }
private bool _isreadOnly;
public bool IsReadOnly
{
get
{
return _isreadOnly;
}
set
{
_isreadOnly = value;
OnPropertyChanged(nameof(IsReadOnly));
}
}
} }
} }

View File

@@ -14,14 +14,19 @@ namespace Apollon.WPF.ViewModels
public ICommand NavigateOverviewCommand { get; } public ICommand NavigateOverviewCommand { get; }
public ICommand NavigateGroupsCommand { get;} public ICommand NavigateGroupsCommand { get;}
public ICommand NavigateClassesCommand { get;} public ICommand NavigateClassesCommand { get;}
public ICommand NavigateNamelistCommand { get;}
public ICommand NavigateArchersCommand { get;} public ICommand NavigateArchersCommand { get;}
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService, NavigationService<GroupsViewModel> groupNavigationService, public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService,
NavigationService<ClassesViewModel> classNavigationService, NavigationService<ArchersViewModel> archersNavigationService) NavigationService<GroupsViewModel> groupNavigationService,
NavigationService<NameListViewModel> namelistNavigationService,
NavigationService<ClassesViewModel> classNavigationService,
NavigationService<ArchersViewModel> archersNavigationService)
{ {
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService); NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService); NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
NavigateClassesCommand = new NavigateCommand<ClassesViewModel>(classNavigationService); NavigateClassesCommand = new NavigateCommand<ClassesViewModel>(classNavigationService);
NavigateNamelistCommand = new NavigateCommand<NameListViewModel>(namelistNavigationService);
NavigateArchersCommand = new NavigateCommand<ArchersViewModel>(archersNavigationService); NavigateArchersCommand = new NavigateCommand<ArchersViewModel>(archersNavigationService);
} }
} }

View File

@@ -2,11 +2,6 @@
using Apollon.WPF.Commands; using Apollon.WPF.Commands;
using Apollon.WPF.Services; using Apollon.WPF.Services;
using Apollon.WPF.Stores; using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
namespace Apollon.WPF.ViewModels namespace Apollon.WPF.ViewModels
@@ -17,11 +12,11 @@ namespace Apollon.WPF.ViewModels
private Tournament SelectedTournament => _selectedTournamentStore.SelectedTournament; private Tournament SelectedTournament => _selectedTournamentStore.SelectedTournament;
public bool HasSelectedTournament => SelectedTournament != null; public bool HasSelectedTournament => SelectedTournament != null;
public string Logo => SelectedTournament?.Logo ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png"; public string Logo => SelectedTournament?.Logo ?? @"\images\Archery.png";
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation"; public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name"; public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie"; public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png"; public string CompetitionImage => SelectedTournament?.CompetitionImage ?? @"\images\Archery.png";
public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum"; public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum";
public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum"; public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort"; public string Location => SelectedTournament?.Location ?? "kein Ort";

View File

@@ -16,11 +16,11 @@ namespace Apollon.WPF.ViewModels
private Tournament SelectedTournament => _selectedTournamentsStore.SelectedTournament; private Tournament SelectedTournament => _selectedTournamentsStore.SelectedTournament;
public bool HasSelectedTournament => SelectedTournament != null; public bool HasSelectedTournament => SelectedTournament != null;
public string Logo => SelectedTournament?.Logo ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png"; public string Logo => SelectedTournament?.Logo ?? @"\images\Archery.png";
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation"; public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name"; public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie"; public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png"; public string CompetitionImage => SelectedTournament?.CompetitionImage ?? @"\images\Archery.png";
public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum"; public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum";
public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum"; public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort"; public string Location => SelectedTournament?.Location ?? "kein Ort";

View File

@@ -83,7 +83,8 @@
</MenuItem.Icon> </MenuItem.Icon>
</MenuItem> </MenuItem>
<MenuItem Header="Namenliste" <MenuItem Header="Namenliste"
Template="{StaticResource Item_Template}"> Template="{StaticResource Item_Template}"
Command="{Binding NavigateNamelistCommand}">
<MenuItem.Icon> <MenuItem.Icon>
<iconPacks:PackIconMaterial Kind="BadgeAccount" <iconPacks:PackIconMaterial Kind="BadgeAccount"
Height="20" Height="20"

View File

@@ -81,7 +81,7 @@
</StackPanel> </StackPanel>
<Image Grid.Column="2" <Image Grid.Column="2"
Grid.Row="2" Grid.Row="2"
Source="{Binding Logo}" Source="{Binding Logo, TargetNullValue={x:Null}}"
Width="50" Width="50"
Height="50"> Height="50">
<Image.Style> <Image.Style>

View File

@@ -9,16 +9,20 @@
<DataGrid FontSize="14" <DataGrid FontSize="14"
HorizontalAlignment="Center" HorizontalAlignment="Center"
CanUserAddRows="True" CanUserAddRows="True"
AutoGenerateColumns="True"> AutoGenerateColumns="True"
IsReadOnly="{Binding IsReadOnly}">
<DataTemplate>
</DataTemplate>
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}"/> <DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}" IsReadOnly="False"/>
<DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" /> <DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" IsReadOnly="False"/>
<DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}"/> <DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}" IsReadOnly="False"/>
<DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" /> <DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" IsReadOnly="False" />
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}"/> <DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}" IsReadOnly="False"/>
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" /> <DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" IsReadOnly="False"/>
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}"/> <DataGridTextColumn Header="Bundesland" Binding="{Binding Country}" IsReadOnly="False"/>
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}"/> <DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}" IsReadOnly="False"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>