52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
using DesktopTools.BaseControls;
|
||
using DesktopTools.Controls;
|
||
using DesktopTools.Interfaces;
|
||
using DesktopTools.Models;
|
||
using ModuleTools.Enums;
|
||
using SecurityBusinessLogic.BindingModels;
|
||
using SecurityBusinessLogic.BusinessLogics;
|
||
using SecurityBusinessLogic.ViewModels;
|
||
using System;
|
||
|
||
namespace SecurityWindowsDesktop.EntityControls
|
||
{
|
||
/// <summary>
|
||
/// Реализация контрола для списка пользователей
|
||
/// </summary>
|
||
public partial class ControlUserList :
|
||
GenericControlEntityList<UserGetBindingModel, UserSetBindingModel, UserListViewModel, UserViewModel, UserBusinessLogic>,
|
||
IGenericControlEntityList
|
||
{
|
||
public ControlUserList() : base()
|
||
{
|
||
InitializeComponent();
|
||
Title = "Пользователи";
|
||
ControlId = new Guid("d5596997-d1f5-4e5e-b94b-6bdd6bca3452");
|
||
AccessOperation = AccessOperation.Пользователи;
|
||
ControlViewEntityElement = new ControlUserElement();
|
||
_genericControlViewEntityList = this;
|
||
FillSearchPanel();
|
||
}
|
||
|
||
public IControl GetInstanceGenericControl() => new ControlUserList() { ControlId = Guid.NewGuid() };
|
||
|
||
public ControlViewEntityListConfiguration GetConfigControl() => new()
|
||
{
|
||
PaginationOn = true,
|
||
CountElementsOnPage = 40
|
||
};
|
||
|
||
private void FillSearchPanel()
|
||
{
|
||
var control = new BaseControlString("UserNameForSearch", false, false, 0)
|
||
{
|
||
Location = new System.Drawing.Point(10, 10),
|
||
Size = new System.Drawing.Size(400, 23),
|
||
Name = "SearchUserName",
|
||
TabIndex = 0
|
||
};
|
||
control.SetTitleWidth(control.SetTitle("Имя пользователя:"));
|
||
panelSearchControls.Controls.Add(control);
|
||
}
|
||
}
|
||
} |