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

49 lines
2.4 KiB
C#
Raw Permalink Normal View History

using CoreModels.ModelsDepartment;
using System;
2022-03-20 10:10:44 +04:00
using ToolsModule.ManagmentEntity;
using ToolsModule.ManagmentMapping;
namespace DepartmentContract.ViewModels
{
/// <summary>
/// Список связей преподавателей и должностей
/// </summary>
public class LecturerPostListViewModel : ListViewModel<LecturerPostViewModel> { }
/// <summary>
/// Связь преподавателя и должности
/// </summary>
[ViewModelControlElementClass()]
public class LecturerPostViewModel : ElementViewModel, ILecturerPostModel
{
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
public Guid LecturerId { get; set; }
[ViewModelControlListProperty("Преподаватель")]
2022-03-20 19:27:50 +04:00
[MapConfiguration("Lecturer.ToString")]
public string LecturerName { get; set; }
[ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlPostList, DepartmentWindowsDesktop")]
public Guid PostId { get; set; }
[ViewModelControlListProperty("Должность")]
2022-03-20 19:27:50 +04:00
[MapConfiguration("Post.ToString")]
public string PostName { get; set; }
[ViewModelControlListProperty("Ставка", ColumnWidth = 80, DefaultCellStyleFormat = "N1")]
[ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, DecimalPlaces = 1, MustHaveValue = true)]
public decimal Rate { get; set; }
[ViewModelControlElementProperty("Внутр. совм.", ControlType.ControlBool, MustHaveValue = true)]
public bool IsInternalCombination { get; set; }
[ViewModelControlListProperty("Внутр. совм.", ColumnWidth = 80)]
public string InternalCombination => IsInternalCombination ? "Да" : "Нет";
[ViewModelControlElementProperty("Внеш. совм.", ControlType.ControlBool, MustHaveValue = true)]
public bool IsExternalCombination { get; set; }
[ViewModelControlListProperty("Внеш. совм.", ColumnWidth = 80)]
public string ExternalCombination => IsExternalCombination ? "Да" : "Нет";
}
}