using CoreModels.ModelsDepartment;
using ToolsModule.Attributes;
using ToolsModule.Enums;
using ToolsModule.ViewModels;
using System;
namespace DepartmentBusinessLogic.ViewModels
{
///
/// Список связей сотрудников и должностей
///
public class EmployeePostListViewModel : ListViewModel { }
///
/// Связь сотрудника и должности
///
[ViewModelControlElementClass()]
public class EmployeePostViewModel : ElementViewModel, IEmployeePostModel
{
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeList, DepartmentWindowsDesktop")]
public Guid EmployeeId { get; set; }
[ViewModelControlListProperty("Сотрудник")]
[MapConfiguration("Employee.ToString", IsDifficle = true)]
public string EmployeeName { get; set; }
[ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlPostList, DepartmentWindowsDesktop")]
public Guid PostId { get; set; }
[ViewModelControlListProperty("Должность")]
[MapConfiguration("Post.ToString", IsDifficle = true)]
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 ? "Да" : "Нет";
}
}