42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using DesktopTools.Controls;
|
||
using DesktopTools.Models;
|
||
using ModelTools.BusinessLogics;
|
||
using ModelTools.Enums;
|
||
using SecurityBusinessLogic.BindingModels;
|
||
using SecurityBusinessLogic.BusinessLogics;
|
||
using SecurityBusinessLogic.ViewModels;
|
||
using System;
|
||
|
||
namespace SecurityWindowsDesktop.Controls
|
||
{
|
||
public partial class UsersControl : AbstractGenerticControlEntityList<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, UserBusinessLogic>
|
||
{
|
||
public UsersControl() : base()
|
||
{
|
||
InitializeComponent();
|
||
_businessLogic = UnityContainerConfigurator.Resolve<UserBusinessLogic>();
|
||
Title = "Пользователи";
|
||
Id = new Guid("d5596997-d1f5-4e5e-b94b-6bdd6bca3452");
|
||
Order = 1;
|
||
AccessOperation = AccessOperation.Пользователи;
|
||
}
|
||
|
||
public override ControlViewEntityList Clone() => new UsersControl() { Id = Guid.NewGuid() };
|
||
|
||
protected override ControlViewEntityListConfiguration GetConfig() => new()
|
||
{
|
||
PaginationOn = true,
|
||
CountElementsOnPage = 40
|
||
};
|
||
|
||
protected override UserListViewModel GetDataWithPageNumber(int page, int count)
|
||
{
|
||
var list = _businessLogic.GetList(new UserGetBindingModel
|
||
{
|
||
PageNumber = page,
|
||
PageSize = count
|
||
});
|
||
return list;
|
||
}
|
||
}
|
||
} |