using CoreModels.ModelsDepartment;
using ToolsModule.ManagmentEntity;
namespace DepartmentContract.ViewModels
{
///
/// Список должностей
///
public class PostListViewModel : ListViewModel { }
///
/// Элемент должности
///
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Сотрудники", Order = 1, ParentPropertyName = "PostId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")]
[ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "PostId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerPostList, DepartmentWindowsDesktop")]
public class PostViewModel : ElementViewModel, IPostModel
{
[ViewModelControlListProperty("Название должности")]
[ViewModelControlElementProperty("Название должности", ControlType.ControlString, MustHaveValue = true)]
public string PostName { get; set; }
[ViewModelControlElementProperty("Часы", ControlType.ControlInt, MustHaveValue = false)]
public int? Hours { get; set; }
[ViewModelControlListProperty("Часы", ColumnWidth = 100)]
public string HoursStr => Hours.HasValue ? Hours.ToString() : string.Empty;
[ViewModelControlListProperty("Порядок", ColumnWidth = 100)]
[ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)]
public int Order { get; set; }
}
}