From 4230c26a1a103afdc4c47012cd78387ba70136eb Mon Sep 17 00:00:00 2001 From: kotcheshir73 Date: Fri, 2 Apr 2021 22:44:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B8=D0=B7=D0=BD=D0=B5=D1=81-=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BF=D0=BE=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=BB=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8F=D0=BC=20=D1=81=D0=BE?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmployeePostBindingModels.cs | 21 ++++++++++++ .../EmployeePostBusinessLogic.cs | 16 ++++++++++ .../DepartmentBusinessLogic.csproj | 8 ++--- .../Interfaces/IEmployeePostService.cs | 10 ++++++ .../ViewModels/EmployeePostViewModels.cs | 32 +++++++++++++++++++ 5 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/EmployeePostBindingModels.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/EmployeePostBusinessLogic.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IEmployeePostService.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/EmployeePostBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/EmployeePostBindingModels.cs new file mode 100644 index 0000000..2627fae --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/EmployeePostBindingModels.cs @@ -0,0 +1,21 @@ +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + public class EmployeePostGetBindingModel : GetBindingModel + { + } + + public class EmployeePostSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("EmployeePostName")] + public string EmployeePostName { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("Order")] + public int Order { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/EmployeePostBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/EmployeePostBusinessLogic.cs new file mode 100644 index 0000000..9e3878d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/EmployeePostBusinessLogic.cs @@ -0,0 +1,16 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; + +namespace DepartmentBusinessLogic.BusinessLogics +{ + /// + /// Логика работы с должностями сотрудников + /// + public class EmployeePostBusinessLogic : GenericBusinessLogic + { + public EmployeePostBusinessLogic(IEmployeePostService service) : base(service, "Должности сотрудников", AccessOperation.Сотрудники) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/DepartmentBusinessLogic.csproj b/DepartmentPortal/Department/DepartmentBusinessLogic/DepartmentBusinessLogic.csproj index 1691e75..c9c9e22 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/DepartmentBusinessLogic.csproj +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/DepartmentBusinessLogic.csproj @@ -5,11 +5,11 @@ - - + + + + - - diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IEmployeePostService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IEmployeePostService.cs new file mode 100644 index 0000000..57c5dd7 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IEmployeePostService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение должностей сотрудников + /// + public interface IEmployeePostService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs new file mode 100644 index 0000000..2624e80 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs @@ -0,0 +1,32 @@ +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.ViewModels; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список ролей + /// + public class EmployeePostListViewModel : ListViewModel { } + + /// + /// Элемент ролей + /// + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + //[ViewModelControlElementDependenceEntity(Title = "Сотрудники", Order = 1, ParentPropertyName = "EmployeePostId", + // ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleUserList, SecurityWindowsDesktop")] + public class EmployeePostViewModel : ElementViewModel + { + [ViewModelControlListProperty("Название должность")] + [ViewModelControlElementProperty("Название должность", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("EmployeePostName")] + public string EmployeePostName { get; set; } + + [ViewModelControlListProperty("Порядок", 100)] + [ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)] + [MapConfiguration("Order")] + public int Order { get; set; } + + public override string ToString() => EmployeePostName; + } +} \ No newline at end of file