using ModuleTools.Attributes;
using ModuleTools.Enums;
using ModuleTools.ViewModels;
namespace SecurityBusinessLogic.ViewModels
{
///
/// Список ролей
///
public class RoleListViewModel : ListViewModel { }
///
/// Элемент ролей
///
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Доступы", Order = 1, ParentPropertyName = "RoleId",
ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlAccessList, SecurityWindowsDesktop")]
[ViewModelControlElementDependenceEntity(Title = "Пользователи", Order = 2, ParentPropertyName = "RoleId",
ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleUserList, SecurityWindowsDesktop")]
public class RoleViewModel : ElementViewModel
{
[ViewModelControlListProperty("Название роли")]
[ViewModelControlElementProperty("Название роли", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("RoleName")]
public string RoleName { get; set; }
[ViewModelControlListProperty("Приоритет", ColumnWidth = 100)]
[ViewModelControlElementProperty("Приоритет", ControlType.ControlInt, MustHaveValue = true)]
[MapConfiguration("RolePriority")]
public int RolePriority { get; set; }
public override string ToString() => RoleName;
}
}