2021-03-28 19:15:55 +04:00
|
|
|
|
using ModuleTools.Attributes;
|
2021-03-30 22:34:31 +04:00
|
|
|
|
using ModuleTools.Enums;
|
2021-03-28 19:15:55 +04:00
|
|
|
|
using ModuleTools.ViewModels;
|
2021-03-26 20:09:52 +04:00
|
|
|
|
|
|
|
|
|
namespace SecurityBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список ролей
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class RoleListViewModel : ListViewModel<RoleViewModel> { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Элемент ролей
|
|
|
|
|
/// </summary>
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
|
|
|
|
|
[ViewModelControlElementDependenceEntity(Title = "Доступы", Order = 1, ParentPropertyName = "RoleId",
|
|
|
|
|
ControlTypeObject = "SecurityWindowsDesktop.Controls.ControlAccessList, SecurityWindowsDesktop")]
|
|
|
|
|
[ViewModelControlElementDependenceEntity(Title = "Пользователи", Order = 2, ParentPropertyName = "RoleId",
|
|
|
|
|
ControlTypeObject = "SecurityWindowsDesktop.Controls.ControlRoleUserList, SecurityWindowsDesktop")]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public class RoleViewModel : ElementViewModel
|
|
|
|
|
{
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Название роли")]
|
|
|
|
|
[ViewModelControlElementProperty("Название роли", ControlType.ControlString, MustHaveValue = true)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
[MapConfiguration("RoleName")]
|
|
|
|
|
public string RoleName { get; set; }
|
|
|
|
|
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Приоритет", 100)]
|
|
|
|
|
[ViewModelControlElementProperty("Приоритет", ControlType.ControlInt, MustHaveValue = true)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
[MapConfiguration("RolePriority")]
|
|
|
|
|
public int RolePriority { get; set; }
|
|
|
|
|
|
|
|
|
|
public override string ToString() => RoleName;
|
|
|
|
|
}
|
|
|
|
|
}
|