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) + { + + } +}