From 3f72f33cdfddb55870374c1da41a84ac29dfa89e Mon Sep 17 00:00:00 2001 From: gg12 darfren Date: Tue, 23 Apr 2024 20:50:34 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D0=BA=D0=B8=D0=B4=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20=D0=B8=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/GuidanceBindingModel.cs | 17 ++++++++++++++ .../BindingModels/MedicineBindingModel.cs | 18 +++++++++++++++ .../BindingModels/PharmacistBindingModel.cs | 17 ++++++++++++++ .../BindingModels/ServiceBindingModel.cs | 19 +++++++++++++++ .../BusinessLogicsContracts/IGuidanceLogic.cs | 20 ++++++++++++++++ .../BusinessLogicsContracts/IMedicineLogic.cs | 20 ++++++++++++++++ .../IPharmacistLogic.cs | 20 ++++++++++++++++ .../BusinessLogicsContracts/IServiceLogic.cs | 20 ++++++++++++++++ .../SearchModels/GuidanceSearchModel.cs | 17 ++++++++++++++ .../SearchModels/MedicineSearchModel.cs | 15 ++++++++++++ .../SearchModels/PharmacistSearchModel.cs | 16 +++++++++++++ .../SearchModels/ServiceSearchModel.cs | 15 ++++++++++++ .../StoragesContracts/IMedicineStorage.cs | 21 +++++++++++++++++ .../StoragesContracts/IPharmacistStorage.cs | 21 +++++++++++++++++ .../StoragesContracts/IServiceStorage.cs | 12 ++++++++++ .../ViewModels/GuidanceViewModel.cs | 22 ++++++++++++++++++ .../ViewModels/MedicineViewModel.cs | 23 +++++++++++++++++++ .../ViewModels/PharmacistViewModel.cs | 21 +++++++++++++++++ .../ViewModels/ServiceViewModel.cs | 23 +++++++++++++++++++ .../Models/IGuidanceModel.cs | 15 ++++++++++++ .../Models/IMedicineModel.cs | 16 +++++++++++++ .../Models/IPharmacistModel.cs | 15 ++++++++++++ .../Models/IServiceModel.cs | 16 +++++++++++++ 23 files changed, 419 insertions(+) create mode 100644 VetClinic/VetClinicContracts/BindingModels/GuidanceBindingModel.cs create mode 100644 VetClinic/VetClinicContracts/BindingModels/MedicineBindingModel.cs create mode 100644 VetClinic/VetClinicContracts/BindingModels/PharmacistBindingModel.cs create mode 100644 VetClinic/VetClinicContracts/BindingModels/ServiceBindingModel.cs create mode 100644 VetClinic/VetClinicContracts/BusinessLogicsContracts/IGuidanceLogic.cs create mode 100644 VetClinic/VetClinicContracts/BusinessLogicsContracts/IMedicineLogic.cs create mode 100644 VetClinic/VetClinicContracts/BusinessLogicsContracts/IPharmacistLogic.cs create mode 100644 VetClinic/VetClinicContracts/BusinessLogicsContracts/IServiceLogic.cs create mode 100644 VetClinic/VetClinicContracts/SearchModels/GuidanceSearchModel.cs create mode 100644 VetClinic/VetClinicContracts/SearchModels/MedicineSearchModel.cs create mode 100644 VetClinic/VetClinicContracts/SearchModels/PharmacistSearchModel.cs create mode 100644 VetClinic/VetClinicContracts/SearchModels/ServiceSearchModel.cs create mode 100644 VetClinic/VetClinicContracts/StoragesContracts/IMedicineStorage.cs create mode 100644 VetClinic/VetClinicContracts/StoragesContracts/IPharmacistStorage.cs create mode 100644 VetClinic/VetClinicContracts/StoragesContracts/IServiceStorage.cs create mode 100644 VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs create mode 100644 VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs create mode 100644 VetClinic/VetClinicContracts/ViewModels/PharmacistViewModel.cs create mode 100644 VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs create mode 100644 VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs create mode 100644 VetClinic/VetClinicDataModels/Models/IMedicineModel.cs create mode 100644 VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs create mode 100644 VetClinic/VetClinicDataModels/Models/IServiceModel.cs diff --git a/VetClinic/VetClinicContracts/BindingModels/GuidanceBindingModel.cs b/VetClinic/VetClinicContracts/BindingModels/GuidanceBindingModel.cs new file mode 100644 index 0000000..bcb0639 --- /dev/null +++ b/VetClinic/VetClinicContracts/BindingModels/GuidanceBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.BindingModels +{ + public class GuidanceBindingModel : IGuidanceModel + { + public int Id { get; set; } + public string Text { get; set; } = string.Empty; + public DateTime Date { get; set; } + public int ServiceId { get; set; } + } +} diff --git a/VetClinic/VetClinicContracts/BindingModels/MedicineBindingModel.cs b/VetClinic/VetClinicContracts/BindingModels/MedicineBindingModel.cs new file mode 100644 index 0000000..5abd45c --- /dev/null +++ b/VetClinic/VetClinicContracts/BindingModels/MedicineBindingModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.BindingModels +{ + public class MedicineBindingModel : IMedicineModel + { + public int Id { get; set; } + public string MedicineName { get; set; } = string.Empty; + public int Price { get; set; } + public int PharmacistId { get; set; } + public Dictionary MedicineAnimals { get; set; } = new(); + } +} diff --git a/VetClinic/VetClinicContracts/BindingModels/PharmacistBindingModel.cs b/VetClinic/VetClinicContracts/BindingModels/PharmacistBindingModel.cs new file mode 100644 index 0000000..31a9c92 --- /dev/null +++ b/VetClinic/VetClinicContracts/BindingModels/PharmacistBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.BindingModels +{ + public class PharmacistBindingModel : IPharmacistModel + { + public int Id { get; set; } + public string PharmacistFIO { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/VetClinic/VetClinicContracts/BindingModels/ServiceBindingModel.cs b/VetClinic/VetClinicContracts/BindingModels/ServiceBindingModel.cs new file mode 100644 index 0000000..2ff2fd7 --- /dev/null +++ b/VetClinic/VetClinicContracts/BindingModels/ServiceBindingModel.cs @@ -0,0 +1,19 @@ +using Microsoft.Identity.Client; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.BindingModels +{ + public class ServiceBindingModel : IServiceModel + { + public int Id { get; set; } + public string ServiceName { get; set; } = string.Empty; + public int Price { get; set; } + public int PharmacistId { get; set; } + public Dictionary ServiceMedicines { get; set; } = new(); + } +} diff --git a/VetClinic/VetClinicContracts/BusinessLogicsContracts/IGuidanceLogic.cs b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IGuidanceLogic.cs new file mode 100644 index 0000000..068b019 --- /dev/null +++ b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IGuidanceLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.BusinessLogicsContracts +{ + public interface IGuidanceLogic + { + List? ReadList(GuidanceSearchModel? model); + GuidanceViewModel? ReadElement(GuidanceSearchModel model); + bool Create(GuidanceBindingModel model); + bool Update(GuidanceBindingModel model); + bool Delete(GuidanceBindingModel model); + } +} diff --git a/VetClinic/VetClinicContracts/BusinessLogicsContracts/IMedicineLogic.cs b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IMedicineLogic.cs new file mode 100644 index 0000000..ea20c0e --- /dev/null +++ b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IMedicineLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.BusinessLogicsContracts +{ + public interface IMedicineLogic + { + List? ReadList(MedicineSearchModel? model); + MedicineSearchModel? ReadElement(MedicineSearchModel model); + bool Create(MedicineBindingModel model); + bool Update(MedicineBindingModel model); + bool Delete(MedicineBindingModel model); + } +} diff --git a/VetClinic/VetClinicContracts/BusinessLogicsContracts/IPharmacistLogic.cs b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IPharmacistLogic.cs new file mode 100644 index 0000000..6620899 --- /dev/null +++ b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IPharmacistLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.BusinessLogicsContracts +{ + public interface IPharmacistLogic + { + List? ReadList(PharmacistSearchModel? model); + PharmacistViewModel? ReadElement(PharmacistSearchModel model); + bool Create(PharmacistBindingModel model); + bool Update(PharmacistBindingModel model); + bool Delete(PharmacistBindingModel model); + } +} diff --git a/VetClinic/VetClinicContracts/BusinessLogicsContracts/IServiceLogic.cs b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IServiceLogic.cs new file mode 100644 index 0000000..ba9387b --- /dev/null +++ b/VetClinic/VetClinicContracts/BusinessLogicsContracts/IServiceLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.BusinessLogicsContracts +{ + 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/VetClinic/VetClinicContracts/SearchModels/GuidanceSearchModel.cs b/VetClinic/VetClinicContracts/SearchModels/GuidanceSearchModel.cs new file mode 100644 index 0000000..bb4e0af --- /dev/null +++ b/VetClinic/VetClinicContracts/SearchModels/GuidanceSearchModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicContracts.SearchModels +{ + public class GuidanceSearchModel + { + public int? Id { get; set; } + public string? Text { get; set; } + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } + public int? ServiceId { get; set; } + } +} diff --git a/VetClinic/VetClinicContracts/SearchModels/MedicineSearchModel.cs b/VetClinic/VetClinicContracts/SearchModels/MedicineSearchModel.cs new file mode 100644 index 0000000..c7caf8e --- /dev/null +++ b/VetClinic/VetClinicContracts/SearchModels/MedicineSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicContracts.SearchModels +{ + public class MedicineSearchModel + { + public int? Id { get; set; } + public string? MedicineName { get; set; } = string.Empty; + public int? PharmacistId { get; set; } + } +} diff --git a/VetClinic/VetClinicContracts/SearchModels/PharmacistSearchModel.cs b/VetClinic/VetClinicContracts/SearchModels/PharmacistSearchModel.cs new file mode 100644 index 0000000..c505976 --- /dev/null +++ b/VetClinic/VetClinicContracts/SearchModels/PharmacistSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicContracts.SearchModels +{ + public class PharmacistSearchModel + { + public int? Id { get; set; } + public string? PharmacistFIO { get; set; } = string.Empty; + public string? Email { get; set; } = string.Empty; + public string? Password { get; set; } = string.Empty; + } +} diff --git a/VetClinic/VetClinicContracts/SearchModels/ServiceSearchModel.cs b/VetClinic/VetClinicContracts/SearchModels/ServiceSearchModel.cs new file mode 100644 index 0000000..edf5d11 --- /dev/null +++ b/VetClinic/VetClinicContracts/SearchModels/ServiceSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicContracts.SearchModels +{ + public class ServiceSearchModel + { + public int? Id { get; set; } + public string? ServiceName { get; set; } = string.Empty; + public int? PharmacistId { get; set; } + } +} diff --git a/VetClinic/VetClinicContracts/StoragesContracts/IMedicineStorage.cs b/VetClinic/VetClinicContracts/StoragesContracts/IMedicineStorage.cs new file mode 100644 index 0000000..83da44e --- /dev/null +++ b/VetClinic/VetClinicContracts/StoragesContracts/IMedicineStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.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/VetClinic/VetClinicContracts/StoragesContracts/IPharmacistStorage.cs b/VetClinic/VetClinicContracts/StoragesContracts/IPharmacistStorage.cs new file mode 100644 index 0000000..b3d7c3e --- /dev/null +++ b/VetClinic/VetClinicContracts/StoragesContracts/IPharmacistStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicContracts.BindingModels; +using VetClinicContracts.SearchModels; +using VetClinicContracts.ViewModels; + +namespace VetClinicContracts.StoragesContracts +{ + public interface IGuidanceStorage + { + List GetFullList(); + List GetFilteredList(GuidanceSearchModel model); + GuidanceViewModel? GetElement(GuidanceSearchModel model); + GuidanceViewModel? Insert(GuidanceBindingModel model); + GuidanceViewModel? Update(GuidanceBindingModel model); + GuidanceViewModel? Delete(GuidanceBindingModel model); + } +} diff --git a/VetClinic/VetClinicContracts/StoragesContracts/IServiceStorage.cs b/VetClinic/VetClinicContracts/StoragesContracts/IServiceStorage.cs new file mode 100644 index 0000000..459b89d --- /dev/null +++ b/VetClinic/VetClinicContracts/StoragesContracts/IServiceStorage.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicContracts.StoragesContracts +{ + internal interface IServiceStorage + { + } +} diff --git a/VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs b/VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs new file mode 100644 index 0000000..a868c55 --- /dev/null +++ b/VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.ViewModels +{ + public class GuidanceViewModel : IGuidanceModel + { + public int Id { get; set; } + [DisplayName("Текст рекомендации")] + public string Text { get; set; } = string.Empty; + [DisplayName("Дата рекомендации")] + public DateTime Date { get; set; } + [DisplayName("Услуга")] + public string ServiceName { get; set; } = string.Empty; + public int ServiceId { get; set; } + } +} diff --git a/VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs b/VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs new file mode 100644 index 0000000..87bdb71 --- /dev/null +++ b/VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.ViewModels +{ + public class MedicineViewModel : IMedicineModel + { + public int Id { get; set; } + [DisplayName("Название медикамента")] + public string MedicineName { get; set; } = string.Empty; + [DisplayName("Цена медикамента")] + public int Price { get; set; } + [DisplayName("Фармацевт")] + public string PharmacistFIO { get; set; } = string.Empty; + public int PharmacistId { get; set; } + public Dictionary MedicineAnimals { get; set; } = new(); + } +} diff --git a/VetClinic/VetClinicContracts/ViewModels/PharmacistViewModel.cs b/VetClinic/VetClinicContracts/ViewModels/PharmacistViewModel.cs new file mode 100644 index 0000000..8f91c9f --- /dev/null +++ b/VetClinic/VetClinicContracts/ViewModels/PharmacistViewModel.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 VetClinicDataModels.Models; + +namespace VetClinicContracts.ViewModels +{ + public class PharmacistViewModel : IPharmacistModel + { + public int Id { get; set; } + [DisplayName("ФИО кладовщика")] + public string PharmacistFIO { get; set; } = string.Empty; + [DisplayName("Логин (эл. почта)")] + public string Email { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs b/VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs new file mode 100644 index 0000000..4d6ec24 --- /dev/null +++ b/VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetClinicDataModels.Models; + +namespace VetClinicContracts.ViewModels +{ + public class ServiceViewModel : IServiceModel + { + public int Id { get; set; } + [DisplayName("Название услуги")] + public string ServiceName { get; set; } = string.Empty; + [DisplayName("Цена услуги")] + public int Price { get; set; } + [DisplayName("Фармацевт")] + public string PharmacistFIO { get; set; } = string.Empty; + public int PharmacistId { get; set; } + public Dictionary ServiceMedicines { get; set; } = new(); + } +} diff --git a/VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs b/VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs new file mode 100644 index 0000000..ce4e90c --- /dev/null +++ b/VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicDataModels.Models +{ + public interface IGuidanceModel : IId + { + string Text { get; } + DateTime Date { get; } + int ServiceId { get; } + } +} diff --git a/VetClinic/VetClinicDataModels/Models/IMedicineModel.cs b/VetClinic/VetClinicDataModels/Models/IMedicineModel.cs new file mode 100644 index 0000000..8793843 --- /dev/null +++ b/VetClinic/VetClinicDataModels/Models/IMedicineModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicDataModels.Models +{ + public interface IMedicineModel : IId + { + string MedicineName { get; } + int Price { get; } + int PharmacistId { get; } + Dictionary MedicineAnimals { get; } + } +} diff --git a/VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs b/VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs new file mode 100644 index 0000000..4416edb --- /dev/null +++ b/VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicDataModels.Models +{ + public interface IPharmacistModel : IId + { + string PharmacistFIO { get; } + string Email { get; } + string Password { get; } + } +} diff --git a/VetClinic/VetClinicDataModels/Models/IServiceModel.cs b/VetClinic/VetClinicDataModels/Models/IServiceModel.cs new file mode 100644 index 0000000..28a7527 --- /dev/null +++ b/VetClinic/VetClinicDataModels/Models/IServiceModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VetClinicDataModels.Models +{ + public interface IServiceModel : IId + { + string ServiceName { get; } + int Price { get; } + int PharmacistId { get; } + Dictionary ServiceMedicines { get; } + } +}