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

65 lines
3.2 KiB
C#
Raw Normal View History

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
namespace DepartmentContract.ViewModels
2021-04-12 10:01:42 +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>
[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")]
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 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; }
[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; }
[ViewModelControlListProperty("Количество студентов")]
public string StudentCount => $"{StudentActualCount + StudentAcademCount} ({StudentActualCount}, {StudentAcademCount})";
2021-04-12 10:01:42 +04:00
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
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
}
}