DepartmentProject/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs

64 lines
2.9 KiB
C#
Raw Normal View History

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