using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using System;
using ToolsModule.ManagmentEntity;
using ToolsModule.ManagmentMapping;
namespace DepartmentContract.ViewModels
{
///
/// Список аудиторий
///
public class AcademicPlanRecordListViewModel : ListViewModel { }
///
/// Элемент аудитории
///
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Часы по нагрузкам", Order = 1, ParentPropertyName = "AcademicPlanRecordId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")]
public class AcademicPlanRecordViewModel : ElementViewModel, IAcademicPlanRecordModel
{
[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("Дисциплина")]
[MapConfiguration("Discipline.ToString", IsDifficle = true)]
public string DisciplineName { get; set; }
[ViewModelControlElementProperty("Преподается на кафедре", ControlType.ControlBool, MustHaveValue = true)]
public bool InDepartment { get; set; }
[ViewModelControlListProperty("На кафедре", ColumnWidth = 100)]
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)]
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} семестр";
}
}