From 9dd158bd4c4003835e71988bb47dd6961dc8f919 Mon Sep 17 00:00:00 2001 From: repka228 <54245562+repka228@users.noreply.github.com> Date: Mon, 11 Nov 2024 07:13:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5?= =?UTF-8?q?=D0=B9=D1=81=D1=8B=20=D1=80=D0=B5=D0=BF=D0=BE=D0=B7=D0=B8=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B5=D0=B2,=20=D1=80=D0=B5=D0=BF=D0=BE?= =?UTF-8?q?=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B8=20unity=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rm1.Designer.cs => FormRacing.Designer.cs} | 2 +- ProjectRacing/{Form1.cs => FormRacing.cs} | 4 +-- ProjectRacing/{Form1.resx => FormRacing.resx} | 0 ProjectRacing/Program.cs | 17 ++++++++++- ProjectRacing/ProjectRacing.csproj | 4 +++ .../Repositories/ICompetitionsRepository.cs | 11 +++++++ .../Repositories/IHorseRepository.cs | 10 +++++++ .../Repositories/IJockeyRepository.cs | 11 +++++++ .../Repositories/IOwnerRepository.cs | 11 +++++++ .../Repositories/IParticipantsRepository.cs | 11 +++++++ .../Implementations/CompetitionsRepository.cs | 29 +++++++++++++++++++ .../Implementations/HorseRepository.cs | 29 +++++++++++++++++++ .../Implementations/JockeyRepository.cs | 29 +++++++++++++++++++ .../Implementations/OwnerRepository.cs | 29 +++++++++++++++++++ .../Implementations/ParticipantsRepository.cs | 29 +++++++++++++++++++ 15 files changed, 222 insertions(+), 4 deletions(-) rename ProjectRacing/{Form1.Designer.cs => FormRacing.Designer.cs} (97%) rename ProjectRacing/{Form1.cs => FormRacing.cs} (57%) rename ProjectRacing/{Form1.resx => FormRacing.resx} (100%) create mode 100644 ProjectRacing/Repositories/ICompetitionsRepository.cs create mode 100644 ProjectRacing/Repositories/IHorseRepository.cs create mode 100644 ProjectRacing/Repositories/IJockeyRepository.cs create mode 100644 ProjectRacing/Repositories/IOwnerRepository.cs create mode 100644 ProjectRacing/Repositories/IParticipantsRepository.cs create mode 100644 ProjectRacing/Repositories/Implementations/CompetitionsRepository.cs create mode 100644 ProjectRacing/Repositories/Implementations/HorseRepository.cs create mode 100644 ProjectRacing/Repositories/Implementations/JockeyRepository.cs create mode 100644 ProjectRacing/Repositories/Implementations/OwnerRepository.cs create mode 100644 ProjectRacing/Repositories/Implementations/ParticipantsRepository.cs diff --git a/ProjectRacing/Form1.Designer.cs b/ProjectRacing/FormRacing.Designer.cs similarity index 97% rename from ProjectRacing/Form1.Designer.cs rename to ProjectRacing/FormRacing.Designer.cs index b4dc1fb..007ba7f 100644 --- a/ProjectRacing/Form1.Designer.cs +++ b/ProjectRacing/FormRacing.Designer.cs @@ -1,6 +1,6 @@ namespace ProjectRacing { - partial class Form1 + partial class FormRacing { /// /// Required designer variable. diff --git a/ProjectRacing/Form1.cs b/ProjectRacing/FormRacing.cs similarity index 57% rename from ProjectRacing/Form1.cs rename to ProjectRacing/FormRacing.cs index 69d8e66..ecdc79d 100644 --- a/ProjectRacing/Form1.cs +++ b/ProjectRacing/FormRacing.cs @@ -1,8 +1,8 @@ namespace ProjectRacing { - public partial class Form1 : Form + public partial class FormRacing : Form { - public Form1() + public FormRacing() { InitializeComponent(); } diff --git a/ProjectRacing/Form1.resx b/ProjectRacing/FormRacing.resx similarity index 100% rename from ProjectRacing/Form1.resx rename to ProjectRacing/FormRacing.resx diff --git a/ProjectRacing/Program.cs b/ProjectRacing/Program.cs index 69556ea..37944a8 100644 --- a/ProjectRacing/Program.cs +++ b/ProjectRacing/Program.cs @@ -1,3 +1,7 @@ +using ProjectRacing.Repositories; +using ProjectRacing.Repositories.Implementations; +using Unity; + namespace ProjectRacing { internal static class Program @@ -11,7 +15,18 @@ namespace ProjectRacing // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(CreateContainer().Resolve()); + } + + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + container.RegisterType(); + return container; } } } \ No newline at end of file diff --git a/ProjectRacing/ProjectRacing.csproj b/ProjectRacing/ProjectRacing.csproj index 663fdb8..894afcd 100644 --- a/ProjectRacing/ProjectRacing.csproj +++ b/ProjectRacing/ProjectRacing.csproj @@ -8,4 +8,8 @@ enable + + + + \ No newline at end of file diff --git a/ProjectRacing/Repositories/ICompetitionsRepository.cs b/ProjectRacing/Repositories/ICompetitionsRepository.cs new file mode 100644 index 0000000..63c55f9 --- /dev/null +++ b/ProjectRacing/Repositories/ICompetitionsRepository.cs @@ -0,0 +1,11 @@ +using ProjectRacing.Entities; + +namespace ProjectRacing.Repositories; +public interface ICompetitionsRepository +{ + IEnumerable GetCompetitionses(); + Competitions GetCompetitionsById(int id); + void CreateCompetitions(Competitions competitions); + void UpdateCompetitions(Competitions competitions); + void DeleteCompetitions(int id); +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/IHorseRepository.cs b/ProjectRacing/Repositories/IHorseRepository.cs new file mode 100644 index 0000000..d1c73e9 --- /dev/null +++ b/ProjectRacing/Repositories/IHorseRepository.cs @@ -0,0 +1,10 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories; +public interface IHorseRepository +{ + IEnumerable GetHorses(); + Horse GetHorseById(int id); + void CreateHorse(Horse horse); + void UpdateHorse(Horse horse); + void DeleteHorse(int id); +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/IJockeyRepository.cs b/ProjectRacing/Repositories/IJockeyRepository.cs new file mode 100644 index 0000000..45736ba --- /dev/null +++ b/ProjectRacing/Repositories/IJockeyRepository.cs @@ -0,0 +1,11 @@ +using ProjectRacing.Entities; + +namespace ProjectRacing.Repositories; +public interface IJockeyRepository +{ + IEnumerable GetJockeys(); + Jockey GetJockeyById(int id); + void CreateJockey(Jockey jockey); + void UpdateJockey(Jockey jockey); + void DeleteJockey(int id); +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/IOwnerRepository.cs b/ProjectRacing/Repositories/IOwnerRepository.cs new file mode 100644 index 0000000..a725a38 --- /dev/null +++ b/ProjectRacing/Repositories/IOwnerRepository.cs @@ -0,0 +1,11 @@ +using ProjectRacing.Entities; + +namespace ProjectRacing.Repositories; +public interface IOwnerRepository +{ + IEnumerable GetOwner(); + Owner GetOwnerById(int id); + void CreateOwner(Owner owner); + void UpdateOwner(Owner owner); + void DeleteOwner(int id); +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/IParticipantsRepository.cs b/ProjectRacing/Repositories/IParticipantsRepository.cs new file mode 100644 index 0000000..878db50 --- /dev/null +++ b/ProjectRacing/Repositories/IParticipantsRepository.cs @@ -0,0 +1,11 @@ +using ProjectRacing.Entities; + +namespace ProjectRacing.Repositories; +public interface IParticipantsRepository +{ + IEnumerable GetParticipants(); + Participants GetParticipantsById(int id); + void CreateParticipants(Participants participants); + void UpdateParticipants(Participants participants); + void DeleteParticipants(int id); +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/Implementations/CompetitionsRepository.cs b/ProjectRacing/Repositories/Implementations/CompetitionsRepository.cs new file mode 100644 index 0000000..8c0536f --- /dev/null +++ b/ProjectRacing/Repositories/Implementations/CompetitionsRepository.cs @@ -0,0 +1,29 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories.Implementations; +internal class CompetitionsRepository : ICompetitionsRepository +{ + public void CreateCompetitions(Competitions competitions) + { + + } + + public void DeleteCompetitions(int id) + { + + } + + public Competitions GetCompetitionsById(int id) + { + return Competitions.CreateEntity(0, new DateOnly(0001,1,1), string.Empty); + } + + public IEnumerable GetCompetitionses() + { + return []; + } + + public void UpdateCompetitions(Competitions competitions) + { + + } +} diff --git a/ProjectRacing/Repositories/Implementations/HorseRepository.cs b/ProjectRacing/Repositories/Implementations/HorseRepository.cs new file mode 100644 index 0000000..66dbbb8 --- /dev/null +++ b/ProjectRacing/Repositories/Implementations/HorseRepository.cs @@ -0,0 +1,29 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories.Implementations; +public class HorseRepository : IHorseRepository +{ + public void CreateHorse(Horse horse) + { + + } + + public void DeleteHorse(int id) + { + + } + + public Horse GetHorseById(int id) + { + return Horse.CreateEntity(0, string.Empty, true, new DateOnly(0001, 1, 1), 0); + } + + public IEnumerable GetHorses() + { + return []; + } + + public void UpdateHorse(Horse horse) + { + + } +} \ No newline at end of file diff --git a/ProjectRacing/Repositories/Implementations/JockeyRepository.cs b/ProjectRacing/Repositories/Implementations/JockeyRepository.cs new file mode 100644 index 0000000..6aec417 --- /dev/null +++ b/ProjectRacing/Repositories/Implementations/JockeyRepository.cs @@ -0,0 +1,29 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories.Implementations; +internal class JockeyRepository : IJockeyRepository +{ + public void CreateJockey(Jockey jockey) + { + + } + + public void DeleteJockey(int id) + { + + } + + public Jockey GetJockeyById(int id) + { + return Jockey.CreateEntity(0, string.Empty, 0, 0, string.Empty); + } + + public IEnumerable GetJockeys() + { + return []; + } + + public void UpdateJockey(Jockey jockey) + { + + } +} diff --git a/ProjectRacing/Repositories/Implementations/OwnerRepository.cs b/ProjectRacing/Repositories/Implementations/OwnerRepository.cs new file mode 100644 index 0000000..51c394e --- /dev/null +++ b/ProjectRacing/Repositories/Implementations/OwnerRepository.cs @@ -0,0 +1,29 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories.Implementations; +internal class OwnerRepository : IOwnerRepository +{ + public void CreateOwner(Owner owner) + { + + } + + public void DeleteOwner(int id) + { + + } + + public IEnumerable GetOwner() + { + return []; + } + + public Owner GetOwnerById(int id) + { + return Owner.CreateEntity(0, string.Empty, string.Empty); + } + + public void UpdateOwner(Owner owner) + { + + } +} diff --git a/ProjectRacing/Repositories/Implementations/ParticipantsRepository.cs b/ProjectRacing/Repositories/Implementations/ParticipantsRepository.cs new file mode 100644 index 0000000..a637e57 --- /dev/null +++ b/ProjectRacing/Repositories/Implementations/ParticipantsRepository.cs @@ -0,0 +1,29 @@ +using ProjectRacing.Entities; +namespace ProjectRacing.Repositories.Implementations; +internal class ParticipantsRepository : IParticipantsRepository +{ + public void CreateParticipants(Participants participants) + { + + } + + public void DeleteParticipants(int id) + { + + } + + public IEnumerable GetParticipants() + { + return []; + } + + public Participants GetParticipantsById(int id) + { + return Participants.CreateEntity(0, 0, 0, 0, TimeSpan.Zero, 0); + } + + public void UpdateParticipants(Participants participants) + { + + } +}