diff --git a/VeterinaryView/VeterinaryContracts/BindingModels/DoctorBindingModel.cs b/VeterinaryView/VeterinaryContracts/BindingModels/DoctorBindingModel.cs new file mode 100644 index 0000000..3817d54 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BindingModels/DoctorBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.BindingModels +{ + public class DoctorBindingModel : IDoctorModel + { + public int Id { get; set; } + public string DoctorFIO { get; set; } = string.Empty; + public string Login { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/VeterinaryView/VeterinaryContracts/BindingModels/DrugBindingModel.cs b/VeterinaryView/VeterinaryContracts/BindingModels/DrugBindingModel.cs new file mode 100644 index 0000000..6c6ac86 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BindingModels/DrugBindingModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.BindingModels +{ + public class DrugBindingModel : IDrugModel + { + public int Id { get; set; } + public string DrugName { get; set; } = string.Empty; + public int Count { get; set; } + public Dictionary DrugMedications + { + get; + set; + } = new(); + } +} diff --git a/VeterinaryView/VeterinaryContracts/BindingModels/MedicationBindingModel.cs b/VeterinaryView/VeterinaryContracts/BindingModels/MedicationBindingModel.cs new file mode 100644 index 0000000..ba71ea7 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BindingModels/MedicationBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.BindingModels +{ + public class MedicationBindingModel : IMedicationModel + { + public int Id { get; set; } + public string MedicationName { get; set; } = string.Empty; + public double Price { get; set; } + public int DoctorId { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryContracts/BindingModels/ServiceBindingModel.cs b/VeterinaryView/VeterinaryContracts/BindingModels/ServiceBindingModel.cs new file mode 100644 index 0000000..d52578b --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BindingModels/ServiceBindingModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.BindingModels +{ + public class ServiceBindingModel : IServiceModel + { + public int Id { get; set; } + public string ServiceName { get; set; } = string.Empty; + public int VisitId { get; set; } + public int DoctorId { get; set; } + public Dictionary ServiceMedications + { + get; + set; + } = new(); + } +} diff --git a/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDoctorLogic.cs b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDoctorLogic.cs new file mode 100644 index 0000000..a0b9aca --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDoctorLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.BusinessLogicContracts +{ + 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/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDrugLogic.cs b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDrugLogic.cs new file mode 100644 index 0000000..8a2b9fd --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IDrugLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.BusinessLogicContracts +{ + public interface IDrugLogic + { + List? ReadList(DrugSearchModel? model); + DrugViewModel? ReadElement(DrugSearchModel model); + bool Create(DrugBindingModel model); + bool Update(DrugBindingModel model); + bool Delete(DrugBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IMedicationLogic.cs b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IMedicationLogic.cs new file mode 100644 index 0000000..876128e --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IMedicationLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.BusinessLogicContracts +{ + public interface IMedicationLogic + { + List? ReadList(MedicationSearchModel? model); + MedicationViewModel? ReadElement(MedicationSearchModel model); + bool Create(MedicationBindingModel model); + bool Update(MedicationBindingModel model); + bool Delete(MedicationBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IServiceLogic.cs b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IServiceLogic.cs new file mode 100644 index 0000000..2a9f774 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/BusinessLogicContracts/IServiceLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.BusinessLogicContracts +{ + public interface IServiceLogic + { + List? ReadList(ServiceSearchModel? model); + ServiceViewModel? ReadElement(ServiceSearchModel model); + bool Create(ServiceBindingModel model); + bool Update(ServiceBindingModel model); + bool Delete(ServiceBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/SearchModels/DoctorSearchModel.cs b/VeterinaryView/VeterinaryContracts/SearchModels/DoctorSearchModel.cs new file mode 100644 index 0000000..04be6bf --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/SearchModels/DoctorSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.SearchModels +{ + public class DoctorSearchModel + { + public int? Id { get; set; } + public string? DoctorFIO { get; set; } + public string? Login { get; set; } + public string? Password { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryContracts/SearchModels/DrugSearchModel.cs b/VeterinaryView/VeterinaryContracts/SearchModels/DrugSearchModel.cs new file mode 100644 index 0000000..0f3dfa3 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/SearchModels/DrugSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.SearchModels +{ + public class DrugSearchModel + { + public int? Id { get; set; } + public string? DrugName { get; set; } + + } +} diff --git a/VeterinaryView/VeterinaryContracts/SearchModels/MedicationSearchModel.cs b/VeterinaryView/VeterinaryContracts/SearchModels/MedicationSearchModel.cs new file mode 100644 index 0000000..49bf4e4 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/SearchModels/MedicationSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.SearchModels +{ + public class MedicationSearchModel + { + public int? Id { get; set; } + public string? MedicationName { get; set; } + public int DoctorId { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryContracts/SearchModels/ServiceSearchModel.cs b/VeterinaryView/VeterinaryContracts/SearchModels/ServiceSearchModel.cs new file mode 100644 index 0000000..e4af795 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/SearchModels/ServiceSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.SearchModels +{ + public class ServiceSearchModel + { + public int? Id { get; set; } + public string? ServiceName { get; set; } + public int VisitId { get; set; } + public int DoctorId { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryContracts/StorageContracts/IDoctorStorage.cs b/VeterinaryView/VeterinaryContracts/StorageContracts/IDoctorStorage.cs new file mode 100644 index 0000000..bcff1f7 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/StorageContracts/IDoctorStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.StorageContracts +{ + 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/VeterinaryView/VeterinaryContracts/StorageContracts/IDrugStorage.cs b/VeterinaryView/VeterinaryContracts/StorageContracts/IDrugStorage.cs new file mode 100644 index 0000000..0f4f045 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/StorageContracts/IDrugStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.StorageContracts +{ + public interface IDrugStorage + { + List GetFullList(); + List GetFilteredList(DrugSearchModel model); + DrugViewModel? GetElement(DrugSearchModel model); + DrugViewModel? Insert(DrugBindingModel model); + DrugViewModel? Update(DrugBindingModel model); + DrugViewModel? Delete(DrugBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/StorageContracts/IMedicationStorage.cs b/VeterinaryView/VeterinaryContracts/StorageContracts/IMedicationStorage.cs new file mode 100644 index 0000000..9e213ed --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/StorageContracts/IMedicationStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.StorageContracts +{ + public interface IMedicationStorage + { + List GetFullList(); + List GetFilteredList(MedicationSearchModel model); + MedicationViewModel? GetElement(MedicationSearchModel model); + MedicationViewModel? Insert(MedicationBindingModel model); + MedicationViewModel? Update(MedicationBindingModel model); + MedicationViewModel? Delete(MedicationBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/StorageContracts/IServiceStorage.cs b/VeterinaryView/VeterinaryContracts/StorageContracts/IServiceStorage.cs new file mode 100644 index 0000000..ebfe28e --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/StorageContracts/IServiceStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryContracts.BindingModels; +using VeterinaryContracts.ViewModels; +using VeterinaryContracts.SearchModels; + +namespace VeterinaryContracts.StorageContracts +{ + public interface IServiceStorage + { + List GetFullList(); + List GetFilteredList(ServiceSearchModel model); + ServiceViewModel? GetElement(ServiceSearchModel model); + ServiceViewModel? Insert(ServiceBindingModel model); + ServiceViewModel? Update(ServiceBindingModel model); + ServiceViewModel? Delete(ServiceBindingModel model); + } +} diff --git a/VeterinaryView/VeterinaryContracts/VeterinaryContracts.csproj b/VeterinaryView/VeterinaryContracts/VeterinaryContracts.csproj index 80a6443..bb7c3dc 100644 --- a/VeterinaryView/VeterinaryContracts/VeterinaryContracts.csproj +++ b/VeterinaryView/VeterinaryContracts/VeterinaryContracts.csproj @@ -6,14 +6,6 @@ enable - - - - - - - - diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/DoctorViewModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/DoctorViewModel.cs new file mode 100644 index 0000000..5294a9e --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/DoctorViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.ViewModels +{ + public class DoctorViewModel : IDoctorModel + { + public int Id { get; set; } + [DisplayName("ФИО доктора")] + public string DoctorFIO { get; set; } = string.Empty; + [DisplayName("Логин (эл. почта) докотора")] + public string Login { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/DrugViewModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/DrugViewModel.cs new file mode 100644 index 0000000..3e5ad0d --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/DrugViewModel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.ViewModels +{ + public class DrugViewModel : IDrugModel + { + public int Id { get; set; } + [DisplayName("Название лекарства")] + public string DrugName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count { get; set; } + public Dictionary DrugMedications + { + get; + set; + } = new(); + } +} diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/MedicationViewModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/MedicationViewModel.cs new file mode 100644 index 0000000..37b54e8 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/MedicationViewModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.ViewModels +{ + public class MedicationViewModel : IMedicationModel + { + public int Id { get; set; } + [DisplayName("Название медикамента")] + public string MedicationName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Price { get; set; } + public int DoctorId { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/ServiceViewModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/ServiceViewModel.cs new file mode 100644 index 0000000..cb0c0c8 --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/ServiceViewModel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryDataModels; + +namespace VeterinaryContracts.ViewModels +{ + public class ServiceViewModel : IServiceModel + { + public int Id { get; set; } + [DisplayName("Название услуги")] + public string ServiceName { get; set; } = string.Empty; + public int VisitId { get; set; } + public int DoctorId { get; set; } + public Dictionary ServiceMedications + { + get; + set; + } = new(); + } +} diff --git a/VeterinaryView/VeterinaryDataModels/IDrugModel.cs b/VeterinaryView/VeterinaryDataModels/IDrugModel.cs index 27111b8..7206ae8 100644 --- a/VeterinaryView/VeterinaryDataModels/IDrugModel.cs +++ b/VeterinaryView/VeterinaryDataModels/IDrugModel.cs @@ -10,6 +10,6 @@ namespace VeterinaryDataModels { string DrugName { get; } int Count { get; } - int MedicationId { get; } + Dictionary DrugMedications { get; } } } diff --git a/VeterinaryView/VeterinaryDataModels/IServiceModel.cs b/VeterinaryView/VeterinaryDataModels/IServiceModel.cs index b71aa37..a54cf76 100644 --- a/VeterinaryView/VeterinaryDataModels/IServiceModel.cs +++ b/VeterinaryView/VeterinaryDataModels/IServiceModel.cs @@ -11,6 +11,7 @@ namespace VeterinaryDataModels String ServiceName { get;} int VisitId { get; } int DoctorId { get; } + Dictionary ServiceMedications { get; } } }