2021-03-27 23:50:29 +04:00
|
|
|
|
using DesktopTools.Controls;
|
|
|
|
|
using DesktopTools.Models;
|
2021-03-28 19:15:55 +04:00
|
|
|
|
using ModuleTools.BusinessLogics;
|
|
|
|
|
using ModuleTools.Enums;
|
2021-03-27 23:50:29 +04:00
|
|
|
|
using SecurityBusinessLogic.BindingModels;
|
|
|
|
|
using SecurityBusinessLogic.BusinessLogics;
|
|
|
|
|
using SecurityBusinessLogic.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace SecurityWindowsDesktop.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class AccessesControl : AbstractGenerticControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, AccessBusinessLogic>
|
|
|
|
|
{
|
|
|
|
|
private readonly RoleBusinessLogic _roleBusinessLogic;
|
|
|
|
|
|
|
|
|
|
public AccessesControl()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2021-03-28 19:48:15 +04:00
|
|
|
|
_roleBusinessLogic = DependencyManager.Instance.Resolve<RoleBusinessLogic>();
|
2021-03-27 23:50:29 +04:00
|
|
|
|
Title = "Доступы";
|
|
|
|
|
Id = new Guid("6eebc4c4-cb86-4368-93e0-33dbdbb7409a");
|
|
|
|
|
Order = 1;
|
|
|
|
|
AccessOperation = AccessOperation.Доступы;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ControlViewEntityList Clone() => new AccessesControl() { Id = Guid.NewGuid() };
|
|
|
|
|
|
|
|
|
|
protected override ControlViewEntityListConfiguration GetConfig() => new()
|
|
|
|
|
{
|
|
|
|
|
PaginationOn = true,
|
|
|
|
|
PageNamesForPagination = _roleBusinessLogic.GetList(new RoleGetBindingModel())?.List?.Select(x => x.RoleName)?.ToList()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override AccessListViewModel GetDataWithPageName(string key)
|
|
|
|
|
{
|
|
|
|
|
var list = _businessLogic.GetList(new AccessGetBindingModel { RoleName = key });
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|