Бизнес-логика по должностям сотрудников
This commit is contained in:
parent
99bcbb6945
commit
4230c26a1a
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
using DepartmentBusinessLogic.BindingModels;
|
||||||
|
using DepartmentBusinessLogic.Interfaces;
|
||||||
|
using DepartmentBusinessLogic.ViewModels;
|
||||||
|
using ModuleTools.BusinessLogics;
|
||||||
|
using ModuleTools.Enums;
|
||||||
|
|
||||||
|
namespace DepartmentBusinessLogic.BusinessLogics
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Логика работы с должностями сотрудников
|
||||||
|
/// </summary>
|
||||||
|
public class EmployeePostBusinessLogic : GenericBusinessLogic<EmployeePostGetBindingModel, EmployeePostSetBindingModel, EmployeePostListViewModel, EmployeePostViewModel>
|
||||||
|
{
|
||||||
|
public EmployeePostBusinessLogic(IEmployeePostService service) : base(service, "Должности сотрудников", AccessOperation.Сотрудники) { }
|
||||||
|
}
|
||||||
|
}
|
@ -5,11 +5,11 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="BindingModels\" />
|
<ProjectReference Include="..\..\Common\ModuleTools\ModuleTools.csproj" />
|
||||||
<Folder Include="BusinessLogics\" />
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
<Folder Include="Enums\" />
|
<Folder Include="Enums\" />
|
||||||
<Folder Include="Interfaces\" />
|
|
||||||
<Folder Include="ViewModels\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
using DepartmentBusinessLogic.BindingModels;
|
||||||
|
using ModuleTools.Interfaces;
|
||||||
|
|
||||||
|
namespace DepartmentBusinessLogic.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Хранение должностей сотрудников
|
||||||
|
/// </summary>
|
||||||
|
public interface IEmployeePostService : IGenerticEntityService<EmployeePostGetBindingModel, EmployeePostSetBindingModel> { }
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
using ModuleTools.Attributes;
|
||||||
|
using ModuleTools.Enums;
|
||||||
|
using ModuleTools.ViewModels;
|
||||||
|
|
||||||
|
namespace DepartmentBusinessLogic.ViewModels
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Список ролей
|
||||||
|
/// </summary>
|
||||||
|
public class EmployeePostListViewModel : ListViewModel<EmployeePostViewModel> { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Элемент ролей
|
||||||
|
/// </summary>
|
||||||
|
[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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user