2022-03-19 19:58:10 +04:00
|
|
|
|
using SecurityContract.BindingModels;
|
|
|
|
|
using SecurityContract.Logics.IGenericEntityLogic;
|
|
|
|
|
using SecurityContract.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using ToolsDesktop.Controls;
|
2022-03-18 22:48:14 +04:00
|
|
|
|
using ToolsDesktop.Enums;
|
|
|
|
|
using ToolsDesktop.Interfaces;
|
|
|
|
|
using ToolsDesktop.Models;
|
2022-03-20 10:10:44 +04:00
|
|
|
|
using ToolsModule.ManagmentDependency;
|
|
|
|
|
using ToolsModule.ManagmentSecurity;
|
2021-04-01 21:30:29 +04:00
|
|
|
|
|
2021-04-02 15:53:15 +04:00
|
|
|
|
namespace SecurityWindowsDesktop.EntityControls
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
2022-03-19 19:58:10 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Реализация контрола для списка доступов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class ControlAccessList :
|
|
|
|
|
GenericControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, IAccessLogic>,
|
2021-04-04 21:09:39 +04:00
|
|
|
|
IGenericControlEntityList
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
2022-03-19 19:58:10 +04:00
|
|
|
|
private readonly IRoleLogic _roleLogic;
|
2021-04-01 21:30:29 +04:00
|
|
|
|
|
|
|
|
|
public ControlAccessList()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2022-03-19 19:58:10 +04:00
|
|
|
|
_roleLogic = DependencyManager.Instance.Resolve<IRoleLogic>();
|
2021-04-01 21:30:29 +04:00
|
|
|
|
Title = "Доступы";
|
|
|
|
|
ControlId = new Guid("6eebc4c4-cb86-4368-93e0-33dbdbb7409a");
|
|
|
|
|
AccessOperation = AccessOperation.Доступы;
|
|
|
|
|
ControlViewEntityElement = new ControlAccessElement();
|
|
|
|
|
_genericControlViewEntityList = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IControl GetInstanceGenericControl() => new ControlAccessList() { ControlId = Guid.NewGuid() };
|
|
|
|
|
|
|
|
|
|
public ControlViewEntityListConfiguration GetConfigControl() => new()
|
|
|
|
|
{
|
|
|
|
|
PaginationOn = true,
|
2022-03-19 19:58:10 +04:00
|
|
|
|
PageNamesForPagination = _roleLogic.GetList(new RoleGetBindingModel())?.List?.Select(x =>
|
2021-04-01 21:30:29 +04:00
|
|
|
|
new PageNamesForPaginationModel
|
|
|
|
|
{
|
2021-04-04 21:09:39 +04:00
|
|
|
|
Key = x.Id,
|
2021-04-01 21:30:29 +04:00
|
|
|
|
Value = x.RoleName
|
|
|
|
|
})?.ToList(),
|
|
|
|
|
ParentPropertyName = "RoleId",
|
|
|
|
|
HideToolStripButton = new List<ToolStripButtonListNames>
|
|
|
|
|
{
|
|
|
|
|
ToolStripButtonListNames.toolStripButtonSearch
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|