Убрал сущность "исполнитель", добавил вместо нее сущность пользователя и перечисление ролей. Заменил в моделях ссылки на исполнитля ссылками на пользователя.
This commit is contained in:
parent
a16836ba24
commit
6e91db5f8f
@ -6,7 +6,7 @@ namespace PolyclinicContracts.BindingModels
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Comment { get; set; } = string.Empty;
|
||||
public int ExecutorId { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
using PolyclinicDataModels.Models;
|
||||
using PolyclinicDataModels.Enums;
|
||||
using PolyclinicDataModels.Models;
|
||||
|
||||
namespace PolyclinicContracts.BindingModels
|
||||
{
|
||||
public class ExecutorBindingModel : IExecutorModel
|
||||
public class UserBindingModel : IUserModel
|
||||
{
|
||||
public string FIO { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public UserRole Role { get; set; } = UserRole.Неизвестный;
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using PolyclinicContracts.BindingModels;
|
||||
using PolyclinicContracts.SearchModels;
|
||||
using PolyclinicContracts.ViewModels;
|
||||
|
||||
namespace PolyclinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IExecutorLogic
|
||||
{
|
||||
List<ExecutorViewModel>? ReadList(ExecutorSearchModel? model);
|
||||
ExecutorViewModel? ReadElement(ExecutorSearchModel model);
|
||||
bool Create(ExecutorBindingModel model);
|
||||
bool Update(ExecutorBindingModel model);
|
||||
bool Delete(ExecutorBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using PolyclinicContracts.BindingModels;
|
||||
using PolyclinicContracts.SearchModels;
|
||||
using PolyclinicContracts.ViewModels;
|
||||
|
||||
namespace PolyclinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IUserLogic
|
||||
{
|
||||
List<UserViewModel>? ReadList(UserSearchModel? model);
|
||||
UserViewModel? ReadElement(UserSearchModel model);
|
||||
bool Create(UserBindingModel model);
|
||||
bool Update(UserBindingModel model);
|
||||
bool Delete(UserBindingModel model);
|
||||
}
|
||||
}
|
@ -3,6 +3,6 @@
|
||||
public class DiagnosisSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? ExecutorId { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace PolyclinicContracts.SearchModels
|
||||
{
|
||||
public class ExecutorSearchModel
|
||||
public class UserSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Email { get; set; }
|
@ -1,16 +0,0 @@
|
||||
using PolyclinicContracts.BindingModels;
|
||||
using PolyclinicContracts.SearchModels;
|
||||
using PolyclinicContracts.ViewModels;
|
||||
|
||||
namespace PolyclinicContracts.StoragesContracts
|
||||
{
|
||||
public interface IExecutorStorage
|
||||
{
|
||||
List<ExecutorViewModel> GetFullList();
|
||||
List<ExecutorViewModel> GetFilteredList(ExecutorSearchModel model);
|
||||
ExecutorViewModel? GetElement(ExecutorSearchModel model);
|
||||
ExecutorViewModel? Insert(ExecutorBindingModel model);
|
||||
ExecutorViewModel? Update(ExecutorBindingModel model);
|
||||
ExecutorViewModel? Delete(ExecutorBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using PolyclinicContracts.BindingModels;
|
||||
using PolyclinicContracts.SearchModels;
|
||||
using PolyclinicContracts.ViewModels;
|
||||
|
||||
namespace PolyclinicContracts.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);
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ namespace PolyclinicContracts.ViewModels
|
||||
public string Name { get; set; } = string.Empty;
|
||||
[DisplayName("Комментарий")]
|
||||
public string Comment { get; set; } = string.Empty;
|
||||
public int ExecutorId { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
using PolyclinicDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace PolyclinicContracts.ViewModels
|
||||
{
|
||||
public class ExecutorViewModel : IExecutorModel
|
||||
{
|
||||
[DisplayName("ФИО исполнителя")]
|
||||
public string FIO { get; set; } = string.Empty;
|
||||
[DisplayName("Email исполнителя")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
19
Polyclinic/PolyclinicContracts/ViewModels/UserViewModel.cs
Normal file
19
Polyclinic/PolyclinicContracts/ViewModels/UserViewModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using PolyclinicDataModels.Enums;
|
||||
using PolyclinicDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace PolyclinicContracts.ViewModels
|
||||
{
|
||||
public class UserViewModel : IUserModel
|
||||
{
|
||||
[DisplayName("ФИО")]
|
||||
public string FIO { get; set; } = string.Empty;
|
||||
[DisplayName("Email")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
[DisplayName("Роль")]
|
||||
public UserRole Role { get; set; } = UserRole.Неизвестный;
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
10
Polyclinic/PolyclinicDataModels/Enums/UserRole.cs
Normal file
10
Polyclinic/PolyclinicDataModels/Enums/UserRole.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace PolyclinicDataModels.Enums
|
||||
{
|
||||
public enum UserRole
|
||||
{
|
||||
Неизвестный = -1,
|
||||
Администратор = 0,
|
||||
Исполнитель = 1,
|
||||
Поручитель = 2
|
||||
}
|
||||
}
|
@ -4,6 +4,6 @@
|
||||
{
|
||||
string Name { get; }
|
||||
string Comment { get; }
|
||||
int ExecutorId { get; }
|
||||
int UserId { get; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
namespace PolyclinicDataModels.Models
|
||||
{
|
||||
public interface IExecutorModel : IId
|
||||
{
|
||||
string FIO { get; }
|
||||
string Email { get; }
|
||||
string Password { get; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PolyclinicDataModels.Models
|
||||
{
|
||||
public interface ISuretorModel : IId
|
||||
{
|
||||
string FIO { get; }
|
||||
string Password { get; }
|
||||
string Email { get; }
|
||||
}
|
||||
}
|
12
Polyclinic/PolyclinicDataModels/Models/IUserModel.cs
Normal file
12
Polyclinic/PolyclinicDataModels/Models/IUserModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using PolyclinicDataModels.Enums;
|
||||
|
||||
namespace PolyclinicDataModels.Models
|
||||
{
|
||||
public interface IUserModel : IId
|
||||
{
|
||||
string FIO { get; }
|
||||
string Email { get; }
|
||||
string Password { get; }
|
||||
UserRole Role { get; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user