пеервод моделей кафедры, вторая итерация

This commit is contained in:
kotcheshir73 2022-03-18 21:44:04 +04:00
parent 941794b273
commit 9f6450142a
12 changed files with 110 additions and 104 deletions

View File

@ -0,0 +1,40 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("Employee", "Сотрудника кафедры")]
[EntityDependency("User", "UserId", "К какому пользователю относится сотрудник")]
public interface IEmployeeModel : IId
{
Guid UserId { get; }
string FirstName { get; }
string LastName { get; }
string Patronymic { get; }
[CheckRigthForMap]
DateTime DateBirth { get; }
[CheckRigthForMap]
string Address { get; }
[CheckRigthForMap]
string Email { get; }
[CheckRigthForMap]
string MobileNumber { get; }
[CheckRigthForMap]
string HomeNumber { get; }
string Description { get; }
byte[] Photo { get; }
string GroupElectricalSafety { get; }
}
}

View File

@ -0,0 +1,23 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("EmployeeEmployeePost", "Связь сотрудника и должность кафедры")]
[EntityDependency("Post", "PostId", "К какой должности относится сотрудник")]
[EntityDependency("Employee", "EmployeeId", "К какой должности относится сотрудник")]
public interface IEmployeePostModel : IId
{
[CheckRigthForMap]
Guid EmployeeId { get; }
Guid PostId { get; }
decimal Rate { get; }
bool IsInternalCombination { get; }
bool IsExternalCombination { get; }
}
}

View File

@ -0,0 +1,15 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("Post", "Должность на кафедры")]
public interface IPostModel : IId
{
string PostName { get; }
int? Hours { get; }
int Order { get; }
}
}

View File

@ -1,5 +1,5 @@
using DatabaseCore.Models.Security; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes; using DatabaseCore.Models.Security;
using ModuleTools.Extensions; using ModuleTools.Extensions;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System; using System;
@ -9,60 +9,43 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary>
/// Класс, описывающий сотрудника кафедры
/// </summary>
[DataContract] [DataContract]
[EntityDescription("Employee", "Сотрудника кафедры")] public class Employee : BaseEntity, IEntitySecurityExtenstion<Employee>, IEmployeeModel
[EntityDependency("User", "UserId", "К какому пользователю относится сотрудник")]
public class Employee : BaseEntity, IEntitySecurityExtenstion<Employee>
{ {
[DataMember] [DataMember]
[MapConfiguration("UserId")]
public Guid UserId { get; set; } public Guid UserId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("FirstName")]
public string FirstName { get; set; } public string FirstName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("LastName")]
public string LastName { get; set; } public string LastName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Patronymic")]
public string Patronymic { get; set; } public string Patronymic { get; set; }
[DataMember] [DataMember]
[MapConfiguration("DateBirth")]
public DateTime DateBirth { get; set; } public DateTime DateBirth { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Address")]
public string Address { get; set; } public string Address { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Email")]
public string Email { get; set; } public string Email { get; set; }
[DataMember] [DataMember]
[MapConfiguration("MobileNumber")]
public string MobileNumber { get; set; } public string MobileNumber { get; set; }
[DataMember] [DataMember]
[MapConfiguration("HomeNumber")]
public string HomeNumber { get; set; } public string HomeNumber { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Photo")]
public byte[] Photo { get; set; } public byte[] Photo { get; set; }
[DataMember] [DataMember]
[MapConfiguration("GroupElectricalSafety")]
public string GroupElectricalSafety { get; set; } public string GroupElectricalSafety { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,37 +1,26 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System; using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary>
/// Класс, описывающий связь сотрудника и должность кафедры
/// </summary>
[DataContract] [DataContract]
[EntityDescription("EmployeeEmployeePost", "Связь сотрудника и должность кафедры")] public class EmployeePost : BaseEntity, IEntitySecurityExtenstion<EmployeePost>, IEmployeePostModel
[EntityDependency("Post", "PostId", "К какой должности относится сотрудник")]
[EntityDependency("Employee", "EmployeeId", "К какой должности относится сотрудник")]
public class EmployeePost : BaseEntity, IEntitySecurityExtenstion<EmployeePost>
{ {
[DataMember] [DataMember]
[MapConfiguration("EmployeeId")]
public Guid EmployeeId { get; set; } public Guid EmployeeId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("PostId")]
public Guid PostId { get; set; } public Guid PostId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Rate")]
public decimal Rate { get; set; } public decimal Rate { get; set; }
[DataMember] [DataMember]
[MapConfiguration("IsInternalCombination")]
public bool IsInternalCombination { get; set; } public bool IsInternalCombination { get; set; }
[DataMember] [DataMember]
[MapConfiguration("IsExternalCombination")]
public bool IsExternalCombination { get; set; } public bool IsExternalCombination { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
@ -6,23 +6,16 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary>
/// Класс, описывающий должность на кафедры
/// </summary>
[DataContract] [DataContract]
[EntityDescription("Post", "Должность на кафедры")] public class Post : BaseEntity, IEntitySecurityExtenstion<Post>, IPostModel
public class Post : BaseEntity, IEntitySecurityExtenstion<Post>
{ {
[DataMember] [DataMember]
[MapConfiguration("PostName")]
public string PostName { get; set; } public string PostName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Hours")]
public int? Hours { get; set; } public int? Hours { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Order")]
public int Order { get; set; } public int Order { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -16,50 +16,38 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение сотрудника /// Сохранение сотрудника
/// </summary> /// </summary>
public class EmployeeSetBindingModel : SetBindingModel public class EmployeeSetBindingModel : SetBindingModel, IEmployeeModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("UserId")]
public Guid UserId { get; set; } public Guid UserId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("LastName")]
public string LastName { get; set; } public string LastName { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("FirstName")]
public string FirstName { get; set; } public string FirstName { get; set; }
[MapConfiguration("Patronymic")]
public string Patronymic { get; set; } public string Patronymic { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("DateBirth")]
public DateTime DateBirth { get; set; } public DateTime DateBirth { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Address")]
public string Address { get; set; } public string Address { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Email")]
public string Email { get; set; } public string Email { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("MobileNumber")]
public string MobileNumber { get; set; } public string MobileNumber { get; set; }
[MapConfiguration("HomeNumber")]
public string HomeNumber { get; set; } public string HomeNumber { get; set; }
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { get; set; }
[MapConfiguration("Photo")]
public byte[] Photo { get; set; } public byte[] Photo { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("GroupElectricalSafety")]
public string GroupElectricalSafety { get; set; } public string GroupElectricalSafety { get; set; }
} }
} }

View File

@ -1,4 +1,4 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -18,24 +18,19 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение связи сотрудника с должностью /// Сохранение связи сотрудника с должностью
/// </summary> /// </summary>
public class EmployeePostSetBindingModel : SetBindingModel public class EmployeePostSetBindingModel : SetBindingModel, IEmployeePostModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("EmployeeId")]
public Guid EmployeeId { get; set; } public Guid EmployeeId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("PostId")]
public Guid PostId { get; set; } public Guid PostId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Rate")]
public decimal Rate { get; set; } public decimal Rate { get; set; }
[MapConfiguration("IsInternalCombination")]
public bool IsInternalCombination { get; set; } public bool IsInternalCombination { get; set; }
[MapConfiguration("IsExternalCombination")]
public bool IsExternalCombination { get; set; } public bool IsExternalCombination { get; set; }
} }
} }

View File

@ -1,4 +1,4 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -14,18 +14,15 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение должности сотрудника /// Сохранение должности сотрудника
/// </summary> /// </summary>
public class PostSetBindingModel : SetBindingModel public class PostSetBindingModel : SetBindingModel, IPostModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("PostName")]
public string PostName { get; set; } public string PostName { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Hours")]
public int? Hours { get; set; } public int? Hours { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Order")]
public int Order { get; set; } public int Order { get; set; }
} }
} }

View File

@ -1,4 +1,5 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
using System; using System;
@ -14,10 +15,9 @@ namespace DepartmentBusinessLogic.ViewModels
/// Связь сотрудника и должности /// Связь сотрудника и должности
/// </summary> /// </summary>
[ViewModelControlElementClass()] [ViewModelControlElementClass()]
public class EmployeePostViewModel : ElementViewModel public class EmployeePostViewModel : ElementViewModel, IEmployeePostModel
{ {
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeList, DepartmentWindowsDesktop")]
[MapConfiguration("EmployeeId", AllowCopyWithoutRigth = false)]
public Guid EmployeeId { get; set; } public Guid EmployeeId { get; set; }
[ViewModelControlListProperty("Сотрудник")] [ViewModelControlListProperty("Сотрудник")]
@ -25,7 +25,6 @@ namespace DepartmentBusinessLogic.ViewModels
public string EmployeeName { get; set; } public string EmployeeName { get; set; }
[ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlPostList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlPostList, DepartmentWindowsDesktop")]
[MapConfiguration("PostId")]
public Guid PostId { get; set; } public Guid PostId { get; set; }
[ViewModelControlListProperty("Должность")] [ViewModelControlListProperty("Должность")]
@ -34,18 +33,15 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlListProperty("Ставка", ColumnWidth = 80, DefaultCellStyleFormat = "N1")] [ViewModelControlListProperty("Ставка", ColumnWidth = 80, DefaultCellStyleFormat = "N1")]
[ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, DecimalPlaces = 1, MustHaveValue = true)] [ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, DecimalPlaces = 1, MustHaveValue = true)]
[MapConfiguration("Rate")]
public decimal Rate { get; set; } public decimal Rate { get; set; }
[ViewModelControlElementProperty("Внутр. совм.", ControlType.ControlBool, MustHaveValue = true)] [ViewModelControlElementProperty("Внутр. совм.", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("IsInternalCombination")]
public bool IsInternalCombination { get; set; } public bool IsInternalCombination { get; set; }
[ViewModelControlListProperty("Внутр. совм.", ColumnWidth = 80)] [ViewModelControlListProperty("Внутр. совм.", ColumnWidth = 80)]
public string InternalCombination => IsInternalCombination ? "Да" : "Нет"; public string InternalCombination => IsInternalCombination ? "Да" : "Нет";
[ViewModelControlElementProperty("Внеш. совм.", ControlType.ControlBool, MustHaveValue = true)] [ViewModelControlElementProperty("Внеш. совм.", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("IsExternalCombination")]
public bool IsExternalCombination { get; set; } public bool IsExternalCombination { get; set; }
[ViewModelControlListProperty("Внеш. совм.", ColumnWidth = 80)] [ViewModelControlListProperty("Внеш. совм.", ColumnWidth = 80)]

View File

@ -1,4 +1,5 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
using System; using System;
@ -18,63 +19,51 @@ namespace DepartmentBusinessLogic.ViewModels
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")]
[ViewModelControlElementDependenceEntity(Title = "Аудитории", Order = 1, ParentPropertyName = "EmployeeId", [ViewModelControlElementDependenceEntity(Title = "Аудитории", Order = 1, ParentPropertyName = "EmployeeId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlClassroomList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlClassroomList, DepartmentWindowsDesktop")]
public class EmployeeViewModel : ElementViewModel public class EmployeeViewModel : ElementViewModel, IEmployeeModel
{ {
[ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")] [ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")]
[MapConfiguration("UserId")]
public Guid UserId { get; set; } public Guid UserId { get; set; }
[ViewModelControlListProperty("Фамилия")] [ViewModelControlListProperty("Фамилия")]
[ViewModelControlElementProperty("Фамилия", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Фамилия", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("LastName")]
public string LastName { get; set; } public string LastName { get; set; }
[ViewModelControlListProperty("Имя")] [ViewModelControlListProperty("Имя")]
[ViewModelControlElementProperty("Имя", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Имя", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("FirstName")]
public string FirstName { get; set; } public string FirstName { get; set; }
[ViewModelControlListProperty("Отчество")] [ViewModelControlListProperty("Отчество")]
[ViewModelControlElementProperty("Отчество", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Отчество", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("Patronymic")]
public string Patronymic { get; set; } public string Patronymic { get; set; }
[ViewModelControlListProperty("Дата рожд.", ColumnWidth = 100, DefaultCellStyleFormat = "dd.MM.yyyy")] [ViewModelControlListProperty("Дата рожд.", ColumnWidth = 100, DefaultCellStyleFormat = "dd.MM.yyyy")]
[ViewModelControlElementProperty("Дата рожд.", ControlType.ControlDateTime, MustHaveValue = true )] [ViewModelControlElementProperty("Дата рожд.", ControlType.ControlDateTime, MustHaveValue = true )]
[MapConfiguration("DateBirth", AllowCopyWithoutRigth = false)]
public DateTime DateBirth { get; set; } public DateTime DateBirth { get; set; }
[ViewModelControlListProperty("Адрес", ColumnWidth = 90)] [ViewModelControlListProperty("Адрес", ColumnWidth = 90)]
[ViewModelControlElementProperty("Адрес", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Адрес", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("Address", AllowCopyWithoutRigth = false)]
public string Address { get; set; } public string Address { get; set; }
[ViewModelControlListProperty("Эл. почта", ColumnWidth = 90)] [ViewModelControlListProperty("Эл. почта", ColumnWidth = 90)]
[ViewModelControlElementProperty("Эл. почта", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Эл. почта", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("Email", AllowCopyWithoutRigth = false)]
public string Email { get; set; } public string Email { get; set; }
[ViewModelControlListProperty("Моб. номер", ColumnWidth = 100)] [ViewModelControlListProperty("Моб. номер", ColumnWidth = 100)]
[ViewModelControlElementProperty("Моб. номер", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Моб. номер", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("MobileNumber", AllowCopyWithoutRigth = false)]
public string MobileNumber { get; set; } public string MobileNumber { get; set; }
[ViewModelControlListProperty("Дом. номер", ColumnWidth = 100)] [ViewModelControlListProperty("Дом. номер", ColumnWidth = 100)]
[ViewModelControlElementProperty("Дом. номер", ControlType.ControlString)] [ViewModelControlElementProperty("Дом. номер", ControlType.ControlString)]
[MapConfiguration("HomeNumber", AllowCopyWithoutRigth = false)]
public string HomeNumber { get; set; } public string HomeNumber { get; set; }
[ViewModelControlElementProperty("Описание", ControlType.ControlText)] [ViewModelControlElementProperty("Описание", ControlType.ControlText)]
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { get; set; }
[ViewModelControlElementProperty("Фото", ControlType.ControlImage, Width = 200, Height = 200)] [ViewModelControlElementProperty("Фото", ControlType.ControlImage, Width = 200, Height = 200)]
[MapConfiguration("Photo")]
public byte[] Photo { get; set; } public byte[] Photo { get; set; }
[ViewModelControlListProperty("Гр. эл.без.", ColumnWidth = 90)] [ViewModelControlListProperty("Гр. эл.без.", ColumnWidth = 90)]
[ViewModelControlElementProperty("Группа эл.безоп", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Группа эл.безоп", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("GroupElectricalSafety")]
public string GroupElectricalSafety { get; set; } public string GroupElectricalSafety { get; set; }
} }
} }

View File

@ -1,4 +1,5 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
@ -17,15 +18,13 @@ namespace DepartmentBusinessLogic.ViewModels
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")]
[ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "PostId", [ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "PostId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerPostList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerPostList, DepartmentWindowsDesktop")]
public class PostViewModel : ElementViewModel public class PostViewModel : ElementViewModel, IPostModel
{ {
[ViewModelControlListProperty("Название должности")] [ViewModelControlListProperty("Название должности")]
[ViewModelControlElementProperty("Название должности", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Название должности", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("PostName")]
public string PostName { get; set; } public string PostName { get; set; }
[ViewModelControlElementProperty("Часы", ControlType.ControlInt, MustHaveValue = false)] [ViewModelControlElementProperty("Часы", ControlType.ControlInt, MustHaveValue = false)]
[MapConfiguration("Hours")]
public int? Hours { get; set; } public int? Hours { get; set; }
[ViewModelControlListProperty("Часы", ColumnWidth = 100)] [ViewModelControlListProperty("Часы", ColumnWidth = 100)]
@ -33,7 +32,6 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlListProperty("Порядок", ColumnWidth = 100)] [ViewModelControlListProperty("Порядок", ColumnWidth = 100)]
[ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)] [ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)]
[MapConfiguration("Order")]
public int Order { get; set; } public int Order { get; set; }
} }
} }