DepartmentProject/DepartmentPortal/Security/SecurityBusinessLogic/ViewModels/RoleViewModels.cs
kotcheshir73 e8836c8806 куча наработко по выводу элемента и списка
правки по сущностям безоапсности
2021-04-01 21:30:29 +04:00

34 lines
1.4 KiB
C#

using ModuleTools.Attributes;
using ModuleTools.Enums;
using ModuleTools.ViewModels;
namespace SecurityBusinessLogic.ViewModels
{
/// <summary>
/// Список ролей
/// </summary>
public class RoleListViewModel : ListViewModel<RoleViewModel> { }
/// <summary>
/// Элемент ролей
/// </summary>
[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")]
public class RoleViewModel : ElementViewModel
{
[ViewModelControlListProperty("Название роли")]
[ViewModelControlElementProperty("Название роли", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("RoleName")]
public string RoleName { get; set; }
[ViewModelControlListProperty("Приоритет", 100)]
[ViewModelControlElementProperty("Приоритет", ControlType.ControlInt, MustHaveValue = true)]
[MapConfiguration("RolePriority")]
public int RolePriority { get; set; }
public override string ToString() => RoleName;
}
}