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;
|
2022-03-18 11:16:29 +04:00
|
|
|
|
using System.Collections.Generic;
|
2021-04-12 10:01:42 +04:00
|
|
|
|
|
|
|
|
|
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>
|
2021-08-20 18:28:34 +04:00
|
|
|
|
[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 15:14:35 +04:00
|
|
|
|
|
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; }
|
|
|
|
|
|
2022-03-18 11:16:29 +04:00
|
|
|
|
[MapConfiguration("Method.GetStudnetsByState[Enum:Учится]", IsDifficle = true, MethodParams = new Type[] { typeof(StudentState) })]
|
|
|
|
|
public int StudentActualCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("Method.GetStudnetsByState[Enum:Академ]", IsDifficle = true, MethodParams = new Type[] { typeof(StudentState) })]
|
|
|
|
|
public int StudentAcademCount { get; set; }
|
|
|
|
|
|
2021-08-20 18:28:34 +04:00
|
|
|
|
[ViewModelControlListProperty("Количество студентов")]
|
2022-03-18 11:16:29 +04:00
|
|
|
|
public string StudentCount => $"{StudentActualCount + StudentAcademCount} ({StudentActualCount}, {StudentAcademCount})";
|
2021-08-20 18:28:34 +04:00
|
|
|
|
|
2021-04-12 10:01:42 +04:00
|
|
|
|
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
|
|
|
|
|
[MapConfiguration("LecturerId")]
|
2021-04-27 15:14:35 +04:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|