diff --git a/Vetclinic/Vetclinic/Models/IMedPurchase.cs b/Vetclinic/Vetclinic/Models/IDrugPurchase.cs similarity index 86% rename from Vetclinic/Vetclinic/Models/IMedPurchase.cs rename to Vetclinic/Vetclinic/Models/IDrugPurchase.cs index aa7c722..420a32d 100644 --- a/Vetclinic/Vetclinic/Models/IMedPurchase.cs +++ b/Vetclinic/Vetclinic/Models/IDrugPurchase.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace VetclinicDataModels.Models { - public interface IMedPurchase: IId + public interface IDrugPurchase: IId { int ClientId { get; } double Cost { get; } diff --git a/Vetclinic/VetclinicContracts/BindingModels/ClientBindingModel.cs b/Vetclinic/VetclinicContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..d47d181 --- /dev/null +++ b/Vetclinic/VetclinicContracts/BindingModels/ClientBindingModel.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 ClientBindingModel: IClientModel + { + public int Id { get; set; } + public string ClientName { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IClientLogic.cs b/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..b6a284c --- /dev/null +++ b/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetclinicContracts.BindingModels; +using VetclinicContracts.SearchModels; + +namespace VetclinicContracts.BusinessLogicsContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + ClientViewModel? ReadElement(ClientSearchModel model); + bool Create(ClientBindingModel model); + bool Update(ClientBindingModel model); + bool Delete(ClientBindingModel model); + } +} diff --git a/Vetclinic/VetclinicContracts/SearchModels/ClientSearchModel.cs b/Vetclinic/VetclinicContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..c2665ee --- /dev/null +++ b/Vetclinic/VetclinicContracts/SearchModels/ClientSearchModel.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.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? ClientName { get; set; } + public string? Email { get; set; } + public string? Password { get; set; } + } +} diff --git a/Vetclinic/VetclinicContracts/StoragesContracts/IClientStorage.cs b/Vetclinic/VetclinicContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..bb007eb --- /dev/null +++ b/Vetclinic/VetclinicContracts/StoragesContracts/IClientStorage.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 IClientStorage + { + List GetFullList(); + List GetFiltredList(ClientSearchModel model); + ClientViewModel? GetElement(ClientSearchModel model); + ClientViewModel? Insert(ClientBindingModel model); + ClientViewModel? Update(ClientBindingModel model); + ClientViewModel? Delete(ClientBindingModel model); + } +} diff --git a/Vetclinic/VetclinicContracts/VetclinicContracts.csproj b/Vetclinic/VetclinicContracts/VetclinicContracts.csproj index 27ac386..4a4f55a 100644 --- a/Vetclinic/VetclinicContracts/VetclinicContracts.csproj +++ b/Vetclinic/VetclinicContracts/VetclinicContracts.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/Vetclinic/VetclinicContracts/ViewModels/ClientViewModel.cs b/Vetclinic/VetclinicContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..c04e595 --- /dev/null +++ b/Vetclinic/VetclinicContracts/ViewModels/ClientViewModel.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 ClientViewModel: IClientModel + { + public int Id { get; set; } + [DisplayName("ФИО клиента")] + public string ClientName { get; set; } = string.Empty; + [DisplayName("Логин (эл. почта)")] + public string Email { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +}