diff --git a/FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs b/FurnitureFactory/FurnitureContracts/BindingModels/MasterBindingModel.cs similarity index 51% rename from FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs rename to FurnitureFactory/FurnitureContracts/BindingModels/MasterBindingModel.cs index 14c44bc..2eb5971 100644 --- a/FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs +++ b/FurnitureFactory/FurnitureContracts/BindingModels/MasterBindingModel.cs @@ -6,14 +6,12 @@ using System.Threading.Tasks; using FurnitureFactoryDataModels.Models; namespace FurnitureContracts.BindingModels { - public class UserBindingModel : IUserModel + public class MasterBindingModel : IMasterModel { - public int Login { get; set; } - - public int Password { get; set; } - public string UserName { get; set; } = string.Empty; - - public int RoleID { get; set; } + public string Login { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public int Id { get; set; } } } diff --git a/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IMasterLogic.cs b/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IMasterLogic.cs new file mode 100644 index 0000000..17e02af --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IMasterLogic.cs @@ -0,0 +1,20 @@ +using FurnitureContracts.BindingModels; +using FurnitureContracts.SearchModels; +using FurnitureContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.BusinessLogicsContracts +{ + public interface IMasterLogic + { + List? ReadList(MasterSearchModel? model); + MasterViewModel? ReadElement(MasterSearchModel model); + bool Create(MasterBindingModel model); + bool Update(MasterBindingModel model); + bool Delete(MasterBindingModel model); + } +} diff --git a/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IUserLogic.cs b/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IUserLogic.cs deleted file mode 100644 index e13c124..0000000 --- a/FurnitureFactory/FurnitureContracts/BusinessLogicsContracts/IUserLogic.cs +++ /dev/null @@ -1,20 +0,0 @@ -using FurnitureContracts.BindingModels; -using FurnitureContracts.SearchModels; -using FurnitureContracts.ViewModel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FurnitureContracts.BusinessLogicsContracts -{ - 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/FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs b/FurnitureFactory/FurnitureContracts/SearchModels/MasterSearchModel.cs similarity index 88% rename from FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs rename to FurnitureFactory/FurnitureContracts/SearchModels/MasterSearchModel.cs index 7b9128f..8a68033 100644 --- a/FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs +++ b/FurnitureFactory/FurnitureContracts/SearchModels/MasterSearchModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace FurnitureContracts.SearchModels { - public class UserSearchModel + public class MasterSearchModel { public string? Name { get; set; } public int? Id { get; set; } diff --git a/FurnitureFactory/FurnitureContracts/StoragesContracts/IMasterStorage.cs b/FurnitureFactory/FurnitureContracts/StoragesContracts/IMasterStorage.cs new file mode 100644 index 0000000..00698bf --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/StoragesContracts/IMasterStorage.cs @@ -0,0 +1,21 @@ +using FurnitureContracts.BindingModels; +using FurnitureContracts.SearchModels; +using FurnitureContracts.ViewModel; + +namespace FurnitureContracts.StoragesContracts +{ + public interface IMasterStorage + { + List GetFullList(); + + List GetFilteredList(MasterSearchModel model); + + MasterViewModel? GetElement(MasterSearchModel model); + + MasterViewModel? Insert(MasterBindingModel model); + + MasterViewModel? Update(MasterBindingModel model); + + MasterViewModel? Delete(MasterBindingModel model); + } +} diff --git a/FurnitureFactory/FurnitureContracts/StoragesContracts/IUserStorage.cs b/FurnitureFactory/FurnitureContracts/StoragesContracts/IUserStorage.cs deleted file mode 100644 index 0e43e91..0000000 --- a/FurnitureFactory/FurnitureContracts/StoragesContracts/IUserStorage.cs +++ /dev/null @@ -1,21 +0,0 @@ -using FurnitureContracts.BindingModels; -using FurnitureContracts.SearchModels; -using FurnitureContracts.ViewModel; - -namespace FurnitureContracts.StoragesContracts -{ - 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/FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/MasterViewModel.cs similarity index 67% rename from FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs rename to FurnitureFactory/FurnitureContracts/ViewModel/MasterViewModel.cs index 6b2d180..7c9ca8b 100644 --- a/FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs +++ b/FurnitureFactory/FurnitureContracts/ViewModel/MasterViewModel.cs @@ -8,16 +8,15 @@ using System.Threading.Tasks; namespace FurnitureContracts.ViewModel { - public class UserViewModel : IUserModel + public class MasterViewModel : IMasterModel { [DisplayName("Логин")] - public int Login { get; set; } + public string Login { get; set; } [DisplayName("Пароль")] - public int Password { get; set; } + public string Password { get; set; } [DisplayName("Имя пользователя")] - + public string Email { get; set; } public string UserName { get; set; } = string.Empty; - - public int RoleID { get; set; } + public int Id { get; set; } } } diff --git a/FurnitureFactory/FurnitureDataBaseImplement/Models/Material.cs b/FurnitureFactory/FurnitureDataBaseImplement/Models/Material.cs index 0a78734..1a57d25 100644 --- a/FurnitureFactory/FurnitureDataBaseImplement/Models/Material.cs +++ b/FurnitureFactory/FurnitureDataBaseImplement/Models/Material.cs @@ -1,6 +1,7 @@ using FurnitureFactoryDataModels.Models; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,13 +10,13 @@ namespace FurnitureDataBaseImplement.Models { public class Material : IMaterialModel { - + [Required] public string Name { get; set; } = string.Empty; - + [Required] public int Cost { get; set; } - + [Required] public int UserID { get; set; } - + [Required] public int Id { get; set; } } } diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/FurnitureFactoryDataBaseImplement.csproj b/FurnitureFactory/FurnitureFactoryDataBaseImplement/FurnitureFactoryDataBaseImplement.csproj index 132c02c..861389c 100644 --- a/FurnitureFactory/FurnitureFactoryDataBaseImplement/FurnitureFactoryDataBaseImplement.csproj +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/FurnitureFactoryDataBaseImplement.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Models/Material.cs b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Models/Material.cs new file mode 100644 index 0000000..feb27cf --- /dev/null +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Models/Material.cs @@ -0,0 +1,20 @@ +using FurnitureFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureFactoryDataBaseImplement.Models +{ + public class Material : IMaterialModel + { + public string Name { get; set; } = string.Empty; + + public int Cost { get; set; } + + public int UserID { get; set; } + + public int Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs b/FurnitureFactory/FurnitureFactoryDataModels/Models/IMasterModel.cs similarity index 61% rename from FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs rename to FurnitureFactory/FurnitureFactoryDataModels/Models/IMasterModel.cs index 2453e95..6f746fb 100644 --- a/FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs +++ b/FurnitureFactory/FurnitureFactoryDataModels/Models/IMasterModel.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; namespace FurnitureFactoryDataModels.Models { - public interface IUserModel + public interface IMasterModel : IId { - string Login { get;} - int Password { get; } + string Login { get; } + string Password { get; } string UserName { get; } - int RoleID { get; } + string Email { get; } } }