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

71 lines
3.4 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
{
2022-12-16 17:43:23 +04:00
[ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")]
public Guid AcademicPlanId { get; set; }
2021-04-12 10:01:42 +04:00
2021-04-12 16:57:29 +04:00
[ViewModelControlListProperty("Шифр", ColumnWidth = 80)]
2022-12-16 17:43:23 +04:00
[MapConfiguration("AcademicPlan.EducationDirection.Cipher")]
2021-04-27 18:04:01 +04:00
public string EducationDirectionCipher { get; set; }
2021-04-12 10:01:42 +04:00
2021-04-12 16:57:29 +04:00
[ViewModelControlListProperty("Профиль")]
2022-12-16 17:43:23 +04:00
[MapConfiguration("AcademicPlan.EducationDirection.Profile")]
2021-04-27 18:04:01 +04:00
public string EducationDirectionProfile { get; set; }
2021-04-12 16:57:29 +04:00
2022-12-16 17:43:23 +04:00
[MapConfiguration("AcademicPlan.EducationDirection.ShortName")]
2021-04-27 18:04:01 +04:00
public string EducationDirectionShortName { get; set; }
2021-04-12 10:01:42 +04:00
2022-12-16 17:43:23 +04:00
[ViewModelControlElementProperty("Год начала", ControlType.ControlInt, MustHaveValue = true)]
public int YearEntrance { get; set; }
[ViewModelControlElementProperty("Год окончания", ControlType.ControlInt, MustHaveValue = true)]
public int YearFinish { get; set; }
2021-04-12 16:57:29 +04:00
[ViewModelControlListProperty("Группа")]
2021-04-27 18:04:01 +04:00
public string GroupName => $"{EducationDirectionShortName}-{(int)AcademicCourse}{GroupNumber}";
2022-12-16 17:43:23 +04:00
[ViewModelControlElementProperty("Курс", ControlType.ControlEnum, ReadOnly = true)]
2021-04-27 18:04:01 +04:00
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-20 19:27:50 +04:00
[MapConfiguration("Method.GetStudnetsByState[Enum:Учится]", MethodParams = new Type[] { typeof(StudentState) })]
public int StudentActualCount { get; set; }
2022-03-20 19:27:50 +04:00
[MapConfiguration("Method.GetStudnetsByState[Enum:Академ]", 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("Куратор")]
2022-03-20 19:27:50 +04:00
[MapConfiguration("Lecturer.ToString")]
2021-04-13 12:52:45 +04:00
public string Lecturer { get; set; }
2021-04-12 10:01:42 +04:00
}
}