using DepartmentBusinessLogic.Enums;
using ModuleTools.Attributes;
using ModuleTools.Enums;
using ModuleTools.ViewModels;
using System;
namespace DepartmentBusinessLogic.ViewModels
{
///
/// Список учебных групп
///
public class StudentGroupListViewModel : ListViewModel { }
///
/// Элемент учебная группа
///
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 1000, Height = 900)]
[ViewModelControlElementDependenceEntity(Title = "Студенты", Order = 1, ParentPropertyName = "StudentGroupId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")]
public class StudentGroupViewModel : ElementViewModel
{
[ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")]
[MapConfiguration("EducationDirectionId")]
public Guid EducationDirectionId { get; set; }
[ViewModelControlListProperty("Шифр", ColumnWidth = 80)]
[MapConfiguration("EducationDirection.Cipher", IsDifficle = true)]
public string EducationDirectionCipher { get; set; }
[ViewModelControlListProperty("Профиль")]
[MapConfiguration("EducationDirection.Profile", IsDifficle = true)]
public string EducationDirectionProfile { get; set; }
[MapConfiguration("EducationDirection.ShortName", IsDifficle = true)]
public string EducationDirectionShortName { get; set; }
[ViewModelControlListProperty("Группа")]
public string GroupName => $"{EducationDirectionShortName}-{(int)AcademicCourse}{GroupNumber}";
[ViewModelControlElementProperty("Курс", ControlType.ControlEnum, MustHaveValue = true)]
[MapConfiguration("AcademicCourse")]
public AcademicCourse AcademicCourse { get; set; }
[ViewModelControlListProperty("Курс")]
public string AcademicCourseTitle => AcademicCourse.ToString("G");
[ViewModelControlListProperty("Номер группы")]
[ViewModelControlElementProperty("Номер группы", ControlType.ControlInt, MustHaveValue = true, MinValue = 0, MaxValue = 4)]
[MapConfiguration("GroupNumber")]
public int GroupNumber { get; set; }
[ViewModelControlListProperty("Количество студентов")]
[MapConfiguration("Students.Count", IsDifficle = true)]
public int StudentCount { get; set; }
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
[MapConfiguration("LecturerId")]
public Guid? LecturerId { get; set; }
[ViewModelControlListProperty("Куратор")]
[MapConfiguration("Lecturer.ToString", IsDifficle = true)]
public string Lecturer { get; set; }
}
}