DepartmentProject/DepartmentPortal/Department/DepartmentContract/ViewModels/StudentGroupViewModels.cs
2022-12-16 17:43:23 +04:00

71 lines
3.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using System;
using ToolsModule.ManagmentEntity;
using ToolsModule.ManagmentMapping;
namespace DepartmentContract.ViewModels
{
/// <summary>
/// Список учебных групп
/// </summary>
public class StudentGroupListViewModel : ListViewModel<StudentGroupViewModel> { }
/// <summary>
/// Элемент учебная группа
/// </summary>
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 1000, Height = 900)]
[ViewModelControlElementDependenceEntity(Title = "Студенты", Order = 1, ParentPropertyName = "StudentGroupId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")]
public class StudentGroupViewModel : ElementViewModel, IStudentGroupModel
{
[ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")]
public Guid AcademicPlanId { get; set; }
[ViewModelControlListProperty("Шифр", ColumnWidth = 80)]
[MapConfiguration("AcademicPlan.EducationDirection.Cipher")]
public string EducationDirectionCipher { get; set; }
[ViewModelControlListProperty("Профиль")]
[MapConfiguration("AcademicPlan.EducationDirection.Profile")]
public string EducationDirectionProfile { get; set; }
[MapConfiguration("AcademicPlan.EducationDirection.ShortName")]
public string EducationDirectionShortName { get; set; }
[ViewModelControlElementProperty("Год начала", ControlType.ControlInt, MustHaveValue = true)]
public int YearEntrance { get; set; }
[ViewModelControlElementProperty("Год окончания", ControlType.ControlInt, MustHaveValue = true)]
public int YearFinish { get; set; }
[ViewModelControlListProperty("Группа")]
public string GroupName => $"{EducationDirectionShortName}-{(int)AcademicCourse}{GroupNumber}";
[ViewModelControlElementProperty("Курс", ControlType.ControlEnum, ReadOnly = true)]
public AcademicCourse AcademicCourse { get; set; }
[ViewModelControlListProperty("Курс")]
public string AcademicCourseTitle => AcademicCourse.ToString("G");
[ViewModelControlListProperty("Номер группы")]
[ViewModelControlElementProperty("Номер группы", ControlType.ControlInt, MustHaveValue = true, MinValue = 0, MaxValue = 4)]
public int GroupNumber { get; set; }
[MapConfiguration("Method.GetStudnetsByState[Enum:Учится]", MethodParams = new Type[] { typeof(StudentState) })]
public int StudentActualCount { get; set; }
[MapConfiguration("Method.GetStudnetsByState[Enum:Академ]", MethodParams = new Type[] { typeof(StudentState) })]
public int StudentAcademCount { get; set; }
[ViewModelControlListProperty("Количество студентов")]
public string StudentCount => $"{StudentActualCount + StudentAcademCount} ({StudentActualCount}, {StudentAcademCount})";
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
public Guid? LecturerId { get; set; }
[ViewModelControlListProperty("Куратор")]
[MapConfiguration("Lecturer.ToString")]
public string Lecturer { get; set; }
}
}