2022-03-18 22:48:14 +04:00
|
|
|
|
using ToolsDesktop.Controls;
|
|
|
|
|
using ToolsDesktop.Enums;
|
|
|
|
|
using ToolsDesktop.Interfaces;
|
|
|
|
|
using ToolsDesktop.Models;
|
2022-03-18 22:38:52 +04:00
|
|
|
|
using ToolsModule.BusinessLogics;
|
|
|
|
|
using ToolsModule.Enums;
|
2021-04-01 21:30:29 +04:00
|
|
|
|
using SecurityBusinessLogic.BindingModels;
|
|
|
|
|
using SecurityBusinessLogic.BusinessLogics;
|
|
|
|
|
using SecurityBusinessLogic.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2021-04-02 15:53:15 +04:00
|
|
|
|
namespace SecurityWindowsDesktop.EntityControls
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Реализация контрола для списка доступов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class ControlAccessList :
|
|
|
|
|
GenericControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, AccessBusinessLogic>,
|
2021-04-04 21:09:39 +04:00
|
|
|
|
IGenericControlEntityList
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
|
|
|
|
private readonly RoleBusinessLogic _roleBusinessLogic;
|
|
|
|
|
|
|
|
|
|
public ControlAccessList()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_roleBusinessLogic = DependencyManager.Instance.Resolve<RoleBusinessLogic>();
|
|
|
|
|
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-15 22:02:13 +04:00
|
|
|
|
PageNamesForPagination = _roleBusinessLogic.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
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|