using DepartmentBusinessLogic.Enums; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; using System; namespace DepartmentBusinessLogic.ViewModels { /// /// Список студентов /// public class StudentListViewModel : ListViewModel { } /// /// Элемент студент /// [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementDependenceEntity(Title = "Приказы по студенту", Order = 1, ParentPropertyName = "StudentId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderStudentRecordList, DepartmentWindowsDesktop")] public class StudentViewModel : ElementViewModel { [ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")] [MapConfiguration("UserId")] public Guid UserId { get; set; } [ViewModelControlElementProperty("Группа", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] [MapConfiguration("StudentGroupId")] public Guid? StudentGroupId { get; set; } [MapConfiguration("StudentGroup.ToString", IsDifficle = true)] public string StudentGroupName { get; set; } [ViewModelControlListProperty("Номер зачетки")] [ViewModelControlElementProperty("Номер зачетки", ControlType.ControlString, MustHaveValue = true, ReadOnly = true)] [MapConfiguration("NumberOfBook")] public string NumberOfBook { get; set; } [ViewModelControlListProperty("Фамилия")] [ViewModelControlElementProperty("Фамилия", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("LastName")] public string LastName { get; set; } [ViewModelControlListProperty("Имя")] [ViewModelControlElementProperty("Имя", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("FirstName")] public string FirstName { get; set; } [ViewModelControlListProperty("Отчество")] [ViewModelControlElementProperty("Отчество", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("Patronymic")] public string Patronymic { get; set; } [ViewModelControlListProperty("Эл. почта", ColumnWidth = 90)] [ViewModelControlElementProperty("Эл. почта", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("Email")] public string Email { get; set; } [ViewModelControlElementProperty("Описание", ControlType.ControlText)] [MapConfiguration("Description")] public string Description { get; set; } [ViewModelControlElementProperty("Статус", ControlType.ControlEnum, MustHaveValue = true)] [MapConfiguration("StudentState")] public StudentState StudentState { get; set; } [ViewModelControlListProperty("Статус", ColumnWidth = 90)] public string StudentStateTitle => StudentState.ToString("G"); [ViewModelControlElementProperty("Фото", ControlType.ControlImage, Width = 200, Height = 200)] [MapConfiguration("Photo")] public byte[] Photo { get; set; } [ViewModelControlElementProperty("Староста", ControlType.ControlBool, MustHaveValue = true)] [MapConfiguration("IsSteward")] public bool IsSteward { get; set; } } }