Compare commits

...

2 Commits

Author SHA1 Message Date
MaxKarme
a424c0708e add user models 2023-04-08 16:44:15 +04:00
MaxKarme
8540b924da delete useless using 2023-04-08 16:44:04 +04:00
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; }
}
}