2021-04-03 22:04:11 +04:00
|
|
|
|
using ModuleTools.Attributes;
|
|
|
|
|
using ModuleTools.Enums;
|
|
|
|
|
using ModuleTools.ViewModels;
|
|
|
|
|
|
|
|
|
|
namespace DepartmentBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-04-05 12:25:10 +04:00
|
|
|
|
/// Список должностей
|
2021-04-03 22:04:11 +04:00
|
|
|
|
/// </summary>
|
2021-04-05 12:25:10 +04:00
|
|
|
|
public class PostListViewModel : ListViewModel<PostViewModel> { }
|
2021-04-03 22:04:11 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-04-05 12:25:10 +04:00
|
|
|
|
/// Элемент должности
|
2021-04-03 22:04:11 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
|
2021-04-05 12:25:10 +04:00
|
|
|
|
[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
|
2021-04-03 22:04:11 +04:00
|
|
|
|
{
|
|
|
|
|
[ViewModelControlListProperty("Название должности")]
|
|
|
|
|
[ViewModelControlElementProperty("Название должности", ControlType.ControlString, MustHaveValue = true)]
|
2021-04-05 12:25:10 +04:00
|
|
|
|
[MapConfiguration("PostName")]
|
|
|
|
|
public string PostName { get; set; }
|
2021-04-03 22:04:11 +04:00
|
|
|
|
|
2021-04-05 12:25:10 +04:00
|
|
|
|
[ViewModelControlElementProperty("Часы", ControlType.ControlInt, MustHaveValue = false)]
|
2021-04-03 22:04:11 +04:00
|
|
|
|
[MapConfiguration("Hours")]
|
2021-04-05 12:25:10 +04:00
|
|
|
|
public int? Hours { get; set; }
|
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Часы", ColumnWidth = 100)]
|
|
|
|
|
public string HoursStr => Hours.HasValue ? Hours.ToString() : string.Empty;
|
2021-04-03 22:04:11 +04:00
|
|
|
|
|
|
|
|
|
[ViewModelControlListProperty("Порядок", ColumnWidth = 100)]
|
|
|
|
|
[ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)]
|
|
|
|
|
[MapConfiguration("Order")]
|
|
|
|
|
public int Order { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|