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

This commit is contained in:
kotcheshir73 2022-03-18 22:24:10 +04:00
parent 952d283aac
commit e4377b8801
18 changed files with 141 additions and 135 deletions

View File

@ -1,9 +1,9 @@
namespace DepartmentBusinessLogic.Enums namespace CoreModels.Enums.Department
{ {
/// <summary> /// <summary>
/// Типы приказов по студентам /// Типы приказов по студентам
/// </summary> /// </summary>
public enum OrderStudentMoveType public enum OrderStudentMoveType
{ {
Неопределено = -1, Неопределено = -1,

View File

@ -1,9 +1,9 @@
namespace DepartmentBusinessLogic.Enums namespace CoreModels.Enums.Department
{ {
/// <summary> /// <summary>
/// Тип приказа /// Тип приказа
/// </summary> /// </summary>
public enum OrderType public enum OrderType
{ {
Игнорировать = -2, Игнорировать = -2,

View File

@ -0,0 +1,17 @@
using CoreModels.Enums.Department;
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("Order", "Приказ")]
public interface IOrderModel : IId
{
string OrderNumber { get; }
DateTime OrderDate { get; }
OrderType OrderType { get; }
}
}

View File

@ -0,0 +1,27 @@
using CoreModels.Enums.Department;
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("OrderStudentRecord", "Запись приказа по студенту")]
[EntityDependency("Order", "OrderId", "Приказ, к которому относится запись")]
[EntityDependency("Student", "StudentId", "Студент, указанный в приказе")]
[EntityDependency("StudentGroup", "StudentGroupFromId", "Из какой группы уходит студент")]
[EntityDependency("StudentGroup", "StudentGroupToId", "В какую группу приходит студент")]
public interface IOrderStudentRecordModel : IId
{
public Guid OrderId { get; set; }
public Guid StudentId { get; set; }
public Guid? StudentGroupFromId { get; set; }
public Guid? StudentGroupToId { get; set; }
public OrderStudentMoveType OrderStudentMoveType { get; set; }
public string Info { get; set; }
}
}

View File

@ -0,0 +1,36 @@
using CoreModels.Enums.Department;
using CoreModels.Tools;
using ModuleTools.Attributes;
using System;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("TimeNorm", "Норма времени")]
[EntityDependency("DisciplineBlock", "DisciplineBlockId", "Блок дисцпилн, к которому относится норма")]
public interface ITimeNormModel : IId
{
Guid DisciplineBlockId { get; }
string TimeNormName { get; }
string TimeNormShortName { get; }
int TimeNormOrder { get; }
EducationDirectionQualification? TimeNormEducationDirectionQualification { get; }
string KindOfLoadName { get; }
string KindOfLoadAttributeName { get; }
string KindOfLoadBlueAsteriskName { get; }
string KindOfLoadBlueAsteriskAttributeName { get; }
string KindOfLoadBlueAsteriskPracticName { get; }
bool UseInLearningProgress { get; }
bool UseInSite { get; }
}
}

View File

@ -1,4 +1,5 @@
using ModuleTools.Attributes; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -8,27 +9,20 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий приказ public class Order : BaseEntity, IEntitySecurityExtenstion<Order>, IOrderModel
/// </summary>
[DataContract]
[EntityDescription("Order", "Приказ")]
public class Order : BaseEntity, IEntitySecurityExtenstion<Order>
{ {
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderNumber")]
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderDate")]
public DateTime OrderDate { get; set; } public DateTime OrderDate { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderType")] public OrderType OrderType { get; set; }
public int OrderType { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,4 +1,5 @@
using ModuleTools.Attributes; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -6,42 +7,28 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий запись приказа по студенту public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion<OrderStudentRecord>, IOrderStudentRecordModel
/// </summary>
[DataContract]
[EntityDescription("OrderStudentRecord", "Запись приказа по студенту")]
[EntityDependency("Order", "OrderId", "Приказ, к которому относится запись")]
[EntityDependency("Student", "StudentId", "Студент, указанный в приказе")]
[EntityDependency("StudentGroup", "StudentGroupFromId", "Из какой группы уходит студент")]
[EntityDependency("StudentGroup", "StudentGroupToId", "В какую группу приходит студент")]
public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion<OrderStudentRecord>
{ {
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderId")]
public Guid OrderId { get; set; } public Guid OrderId { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("StudentId")]
public Guid StudentId { get; set; } public Guid StudentId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("StudentGroupFromId")]
public Guid? StudentGroupFromId { get; set; } public Guid? StudentGroupFromId { get; set; }
[DataMember] [DataMember]
[MapConfiguration("StudentGroupToId")]
public Guid? StudentGroupToId { get; set; } public Guid? StudentGroupToId { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderStudentMoveType")] public OrderStudentMoveType OrderStudentMoveType { get; set; }
public int OrderStudentMoveType { get; set; }
[DataMember] [DataMember]
[MapConfiguration("Info")]
public string Info { get; set; } public string Info { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.Interfaces; using ModuleTools.Interfaces;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -9,65 +9,48 @@ using System.Runtime.Serialization;
namespace DatabaseCore.Models.Department namespace DatabaseCore.Models.Department
{ {
/// <summary> [DataContract]
/// Класс, описывающий норму времени public class TimeNorm : BaseEntity, IEntitySecurityExtenstion<TimeNorm>, ITimeNormModel
/// </summary>
[DataContract]
[EntityDescription("TimeNorm", "Норма времени")]
[EntityDependency("DisciplineBlock", "DisciplineBlockId", "Блок дисцпилн, к которому относится норма")]
public class TimeNorm : BaseEntity, IEntitySecurityExtenstion<TimeNorm>
{ {
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("DisciplineBlockId")]
public Guid DisciplineBlockId { get; set; } public Guid DisciplineBlockId { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormName")]
public string TimeNormName { get; set; } public string TimeNormName { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormShortName")]
public string TimeNormShortName { get; set; } public string TimeNormShortName { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormOrder")]
public int TimeNormOrder { get; set; } public int TimeNormOrder { get; set; }
[DataMember] [DataMember]
[MapConfiguration("TimeNormEducationDirectionQualification")]
public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; }
[DataMember] [DataMember]
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("KindOfLoadName")]
public string KindOfLoadName { get; set; } public string KindOfLoadName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("KindOfLoadAttributeName")]
public string KindOfLoadAttributeName { get; set; } public string KindOfLoadAttributeName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("KindOfLoadBlueAsteriskName")]
public string KindOfLoadBlueAsteriskName { get; set; } public string KindOfLoadBlueAsteriskName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("KindOfLoadBlueAsteriskAttributeName")]
public string KindOfLoadBlueAsteriskAttributeName { get; set; } public string KindOfLoadBlueAsteriskAttributeName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("KindOfLoadBlueAsteriskPracticName")]
public string KindOfLoadBlueAsteriskPracticName { get; set; } public string KindOfLoadBlueAsteriskPracticName { get; set; }
[DataMember] [DataMember]
[MapConfiguration("UseInLearningProgress")]
public bool UseInLearningProgress { get; set; } public bool UseInLearningProgress { get; set; }
[DataMember] [DataMember]
[MapConfiguration("UseInSite")]
public bool UseInSite { get; set; } public bool UseInSite { get; set; }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -1,15 +1,15 @@
using DepartmentBusinessLogic.Enums; using CoreModels.Enums.Department;
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 OrderGetBindingModel : GetBindingModel public class OrderGetBindingModel : GetBindingModel
{ {
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
@ -19,18 +19,15 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение приказа /// Сохранение приказа
/// </summary> /// </summary>
public class OrderSetBindingModel : SetBindingModel public class OrderSetBindingModel : SetBindingModel, IOrderModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderNumber")]
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderDate")]
public DateTime OrderDate { get; set; } public DateTime OrderDate { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderType")]
public OrderType OrderType { get; set; } public OrderType OrderType { get; set; }
} }
} }

View File

@ -1,15 +1,15 @@
using DepartmentBusinessLogic.Enums; using CoreModels.Enums.Department;
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 OrderStudentRecordGetBindingModel : GetBindingModel public class OrderStudentRecordGetBindingModel : GetBindingModel
{ {
public Guid? OrderId { get; set; } public Guid? OrderId { get; set; }
@ -23,27 +23,21 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение записи приказа по студенту /// Сохранение записи приказа по студенту
/// </summary> /// </summary>
public class OrderStudentRecordSetBindingModel : SetBindingModel public class OrderStudentRecordSetBindingModel : SetBindingModel, IOrderStudentRecordModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderId")]
public Guid OrderId { get; set; } public Guid OrderId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("StudentId")]
public Guid StudentId { get; set; } public Guid StudentId { get; set; }
[MapConfiguration("StudentGroupFromId")]
public Guid? StudentGroupFromId { get; set; } public Guid? StudentGroupFromId { get; set; }
[MapConfiguration("StudentGroupToId")]
public Guid? StudentGroupToId { get; set; } public Guid? StudentGroupToId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("OrderStudentMoveType")]
public OrderStudentMoveType OrderStudentMoveType { get; set; } public OrderStudentMoveType OrderStudentMoveType { get; set; }
[MapConfiguration("Info")]
public string Info { get; set; } public string Info { get; set; }
} }
} }

View File

@ -1,5 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using ModuleTools.Attributes; using CoreModels.ModelsDepartment;
using ModuleTools.BindingModels; using ModuleTools.BindingModels;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -17,47 +17,35 @@ namespace DepartmentBusinessLogic.BindingModels
/// <summary> /// <summary>
/// Сохранение нормы времени /// Сохранение нормы времени
/// </summary> /// </summary>
public class TimeNormSetBindingModel : SetBindingModel public class TimeNormSetBindingModel : SetBindingModel, ITimeNormModel
{ {
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("DisciplineBlockId")]
public Guid DisciplineBlockId { get; set; } public Guid DisciplineBlockId { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormName")]
public string TimeNormName { get; set; } public string TimeNormName { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormShortName")]
public string TimeNormShortName { get; set; } public string TimeNormShortName { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("TimeNormOrder")]
public int TimeNormOrder { get; set; } public int TimeNormOrder { get; set; }
[MapConfiguration("TimeNormEducationDirectionQualification")]
public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; }
[Required(ErrorMessage = "required")] [Required(ErrorMessage = "required")]
[MapConfiguration("KindOfLoadName")]
public string KindOfLoadName { get; set; } public string KindOfLoadName { get; set; }
[MapConfiguration("KindOfLoadAttributeName")]
public string KindOfLoadAttributeName { get; set; } public string KindOfLoadAttributeName { get; set; }
[MapConfiguration("KindOfLoadBlueAsteriskName")]
public string KindOfLoadBlueAsteriskName { get; set; } public string KindOfLoadBlueAsteriskName { get; set; }
[MapConfiguration("KindOfLoadBlueAsteriskAttributeName")]
public string KindOfLoadBlueAsteriskAttributeName { get; set; } public string KindOfLoadBlueAsteriskAttributeName { get; set; }
[MapConfiguration("KindOfLoadBlueAsteriskPracticName")]
public string KindOfLoadBlueAsteriskPracticName { get; set; } public string KindOfLoadBlueAsteriskPracticName { get; set; }
[MapConfiguration("UseInLearningProgress")]
public bool UseInLearningProgress { get; set; } public bool UseInLearningProgress { get; set; }
[MapConfiguration("UseInSite")]
public bool UseInSite { get; set; } public bool UseInSite { get; set; }
/// <summary> /// <summary>

View File

@ -1,6 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.BindingModels;
using DepartmentBusinessLogic.Enums;
using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.Interfaces;
using DepartmentBusinessLogic.ViewModels; using DepartmentBusinessLogic.ViewModels;
using ModuleTools.BusinessLogics; using ModuleTools.BusinessLogics;

View File

@ -1,6 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.BindingModels;
using DepartmentBusinessLogic.Enums;
using DepartmentBusinessLogic.HelperModels; using DepartmentBusinessLogic.HelperModels;
using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.Interfaces;
using DepartmentBusinessLogic.ViewModels; using DepartmentBusinessLogic.ViewModels;

View File

@ -1,4 +1,5 @@
using DepartmentBusinessLogic.Enums; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using ModuleTools.Attributes; using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
@ -6,40 +7,38 @@ using System;
namespace DepartmentBusinessLogic.ViewModels namespace DepartmentBusinessLogic.ViewModels
{ {
/// <summary> /// <summary>
/// Список приказов /// Список приказов
/// </summary> /// </summary>
public class OrderStudentRecordListViewModel : ListViewModel<OrderStudentRecordViewModel> { } public class OrderStudentRecordListViewModel : ListViewModel<OrderStudentRecordViewModel> { }
/// <summary> /// <summary>
/// Элемент приказа /// Элемент приказа
/// </summary> /// </summary>
[ViewModelControlElementClass(HaveDependenceEntities = false)] [ViewModelControlElementClass(HaveDependenceEntities = false)]
public class OrderStudentRecordViewModel : ElementViewModel public class OrderStudentRecordViewModel : ElementViewModel, IOrderStudentRecordModel
{ {
[ViewModelControlElementProperty("Приказ", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Приказ", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderList, DepartmentWindowsDesktop")]
[MapConfiguration("OrderId")]
public Guid OrderId { get; set; } public Guid OrderId { get; set; }
[ViewModelControlElementProperty("Студент", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Студент", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")]
[MapConfiguration("StudentId")]
public Guid StudentId { get; set; } public Guid StudentId { get; set; }
[ViewModelControlElementProperty("Из группы", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Из группы", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")]
[MapConfiguration("StudentGroupFromId")]
public Guid? StudentGroupFromId { get; set; } public Guid? StudentGroupFromId { get; set; }
[ViewModelControlElementProperty("В группу", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("В группу", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")]
[MapConfiguration("StudentGroupToId")]
public Guid? StudentGroupToId { get; set; } public Guid? StudentGroupToId { get; set; }
[ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)] [ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)]
[MapConfiguration("OrderStudentMoveType")]
public OrderStudentMoveType OrderStudentMoveType { get; set; } public OrderStudentMoveType OrderStudentMoveType { get; set; }
[ViewModelControlListProperty("Тип приказа")] [ViewModelControlListProperty("Тип приказа")]
public string OrderStudentMoveTypeTitle => OrderStudentMoveType.ToString("G"); public string OrderStudentMoveTypeTitle => OrderStudentMoveType.ToString("G");
public override string ToString() => $""; [ViewModelControlElementProperty("Тип приказа", ControlType.ControlText, Height = 200)]
public string Info { get; set; }
public override string ToString() => $"";
} }
} }

View File

@ -1,4 +1,5 @@
using DepartmentBusinessLogic.Enums; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using ModuleTools.Attributes; using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
@ -6,10 +7,10 @@ using System;
namespace DepartmentBusinessLogic.ViewModels namespace DepartmentBusinessLogic.ViewModels
{ {
/// <summary> /// <summary>
/// Список приказов /// Список приказов
/// </summary> /// </summary>
public class OrderListViewModel : ListViewModel<OrderViewModel> { } public class OrderListViewModel : ListViewModel<OrderViewModel> { }
/// <summary> /// <summary>
/// Элемент приказа /// Элемент приказа
@ -17,20 +18,17 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Записи по студентам", Order = 1, ParentPropertyName = "AcademicPlanId", [ViewModelControlElementDependenceEntity(Title = "Записи по студентам", Order = 1, ParentPropertyName = "AcademicPlanId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderStudentRecordList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderStudentRecordList, DepartmentWindowsDesktop")]
public class OrderViewModel : ElementViewModel public class OrderViewModel : ElementViewModel, IOrderModel
{ {
[ViewModelControlListProperty("Номер приказа", ColumnWidth = 120)] [ViewModelControlListProperty("Номер приказа", ColumnWidth = 120)]
[ViewModelControlElementProperty("Номер приказа", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Номер приказа", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("OrderNumber")]
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
[ViewModelControlListProperty("Дата приказа", ColumnWidth = 120, DefaultCellStyleFormat = "dd.MM.yyyy")] [ViewModelControlListProperty("Дата приказа", ColumnWidth = 120, DefaultCellStyleFormat = "dd.MM.yyyy")]
[ViewModelControlElementProperty("Дата приказа", ControlType.ControlDateTime, MustHaveValue = true)] [ViewModelControlElementProperty("Дата приказа", ControlType.ControlDateTime, MustHaveValue = true)]
[MapConfiguration("OrderDate")]
public DateTime OrderDate { get; set; } public DateTime OrderDate { get; set; }
[ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)] [ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)]
[MapConfiguration("OrderType")]
public OrderType OrderType { get; set; } public OrderType OrderType { get; set; }
[ViewModelControlListProperty("Тип приказа")] [ViewModelControlListProperty("Тип приказа")]

View File

@ -1,6 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment; using CoreModels.ModelsDepartment;
using DepartmentBusinessLogic.Enums;
using ModuleTools.Attributes; using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;

View File

@ -1,4 +1,5 @@
using CoreModels.Enums.Department; using CoreModels.Enums.Department;
using CoreModels.ModelsDepartment;
using ModuleTools.Attributes; using ModuleTools.Attributes;
using ModuleTools.Enums; using ModuleTools.Enums;
using ModuleTools.ViewModels; using ModuleTools.ViewModels;
@ -17,29 +18,24 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)]
[ViewModelControlElementDependenceEntity(Title = "Нагрузки в планах", Order = 1, ParentPropertyName = "TimeNormId", [ViewModelControlElementDependenceEntity(Title = "Нагрузки в планах", Order = 1, ParentPropertyName = "TimeNormId",
ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")] ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")]
public class TimeNormViewModel : ElementViewModel public class TimeNormViewModel : ElementViewModel, ITimeNormModel
{ {
[ViewModelControlElementProperty("Блок дисциплин", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineBlockList, DepartmentWindowsDesktop")] [ViewModelControlElementProperty("Блок дисциплин", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineBlockList, DepartmentWindowsDesktop")]
[MapConfiguration("DisciplineBlockId")]
public Guid DisciplineBlockId { get; set; } public Guid DisciplineBlockId { get; set; }
[ViewModelControlListProperty("Название")] [ViewModelControlListProperty("Название")]
[ViewModelControlElementProperty("Название", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Название", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("TimeNormName")]
public string TimeNormName { get; set; } public string TimeNormName { get; set; }
[ViewModelControlListProperty("Сокращение", ColumnWidth = 100)] [ViewModelControlListProperty("Сокращение", ColumnWidth = 100)]
[ViewModelControlElementProperty("Сокращение", ControlType.ControlString, MustHaveValue = true)] [ViewModelControlElementProperty("Сокращение", ControlType.ControlString, MustHaveValue = true)]
[MapConfiguration("TimeNormShortName")]
public string TimeNormShortName { get; set; } public string TimeNormShortName { get; set; }
[ViewModelControlListProperty("Порядок", ColumnWidth = 100)] [ViewModelControlListProperty("Порядок", ColumnWidth = 100)]
[ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)] [ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)]
[MapConfiguration("TimeNormOrder")]
public int TimeNormOrder { get; set; } public int TimeNormOrder { get; set; }
[ViewModelControlElementProperty("Обучение", ControlType.ControlEnum, MustHaveValue = false)] [ViewModelControlElementProperty("Обучение", ControlType.ControlEnum, MustHaveValue = false)]
[MapConfiguration("TimeNormEducationDirectionQualification")]
public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; }
[ViewModelControlListProperty("Обучение", ColumnWidth = 100)] [ViewModelControlListProperty("Обучение", ColumnWidth = 100)]
@ -47,31 +43,24 @@ namespace DepartmentBusinessLogic.ViewModels
[ViewModelControlListProperty("Тип нагрузки", ColumnWidth = 300)] [ViewModelControlListProperty("Тип нагрузки", ColumnWidth = 300)]
[ViewModelControlElementProperty("Тип нагрузки", ControlType.ControlString)] [ViewModelControlElementProperty("Тип нагрузки", ControlType.ControlString)]
[MapConfiguration("KindOfLoadName")]
public string KindOfLoadName { get; set; } public string KindOfLoadName { get; set; }
[ViewModelControlElementProperty("Атрибут для поиска в старой версии", ControlType.ControlString)] [ViewModelControlElementProperty("Атрибут для поиска в старой версии", ControlType.ControlString)]
[MapConfiguration("KindOfLoadAttributeName")]
public string KindOfLoadAttributeName { get; set; } public string KindOfLoadAttributeName { get; set; }
[ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)]
[MapConfiguration("KindOfLoadBlueAsteriskName")]
public string KindOfLoadBlueAsteriskName { get; set; } public string KindOfLoadBlueAsteriskName { get; set; }
[ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)]
[MapConfiguration("KindOfLoadBlueAsteriskAttributeName")]
public string KindOfLoadBlueAsteriskAttributeName { get; set; } public string KindOfLoadBlueAsteriskAttributeName { get; set; }
[ViewModelControlElementProperty("Название атрибута по которму извлекать часы", ControlType.ControlString)] [ViewModelControlElementProperty("Название атрибута по которму извлекать часы", ControlType.ControlString)]
[MapConfiguration("KindOfLoadBlueAsteriskPracticName")]
public string KindOfLoadBlueAsteriskPracticName { get; set; } public string KindOfLoadBlueAsteriskPracticName { get; set; }
[ViewModelControlElementProperty("Учитывается в учебной нагрузке", ControlType.ControlBool, MustHaveValue = true)] [ViewModelControlElementProperty("Учитывается в учебной нагрузке", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("UseInLearningProgress")]
public bool UseInLearningProgress { get; set; } public bool UseInLearningProgress { get; set; }
[ViewModelControlElementProperty("Выводить для сайта", ControlType.ControlBool, MustHaveValue = true)] [ViewModelControlElementProperty("Выводить для сайта", ControlType.ControlBool, MustHaveValue = true)]
[MapConfiguration("UseInSite")]
public bool UseInSite { get; set; } public bool UseInSite { get; set; }
} }
} }

View File

@ -60,7 +60,7 @@ namespace DepartmentDatabaseImplementation.Implementations
{ {
if (model.OrderId.HasValue && model.StudentId.HasValue && model.OrderStudentMoveType.HasValue) if (model.OrderId.HasValue && model.StudentId.HasValue && model.OrderStudentMoveType.HasValue)
{ {
return list.FirstOrDefault(x => x.OrderId == model.OrderId && x.StudentId == model.StudentId && x.OrderStudentMoveType == (int)model.OrderStudentMoveType); return list.FirstOrDefault(x => x.OrderId == model.OrderId && x.StudentId == model.StudentId && x.OrderStudentMoveType == model.OrderStudentMoveType);
} }
return base.GetSingleRecord(list, model); return base.GetSingleRecord(list, model);
} }