This commit is contained in:
MaxKarme 2023-04-08 16:48:36 +04:00
commit a17a5f38cd
7 changed files with 87 additions and 7 deletions

View File

@ -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;
}
}

View File

@ -0,0 +1,15 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IUserLogic
{
List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElement(UserSearchModel model);
bool Create(UserBindingModel model);
bool Update(UserBindingModel model);
bool Delete(UserBindingModel model);
}
}

View File

@ -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; }
}
}

View File

@ -0,0 +1,16 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.StoragesContracts
{
public interface IUserStorage
{
List<UserViewModel> GetFullList();
List<UserViewModel> GetFilteredList(UserSearchModel model);
UserViewModel? GetElement(UserSearchModel model);
UserViewModel? Insert(UserBindingModel model);
UserViewModel? Update(UserBindingModel model);
UserViewModel? Delete(UserBindingModel model);
}
}

View File

@ -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;
}
}

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UniversityDataModels.Enums
namespace UniversityDataModels.Enums
{
public enum MarkType
{

View File

@ -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; }
}
}