DepartmentProject/DepartmentPortal/Security/SecurityWindowsDesktop/Controls/AccessesControl.cs

52 lines
1.6 KiB
C#
Raw Normal View History

using DesktopTools.Controls;
using DesktopTools.Models;
using ModuleTools.BusinessLogics;
using ModuleTools.Enums;
using SecurityBusinessLogic.BindingModels;
using SecurityBusinessLogic.BusinessLogics;
using SecurityBusinessLogic.ViewModels;
using System;
using System.Data;
using System.Linq;
namespace SecurityWindowsDesktop.Controls
{
2021-03-30 22:34:31 +04:00
public partial class AccessesControl : AbstractGenericControlEntityList<AccessGetBindingModel, AccessSetBindingModel, AccessListViewModel, AccessViewModel, AccessBusinessLogic>
{
private readonly RoleBusinessLogic _roleBusinessLogic;
public AccessesControl()
{
InitializeComponent();
_roleBusinessLogic = DependencyManager.Instance.Resolve<RoleBusinessLogic>();
Title = "Доступы";
ControlId = new Guid("6eebc4c4-cb86-4368-93e0-33dbdbb7409a");
Order = 1;
AccessOperation = AccessOperation.Доступы;
}
2021-03-30 22:34:31 +04:00
public override AbstractControlViewEntityList Clone() => new AccessesControl() { ControlId = Guid.NewGuid() };
protected override ControlViewEntityListConfiguration GetConfig() => new()
{
PaginationOn = true,
PageNamesForPagination = _roleBusinessLogic.GetList(new RoleGetBindingModel())?.List?.Select(x => x.RoleName)?.ToList()
};
2021-03-30 22:34:31 +04:00
protected override AccessListViewModel GetData()
{
throw new NotImplementedException();
}
protected override AccessListViewModel GetDataWithPageName(string key)
{
var list = _businessLogic.GetList(new AccessGetBindingModel { RoleName = key });
return list;
}
2021-03-30 22:34:31 +04:00
protected override AccessListViewModel GetDataWithPageNumber(int page, int count)
{
throw new NotImplementedException();
}
}
}