diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderStudentMoveType.cs b/DepartmentPortal/Common/CoreModels/Enums/Department/OrderStudentMoveType.cs similarity index 94% rename from DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderStudentMoveType.cs rename to DepartmentPortal/Common/CoreModels/Enums/Department/OrderStudentMoveType.cs index 8ea1377..0efda45 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderStudentMoveType.cs +++ b/DepartmentPortal/Common/CoreModels/Enums/Department/OrderStudentMoveType.cs @@ -1,9 +1,9 @@ -namespace DepartmentBusinessLogic.Enums +namespace CoreModels.Enums.Department { - /// - /// Типы приказов по студентам - /// - public enum OrderStudentMoveType + /// + /// Типы приказов по студентам + /// + public enum OrderStudentMoveType { Неопределено = -1, diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderType.cs b/DepartmentPortal/Common/CoreModels/Enums/Department/OrderType.cs similarity index 70% rename from DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderType.cs rename to DepartmentPortal/Common/CoreModels/Enums/Department/OrderType.cs index c844d64..5866d8f 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/OrderType.cs +++ b/DepartmentPortal/Common/CoreModels/Enums/Department/OrderType.cs @@ -1,9 +1,9 @@ -namespace DepartmentBusinessLogic.Enums +namespace CoreModels.Enums.Department { - /// - /// Тип приказа - /// - public enum OrderType + /// + /// Тип приказа + /// + public enum OrderType { Игнорировать = -2, diff --git a/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderModel.cs b/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderModel.cs new file mode 100644 index 0000000..232d759 --- /dev/null +++ b/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderModel.cs @@ -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; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderStudentRecordModel.cs b/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderStudentRecordModel.cs new file mode 100644 index 0000000..afa435f --- /dev/null +++ b/DepartmentPortal/Common/CoreModels/ModelsDepartment/IOrderStudentRecordModel.cs @@ -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; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreModels/ModelsDepartment/ITimeNormModel.cs b/DepartmentPortal/Common/CoreModels/ModelsDepartment/ITimeNormModel.cs new file mode 100644 index 0000000..6173137 --- /dev/null +++ b/DepartmentPortal/Common/CoreModels/ModelsDepartment/ITimeNormModel.cs @@ -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; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs index a778f43..5d0f954 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs @@ -1,4 +1,5 @@ -using ModuleTools.Attributes; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.Interfaces; using System; using System.Collections.Generic; @@ -8,27 +9,20 @@ using System.Runtime.Serialization; namespace DatabaseCore.Models.Department { - /// - /// Класс, описывающий приказ - /// - [DataContract] - [EntityDescription("Order", "Приказ")] - public class Order : BaseEntity, IEntitySecurityExtenstion + [DataContract] + public class Order : BaseEntity, IEntitySecurityExtenstion, IOrderModel { [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("OrderNumber")] public string OrderNumber { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("OrderDate")] public DateTime OrderDate { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("OrderType")] - public int OrderType { get; set; } + public OrderType OrderType { get; set; } //------------------------------------------------------------------------- diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs index 47def89..8a5405b 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs @@ -1,4 +1,5 @@ -using ModuleTools.Attributes; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.Interfaces; using System; using System.ComponentModel.DataAnnotations; @@ -6,42 +7,28 @@ using System.Runtime.Serialization; namespace DatabaseCore.Models.Department { - /// - /// Класс, описывающий запись приказа по студенту - /// - [DataContract] - [EntityDescription("OrderStudentRecord", "Запись приказа по студенту")] - [EntityDependency("Order", "OrderId", "Приказ, к которому относится запись")] - [EntityDependency("Student", "StudentId", "Студент, указанный в приказе")] - [EntityDependency("StudentGroup", "StudentGroupFromId", "Из какой группы уходит студент")] - [EntityDependency("StudentGroup", "StudentGroupToId", "В какую группу приходит студент")] - public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion + [DataContract] + public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion, IOrderStudentRecordModel { [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("OrderId")] public Guid OrderId { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("StudentId")] public Guid StudentId { get; set; } [DataMember] - [MapConfiguration("StudentGroupFromId")] public Guid? StudentGroupFromId { get; set; } [DataMember] - [MapConfiguration("StudentGroupToId")] public Guid? StudentGroupToId { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("OrderStudentMoveType")] - public int OrderStudentMoveType { get; set; } + public OrderStudentMoveType OrderStudentMoveType { get; set; } [DataMember] - [MapConfiguration("Info")] public string Info { get; set; } //------------------------------------------------------------------------- diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs index 3149d32..fcdcd08 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs @@ -1,5 +1,5 @@ using CoreModels.Enums.Department; -using ModuleTools.Attributes; +using CoreModels.ModelsDepartment; using ModuleTools.Interfaces; using System; using System.Collections.Generic; @@ -9,65 +9,48 @@ using System.Runtime.Serialization; namespace DatabaseCore.Models.Department { - /// - /// Класс, описывающий норму времени - /// - [DataContract] - [EntityDescription("TimeNorm", "Норма времени")] - [EntityDependency("DisciplineBlock", "DisciplineBlockId", "Блок дисцпилн, к которому относится норма")] - public class TimeNorm : BaseEntity, IEntitySecurityExtenstion + [DataContract] + public class TimeNorm : BaseEntity, IEntitySecurityExtenstion, ITimeNormModel { [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("DisciplineBlockId")] public Guid DisciplineBlockId { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormName")] public string TimeNormName { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormShortName")] public string TimeNormShortName { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormOrder")] public int TimeNormOrder { get; set; } [DataMember] - [MapConfiguration("TimeNormEducationDirectionQualification")] public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } [DataMember] [Required(ErrorMessage = "required")] - [MapConfiguration("KindOfLoadName")] public string KindOfLoadName { get; set; } [DataMember] - [MapConfiguration("KindOfLoadAttributeName")] public string KindOfLoadAttributeName { get; set; } [DataMember] - [MapConfiguration("KindOfLoadBlueAsteriskName")] public string KindOfLoadBlueAsteriskName { get; set; } [DataMember] - [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] public string KindOfLoadBlueAsteriskAttributeName { get; set; } [DataMember] - [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] public string KindOfLoadBlueAsteriskPracticName { get; set; } [DataMember] - [MapConfiguration("UseInLearningProgress")] public bool UseInLearningProgress { get; set; } [DataMember] - [MapConfiguration("UseInSite")] public bool UseInSite { get; set; } //------------------------------------------------------------------------- diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderBindingModels.cs index 306e059..1af1e10 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderBindingModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderBindingModels.cs @@ -1,15 +1,15 @@ -using DepartmentBusinessLogic.Enums; -using ModuleTools.Attributes; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.BindingModels; using System; using System.ComponentModel.DataAnnotations; namespace DepartmentBusinessLogic.BindingModels { - /// - /// Получение приказа - /// - public class OrderGetBindingModel : GetBindingModel + /// + /// Получение приказа + /// + public class OrderGetBindingModel : GetBindingModel { public string OrderNumber { get; set; } @@ -19,18 +19,15 @@ namespace DepartmentBusinessLogic.BindingModels /// /// Сохранение приказа /// - public class OrderSetBindingModel : SetBindingModel + public class OrderSetBindingModel : SetBindingModel, IOrderModel { [Required(ErrorMessage = "required")] - [MapConfiguration("OrderNumber")] public string OrderNumber { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("OrderDate")] public DateTime OrderDate { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("OrderType")] public OrderType OrderType { get; set; } } } \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderStudentRecordBindingModel.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderStudentRecordBindingModel.cs index 7cb5a17..271c261 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderStudentRecordBindingModel.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/OrderStudentRecordBindingModel.cs @@ -1,15 +1,15 @@ -using DepartmentBusinessLogic.Enums; -using ModuleTools.Attributes; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.BindingModels; using System; using System.ComponentModel.DataAnnotations; namespace DepartmentBusinessLogic.BindingModels { - /// - /// Получение записи приказа по студенту - /// - public class OrderStudentRecordGetBindingModel : GetBindingModel + /// + /// Получение записи приказа по студенту + /// + public class OrderStudentRecordGetBindingModel : GetBindingModel { public Guid? OrderId { get; set; } @@ -23,27 +23,21 @@ namespace DepartmentBusinessLogic.BindingModels /// /// Сохранение записи приказа по студенту /// - public class OrderStudentRecordSetBindingModel : SetBindingModel + public class OrderStudentRecordSetBindingModel : SetBindingModel, IOrderStudentRecordModel { [Required(ErrorMessage = "required")] - [MapConfiguration("OrderId")] public Guid OrderId { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("StudentId")] public Guid StudentId { get; set; } - [MapConfiguration("StudentGroupFromId")] public Guid? StudentGroupFromId { get; set; } - [MapConfiguration("StudentGroupToId")] public Guid? StudentGroupToId { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("OrderStudentMoveType")] public OrderStudentMoveType OrderStudentMoveType { get; set; } - [MapConfiguration("Info")] public string Info { get; set; } } } \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs index c1f790e..7ee585b 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs @@ -1,5 +1,5 @@ using CoreModels.Enums.Department; -using ModuleTools.Attributes; +using CoreModels.ModelsDepartment; using ModuleTools.BindingModels; using System; using System.ComponentModel.DataAnnotations; @@ -17,47 +17,35 @@ namespace DepartmentBusinessLogic.BindingModels /// /// Сохранение нормы времени /// - public class TimeNormSetBindingModel : SetBindingModel + public class TimeNormSetBindingModel : SetBindingModel, ITimeNormModel { [Required(ErrorMessage = "required")] - [MapConfiguration("DisciplineBlockId")] public Guid DisciplineBlockId { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormName")] public string TimeNormName { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormShortName")] public string TimeNormShortName { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("TimeNormOrder")] public int TimeNormOrder { get; set; } - [MapConfiguration("TimeNormEducationDirectionQualification")] public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } [Required(ErrorMessage = "required")] - [MapConfiguration("KindOfLoadName")] public string KindOfLoadName { get; set; } - [MapConfiguration("KindOfLoadAttributeName")] public string KindOfLoadAttributeName { get; set; } - [MapConfiguration("KindOfLoadBlueAsteriskName")] public string KindOfLoadBlueAsteriskName { get; set; } - [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] public string KindOfLoadBlueAsteriskAttributeName { get; set; } - [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] public string KindOfLoadBlueAsteriskPracticName { get; set; } - [MapConfiguration("UseInLearningProgress")] public bool UseInLearningProgress { get; set; } - [MapConfiguration("UseInSite")] public bool UseInSite { get; set; } /// diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderStudentRecordBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderStudentRecordBusinessLogic.cs index a1ba892..4694d72 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderStudentRecordBusinessLogic.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderStudentRecordBusinessLogic.cs @@ -1,6 +1,5 @@ using CoreModels.Enums.Department; using DepartmentBusinessLogic.BindingModels; -using DepartmentBusinessLogic.Enums; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; using ModuleTools.BusinessLogics; diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderSyncHistoryBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderSyncHistoryBusinessLogic.cs index 1643c85..6dc2cbe 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderSyncHistoryBusinessLogic.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/OrderSyncHistoryBusinessLogic.cs @@ -1,6 +1,5 @@ using CoreModels.Enums.Department; using DepartmentBusinessLogic.BindingModels; -using DepartmentBusinessLogic.Enums; using DepartmentBusinessLogic.HelperModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderStudentRecordViewModel.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderStudentRecordViewModel.cs index ed77305..1a9303c 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderStudentRecordViewModel.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderStudentRecordViewModel.cs @@ -1,4 +1,5 @@ -using DepartmentBusinessLogic.Enums; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; @@ -6,40 +7,38 @@ using System; namespace DepartmentBusinessLogic.ViewModels { - /// - /// Список приказов - /// - public class OrderStudentRecordListViewModel : ListViewModel { } + /// + /// Список приказов + /// + public class OrderStudentRecordListViewModel : ListViewModel { } /// /// Элемент приказа /// [ViewModelControlElementClass(HaveDependenceEntities = false)] - public class OrderStudentRecordViewModel : ElementViewModel + public class OrderStudentRecordViewModel : ElementViewModel, IOrderStudentRecordModel { [ViewModelControlElementProperty("Приказ", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderList, DepartmentWindowsDesktop")] - [MapConfiguration("OrderId")] public Guid OrderId { get; set; } [ViewModelControlElementProperty("Студент", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentList, DepartmentWindowsDesktop")] - [MapConfiguration("StudentId")] public Guid StudentId { get; set; } [ViewModelControlElementProperty("Из группы", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] - [MapConfiguration("StudentGroupFromId")] public Guid? StudentGroupFromId { get; set; } [ViewModelControlElementProperty("В группу", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] - [MapConfiguration("StudentGroupToId")] public Guid? StudentGroupToId { get; set; } [ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)] - [MapConfiguration("OrderStudentMoveType")] public OrderStudentMoveType OrderStudentMoveType { get; set; } [ViewModelControlListProperty("Тип приказа")] public string OrderStudentMoveTypeTitle => OrderStudentMoveType.ToString("G"); - public override string ToString() => $""; + [ViewModelControlElementProperty("Тип приказа", ControlType.ControlText, Height = 200)] + public string Info { get; set; } + + public override string ToString() => $""; } } \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderViewModels.cs index 0533fca..45f48bb 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/OrderViewModels.cs @@ -1,4 +1,5 @@ -using DepartmentBusinessLogic.Enums; +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; @@ -6,10 +7,10 @@ using System; namespace DepartmentBusinessLogic.ViewModels { - /// - /// Список приказов - /// - public class OrderListViewModel : ListViewModel { } + /// + /// Список приказов + /// + public class OrderListViewModel : ListViewModel { } /// /// Элемент приказа @@ -17,20 +18,17 @@ namespace DepartmentBusinessLogic.ViewModels [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementDependenceEntity(Title = "Записи по студентам", Order = 1, ParentPropertyName = "AcademicPlanId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlOrderStudentRecordList, DepartmentWindowsDesktop")] - public class OrderViewModel : ElementViewModel + public class OrderViewModel : ElementViewModel, IOrderModel { [ViewModelControlListProperty("Номер приказа", ColumnWidth = 120)] [ViewModelControlElementProperty("Номер приказа", ControlType.ControlString, MustHaveValue = true)] - [MapConfiguration("OrderNumber")] public string OrderNumber { get; set; } [ViewModelControlListProperty("Дата приказа", ColumnWidth = 120, DefaultCellStyleFormat = "dd.MM.yyyy")] [ViewModelControlElementProperty("Дата приказа", ControlType.ControlDateTime, MustHaveValue = true)] - [MapConfiguration("OrderDate")] public DateTime OrderDate { get; set; } [ViewModelControlElementProperty("Тип приказа", ControlType.ControlEnum, MustHaveValue = true)] - [MapConfiguration("OrderType")] public OrderType OrderType { get; set; } [ViewModelControlListProperty("Тип приказа")] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs index 00bdbd3..55c696e 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs @@ -1,6 +1,5 @@ using CoreModels.Enums.Department; using CoreModels.ModelsDepartment; -using DepartmentBusinessLogic.Enums; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs index 8a624c4..66be0ed 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs @@ -1,4 +1,5 @@ using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; using ModuleTools.Attributes; using ModuleTools.Enums; using ModuleTools.ViewModels; @@ -17,29 +18,24 @@ namespace DepartmentBusinessLogic.ViewModels [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementDependenceEntity(Title = "Нагрузки в планах", Order = 1, ParentPropertyName = "TimeNormId", 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")] - [MapConfiguration("DisciplineBlockId")] public Guid DisciplineBlockId { get; set; } [ViewModelControlListProperty("Название")] [ViewModelControlElementProperty("Название", ControlType.ControlString, MustHaveValue = true)] - [MapConfiguration("TimeNormName")] public string TimeNormName { get; set; } [ViewModelControlListProperty("Сокращение", ColumnWidth = 100)] [ViewModelControlElementProperty("Сокращение", ControlType.ControlString, MustHaveValue = true)] - [MapConfiguration("TimeNormShortName")] public string TimeNormShortName { get; set; } [ViewModelControlListProperty("Порядок", ColumnWidth = 100)] [ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)] - [MapConfiguration("TimeNormOrder")] public int TimeNormOrder { get; set; } [ViewModelControlElementProperty("Обучение", ControlType.ControlEnum, MustHaveValue = false)] - [MapConfiguration("TimeNormEducationDirectionQualification")] public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } [ViewModelControlListProperty("Обучение", ColumnWidth = 100)] @@ -47,31 +43,24 @@ namespace DepartmentBusinessLogic.ViewModels [ViewModelControlListProperty("Тип нагрузки", ColumnWidth = 300)] [ViewModelControlElementProperty("Тип нагрузки", ControlType.ControlString)] - [MapConfiguration("KindOfLoadName")] public string KindOfLoadName { get; set; } [ViewModelControlElementProperty("Атрибут для поиска в старой версии", ControlType.ControlString)] - [MapConfiguration("KindOfLoadAttributeName")] public string KindOfLoadAttributeName { get; set; } [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] - [MapConfiguration("KindOfLoadBlueAsteriskName")] public string KindOfLoadBlueAsteriskName { get; set; } [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] - [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] public string KindOfLoadBlueAsteriskAttributeName { get; set; } [ViewModelControlElementProperty("Название атрибута по которму извлекать часы", ControlType.ControlString)] - [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] public string KindOfLoadBlueAsteriskPracticName { get; set; } [ViewModelControlElementProperty("Учитывается в учебной нагрузке", ControlType.ControlBool, MustHaveValue = true)] - [MapConfiguration("UseInLearningProgress")] public bool UseInLearningProgress { get; set; } [ViewModelControlElementProperty("Выводить для сайта", ControlType.ControlBool, MustHaveValue = true)] - [MapConfiguration("UseInSite")] public bool UseInSite { get; set; } } } \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs index 1c69733..8725811 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs @@ -60,7 +60,7 @@ namespace DepartmentDatabaseImplementation.Implementations { 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); }