79 lines
3.8 KiB
C#
79 lines
3.8 KiB
C#
using DepartmentBusinessLogic.Enums;
|
||
using ModuleTools.Attributes;
|
||
using ModuleTools.Enums;
|
||
using ModuleTools.ViewModels;
|
||
using System;
|
||
|
||
namespace DepartmentBusinessLogic.ViewModels
|
||
{
|
||
/// <summary>
|
||
/// Список аудиторий
|
||
/// </summary>
|
||
public class AcademicPlanRecordListViewModel : ListViewModel<AcademicPlanRecordViewModel> { }
|
||
|
||
/// <summary>
|
||
/// Элемент аудитории
|
||
/// </summary>
|
||
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
|
||
[ViewModelControlElementDependenceEntity(Title = "Часы по нагрузкам", Order = 1, ParentPropertyName = "AcademicPlanRecordId",
|
||
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")]
|
||
public class AcademicPlanRecordViewModel : ElementViewModel
|
||
{
|
||
[ViewModelControlElementProperty("Учебный план", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")]
|
||
[MapConfiguration("AcademicPlanId")]
|
||
public Guid AcademicPlanId { get; set; }
|
||
|
||
[ViewModelControlElementProperty("Дисциплина", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")]
|
||
[MapConfiguration("DisciplineId")]
|
||
public Guid DisciplineId { get; set; }
|
||
|
||
[ViewModelControlListProperty("Дисциплина")]
|
||
[MapConfiguration("Discipline.ToString", IsDifficle = true)]
|
||
public string DisciplineName { get; set; }
|
||
|
||
[ViewModelControlElementProperty("Преподается на кафедре", ControlType.ControlBool, MustHaveValue = true)]
|
||
[MapConfiguration("InDepartment")]
|
||
public bool InDepartment { get; set; }
|
||
|
||
[ViewModelControlListProperty("На кафедре", ColumnWidth = 100)]
|
||
public string InDepartmentValue => InDepartment ? "Да" : "Нет";
|
||
|
||
[ViewModelControlElementProperty("Семестр", ControlType.ControlEnum, MustHaveValue = true)]
|
||
[MapConfiguration("Semester")]
|
||
public Semester Semester { get; set; }
|
||
|
||
[ViewModelControlListProperty("Семестр", ColumnWidth = 80)]
|
||
public string SemesterTitle => Semester.ToString("G");
|
||
|
||
[ViewModelControlListProperty("Зет", ColumnWidth = 60)]
|
||
[ViewModelControlElementProperty("Зет", ControlType.ControlInt, MustHaveValue = true)]
|
||
[MapConfiguration("Zet")]
|
||
public int Zet { get; set; }
|
||
|
||
[ViewModelControlElementProperty("Родитель", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")]
|
||
[MapConfiguration("AcademicPlanRecordParentId")]
|
||
public Guid? AcademicPlanRecordParentId { get; set; }
|
||
|
||
[ViewModelControlElementProperty("Является родительской", ControlType.ControlBool, MustHaveValue = true)]
|
||
[MapConfiguration("IsParent")]
|
||
public bool IsParent { get; set; }
|
||
|
||
[ViewModelControlListProperty("ДВ", ColumnWidth = 50)]
|
||
public string IsParentValue => IsParent ? "Да" : "Нет";
|
||
|
||
[ViewModelControlListProperty("По выбору", ColumnWidth = 100)]
|
||
public string IsChildValue => AcademicPlanRecordParentId.HasValue ? "Да" : "Нет";
|
||
|
||
/// <summary>
|
||
/// Является факультативной дисциплиной
|
||
/// </summary>
|
||
[ViewModelControlElementProperty("Является факультативной", ControlType.ControlBool, MustHaveValue = true)]
|
||
[MapConfiguration("IsFacultative")]
|
||
public bool IsFacultative { get; set; }
|
||
|
||
[ViewModelControlListProperty("Факульт", ColumnWidth = 80)]
|
||
public string IsFacultativeValue => IsFacultative ? "Да" : "Нет";
|
||
|
||
public override string ToString() => $"{DisciplineName} - {SemesterTitle} семестр";
|
||
}
|
||
} |