using AcademicProgressBusinessLogic.Enums; using DepartmentBusinessLogic.Enums; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; using System; namespace AcademicProgressBusinessLogic.ViewModels { /// /// Список успеваемости студентов /// public class StudentAcademicProgressListViewModel : ListViewModel { } /// /// Элемент успеваемости студента /// [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 1200, Height = 800)] [ViewModelControlElementDependenceEntity(Title = "Студенты", Order = 1, ParentPropertyName = "StudentAcademicProgressId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")] [ViewModelControlElementDependenceEntity(Title = "Дисципилны", Order = 2, ParentPropertyName = "StudentAcademicProgressId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")] public class StudentAcademicProgressViewModels : ElementViewModel { [ViewModelControlElementProperty("Студент", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")] [MapConfiguration("StudentId")] public Guid StudentId { get; set; } [ViewModelControlListProperty("Фамилия", ColumnWidth = 250)] [MapConfiguration("Student.LastName", IsDifficle = true)] public string LastName { get; set; } [ViewModelControlListProperty("Имя", ColumnWidth = 200)] [MapConfiguration("Student.FirstName", IsDifficle = true)] public string FirstName { get; set; } [ViewModelControlElementProperty("Дисциплина", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")] [MapConfiguration("DisciplineId")] public Guid DisciplineId { get; set; } [ViewModelControlListProperty("Дисциплина")] [MapConfiguration("Discipline.ToString", IsDifficle = true)] public string DisciplineName { get; set; } [ViewModelControlElementProperty("Семестр", ControlType.ControlEnum, MustHaveValue = true)] [MapConfiguration("Semester")] public Semester Semester { get; set; } [ViewModelControlListProperty("Семестр", ColumnWidth = 100)] public string SemesterTitle => Semester.ToString("G"); [ViewModelControlElementProperty("Оценка", ControlType.ControlEnum, MustHaveValue = true)] [MapConfiguration("Score")] public ExamScores Score { get; set; } [ViewModelControlListProperty("Оценка", ColumnWidth = 160)] public string ExamScoresTitle => Score.ToString("G"); [ViewModelControlElementProperty("Является сдачей по направлению", ControlType.ControlBool, MustHaveValue = true)] [MapConfiguration("IsResit")] public bool IsResit { get; set; } [ViewModelControlListProperty("Cдача по направлению", ColumnWidth = 120)] public string IsResitT => IsResit ? "Да" : "Нет"; [ViewModelControlElementProperty("Является повышением оценки", ControlType.ControlBool, MustHaveValue = true)] [MapConfiguration("IsIncreaseScore")] public bool IsIncreaseScore { get; set; } [ViewModelControlListProperty("Повышение оценки", ColumnWidth = 120)] public string IsIncreaseScoreS => IsIncreaseScore ? "Да" : "Нет"; [ViewModelControlListProperty("Дата проставления", ColumnWidth = 120, DefaultCellStyleFormat = "dd.MM.yyyy")] [ViewModelControlElementProperty("Дата проставления", ControlType.ControlDateTime, MustHaveValue = true)] [MapConfiguration("AffixingDate")] public DateTime AffixingDate { get; set; } } }