DepartmentProject/DepartmentPortal/Security/SecurityBusinessLogic/ViewModels/UserRoleViewModels.cs

37 lines
1.6 KiB
C#

using ModuleTools.Attributes;
using ModuleTools.Enums;
using ModuleTools.ViewModels;
using System;
namespace SecurityBusinessLogic.ViewModels
{
/// <summary>
/// Список пользователей
/// </summary>
public class UserRoleListViewModel : ListViewModel<UserRoleViewModel> { }
/// <summary>
/// Элемент пользователей
/// </summary>
[ViewModelControlElementClass()]
public class UserRoleViewModel : ElementViewModel
{
[ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")]
[MapConfiguration("UserId", AllowCopyWithoutRigth = false)]
public Guid UserId { get; set; }
[ViewModelControlListProperty("Пользователь")]
[MapConfiguration("User.UserName", IsDifficle = true, AllowCopyWithoutRigth = false)]
public string UserName { get; set; }
[ViewModelControlElementProperty("Роль", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleList, SecurityWindowsDesktop")]
[MapConfiguration("RoleId", AllowCopyWithoutRigth = false)]
public Guid RoleId { get; set; }
[ViewModelControlListProperty("Роль")]
[MapConfiguration("Role.RoleName", IsDifficle = true, AllowCopyWithoutRigth = false)]
public string RoleName { get; set; }
public override string ToString() => $"{RoleName}-{UserName}";
}
}