diff --git a/University/UniversityContracts/BindingModels/UserBindingModel.cs b/University/UniversityContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..9b144d7 --- /dev/null +++ b/University/UniversityContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,14 @@ +using UniversityDataModels.Models; +namespace UniversityContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Surname { get; set; } = String.Empty; + public string PhoneNumber { get; set; } = String.Empty; + public string Position { get; set; } = String.Empty; + public string Login { get; set; } = String.Empty; + public string Password { get; set; } = String.Empty; + } +} diff --git a/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs b/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs new file mode 100644 index 0000000..218c1df --- /dev/null +++ b/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs @@ -0,0 +1,15 @@ +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; + +namespace UniversityContracts.BuisnessLogicContracts +{ + 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/University/UniversityContracts/SearchModels/UserSearchModel.cs b/University/UniversityContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..83bd13e --- /dev/null +++ b/University/UniversityContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,9 @@ +namespace UniversityContracts.SearchModels +{ + public class UserSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + public string? Password { get; set; } + } +} diff --git a/University/UniversityContracts/StoragesContracts/IUserStorage.cs b/University/UniversityContracts/StoragesContracts/IUserStorage.cs new file mode 100644 index 0000000..574c780 --- /dev/null +++ b/University/UniversityContracts/StoragesContracts/IUserStorage.cs @@ -0,0 +1,16 @@ +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; + +namespace UniversityContracts.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/University/UniversityContracts/ViewModels/UserViewModel.cs b/University/UniversityContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..35afe78 --- /dev/null +++ b/University/UniversityContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,14 @@ +using UniversityDataModels.Models; +namespace UniversityContracts.ViewModels +{ + public class UserViewModel : IUserModel + { + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Surname { get; set; } = String.Empty; + public string PhoneNumber { get; set; } = String.Empty; + public string Position { get; set; } = String.Empty; + public string Login { get; set; } = String.Empty; + public string Password { get; set; } = String.Empty; + } +} diff --git a/University/UniversityDataModels/Models/IUserModel.cs b/University/UniversityDataModels/Models/IUserModel.cs new file mode 100644 index 0000000..a4a74d0 --- /dev/null +++ b/University/UniversityDataModels/Models/IUserModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UniversityDataModels.Models +{ + public interface IUserModel : IId + { + string Name { get; } + string Surname { get; } + string PhoneNumber { get; } + string Position { get; } + string Login { get; } + string Password { get; } + } +}