65 lines
3.2 KiB
C#
65 lines
3.2 KiB
C#
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.ControlEducationDirectionList, DepartmentWindowsDesktop")]
|
||
public Guid EducationDirectionId { get; set; }
|
||
|
||
[ViewModelControlListProperty("Шифр", ColumnWidth = 80)]
|
||
[MapConfiguration("EducationDirection.Cipher", IsDifficle = true)]
|
||
public string EducationDirectionCipher { get; set; }
|
||
|
||
[ViewModelControlListProperty("Профиль")]
|
||
[MapConfiguration("EducationDirection.Profile", IsDifficle = true)]
|
||
public string EducationDirectionProfile { get; set; }
|
||
|
||
[MapConfiguration("EducationDirection.ShortName", IsDifficle = true)]
|
||
public string EducationDirectionShortName { get; set; }
|
||
|
||
[ViewModelControlListProperty("Группа")]
|
||
public string GroupName => $"{EducationDirectionShortName}-{(int)AcademicCourse}{GroupNumber}";
|
||
|
||
[ViewModelControlElementProperty("Курс", ControlType.ControlEnum, MustHaveValue = 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:Учится]", 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})";
|
||
|
||
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
|
||
public Guid? LecturerId { get; set; }
|
||
|
||
[ViewModelControlListProperty("Куратор")]
|
||
[MapConfiguration("Lecturer.ToString", IsDifficle = true)]
|
||
public string Lecturer { get; set; }
|
||
}
|
||
} |