Namelist to navbar
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Apollon.Domain.Models
|
||||
{
|
||||
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;
|
||||
FirstName = firstName;
|
||||
@@ -27,7 +27,7 @@ namespace Apollon.Domain.Models
|
||||
public int PassNumber { get; }
|
||||
public string Society { get; }
|
||||
public int SocietyNumber { get; }
|
||||
public string Birthday { get; }
|
||||
public DateTime Birthday { get; }
|
||||
public string Country { get; }
|
||||
public int Qualification { get; }
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Apollon.EntityFramework.DTOs
|
||||
public int PassNumber { get; set; }
|
||||
public string Society { get; set; }
|
||||
public int SocietyNumber { get; set; }
|
||||
public string Birthday { get; set; }
|
||||
public DateTime Birthday { get; set; }
|
||||
public string Country { get; set; }
|
||||
public int Qualification { get; set; }
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="images\3d.png" />
|
||||
<None Remove="images\Archery.png" />
|
||||
<None Remove="images\targetField.png" />
|
||||
<None Remove="images\targetHall.png" />
|
||||
<None Remove="images\targetOutdoor.png" />
|
||||
@@ -25,14 +26,13 @@
|
||||
<ProjectReference Include="..\Apollon.EntityFramework\Apollon.EntityFramework.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Images\Logos\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="images\3d.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="images\Archery.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="images\targetField.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
|
||||
@@ -51,7 +51,8 @@ namespace Apollon.WPF
|
||||
|
||||
_navBarPreparationViewModel = new NavBarPreparationViewModel(CreateOverviewNavigationService(),
|
||||
CreateGroupsNavigationService(),
|
||||
CreateClassesNavigationService(),
|
||||
CreateNamelistNavigationService(),
|
||||
CreateClassesNavigationService(),
|
||||
CreateArchersNavigationService());
|
||||
}
|
||||
|
||||
@@ -105,6 +106,12 @@ namespace Apollon.WPF
|
||||
_navigationStore, ()=> new ClassesViewModel(_navBarPreparationViewModel, _selectedTournamentStore));
|
||||
}
|
||||
|
||||
private NavigationService<NameListViewModel> CreateNamelistNavigationService()
|
||||
{
|
||||
return new NavigationService<NameListViewModel>(
|
||||
_navigationStore, () => new NameListViewModel());
|
||||
}
|
||||
|
||||
private NavigationService<ArchersViewModel> CreateArchersNavigationService()
|
||||
{
|
||||
return new NavigationService<ArchersViewModel>(
|
||||
|
||||
@@ -134,16 +134,16 @@ namespace Apollon.WPF.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private int _rounds;
|
||||
private int _groups;
|
||||
public int Groups
|
||||
{
|
||||
get
|
||||
{
|
||||
return _rounds;
|
||||
return _groups;
|
||||
}
|
||||
set
|
||||
{
|
||||
_rounds = value;
|
||||
_groups = value;
|
||||
OnPropertyChanged(nameof(Groups));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ namespace Apollon.WPF.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private string _birthday;
|
||||
public string Birthday
|
||||
private DateTime _birthday;
|
||||
public DateTime Birthday
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -119,5 +119,19 @@ namespace Apollon.WPF.ViewModels
|
||||
OnPropertyChanged(nameof(Qualification));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isreadOnly;
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isreadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isreadOnly = value;
|
||||
OnPropertyChanged(nameof(IsReadOnly));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,14 +14,19 @@ namespace Apollon.WPF.ViewModels
|
||||
public ICommand NavigateOverviewCommand { get; }
|
||||
public ICommand NavigateGroupsCommand { get;}
|
||||
public ICommand NavigateClassesCommand { get;}
|
||||
public ICommand NavigateNamelistCommand { get;}
|
||||
public ICommand NavigateArchersCommand { get;}
|
||||
|
||||
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService, NavigationService<GroupsViewModel> groupNavigationService,
|
||||
NavigationService<ClassesViewModel> classNavigationService, NavigationService<ArchersViewModel> archersNavigationService)
|
||||
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService,
|
||||
NavigationService<GroupsViewModel> groupNavigationService,
|
||||
NavigationService<NameListViewModel> namelistNavigationService,
|
||||
NavigationService<ClassesViewModel> classNavigationService,
|
||||
NavigationService<ArchersViewModel> archersNavigationService)
|
||||
{
|
||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
||||
NavigateClassesCommand = new NavigateCommand<ClassesViewModel>(classNavigationService);
|
||||
NavigateNamelistCommand = new NavigateCommand<NameListViewModel>(namelistNavigationService);
|
||||
NavigateArchersCommand = new NavigateCommand<ArchersViewModel>(archersNavigationService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
using Apollon.WPF.Commands;
|
||||
using Apollon.WPF.Services;
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Apollon.WPF.ViewModels
|
||||
@@ -17,11 +12,11 @@ namespace Apollon.WPF.ViewModels
|
||||
private Tournament SelectedTournament => _selectedTournamentStore.SelectedTournament;
|
||||
|
||||
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 TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
|
||||
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 EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
|
||||
public string Location => SelectedTournament?.Location ?? "kein Ort";
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace Apollon.WPF.ViewModels
|
||||
private Tournament SelectedTournament => _selectedTournamentsStore.SelectedTournament;
|
||||
|
||||
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 TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
|
||||
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 EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
|
||||
public string Location => SelectedTournament?.Location ?? "kein Ort";
|
||||
|
||||
@@ -83,7 +83,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Namenliste"
|
||||
Template="{StaticResource Item_Template}">
|
||||
Template="{StaticResource Item_Template}"
|
||||
Command="{Binding NavigateNamelistCommand}">
|
||||
<MenuItem.Icon>
|
||||
<iconPacks:PackIconMaterial Kind="BadgeAccount"
|
||||
Height="20"
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</StackPanel>
|
||||
<Image Grid.Column="2"
|
||||
Grid.Row="2"
|
||||
Source="{Binding Logo}"
|
||||
Source="{Binding Logo, TargetNullValue={x:Null}}"
|
||||
Width="50"
|
||||
Height="50">
|
||||
<Image.Style>
|
||||
|
||||
@@ -9,16 +9,20 @@
|
||||
<DataGrid FontSize="14"
|
||||
HorizontalAlignment="Center"
|
||||
CanUserAddRows="True"
|
||||
AutoGenerateColumns="True">
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="{Binding IsReadOnly}">
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}"/>
|
||||
<DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" />
|
||||
<DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}"/>
|
||||
<DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" />
|
||||
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}"/>
|
||||
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" />
|
||||
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}"/>
|
||||
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}"/>
|
||||
<DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" IsReadOnly="False" />
|
||||
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}" IsReadOnly="False"/>
|
||||
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}" IsReadOnly="False"/>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
Reference in New Issue
Block a user