diff --git a/ComputerShopBusinessLogic/ComputerShopBusinessLogic.csproj b/ComputerShopBusinessLogic/ComputerShopBusinessLogic.csproj index 63a55ef..bb69535 100644 --- a/ComputerShopBusinessLogic/ComputerShopBusinessLogic.csproj +++ b/ComputerShopBusinessLogic/ComputerShopBusinessLogic.csproj @@ -6,8 +6,16 @@ enable + + + + + + + + diff --git a/ComputerShopContracts/BindingModels/UserBindingModel.cs b/ComputerShopContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..6031abb --- /dev/null +++ b/ComputerShopContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,20 @@ +using ComputerShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public int Id { get; set; } + //!!!МБ НЕ НАДО string.Empty + public string Login { get; set; } = string.Empty; + //!!!МБ НЕ НАДО string.Empty + public string Password { get; set; } = string.Empty; + //!!!МБ НЕ НАДО string.Empty + public string Email { get; set; } = string.Empty; + } +} diff --git a/ComputerShopContracts/BusinessLogicContracts/IUserLogic.cs b/ComputerShopContracts/BusinessLogicContracts/IUserLogic.cs new file mode 100644 index 0000000..0a6ce48 --- /dev/null +++ b/ComputerShopContracts/BusinessLogicContracts/IUserLogic.cs @@ -0,0 +1,20 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopContracts.BusinessLogicContracts +{ + public interface IUserLogic + { + List? ReadList(UserSearchModel? model); + UserViewModel? ReadElement(UserSearchModel model); + bool Create(UserBindingModel model); + bool Update(UserBindingModel model); + bool Delete(UserBindingModel model); + } +} diff --git a/ComputerShopContracts/SearchModels/UserSearchModel.cs b/ComputerShopContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..cb907f2 --- /dev/null +++ b/ComputerShopContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopContracts.SearchModels +{ + public class UserSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + + //!!!ПОИСК ПО ПАРОЛЮ НЕ СТАЛ ДОБАВЛЯТЬ, ИБО СТРАННО + + public string? Email { get; set; } + } +} diff --git a/ComputerShopContracts/StorageContracts/IUserStorage.cs b/ComputerShopContracts/StorageContracts/IUserStorage.cs new file mode 100644 index 0000000..4874afc --- /dev/null +++ b/ComputerShopContracts/StorageContracts/IUserStorage.cs @@ -0,0 +1,21 @@ +using ComputerShopContracts.BindingModels; +using ComputerShopContracts.SearchModels; +using ComputerShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopContracts.StorageContracts +{ + public interface IUserStorage + { + List GetFullList(); + List GetFilteredList(UserSearchModel model); + UserViewModel? GetElement(UserSearchModel model); + UserViewModel? Insert(UserBindingModel model); + UserViewModel? Update(UserBindingModel model); + UserViewModel? Delete(UserBindingModel model); + } +} diff --git a/ComputerShopContracts/ViewModels/UserViewModel.cs b/ComputerShopContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..c644d94 --- /dev/null +++ b/ComputerShopContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopContracts.ViewModels +{ + public class UserViewModel + { + //!!!МБ ТУТ НАДО DisplayName (НО ВРЯД ЛИ) + public int Id { get; set; } + + //!!!МБ ТУТ НЕ НУЖНЫ string.Empty + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + } +} diff --git a/ComputerShopDataModels/Models/IUserModel.cs b/ComputerShopDataModels/Models/IUserModel.cs new file mode 100644 index 0000000..7279902 --- /dev/null +++ b/ComputerShopDataModels/Models/IUserModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerShopDataModels.Models +{ + public interface IUserModel : IId + { + string Login { get; } + string Password { get; } + string Email { get; } + } +}