From 8745ef65a8267edae192ac75ff2bee1b81c51b2f Mon Sep 17 00:00:00 2001 From: Alenka Date: Sat, 27 Apr 2024 16:37:42 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=B0=D0=B6=D0=B5=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D0=B2=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IDescriptionProcedureStorege.cs | 21 +++++++++++++++++++ .../StoragesContracts/IPharmacistStorage.cs | 21 +++++++++++++++++++ .../StoragesContracts/IProcedureStorage.cs | 21 +++++++++++++++++++ .../DescriptionProcedureViewModel.cs | 10 ++++++++- .../ViewModels/MedicineViewModel.cs | 16 +++++++++++++- .../ViewModels/PharmacistViewModel.cs | 15 +++++++++++-- .../ViewModels/ProcedureViewModel.cs | 18 ++++++++++++++-- .../Models/IDescriptionProcedureModel.cs | 2 +- 8 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 Hospital/HospitalContracts/StoragesContracts/IDescriptionProcedureStorege.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IPharmacistStorage.cs create mode 100644 Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs diff --git a/Hospital/HospitalContracts/StoragesContracts/IDescriptionProcedureStorege.cs b/Hospital/HospitalContracts/StoragesContracts/IDescriptionProcedureStorege.cs new file mode 100644 index 0000000..bc91173 --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IDescriptionProcedureStorege.cs @@ -0,0 +1,21 @@ +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 IDescriptionProcedureStorege + { + List GetFullList(); + List GetFilteredList(DescriptionProcedureSearchModel model); + DescriptionProcedureViewModel? GetElement(DescriptionProcedureSearchModel model); + DescriptionProcedureViewModel? Insert(DescriptionProcedureBindingModel model); + DescriptionProcedureViewModel? Update(DescriptionProcedureBindingModel model); + DescriptionProcedureViewModel? Delete(DescriptionProcedureBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IPharmacistStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IPharmacistStorage.cs new file mode 100644 index 0000000..8d96aea --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IPharmacistStorage.cs @@ -0,0 +1,21 @@ +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 IPharmacistStorage + { + List GetFullList(); + List GetFilteredList(PharmacistSearchModel model); + PharmacistViewModel? GetElement(PharmacistSearchModel model); + PharmacistViewModel? Insert(PharmacistBindingModel model); + PharmacistViewModel? Update(PharmacistBindingModel model); + PharmacistViewModel? Delete(PharmacistBindingModel model); + } +} diff --git a/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs b/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs new file mode 100644 index 0000000..cce5954 --- /dev/null +++ b/Hospital/HospitalContracts/StoragesContracts/IProcedureStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HospitalContracts.BindingModels; +using HospitalContracts.SearchModels; +using HospitalContracts.ViewModels; + +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/ViewModels/DescriptionProcedureViewModel.cs b/Hospital/HospitalContracts/ViewModels/DescriptionProcedureViewModel.cs index 621ff45..0bb1923 100644 --- a/Hospital/HospitalContracts/ViewModels/DescriptionProcedureViewModel.cs +++ b/Hospital/HospitalContracts/ViewModels/DescriptionProcedureViewModel.cs @@ -1,12 +1,20 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using HospitalDataModels.Models; namespace HospitalContracts.ViewModels { - public class DescriptionProcedureViewModel + public class DescriptionProcedureViewModel : IDescriptionProcedureModel { + public int Id { get; set; } + [DisplayName("Описание процедупы")] + public string Description { get; set; } = string.Empty; + + [DisplayName("Фармацевт")] + public int PharmacistId { get; set; } } } diff --git a/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs b/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs index 9ab17f5..ff90dac 100644 --- a/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs +++ b/Hospital/HospitalContracts/ViewModels/MedicineViewModel.cs @@ -1,12 +1,26 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using HospitalDataModels.Models; namespace HospitalContracts.ViewModels { - public class MedicineViewModel + public class MedicineViewModel : IMedicineModel { + public int Id { get; set; } + [DisplayName("Название лекарства")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цена лекарства")] + public double Price { get; set; } + [DisplayName("Страна производителя")] + public string CountryOrigin { get; set; } = string.Empty; + + [DisplayName("Фармацевт")] + public int PharmacistId { get; set; } + public Dictionary MedicineProcedures { get; set; } = new(); + public Dictionary MedicineRecipes { get; set; } = new(); } } diff --git a/Hospital/HospitalContracts/ViewModels/PharmacistViewModel.cs b/Hospital/HospitalContracts/ViewModels/PharmacistViewModel.cs index 92156f5..b59b579 100644 --- a/Hospital/HospitalContracts/ViewModels/PharmacistViewModel.cs +++ b/Hospital/HospitalContracts/ViewModels/PharmacistViewModel.cs @@ -1,12 +1,23 @@ -using System; +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 PharmacistViewModel + public class PharmacistViewModel : IPharmacistModel { + public int Id { get; set; } + [DisplayName("ФИО кладовщика")] + public string FIO { get; set; } = string.Empty; + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + [DisplayName("Номер телефона")] + public string PhoneNumber { get; set; } = string.Empty; } } diff --git a/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs b/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs index 0aeaf70..132b6cc 100644 --- a/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs +++ b/Hospital/HospitalContracts/ViewModels/ProcedureViewModel.cs @@ -1,12 +1,26 @@ -using System; +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 + public class ProcedureViewModel : IProcedureModel { + public int Id { get; set; } + [DisplayName("Название услуги")] + public string Name { get; set; } = string.Empty; + [DisplayName("Дата процедуры")] + public DateTime Date { get; set; } + [DisplayName("Фармацевт")] + //public string PharmacistFIO { get; set; } = string.Empty; + public int PharmacistId { get; set; } + [DisplayName("Описание процедуры")] + public int DescriptionOfTheProcedureId { get; set; } + public Dictionary MedicineProcedures { get; set; } = new(); + public Dictionary PatientProcedures { get; set; } = new(); } } diff --git a/Hospital/HospitalDataModels/Models/IDescriptionProcedureModel.cs b/Hospital/HospitalDataModels/Models/IDescriptionProcedureModel.cs index 85df7a2..f22ced5 100644 --- a/Hospital/HospitalDataModels/Models/IDescriptionProcedureModel.cs +++ b/Hospital/HospitalDataModels/Models/IDescriptionProcedureModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace HospitalDataModels.Models { - internal interface IDescriptionProcedureModel + public interface IDescriptionProcedureModel { string Description { get; } int PharmacistId { get; }