2022-03-18 22:08:29 +04:00
|
|
|
|
using CoreModels.Enums.Department;
|
|
|
|
|
using CoreModels.ModelsDepartment;
|
2021-04-12 10:01:42 +04:00
|
|
|
|
using System;
|
2022-03-20 10:10:44 +04:00
|
|
|
|
using ToolsModule.ManagmentEntity;
|
|
|
|
|
using ToolsModule.ManagmentMapping;
|
2021-04-12 10:01:42 +04:00
|
|
|
|
|
2022-03-19 22:48:13 +04:00
|
|
|
|
namespace DepartmentContract.ViewModels
|
2021-04-12 10:01:42 +04:00
|
|
|
|
{
|
2022-03-18 22:08:29 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список учебных групп
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class StudentGroupListViewModel : ListViewModel<StudentGroupViewModel> { }
|
2021-04-12 10:01:42 +04:00
|
|
|
|
|
|
|
|
|
/// <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")]
|
2022-03-18 22:08:29 +04:00
|
|
|
|
public class StudentGroupViewModel : ElementViewModel, IStudentGroupModel
|
2021-04-12 10:01:42 +04:00
|
|
|
|
{
|
2021-04-27 18:04:01 +04:00
|
|
|
|
[ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")]
|
|
|
|
|
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)]
|
|
|
|
|
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
|
|
|
|
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")]
|
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
|
|
|
|
}
|
|
|
|
|
}
|