DepartmentProject/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerPostViewModels.cs

54 lines
2.6 KiB
C#
Raw Normal View History

using ModuleTools.Attributes;
using ModuleTools.Enums;
using ModuleTools.ViewModels;
using System;
namespace DepartmentBusinessLogic.ViewModels
{
/// <summary>
/// Список связей преподавателей и должностей
/// </summary>
public class LecturerPostListViewModel : ListViewModel<LecturerPostViewModel> { }
/// <summary>
/// Связь преподавателя и должности
/// </summary>
[ViewModelControlElementClass()]
public class LecturerPostViewModel : ElementViewModel
{
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
[MapConfiguration("LecturerId", AllowCopyWithoutRigth = false)]
public Guid LecturerId { get; set; }
[ViewModelControlListProperty("Преподаватель")]
2021-04-13 12:52:45 +04:00
[MapConfiguration("Lecturer.ToString", IsDifficle = true)]
public string LecturerName { get; set; }
[ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlPostList, DepartmentWindowsDesktop")]
[MapConfiguration("PostId")]
public Guid PostId { get; set; }
[ViewModelControlListProperty("Должность")]
2021-04-13 12:52:45 +04:00
[MapConfiguration("Post.ToString", IsDifficle = true)]
public string PostName { get; set; }
[ViewModelControlListProperty("Ставка", ColumnWidth = 80, DefaultCellStyleFormat = "N1")]
[ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, DecimalPlaces = 1, MustHaveValue = true)]
[MapConfiguration("Rate")]
public decimal Rate { get; set; }
[ViewModelControlElementProperty("Внутр. совм.", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("IsInternalCombination")]
public bool IsInternalCombination { get; set; }
[ViewModelControlListProperty("Внутр. совм.", ColumnWidth = 80)]
public string InternalCombination => IsInternalCombination ? "Да" : "Нет";
[ViewModelControlElementProperty("Внеш. совм.", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("IsExternalCombination")]
public bool IsExternalCombination { get; set; }
[ViewModelControlListProperty("Внеш. совм.", ColumnWidth = 80)]
public string ExternalCombination => IsExternalCombination ? "Да" : "Нет";
}
}