73 lines
2.8 KiB
C#
73 lines
2.8 KiB
C#
|
using DepartmentBusinessLogic.Enums;
|
|||
|
using ModuleTools.Attributes;
|
|||
|
using ModuleTools.Enums;
|
|||
|
using ModuleTools.ViewModels;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace DepartmentBusinessLogic.ViewModels
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Список ролей
|
|||
|
/// </summary>
|
|||
|
public class ClassroomListViewModel : ListViewModel<ClassroomViewModel> { }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Элемент ролей
|
|||
|
/// </summary>
|
|||
|
[ViewModelControlElementClass()]
|
|||
|
public class ClassroomViewModel : ElementViewModel
|
|||
|
{
|
|||
|
[ViewModelControlListProperty("Номер", 80)]
|
|||
|
[ViewModelControlElementProperty("Номер аудитории", ControlType.ControlString, MustHaveValue = true)]
|
|||
|
[MapConfiguration("Number")]
|
|||
|
public string Number { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Название")]
|
|||
|
[ViewModelControlElementProperty("Название", ControlType.ControlString)]
|
|||
|
[MapConfiguration("Title")]
|
|||
|
public string Title { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeList, DepartmentWindowsDesktop")]
|
|||
|
[MapConfiguration("EmployeeId")]
|
|||
|
public Guid EmployeeId { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Сотрудник")]
|
|||
|
[MapConfiguration("Employee.LastName", IsDifficle = true)]
|
|||
|
public string EmployeeName { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Тип", ControlType.ControlEnum, MustHaveValue = true)]
|
|||
|
[MapConfiguration("ClassroomType")]
|
|||
|
public ClassroomType ClassroomType { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Тип", 120)]
|
|||
|
public string ClassroomTypeTitle => ClassroomType.ToString("G");
|
|||
|
|
|||
|
[ViewModelControlListProperty("Площадь", 90)]
|
|||
|
[ViewModelControlElementProperty("Площадь", ControlType.ControlDecimal, MustHaveValue = true)]
|
|||
|
[MapConfiguration("Square")]
|
|||
|
public decimal Square { get; set; }
|
|||
|
|
|||
|
[ViewModelControlListProperty("Кол-во мест", 100)]
|
|||
|
[ViewModelControlElementProperty("Кол-во мест", ControlType.ControlInt, MustHaveValue = true)]
|
|||
|
[MapConfiguration("Capacity")]
|
|||
|
public int Capacity { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Код безоп.", ControlType.ControlString, MustHaveValue = true)]
|
|||
|
[MapConfiguration("SecurityCode")]
|
|||
|
public string SecurityCode { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Есть проектор", ControlType.ControlBool, MustHaveValue = true)]
|
|||
|
[MapConfiguration("HaveProjector")]
|
|||
|
public bool HaveProjector { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Описание", ControlType.ControlText)]
|
|||
|
[MapConfiguration("Description")]
|
|||
|
public string Description { get; set; }
|
|||
|
|
|||
|
[ViewModelControlElementProperty("Фото", ControlType.ControlImage, Width = 200, Height = 200)]
|
|||
|
[MapConfiguration("Photo")]
|
|||
|
public byte[] Photo { get; set; }
|
|||
|
|
|||
|
public override string ToString() => Number;
|
|||
|
}
|
|||
|
}
|