This commit is contained in:
Natlinux
2022-11-13 19:54:03 +01:00
parent ee8c687f5c
commit 4a47b178f4
30 changed files with 827 additions and 25 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) public NameList(Guid id, string firstName, string lastName, int passNumber, string society, int societyNumber, string birthday, string country, int qualification)
{ {
Id = id; Id = id;
FirstName = firstName; FirstName = firstName;
@@ -18,6 +18,7 @@ namespace Apollon.Domain.Models
SocietyNumber = societyNumber; SocietyNumber = societyNumber;
Birthday = birthday; Birthday = birthday;
Country = country; Country = country;
Qualification = qualification;
} }
public Guid Id { get; } public Guid Id { get; }
@@ -28,5 +29,6 @@ namespace Apollon.Domain.Models
public int SocietyNumber { get; } public int SocietyNumber { get; }
public string Birthday { get; } public string Birthday { get; }
public string Country { get; } public string Country { get; }
public int Qualification { get; }
} }
} }

View File

@@ -8,7 +8,7 @@ namespace Apollon.Domain.Models
{ {
public class Tournament public class Tournament
{ {
public Tournament(Guid id, string logo, string organisation, string tournamentName, string competition, string competitionImage, DateTime startDate, DateTime endDate, string location, int rounds) public Tournament(Guid id, string logo, string organisation, string tournamentName, string competition, string competitionImage, DateTime startDate, DateTime endDate, string location, int rounds, int targets)
{ {
Id = id; Id = id;
Logo = logo; Logo = logo;
@@ -20,6 +20,7 @@ namespace Apollon.Domain.Models
EndDate = endDate; EndDate = endDate;
Location = location; Location = location;
Rounds = rounds; Rounds = rounds;
Targets = targets;
} }
public Guid Id { get; } public Guid Id { get; }
@@ -32,6 +33,7 @@ namespace Apollon.Domain.Models
public DateTime EndDate { get; } public DateTime EndDate { get; }
public string Location { get; } public string Location { get; }
public int Rounds { get; } public int Rounds { get; }
public int Targets { get; }
} }
} }

View File

@@ -35,6 +35,7 @@ namespace Apollon.EntityFramework.Commands
EndDate = tournament.EndDate, EndDate = tournament.EndDate,
Location = tournament.Location, Location = tournament.Location,
Rounds = tournament.Rounds, Rounds = tournament.Rounds,
Targets = tournament.Targets,
}; };
context.Tournaments.Add(tournamentDto); context.Tournaments.Add(tournamentDto);

View File

@@ -34,6 +34,7 @@ namespace Apollon.EntityFramework.Commands
EndDate = tournament.EndDate, EndDate = tournament.EndDate,
Location = tournament.Location, Location = tournament.Location,
Rounds = tournament.Rounds, Rounds = tournament.Rounds,
Targets = tournament.Targets,
}; };
context.Tournaments.Update(tournamentDto); context.Tournaments.Update(tournamentDto);

View File

@@ -16,5 +16,6 @@ namespace Apollon.EntityFramework.DTOs
public int SocietyNumber { get; set; } public int SocietyNumber { get; set; }
public string Birthday { get; set; } public string Birthday { get; set; }
public string Country { get; set; } public string Country { get; set; }
public int Qualification { get; set; }
} }
} }

View File

@@ -18,5 +18,6 @@ namespace Apollon.EntityFramework.DTOs
public DateTime EndDate { get; set; } public DateTime EndDate { get; set; }
public string Location { get; set; } public string Location { get; set; }
public int Rounds { get; set; } public int Rounds { get; set; }
public int Targets { get; set; }
} }
} }

View File

@@ -0,0 +1,118 @@
// <auto-generated />
using System;
using Apollon.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20221113173340_Targets")]
partial class Targets
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.CompetitionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Competition");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.NameListDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Birthday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PassNumber")
.HasColumnType("int");
b.Property<string>("Society")
.HasColumnType("nvarchar(max)");
b.Property<int>("SocietyNumber")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("NameList");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("Location")
.HasColumnType("nvarchar(max)");
b.Property<string>("Logo")
.HasColumnType("nvarchar(max)");
b.Property<string>("Organisation")
.HasColumnType("nvarchar(max)");
b.Property<int>("Rounds")
.HasColumnType("int");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tournaments");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,54 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
public partial class Targets : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Competition",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CompetitionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
CompetitionImage = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Competition", x => x.Id);
});
migrationBuilder.CreateTable(
name: "NameList",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true),
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true),
PassNumber = table.Column<int>(type: "int", nullable: false),
Society = table.Column<string>(type: "nvarchar(max)", nullable: true),
SocietyNumber = table.Column<int>(type: "int", nullable: false),
Birthday = table.Column<string>(type: "nvarchar(max)", nullable: true),
Country = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_NameList", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Competition");
migrationBuilder.DropTable(
name: "NameList");
}
}
}

View File

@@ -0,0 +1,121 @@
// <auto-generated />
using System;
using Apollon.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20221113173650_Target")]
partial class Target
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.CompetitionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Competition");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.NameListDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Birthday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PassNumber")
.HasColumnType("int");
b.Property<string>("Society")
.HasColumnType("nvarchar(max)");
b.Property<int>("SocietyNumber")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("NameList");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("Location")
.HasColumnType("nvarchar(max)");
b.Property<string>("Logo")
.HasColumnType("nvarchar(max)");
b.Property<string>("Organisation")
.HasColumnType("nvarchar(max)");
b.Property<int>("Rounds")
.HasColumnType("int");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Targets")
.HasColumnType("int");
b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tournaments");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
public partial class Target : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Targets",
table: "Tournaments",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Targets",
table: "Tournaments");
}
}
}

View File

@@ -0,0 +1,121 @@
// <auto-generated />
using System;
using Apollon.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20221113174443_T")]
partial class T
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.CompetitionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Competition");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.NameListDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Birthday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PassNumber")
.HasColumnType("int");
b.Property<string>("Society")
.HasColumnType("nvarchar(max)");
b.Property<int>("SocietyNumber")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("NameList");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("Location")
.HasColumnType("nvarchar(max)");
b.Property<string>("Logo")
.HasColumnType("nvarchar(max)");
b.Property<string>("Organisation")
.HasColumnType("nvarchar(max)");
b.Property<int>("Rounds")
.HasColumnType("int");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Targets")
.HasColumnType("int");
b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tournaments");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
public partial class T : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@@ -0,0 +1,124 @@
// <auto-generated />
using System;
using Apollon.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20221113175434_quali")]
partial class quali
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.CompetitionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Competition");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.NameListDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Birthday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PassNumber")
.HasColumnType("int");
b.Property<int>("Qualification")
.HasColumnType("int");
b.Property<string>("Society")
.HasColumnType("nvarchar(max)");
b.Property<int>("SocietyNumber")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("NameList");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Competition")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("Location")
.HasColumnType("nvarchar(max)");
b.Property<string>("Logo")
.HasColumnType("nvarchar(max)");
b.Property<string>("Organisation")
.HasColumnType("nvarchar(max)");
b.Property<int>("Rounds")
.HasColumnType("int");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Targets")
.HasColumnType("int");
b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Tournaments");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Apollon.EntityFramework.Migrations
{
public partial class quali : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Qualification",
table: "NameList",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Qualification",
table: "NameList");
}
}
}

View File

@@ -22,6 +22,60 @@ namespace Apollon.EntityFramework.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Apollon.EntityFramework.DTOs.CompetitionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CompetitionImage")
.HasColumnType("nvarchar(max)");
b.Property<string>("CompetitionName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Competition");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.NameListDto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Birthday")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<int>("PassNumber")
.HasColumnType("int");
b.Property<int>("Qualification")
.HasColumnType("int");
b.Property<string>("Society")
.HasColumnType("nvarchar(max)");
b.Property<int>("SocietyNumber")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("NameList");
});
modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b => modelBuilder.Entity("Apollon.EntityFramework.DTOs.TournamentDto", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@@ -52,6 +106,9 @@ namespace Apollon.EntityFramework.Migrations
b.Property<DateTime>("StartDate") b.Property<DateTime>("StartDate")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<int>("Targets")
.HasColumnType("int");
b.Property<string>("TournamentName") b.Property<string>("TournamentName")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

View File

@@ -33,7 +33,8 @@ namespace Apollon.EntityFramework.Queries
y.Society, y.Society,
y.SocietyNumber, y.SocietyNumber,
y.Birthday, y.Birthday,
y.Country)); y.Country,
y.Qualification));
} }
} }
} }

View File

@@ -35,7 +35,8 @@ namespace Apollon.EntityFramework.Queries
y.StartDate, y.StartDate,
y.EndDate, y.EndDate,
y.Location, y.Location,
y.Rounds)); y.Rounds,
y.Targets));
} }
} }
} }

View File

@@ -44,7 +44,8 @@ namespace Apollon.WPF.Commands
detailsViewModel.StartDate, detailsViewModel.StartDate,
detailsViewModel.EndDate, detailsViewModel.EndDate,
detailsViewModel.Location, detailsViewModel.Location,
detailsViewModel.Rounds); detailsViewModel.Rounds,
detailsViewModel.Targets);
try try
{ {

View File

@@ -39,7 +39,8 @@ namespace Apollon.WPF.Commands
detailsViewModel.StartDate, detailsViewModel.StartDate,
detailsViewModel.EndDate, detailsViewModel.EndDate,
detailsViewModel.Location, detailsViewModel.Location,
detailsViewModel.Rounds); detailsViewModel.Rounds,
detailsViewModel.Targets);
try try
{ {

View File

@@ -162,6 +162,20 @@ namespace Apollon.WPF.ViewModels
} }
} }
private int _targets;
public int Targets
{
get
{
return _targets;
}
set
{
_targets = value;
OnPropertyChanged(nameof(Targets));
}
}
private bool _isSubmitting; private bool _isSubmitting;
public bool IsSubmitting public bool IsSubmitting
{ {

View File

@@ -33,6 +33,7 @@ namespace Apollon.WPF.ViewModels
EndDate = tournament.EndDate, EndDate = tournament.EndDate,
Location = tournament.Location, Location = tournament.Location,
Rounds = tournament.Rounds, Rounds = tournament.Rounds,
Targets = tournament.Targets,
}; };
} }

View File

@@ -105,5 +105,19 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(Country)); OnPropertyChanged(nameof(Country));
} }
} }
private int _qualification;
public int Qualification
{
get
{
return _qualification;
}
set
{
_qualification = value;
OnPropertyChanged(nameof(Qualification));
}
}
} }
} }

View File

@@ -7,7 +7,7 @@ using System.Windows.Input;
namespace Apollon.WPF.ViewModels namespace Apollon.WPF.ViewModels
{ {
public class NavigationBarViewModel : ViewModelBase public class NavBarTournamentDetailsViewModel : ViewModelBase
{ {
public ICommand NavigateNameListCommand { get;} public ICommand NavigateNameListCommand { get;}
public ICommand GroupsCommand { get;} public ICommand GroupsCommand { get;}

View File

@@ -25,8 +25,9 @@ namespace Apollon.WPF.ViewModels
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";
public int Rounds => SelectedTournament?.Rounds ?? 0; public int Rounds => SelectedTournament?.Rounds ?? 0;
public int Targets => SelectedTournament?.Targets ?? 0;
public ICommand NavigateNavBarCommand { get; } public ICommand NavigateTournamentDetailsCommand { get; }
public OverviewDetailsViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationStore navigationStore, ModalNavigationStore modalNavigationStore,TournamentsStore tournamentsStore) public OverviewDetailsViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationStore navigationStore, ModalNavigationStore modalNavigationStore,TournamentsStore tournamentsStore)
{ {
@@ -34,7 +35,7 @@ namespace Apollon.WPF.ViewModels
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged; _selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
NavigateNavBarCommand = new NavigateCommand<TournamentDetailsViewModel>(navigationStore, () => new TournamentDetailsViewModel(navigationStore, selectedTournamentStore, modalNavigationStore, tournamentsStore)); NavigateTournamentDetailsCommand = new NavigateCommand<TournamentDetailsViewModel>(navigationStore, () => new TournamentDetailsViewModel(navigationStore, selectedTournamentStore, modalNavigationStore, tournamentsStore));
} }
protected override void Dispose() protected override void Dispose()
@@ -57,6 +58,7 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(EndDate)); OnPropertyChanged(nameof(EndDate));
OnPropertyChanged(nameof(Location)); OnPropertyChanged(nameof(Location));
OnPropertyChanged(nameof(Rounds)); OnPropertyChanged(nameof(Rounds));
OnPropertyChanged(nameof(Targets));
} }
} }
} }

View File

@@ -27,6 +27,7 @@ namespace Apollon.WPF.ViewModels
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";
public int Rounds => SelectedTournament?.Rounds ?? 0; public int Rounds => SelectedTournament?.Rounds ?? 0;
public int Targets => SelectedTournament?.Targets ?? 0;
public ICommand NavigateOverviewCommand { get; } public ICommand NavigateOverviewCommand { get; }
public TournamentDetailsViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore) public TournamentDetailsViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)

View File

@@ -144,8 +144,10 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Background="LightGray"/> Background="LightGray"/>
<TextBox Grid.Row="6" <WrapPanel Grid.Row="6"
Grid.Column="1" Grid.Column="1"
VerticalAlignment="Center">
<TextBox
Text="{Binding Rounds}" Text="{Binding Rounds}"
FontFamily="Arial" FontFamily="Arial"
FontSize="16" FontSize="16"
@@ -154,6 +156,21 @@
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Background="LightGray"/> Background="LightGray"/>
<TextBlock
Margin="50 0 0 0"
Text="Anzahl der Scheiben: "
Style="{StaticResource ModalTextBlock}"/>
<TextBox
Text="{Binding Targets}"
FontFamily="Arial"
FontSize="16"
Height="30"
Width="50"
VerticalContentAlignment="Center"
HorizontalAlignment="Left"
Background="LightGray"/>
</WrapPanel>
<TextBlock Text="{Binding ErrorMessage}" <TextBlock Text="{Binding ErrorMessage}"
Grid.Row="7" Grid.Row="7"

View File

@@ -137,7 +137,7 @@
</Image> </Image>
</WrapPanel> </WrapPanel>
<WrapPanel Margin="10" HorizontalAlignment="Center"> <WrapPanel Margin="5" HorizontalAlignment="Center">
<TextBlock Text="{Binding StartDate}" <TextBlock Text="{Binding StartDate}"
TextAlignment="Center" TextAlignment="Center"
FontFamily="Arial" FontFamily="Arial"
@@ -198,7 +198,7 @@
FontWeight="Bold" FontWeight="Bold"
FontSize="14" FontSize="14"
Foreground="#0000a0" Foreground="#0000a0"
Margin="10"> Margin="5">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/> <Setter Property="Visibility" Value="Hidden"/>
@@ -216,7 +216,7 @@
FontWeight="Bold" FontWeight="Bold"
FontSize="14" FontSize="14"
Foreground="#0000a0" Foreground="#0000a0"
Margin="10"> Margin="5">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/> <Setter Property="Visibility" Value="Hidden"/>
@@ -233,7 +233,43 @@
FontWeight="Bold" FontWeight="Bold"
FontSize="14" FontSize="14"
Foreground="#0000a0" Foreground="#0000a0"
Margin="10"> Margin="5">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</WrapPanel>
<WrapPanel HorizontalAlignment="Center">
<TextBlock Text="Anzahl der Scheiben:"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="5">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="{Binding Targets}"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="5">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/> <Setter Property="Visibility" Value="Hidden"/>
@@ -247,11 +283,49 @@
</TextBlock> </TextBlock>
</WrapPanel> </WrapPanel>
<Button <Button
Content="Turnier öffnen" Content="Turnier vorbereiten"
FontSize="16" FontSize="14"
Height="40" Height="35"
Width="150" Width="150"
Margin="20" Margin="10"
Cursor="Hand"
Command="{Binding NavigateTournamentDetailsCommand}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource ModernButton}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button
Content="Turnier durchführen"
FontSize="14"
Height="35"
Width="150"
Margin="10"
Cursor="Hand"
Command="{Binding NavigateNavBarCommand}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource ModernButton}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button
Content="Turnier abschließen"
FontSize="14"
Height="35"
Width="150"
Margin="10"
Cursor="Hand" Cursor="Hand"
Command="{Binding NavigateNavBarCommand}"> Command="{Binding NavigateNavBarCommand}">
<Button.Style> <Button.Style>

View File

@@ -18,6 +18,7 @@
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}"/> <DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}"/>
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" /> <DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" />
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}"/> <DataGridTextColumn Header="Bundesland" Binding="{Binding Country}"/>
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>