2021-04-12 10:01:42 +04:00
|
|
|
|
using ModuleTools.Attributes;
|
|
|
|
|
using ModuleTools.Enums;
|
|
|
|
|
using ModuleTools.Extensions;
|
|
|
|
|
using ModuleTools.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace DepartmentBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-04-12 16:57:29 +04:00
|
|
|
|
/// Список учебных групп
|
2021-04-12 10:01:42 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
public class StudentGroupListViewModel : ListViewModel<StudentGroupViewModel> { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-04-12 16:57:29 +04:00
|
|
|
|
/// Элемент учебная группа
|
2021-04-12 10:01:42 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
|
2021-04-12 16:57:29 +04:00
|
|
|
|
[ViewModelControlElementDependenceEntity(Title = "Студенты", Order = 1, ParentPropertyName = "StudentGroupId",
|
|
|
|
|
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")]
|
2021-04-12 10:01:42 +04:00
|
|
|
|
public class StudentGroupViewModel : ElementViewModel
|
|
|
|
|
{
|
|
|
|
|
[ViewModelControlElementProperty("Учебный план", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")]
|
|
|
|
|
[MapConfiguration("AcademicPlanId")]
|
|
|
|
|
public Guid AcademicPlanId { get; set; }
|
|
|
|
|
|
2021-04-12 16:57:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Шифр", ColumnWidth = 80)]
|
2021-04-12 10:01:42 +04:00
|
|
|
|
[MapConfiguration("AcademicPlan.EducationDirection.Cipher", IsDifficle = true)]
|
|
|
|
|
public string AcademicPlanEducationDirectionCipher { get; set; }
|
|
|
|
|
|
2021-04-12 16:57:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Профиль")]
|
|
|
|
|
[MapConfiguration("AcademicPlan.EducationDirection.Profile", IsDifficle = true)]
|
|
|
|
|
public string AcademicPlanEducationDirectionProfile { get; set; }
|
|
|
|
|
|
2021-04-12 10:01:42 +04:00
|
|
|
|
[MapConfiguration("AcademicPlan.EducationDirection.ShortName", IsDifficle = true)]
|
|
|
|
|
public string AcademicPlanEducationDirectionShortName { get; set; }
|
|
|
|
|
|
2021-04-12 16:57:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Группа")]
|
|
|
|
|
public string GroupName => $"{AcademicPlanEducationDirectionShortName}({EnrollmentYear})-{GroupNumber}";
|
|
|
|
|
|
2021-04-12 10:01:42 +04:00
|
|
|
|
[ViewModelControlListProperty("Номер группы")]
|
|
|
|
|
[ViewModelControlElementProperty("Номер группы", ControlType.ControlInt, MustHaveValue = true, MinValue = 1, MaxValue = 4)]
|
|
|
|
|
[MapConfiguration("GroupNumber")]
|
|
|
|
|
public int GroupNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Год зачисления")]
|
|
|
|
|
[ViewModelControlElementProperty("Год зачисления", ControlType.ControlInt, MustHaveValue = true)]
|
|
|
|
|
[MapConfiguration("EnrollmentYear")]
|
|
|
|
|
public int EnrollmentYear { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
|
|
|
|
|
[MapConfiguration("LecturerId")]
|
|
|
|
|
public Guid? CuratorId { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("Lecturer.LastName", IsDifficle = true)]
|
|
|
|
|
public string LecturerLastName { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("Lecturer.FirstName", IsDifficle = true)]
|
|
|
|
|
public string LecturerFirstName { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("Lecturer.Patronymic", IsDifficle = true)]
|
|
|
|
|
public string LecturerPatronymic { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Куратор")]
|
|
|
|
|
public string Lecturer => $"{LecturerLastName}{(LecturerFirstName.IsNotEmpty() ? $" {LecturerFirstName[0]}." : string.Empty)}{(LecturerPatronymic.IsNotEmpty() ? $"{LecturerPatronymic[0]}." : string.Empty)}";
|
|
|
|
|
|
2021-04-12 16:57:29 +04:00
|
|
|
|
public override string ToString() => GroupName;
|
2021-04-12 10:01:42 +04:00
|
|
|
|
}
|
|
|
|
|
}
|