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

This commit is contained in:
kotcheshir73 2022-03-18 21:54:25 +04:00
parent 9f6450142a
commit c7a24dcaad
16 changed files with 155 additions and 148 deletions

View File

@ -0,0 +1,15 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("LecturerAcademicDegree", "Ученой степени преподавателя кафедры")]
public interface ILecturerAcademicDegreeModel : IId
{
string LecturerAcademicDegreeName { get; }
string Description { get; }
int Order { get; }
}
}

View File

@ -0,0 +1,13 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("LecturerAcademicRank", "Ученое звание преподавателя кафедры")]
public interface ILecturerAcademicRankModel : IId
{
string LecturerAcademicRankName { get; }
int Order { get; }
}
}

View File

@ -0,0 +1,50 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("Lecturer", "Преподаваетль кафедры")]
[EntityDependency("User", "UserId", "К какому пользователю относится преподаватель")]
[EntityDependency("LecturerAcademicRank", "LecturerAcademicRankId", "Какое звание имеет преподаватель")]
[EntityDependency("LecturerAcademicDegree", "LecturerAcademicDegreeId", "Какую степень имеет преподаватель")]
public interface ILecturerModel : IId
{
Guid UserId { get; }
Guid? LecturerAcademicRankId { get; }
Guid? LecturerAcademicDegreeId { get; }
string LastName { get; }
string FirstName { get; }
string Patronymic { get; }
string Abbreviation { 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; }
bool OnlyForPrivate { get; }
string GroupElectricalSafety { get; }
}
}

View File

@ -0,0 +1,23 @@
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("LecturerPost", "Связь преподавателя и должность кафедры")]
[EntityDependency("Post", "PostId", "К какой должности относится преподаватель")]
[EntityDependency("Lecturer", "LecturerId", "К какой должности относится преподаватель")]
public interface ILecturerPostModel : IId
{
[CheckRigthForMap]
Guid LecturerId { get; }
Guid PostId { get; }
decimal Rate { get; }
bool IsInternalCombination { get; }
bool IsExternalCombination { 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;
@ -10,85 +10,62 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий преподавателя public class Lecturer : BaseEntity, IEntitySecurityExtenstion<Lecturer>, ILecturerModel
/// </summary>
[DataContract]
[EntityDescription("Lecturer", "Преподаваетль кафедры")]
[EntityDependency("User", "UserId", "К какому пользователю относится преподаватель")]
[EntityDependency("LecturerAcademicRank", "LecturerAcademicRankId", "Какое звание имеет преподаватель")]
[EntityDependency("LecturerAcademicDegree", "LecturerAcademicDegreeId", "Какую степень имеет преподаватель")]
public class Lecturer : BaseEntity, IEntitySecurityExtenstion<Lecturer>
{ {
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("UserId")]
public Guid UserId { get; set; } public Guid UserId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("LecturerAcademicRankId")]
public Guid? LecturerAcademicRankId { get; set; } public Guid? LecturerAcademicRankId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("LecturerAcademicDegreeId")]
public Guid? LecturerAcademicDegreeId { get; set; } public Guid? LecturerAcademicDegreeId { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("LastName")]
public string LastName { get; set; } public string LastName { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("FirstName")]
public string FirstName { get; set; } public string FirstName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Patronymic")]
public string Patronymic { get; set; } public string Patronymic { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Abbreviation")]
public string Abbreviation { get; set; } public string Abbreviation { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("DateBirth")]
public DateTime DateBirth { get; set; } public DateTime DateBirth { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("Address")]
public string Address { get; set; } public string Address { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("Email")]
public string Email { get; set; } public string Email { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[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("OnlyForPrivate")]
public bool OnlyForPrivate { get; set; } public bool OnlyForPrivate { get; set; }
[DataMember] [DataMember]
[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.Interfaces; using ModuleTools.Interfaces;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -7,24 +7,17 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий ученой степени преподавателя кафедры public class LecturerAcademicDegree : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicDegree>, ILecturerAcademicDegreeModel
/// </summary>
[DataContract]
[EntityDescription("LecturerAcademicDegree", "Ученой степени преподавателя кафедры")]
public class LecturerAcademicDegree : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicDegree>
{ {
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("LecturerAcademicDegreeName")]
public string LecturerAcademicDegreeName { get; set; } public string LecturerAcademicDegreeName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { 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.Interfaces; using ModuleTools.Interfaces;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -7,20 +7,14 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий ученое звание преподавателя кафедры public class LecturerAcademicRank : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicRank>, ILecturerAcademicRankModel
/// </summary>
[DataContract]
[EntityDescription("LecturerAcademicRank", "Ученое звание преподавателя кафедры")]
public class LecturerAcademicRank : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicRank>
{ {
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("LecturerAcademicRankName")]
public string LecturerAcademicRankName { get; set; } public string LecturerAcademicRankName { 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.Interfaces; using ModuleTools.Interfaces;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -6,36 +6,25 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий связь преподавателя и должность кафедры public class LecturerPost : BaseEntity, IEntitySecurityExtenstion<LecturerPost>, ILecturerPostModel
/// </summary>
[DataContract]
[EntityDescription("LecturerPost", "Связь преподавателя и должность кафедры")]
[EntityDependency("Post", "PostId", "К какой должности относится преподаватель")]
[EntityDependency("Lecturer", "LecturerId", "К какой должности относится преподаватель")]
public class LecturerPost : BaseEntity, IEntitySecurityExtenstion<LecturerPost>
{ {
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("LecturerId")]
public Guid LecturerId { get; set; } public Guid LecturerId { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[MapConfiguration("PostId")]
public Guid PostId { get; set; } public Guid PostId { get; set; }
[DataMember] [DataMember]
[Required] [Required]
[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.BindingModels; using ModuleTools.BindingModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -14,17 +14,14 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение ученой степени преподавателя /// Сохранение ученой степени преподавателя
/// </summary> /// </summary>
public class LecturerAcademicDegreeSetBindingModel : SetBindingModel public class LecturerAcademicDegreeSetBindingModel : SetBindingModel, ILecturerAcademicDegreeModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("LecturerAcademicDegreeName")]
public string LecturerAcademicDegreeName { get; set; } public string LecturerAcademicDegreeName { get; set; }
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { 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.BindingModels; using ModuleTools.BindingModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -14,14 +15,12 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение ученого звания преподавателя /// Сохранение ученого звания преподавателя
/// </summary> /// </summary>
public class LecturerAcademicRankSetBindingModel : SetBindingModel public class LecturerAcademicRankSetBindingModel : SetBindingModel, ILecturerAcademicRankModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("LecturerAcademicRankName")]
public string LecturerAcademicRankName { get; set; } public string LecturerAcademicRankName { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("Order")]
public int Order { get; set; } public int Order { get; set; }
} }
} }

View File

@ -1,14 +1,14 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace DepartmentBusinessLogic.BindingModels namespace DepartmentBusinessLogic.BindingModels
{ {
/// <summary> /// <summary>
/// Получение преподавателя /// Получение преподавателя
/// </summary> /// </summary>
public class LecturerGetBindingModel : GetBindingModel public class LecturerGetBindingModel : GetBindingModel
{ {
public Guid? UserId { get; set; } public Guid? UserId { get; set; }
@ -20,62 +20,46 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение преподавателя /// Сохранение преподавателя
/// </summary> /// </summary>
public class LecturerSetBindingModel : SetBindingModel public class LecturerSetBindingModel : SetBindingModel, ILecturerModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("UserId")]
public Guid UserId { get; set; } public Guid UserId { get; set; }
[MapConfiguration("LecturerAcademicRankId")]
public Guid? LecturerAcademicRankId { get; set; } public Guid? LecturerAcademicRankId { get; set; }
[MapConfiguration("LecturerAcademicDegreeId")]
public Guid? LecturerAcademicDegreeId { get; set; } public Guid? LecturerAcademicDegreeId { 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; }
[MapConfiguration("Abbreviation")]
public string Abbreviation { get; set; } public string Abbreviation { 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; }
[MapConfiguration("OnlyForPrivate")]
public bool OnlyForPrivate { get; set; } public bool OnlyForPrivate { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("GroupElectricalSafety")]
public string GroupElectricalSafety { get; set; } public string GroupElectricalSafety { get; set; }
} }
} }

View File

@ -1,14 +1,14 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace DepartmentBusinessLogic.BindingModels namespace DepartmentBusinessLogic.BindingModels
{ {
/// <summary> /// <summary>
/// Получение связи преподавателя с должностью /// Получение связи преподавателя с должностью
/// </summary> /// </summary>
public class LecturerPostGetBindingModel : GetBindingModel public class LecturerPostGetBindingModel : GetBindingModel
{ {
public Guid? LecturerId { get; set; } public Guid? LecturerId { get; set; }
@ -18,24 +18,19 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение связи преподавателя с должностью /// Сохранение связи преподавателя с должностью
/// </summary> /// </summary>
public class LecturerPostSetBindingModel : SetBindingModel public class LecturerPostSetBindingModel : SetBindingModel, ILecturerPostModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("LecturerId")]
public Guid LecturerId { get; set; } public Guid LecturerId { 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,13 +1,14 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
namespace DepartmentBusinessLogic.ViewModels namespace DepartmentBusinessLogic.ViewModels
{ {
/// <summary> /// <summary>
/// Список должностей преподавателей /// Список должностей преподавателей
/// </summary> /// </summary>
public class LecturerAcademicDegreeListViewModel : ListViewModel<LecturerAcademicDegreeViewModel> { } public class LecturerAcademicDegreeListViewModel : ListViewModel<LecturerAcademicDegreeViewModel> { }
/// <summary> /// <summary>
/// Элемент должности преподавателей /// Элемент должности преподавателей
@ -15,21 +16,18 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "LecturerAcademicDegreeId", [ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "LecturerAcademicDegreeId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
public class LecturerAcademicDegreeViewModel : ElementViewModel public class LecturerAcademicDegreeViewModel : ElementViewModel, ILecturerAcademicDegreeModel
{ {
[ViewModelControlListProperty("Ученая степень")] [ViewModelControlListProperty("Ученая степень")]
[ViewModelControlElementProperty("Ученая степень", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Ученая степень", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("LecturerAcademicDegreeName")]
public string LecturerAcademicDegreeName { get; set; } public string LecturerAcademicDegreeName { get; set; }
[ViewModelControlListProperty("Описание")] [ViewModelControlListProperty("Описание")]
[ViewModelControlElementProperty("Описание", ControlType.ControlString)] [ViewModelControlElementProperty("Описание", ControlType.ControlString)]
[MapConfiguration("Description")]
public string Description { get; set; } public string Description { get; set; }
[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; }
} }
} }

View File

@ -1,13 +1,14 @@
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
namespace DepartmentBusinessLogic.ViewModels namespace DepartmentBusinessLogic.ViewModels
{ {
/// <summary> /// <summary>
/// Список должностей преподавателей /// Список должностей преподавателей
/// </summary> /// </summary>
public class LecturerAcademicRankListViewModel : ListViewModel<LecturerAcademicRankViewModel> { } public class LecturerAcademicRankListViewModel : ListViewModel<LecturerAcademicRankViewModel> { }
/// <summary> /// <summary>
/// Элемент должности преподавателей /// Элемент должности преподавателей
@ -15,16 +16,14 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "LecturerAcademicRankId", [ViewModelControlElementDependenceEntity(Title = "Преподаватели", Order = 1, ParentPropertyName = "LecturerAcademicRankId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
public class LecturerAcademicRankViewModel : ElementViewModel public class LecturerAcademicRankViewModel : ElementViewModel, ILecturerAcademicRankModel
{ {
[ViewModelControlListProperty("Ученая степень")] [ViewModelControlListProperty("Ученая степень")]
[ViewModelControlElementProperty("Ученая степень", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Ученая степень", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("LecturerAcademicRankName")]
public string LecturerAcademicRankName { get; set; } public string LecturerAcademicRankName { get; set; }
[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; }
} }
} }

View File

@ -1,23 +1,23 @@
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;
namespace DepartmentBusinessLogic.ViewModels namespace DepartmentBusinessLogic.ViewModels
{ {
/// <summary> /// <summary>
/// Список связей преподавателей и должностей /// Список связей преподавателей и должностей
/// </summary> /// </summary>
public class LecturerPostListViewModel : ListViewModel<LecturerPostViewModel> { } public class LecturerPostListViewModel : ListViewModel<LecturerPostViewModel> { }
/// <summary> /// <summary>
/// Связь преподавателя и должности /// Связь преподавателя и должности
/// </summary> /// </summary>
[ViewModelControlElementClass()] [ViewModelControlElementClass()]
public class LecturerPostViewModel : ElementViewModel public class LecturerPostViewModel : ElementViewModel, ILecturerPostModel
{ {
[ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")]
[MapConfiguration("LecturerId", AllowCopyWithoutRigth = false)]
public Guid LecturerId { get; set; } public Guid LecturerId { get; set; }
[ViewModelControlListProperty("Преподаватель")] [ViewModelControlListProperty("Преподаватель")]
@ -25,7 +25,6 @@ namespace DepartmentBusinessLogic.ViewModels
public string LecturerName { get; set; } public string LecturerName { 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;
@ -20,14 +21,12 @@ namespace DepartmentBusinessLogic.ViewModels
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")]
[ViewModelControlElementDependenceEntity(Title = "Кураторство групп", Order = 3, ParentPropertyName = "LecturerId", [ViewModelControlElementDependenceEntity(Title = "Кураторство групп", Order = 3, ParentPropertyName = "LecturerId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")]
public class LecturerViewModel : ElementViewModel public class LecturerViewModel : ElementViewModel, ILecturerModel
{ {
[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; }
[ViewModelControlElementProperty("Уч. степень", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerAcademicDegreeList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Уч. степень", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerAcademicDegreeList, DepartmentWindowsDesktop")]
[MapConfiguration("LecturerAcademicDegreeId")]
public Guid? LecturerAcademicDegreeId { get; set; } public Guid? LecturerAcademicDegreeId { get; set; }
[ViewModelControlListProperty("Уч. степень")] [ViewModelControlListProperty("Уч. степень")]
@ -35,7 +34,6 @@ namespace DepartmentBusinessLogic.ViewModels
public string LecturerAcademicDegree { get; set; } public string LecturerAcademicDegree { get; set; }
[ViewModelControlElementProperty("Уч. звание", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerAcademicRankList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Уч. звание", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerAcademicRankList, DepartmentWindowsDesktop")]
[MapConfiguration("LecturerAcademicRankId")]
public Guid? LecturerAcademicRankId { get; set; } public Guid? LecturerAcademicRankId { get; set; }
[ViewModelControlListProperty("Уч. звание")] [ViewModelControlListProperty("Уч. звание")]
@ -44,63 +42,50 @@ namespace DepartmentBusinessLogic.ViewModels
[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; }
[ViewModelControlElementProperty("Аббревиатура", ControlType.ControlString)] [ViewModelControlElementProperty("Аббревиатура", ControlType.ControlString)]
[MapConfiguration("Abbreviation")]
public string Abbreviation { get; set; } public string Abbreviation { 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; }
[ViewModelControlElementProperty("Для внутр. пользования", ControlType.ControlBool, MustHaveValue = true)] [ViewModelControlElementProperty("Для внутр. пользования", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("OnlyForPrivate")]
public bool OnlyForPrivate { get; set; } public bool OnlyForPrivate { 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; }
} }
} }