DepartmentProject/DepartmentPortal/Department/DepartmentContract/ViewModels/AcademicPlanRecordViewModels.cs

68 lines
3.5 KiB
C#
Raw Normal View History

using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
2021-04-06 22:07:11 +04:00
using System;
2022-03-20 10:10:44 +04:00
using ToolsModule.ManagmentEntity;
using ToolsModule.ManagmentMapping;
2021-04-06 22:07:11 +04:00
namespace DepartmentContract.ViewModels
2021-04-06 22:07:11 +04:00
{
/// <summary>
/// Список аудиторий
/// </summary>
public class AcademicPlanRecordListViewModel : ListViewModel<AcademicPlanRecordViewModel> { }
2021-04-06 22:07:11 +04:00
/// <summary>
/// Элемент аудитории
/// </summary>
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Часы по нагрузкам", Order = 1, ParentPropertyName = "AcademicPlanRecordId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")]
public class AcademicPlanRecordViewModel : ElementViewModel, IAcademicPlanRecordModel
2021-04-06 22:07:11 +04:00
{
[ViewModelControlElementProperty("Учебный план", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")]
public Guid AcademicPlanId { get; set; }
[ViewModelControlElementProperty("Дисциплина", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")]
public Guid DisciplineId { get; set; }
[ViewModelControlListProperty("Дисциплина")]
2022-03-20 19:27:50 +04:00
[MapConfiguration("Discipline.ToString")]
2021-04-06 22:07:11 +04:00
public string DisciplineName { get; set; }
[ViewModelControlElementProperty("Преподается на кафедре", ControlType.ControlBool, MustHaveValue = true)]
public bool InDepartment { get; set; }
[ViewModelControlListProperty("На кафедре", ColumnWidth = 100)]
2021-04-06 22:07:11 +04:00
public string InDepartmentValue => InDepartment ? "Да" : "Нет";
[ViewModelControlElementProperty("Семестр", ControlType.ControlEnum, MustHaveValue = true)]
public Semester Semester { get; set; }
[ViewModelControlListProperty("Семестр", ColumnWidth = 80)]
public string SemesterTitle => Semester.ToString("G");
[ViewModelControlListProperty("Зет", ColumnWidth = 60)]
[ViewModelControlElementProperty("Зет", ControlType.ControlInt, MustHaveValue = true)]
public int Zet { get; set; }
[ViewModelControlElementProperty("Родитель", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")]
public Guid? AcademicPlanRecordParentId { get; set; }
[ViewModelControlElementProperty("Является родительской", ControlType.ControlBool, MustHaveValue = true)]
public bool IsParent { get; set; }
[ViewModelControlListProperty("ДВ", ColumnWidth = 50)]
public string IsParentValue => IsParent ? "Да" : "Нет";
[ViewModelControlListProperty("По выбору", ColumnWidth = 100)]
2021-04-06 22:07:11 +04:00
public string IsChildValue => AcademicPlanRecordParentId.HasValue ? "Да" : "Нет";
[ViewModelControlElementProperty("Является факультативной", ControlType.ControlBool, MustHaveValue = true)]
public bool IsFacultative { get; set; }
[ViewModelControlListProperty("Факульт", ColumnWidth = 80)]
public string IsFacultativeValue => IsFacultative ? "Да" : "Нет";
public override string ToString() => $"{DisciplineName} - {SemesterTitle} семестр";
}
}