From 63588ee55735a759f7ad33e4fcb44d2c0ff1d55d Mon Sep 17 00:00:00 2001 From: Anastasia Date: Tue, 4 Apr 2023 20:57:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20DataModels=20=D0=B8=20Contracts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hospital/Hospital.sln | 14 +++++++- .../BindingModels/DiseaseBindingModel.cs | 20 +++++++++++ .../BindingModels/DoctorBindingModel.cs | 20 +++++++++++ .../BindingModels/MedicineBindingModel.cs | 18 ++++++++++ .../BindingModels/PatientBindingModel.cs | 28 ++++++++++++++++ .../BindingModels/ProcedureBindingModel.cs | 18 ++++++++++ .../BindingModels/RecipeBindingModel.cs | 22 +++++++++++++ .../BusinessLogicsContracts/IDiseaseLogic.cs | 24 ++++++++++++++ .../BusinessLogicsContracts/IDoctorLogic.cs | 24 ++++++++++++++ .../BusinessLogicsContracts/IMedicineLogic.cs | 24 ++++++++++++++ .../BusinessLogicsContracts/IPatientLogic.cs | 24 ++++++++++++++ .../IProcedureLogic.cs | 24 ++++++++++++++ .../BusinessLogicsContracts/IRecipeLogic.cs | 24 ++++++++++++++ .../HospitalContracts.csproj | 13 ++++++++ .../SearchModels/DiseaseSearchModel.cs | 15 +++++++++ .../SearchModels/DoctorSearchModel.cs | 19 +++++++++++ .../SearchModels/MedicineSearchModel.cs | 15 +++++++++ .../SearchModels/PatientSearchModel.cs | 19 +++++++++++ .../SearchModels/ProcedureSearchModel.cs | 15 +++++++++ .../SearchModels/RecipeSearchModel.cs | 13 ++++++++ .../StoragesContracts/IDiseaseStorage.cs | 26 +++++++++++++++ .../StoragesContracts/IDoctorStorage.cs | 26 +++++++++++++++ .../StoragesContracts/IMedicineStorage.cs | 26 +++++++++++++++ .../StoragesContracts/IPatientStorage.cs | 26 +++++++++++++++ .../StoragesContracts/IProcedureStorage.cs | 26 +++++++++++++++ .../StoragesContracts/IRecipeStorage.cs | 26 +++++++++++++++ .../ViewModels/DiseaseViewModel.cs | 23 +++++++++++++ .../ViewModels/DoctorViewModel.cs | 24 ++++++++++++++ .../ViewModels/MedicineViewModel.cs | 21 ++++++++++++ .../ViewModels/PatientViewModel.cs | 33 +++++++++++++++++++ .../ViewModels/ProcedureViewModel.cs | 20 +++++++++++ .../ViewModels/RecipeViewModel.cs | 25 ++++++++++++++ .../HospitalDataModels.csproj | 9 +++++ Hospital/HospitalDataModels/IId.cs | 13 ++++++++ .../Models/IDiseaseModel.cs | 17 ++++++++++ .../HospitalDataModels/Models/IDoctorModel.cs | 17 ++++++++++ .../Models/IMedicineModel.cs | 15 +++++++++ .../Models/IPatientModel.cs | 25 ++++++++++++++ .../Models/IProcedureModel.cs | 15 +++++++++ .../HospitalDataModels/Models/IRecipeModel.cs | 20 +++++++++++ 40 files changed, 825 insertions(+), 1 deletion(-) create mode 100644 Hospital/HospitalContracts/BindingModels/DiseaseBindingModel.cs create mode 100644 Hospital/HospitalContracts/BindingModels/DoctorBindingModel.cs create mode 100644 Hospital/HospitalContracts/BindingModels/MedicineBindingModel.cs create mode 100644 Hospital/HospitalContracts/BindingModels/PatientBindingModel.cs create mode 100644 Hospital/HospitalContracts/BindingModels/ProcedureBindingModel.cs create mode 100644 Hospital/HospitalContracts/BindingModels/RecipeBindingModel.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IDiseaseLogic.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IDoctorLogic.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IMedicineLogic.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IPatientLogic.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IProcedureLogic.cs create mode 100644 Hospital/HospitalContracts/BusinessLogicsContracts/IRecipeLogic.cs create mode 100644 Hospital/HospitalContracts/HospitalContracts.csproj create mode 100644 Hospital/HospitalContracts/SearchModels/DiseaseSearchModel.cs create mode 100644 Hospital/HospitalContracts/SearchModels/DoctorSearchModel.cs create mode 100644 Hospital/HospitalContracts/SearchModels/MedicineSearchModel.cs create mode 100644 Hospital/HospitalContracts/SearchModels/PatientSearchModel.cs create mode 100644 Hospital/HospitalContracts/SearchModels/ProcedureSearchModel.cs create mode 100644 Hospital/HospitalContracts/SearchModels/RecipeSearchModel.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IDiseaseStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IDoctorStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IMedicineStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IPatientStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IRecipeStorage.cs create mode 100644 Hospital/HospitalContracts/ViewModels/DiseaseViewModel.cs create mode 100644 Hospital/HospitalContracts/ViewModels/DoctorViewModel.cs create mode 100644 Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs create mode 100644 Hospital/HospitalContracts/ViewModels/PatientViewModel.cs create mode 100644 Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs create mode 100644 Hospital/HospitalContracts/ViewModels/RecipeViewModel.cs create mode 100644 Hospital/HospitalDataModels/HospitalDataModels.csproj create mode 100644 Hospital/HospitalDataModels/IId.cs create mode 100644 Hospital/HospitalDataModels/Models/IDiseaseModel.cs create mode 100644 Hospital/HospitalDataModels/Models/IDoctorModel.cs create mode 100644 Hospital/HospitalDataModels/Models/IMedicineModel.cs create mode 100644 Hospital/HospitalDataModels/Models/IPatientModel.cs create mode 100644 Hospital/HospitalDataModels/Models/IProcedureModel.cs create mode 100644 Hospital/HospitalDataModels/Models/IRecipeModel.cs diff --git a/Hospital/Hospital.sln b/Hospital/Hospital.sln index 690b598..4115a32 100644 --- a/Hospital/Hospital.sln +++ b/Hospital/Hospital.sln @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32819.101 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hospital", "Hospital\Hospital.csproj", "{AFB79BC5-47CC-4DC9-B090-2190ECC6165E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hospital", "Hospital\Hospital.csproj", "{AFB79BC5-47CC-4DC9-B090-2190ECC6165E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HospitalDataModels", "HospitalDataModels\HospitalDataModels.csproj", "{84B572A0-F8F5-40D2-9D9E-ACAEC7A91859}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HospitalContracts", "HospitalContracts\HospitalContracts.csproj", "{0A3FDB59-29E9-459A-8D17-62CA88D1C56E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +19,14 @@ Global {AFB79BC5-47CC-4DC9-B090-2190ECC6165E}.Debug|Any CPU.Build.0 = Debug|Any CPU {AFB79BC5-47CC-4DC9-B090-2190ECC6165E}.Release|Any CPU.ActiveCfg = Release|Any CPU {AFB79BC5-47CC-4DC9-B090-2190ECC6165E}.Release|Any CPU.Build.0 = Release|Any CPU + {84B572A0-F8F5-40D2-9D9E-ACAEC7A91859}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84B572A0-F8F5-40D2-9D9E-ACAEC7A91859}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84B572A0-F8F5-40D2-9D9E-ACAEC7A91859}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84B572A0-F8F5-40D2-9D9E-ACAEC7A91859}.Release|Any CPU.Build.0 = Release|Any CPU + {0A3FDB59-29E9-459A-8D17-62CA88D1C56E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A3FDB59-29E9-459A-8D17-62CA88D1C56E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A3FDB59-29E9-459A-8D17-62CA88D1C56E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A3FDB59-29E9-459A-8D17-62CA88D1C56E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Hospital/HospitalContracts/BindingModels/DiseaseBindingModel.cs b/Hospital/HospitalContracts/BindingModels/DiseaseBindingModel.cs new file mode 100644 index 0000000..ea7b62a --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/DiseaseBindingModel.cs @@ -0,0 +1,20 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class DiseaseBindingModel : IDiseaseModel + { + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Symptoms { get; set; } = string.Empty; + + public int DoctorId { get; set; } + } +} diff --git a/Hospital/HospitalContracts/BindingModels/DoctorBindingModel.cs b/Hospital/HospitalContracts/BindingModels/DoctorBindingModel.cs new file mode 100644 index 0000000..e9bb90e --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/DoctorBindingModel.cs @@ -0,0 +1,20 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class DoctorBindingModel : IDoctorModel + { + public int Id { get; set; } + + public string Login { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + } +} diff --git a/Hospital/HospitalContracts/BindingModels/MedicineBindingModel.cs b/Hospital/HospitalContracts/BindingModels/MedicineBindingModel.cs new file mode 100644 index 0000000..5be8458 --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/MedicineBindingModel.cs @@ -0,0 +1,18 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class MedicineBindingModel : IMedicineModel + { + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Form { get; set; } = string.Empty; + } +} diff --git a/Hospital/HospitalContracts/BindingModels/PatientBindingModel.cs b/Hospital/HospitalContracts/BindingModels/PatientBindingModel.cs new file mode 100644 index 0000000..44ce43c --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/PatientBindingModel.cs @@ -0,0 +1,28 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class PatientBindingModel : IPatientModel + { + public int Id { get; set; } + + public string Surname { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string Patronymic { get; set; } = string.Empty; + + public int Age { get; set; } + + public int DoctorId { get; set; } + + public Dictionary PatientProcedures { get; set; } = new(); + + public Dictionary PatientRecipes { get; set; } = new(); + } +} diff --git a/Hospital/HospitalContracts/BindingModels/ProcedureBindingModel.cs b/Hospital/HospitalContracts/BindingModels/ProcedureBindingModel.cs new file mode 100644 index 0000000..ac48f71 --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/ProcedureBindingModel.cs @@ -0,0 +1,18 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class ProcedureBindingModel : IProcedureModel + { + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public Dictionary ProcedureMedicines { get; set; } = new(); + } +} diff --git a/Hospital/HospitalContracts/BindingModels/RecipeBindingModel.cs b/Hospital/HospitalContracts/BindingModels/RecipeBindingModel.cs new file mode 100644 index 0000000..c1007da --- /dev/null +++ b/Hospital/HospitalContracts/BindingModels/RecipeBindingModel.cs @@ -0,0 +1,22 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BindingModels +{ + public class RecipeBindingModel : IRecipeModel + { + public int Id { get; set; } + + public DateTime IssueDate { get; set; } = DateTime.Now; + + public int DiseaseId { get; set; } + + public int DoctorId { get; set; } + + public Dictionary RecipeMedicines { get; set; } = new(); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IDiseaseLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IDiseaseLogic.cs new file mode 100644 index 0000000..0f98afe --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IDiseaseLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IDiseaseLogic + { + List? ReadList(DiseaseSearchModel? model); + + DiseaseViewModel? ReadElement(DiseaseSearchModel model); + + bool Create(DiseaseBindingModel model); + + bool Update(DiseaseBindingModel model); + + bool Delete(DiseaseBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IDoctorLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IDoctorLogic.cs new file mode 100644 index 0000000..434a758 --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IDoctorLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IDoctorLogic + { + List? ReadList(DoctorSearchModel? model); + + DoctorViewModel? ReadElement(DoctorSearchModel model); + + bool Create(DoctorBindingModel model); + + bool Update(DoctorBindingModel model); + + bool Delete(DoctorBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IMedicineLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IMedicineLogic.cs new file mode 100644 index 0000000..84716aa --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IMedicineLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IMedicineLogic + { + List? ReadList(MedicineSearchModel? model); + + MedicineViewModel? ReadElement(MedicineSearchModel model); + + bool Create(MedicineBindingModel model); + + bool Update(MedicineBindingModel model); + + bool Delete(MedicineBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IPatientLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IPatientLogic.cs new file mode 100644 index 0000000..115a04f --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IPatientLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IPatientLogic + { + List? ReadList(PatientSearchModel? model); + + PatientViewModel? ReadElement(PatientSearchModel model); + + bool Create(PatientBindingModel model); + + bool Update(PatientBindingModel model); + + bool Delete(PatientBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IProcedureLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IProcedureLogic.cs new file mode 100644 index 0000000..6d313d7 --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IProcedureLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IProcedureLogic + { + List? ReadList(ProcedureSearchModel? model); + + ProcedureViewModel? ReadElement(ProcedureSearchModel model); + + bool Create(ProcedureBindingModel model); + + bool Update(ProcedureBindingModel model); + + bool Delete(ProcedureBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/BusinessLogicsContracts/IRecipeLogic.cs b/Hospital/HospitalContracts/BusinessLogicsContracts/IRecipeLogic.cs new file mode 100644 index 0000000..1cdd842 --- /dev/null +++ b/Hospital/HospitalContracts/BusinessLogicsContracts/IRecipeLogic.cs @@ -0,0 +1,24 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.BusinessLogicsContracts +{ + public interface IRecipeLogic + { + List? ReadList(RecipeSearchModel? model); + + RecipeViewModel? ReadElement(RecipeSearchModel model); + + bool Create(RecipeBindingModel model); + + bool Update(RecipeBindingModel model); + + bool Delete(RecipeBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/HospitalContracts.csproj b/Hospital/HospitalContracts/HospitalContracts.csproj new file mode 100644 index 0000000..a2f8c75 --- /dev/null +++ b/Hospital/HospitalContracts/HospitalContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/Hospital/HospitalContracts/SearchModels/DiseaseSearchModel.cs b/Hospital/HospitalContracts/SearchModels/DiseaseSearchModel.cs new file mode 100644 index 0000000..107d58e --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/DiseaseSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class DiseaseSearchModel + { + public int? Id { get; set; } + + public string? Name { get; set; } + } +} diff --git a/Hospital/HospitalContracts/SearchModels/DoctorSearchModel.cs b/Hospital/HospitalContracts/SearchModels/DoctorSearchModel.cs new file mode 100644 index 0000000..1795991 --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/DoctorSearchModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class DoctorSearchModel + { + public int? Id { get; set; } + + public string? Login { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Password { get; set; } + } +} diff --git a/Hospital/HospitalContracts/SearchModels/MedicineSearchModel.cs b/Hospital/HospitalContracts/SearchModels/MedicineSearchModel.cs new file mode 100644 index 0000000..5c79744 --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/MedicineSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class MedicineSearchModel + { + public int? Id { get; set; } + + public string? Name { get; set; } + } +} diff --git a/Hospital/HospitalContracts/SearchModels/PatientSearchModel.cs b/Hospital/HospitalContracts/SearchModels/PatientSearchModel.cs new file mode 100644 index 0000000..c8e2df4 --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/PatientSearchModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class PatientSearchModel + { + public int? Id { get; set; } + + public string? Surname { get; set; } + + public string? Name { get; set; } + + public string? Patronymic { get; set; } + } +} diff --git a/Hospital/HospitalContracts/SearchModels/ProcedureSearchModel.cs b/Hospital/HospitalContracts/SearchModels/ProcedureSearchModel.cs new file mode 100644 index 0000000..560a807 --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/ProcedureSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class ProcedureSearchModel + { + public int? Id { get; set; } + + public string? Name { get; set; } + } +} diff --git a/Hospital/HospitalContracts/SearchModels/RecipeSearchModel.cs b/Hospital/HospitalContracts/SearchModels/RecipeSearchModel.cs new file mode 100644 index 0000000..1a2f290 --- /dev/null +++ b/Hospital/HospitalContracts/SearchModels/RecipeSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.SearchModels +{ + public class RecipeSearchModel + { + public int? Id { get; set; } + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IDiseaseStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IDiseaseStorage.cs new file mode 100644 index 0000000..448768f --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IDiseaseStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IDiseaseStorage + { + List GetFullList(); + + List GetFilteredList(DiseaseSearchModel model); + + DiseaseViewModel? GetElement(DiseaseSearchModel model); + + DiseaseViewModel? Insert(DiseaseBindingModel model); + + DiseaseViewModel? Update(DiseaseBindingModel model); + + DiseaseViewModel? Delete(DiseaseBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IDoctorStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IDoctorStorage.cs new file mode 100644 index 0000000..4a5494a --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IDoctorStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IDoctorStorage + { + List GetFullList(); + + List GetFilteredList(DoctorSearchModel model); + + DoctorViewModel? GetElement(DoctorSearchModel model); + + DoctorViewModel? Insert(DoctorBindingModel model); + + DoctorViewModel? Update(DoctorBindingModel model); + + DoctorViewModel? Delete(DoctorBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IMedicineStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IMedicineStorage.cs new file mode 100644 index 0000000..4cc6458 --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IMedicineStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IMedicineStorage + { + List GetFullList(); + + List GetFilteredList(MedicineSearchModel model); + + MedicineViewModel? GetElement(MedicineSearchModel model); + + MedicineViewModel? Insert(MedicineBindingModel model); + + MedicineViewModel? Update(MedicineBindingModel model); + + MedicineViewModel? Delete(MedicineBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IPatientStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IPatientStorage.cs new file mode 100644 index 0000000..a003172 --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IPatientStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IPatientStorage + { + List GetFullList(); + + List GetFilteredList(PatientSearchModel model); + + PatientViewModel? GetElement(PatientSearchModel model); + + PatientViewModel? Insert(PatientBindingModel model); + + PatientViewModel? Update(PatientBindingModel model); + + PatientViewModel? Delete(PatientBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs new file mode 100644 index 0000000..f51b820 --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IProcedureStorage + { + List GetFullList(); + + List GetFilteredList(ProcedureSearchModel model); + + ProcedureViewModel? GetElement(ProcedureSearchModel model); + + ProcedureViewModel? Insert(ProcedureBindingModel model); + + ProcedureViewModel? Update(ProcedureBindingModel model); + + ProcedureViewModel? Delete(ProcedureBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IRecipeStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IRecipeStorage.cs new file mode 100644 index 0000000..f8ac72b --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IRecipeStorage.cs @@ -0,0 +1,26 @@ +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.StoragesContracts +{ + public interface IRecipeStorage + { + List GetFullList(); + + List GetFilteredList(RecipeSearchModel model); + + RecipeViewModel? GetElement(RecipeSearchModel model); + + RecipeViewModel? Insert(RecipeBindingModel model); + + RecipeViewModel? Update(RecipeBindingModel model); + + RecipeViewModel? Delete(RecipeBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/ViewModels/DiseaseViewModel.cs b/Hospital/HospitalContracts/ViewModels/DiseaseViewModel.cs new file mode 100644 index 0000000..9f2539c --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/DiseaseViewModel.cs @@ -0,0 +1,23 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class DiseaseViewModel : IDiseaseModel + { + public int Id { get; set; } + + [DisplayName("Название болезни")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Симптомы болезни")] + public string Symptoms { get; set; } = string.Empty; + + public int DoctorId { get; set; } + } +} diff --git a/Hospital/HospitalContracts/ViewModels/DoctorViewModel.cs b/Hospital/HospitalContracts/ViewModels/DoctorViewModel.cs new file mode 100644 index 0000000..dff34d5 --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/DoctorViewModel.cs @@ -0,0 +1,24 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class DoctorViewModel : IDoctorModel + { + public int Id { get; set; } + + [DisplayName("Логин врача")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Номер телефона врача")] + public string PhoneNumber { get; set; } = string.Empty; + + [DisplayName("Пароль врача")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs b/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs new file mode 100644 index 0000000..0aadfff --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs @@ -0,0 +1,21 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class MedicineViewModel : IMedicineModel + { + public int Id { get; set; } + + [DisplayName("Название лекарства")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Форма выпуска лекарства")] + public string Form { get; set; } = string.Empty; + } +} diff --git a/Hospital/HospitalContracts/ViewModels/PatientViewModel.cs b/Hospital/HospitalContracts/ViewModels/PatientViewModel.cs new file mode 100644 index 0000000..c2eb9cb --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/PatientViewModel.cs @@ -0,0 +1,33 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class PatientViewModel : IPatientModel + { + public int Id { get; set; } + + [DisplayName("Фамилия пациента")] + public string Surname { get; set; } = string.Empty; + + [DisplayName("Имя пациента")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Отчество пациента")] + public string Patronymic { get; set; } = string.Empty; + + [DisplayName("Возраст пациента")] + public int Age { get; set; } + + public int DoctorId { get; set; } + + public Dictionary PatientProcedures { get; set; } = new(); + + public Dictionary PatientRecipes { get; set; } = new(); + } +} diff --git a/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs b/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs new file mode 100644 index 0000000..09ebb44 --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs @@ -0,0 +1,20 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class ProcedureViewModel : IProcedureModel + { + public int Id { get; set; } + + [DisplayName("Название процедуры")] + public string Name { get; set; } = string.Empty; + + public Dictionary ProcedureMedicines { get; set; } = new(); + } +} diff --git a/Hospital/HospitalContracts/ViewModels/RecipeViewModel.cs b/Hospital/HospitalContracts/ViewModels/RecipeViewModel.cs new file mode 100644 index 0000000..035fe31 --- /dev/null +++ b/Hospital/HospitalContracts/ViewModels/RecipeViewModel.cs @@ -0,0 +1,25 @@ +using HospitalDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalContracts.ViewModels +{ + public class RecipeViewModel : IRecipeModel + { + [DisplayName("Номер рецепта")] + public int Id { get; set; } + + [DisplayName("Дата выдачи")] + public DateTime IssueDate { get; set; } = DateTime.Now; + + public int DiseaseId { get; set; } + + public int DoctorId { get; set; } + + public Dictionary RecipeMedicines { get; set; } = new(); + } +} diff --git a/Hospital/HospitalDataModels/HospitalDataModels.csproj b/Hospital/HospitalDataModels/HospitalDataModels.csproj new file mode 100644 index 0000000..27ac386 --- /dev/null +++ b/Hospital/HospitalDataModels/HospitalDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/Hospital/HospitalDataModels/IId.cs b/Hospital/HospitalDataModels/IId.cs new file mode 100644 index 0000000..31b3723 --- /dev/null +++ b/Hospital/HospitalDataModels/IId.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels +{ + public interface IId + { + int Id { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IDiseaseModel.cs b/Hospital/HospitalDataModels/Models/IDiseaseModel.cs new file mode 100644 index 0000000..019625d --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IDiseaseModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IDiseaseModel : IId + { + string Name { get; } + + string Symptoms { get; } + + int DoctorId { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IDoctorModel.cs b/Hospital/HospitalDataModels/Models/IDoctorModel.cs new file mode 100644 index 0000000..3bf26da --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IDoctorModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IDoctorModel : IId + { + string Login { get; } + + string PhoneNumber { get; } + + string Password { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IMedicineModel.cs b/Hospital/HospitalDataModels/Models/IMedicineModel.cs new file mode 100644 index 0000000..15c07f7 --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IMedicineModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IMedicineModel : IId + { + string Name { get; } + + string Form { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IPatientModel.cs b/Hospital/HospitalDataModels/Models/IPatientModel.cs new file mode 100644 index 0000000..8258569 --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IPatientModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IPatientModel : IId + { + string Surname { get; } + + string Name { get; } + + string Patronymic { get; } + + int Age { get; } + + int DoctorId { get; } + + Dictionary PatientProcedures { get; } + + Dictionary PatientRecipes { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IProcedureModel.cs b/Hospital/HospitalDataModels/Models/IProcedureModel.cs new file mode 100644 index 0000000..03a05f5 --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IProcedureModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IProcedureModel : IId + { + string Name { get; } + + Dictionary ProcedureMedicines { get; } + } +} diff --git a/Hospital/HospitalDataModels/Models/IRecipeModel.cs b/Hospital/HospitalDataModels/Models/IRecipeModel.cs new file mode 100644 index 0000000..b026910 --- /dev/null +++ b/Hospital/HospitalDataModels/Models/IRecipeModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HospitalDataModels.Models +{ + public interface IRecipeModel : IId + { + DateTime IssueDate { get; } + + int DiseaseId { get; } + + int DoctorId { get; } + + Dictionary RecipeMedicines { get; } + + } +}