51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using CoreModels.Enums.Department;
|
||
using DepartmentBusinessLogic.BindingModels;
|
||
using DepartmentBusinessLogic.BusinessLogics;
|
||
using DepartmentBusinessLogic.ViewModels;
|
||
using DesktopTools.Controls;
|
||
using DesktopTools.Enums;
|
||
using DesktopTools.Interfaces;
|
||
using DesktopTools.Models;
|
||
using ModuleTools.Enums;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
|
||
namespace DepartmentWindowsDesktop.EntityControls
|
||
{
|
||
/// <summary>
|
||
/// Реализация контрола для списка студентов
|
||
/// </summary>
|
||
public partial class ControlStudentList :
|
||
GenericControlEntityList<StudentGetBindingModel, StudentSetBindingModel, StudentListViewModel, StudentViewModel, StudentBusinessLogic>,
|
||
IGenericControlEntityList
|
||
{
|
||
public ControlStudentList()
|
||
{
|
||
InitializeComponent();
|
||
Title = "Студенты";
|
||
ControlId = new Guid("5fef6c48-efb8-4d52-a02e-27beb914f397");
|
||
AccessOperation = AccessOperation.Студенты;
|
||
ControlViewEntityElement = new ControlStudentElement();
|
||
_genericControlViewEntityList = this;
|
||
}
|
||
|
||
public IControl GetInstanceGenericControl() => new ControlStudentList() { ControlId = Guid.NewGuid() };
|
||
|
||
public ControlViewEntityListConfiguration GetConfigControl() => new()
|
||
{
|
||
PaginationOn = true,
|
||
PageNamesForPagination = Enum.GetValues(typeof(StudentState)).OfType<StudentState>().ToList().Select(x =>
|
||
new PageNamesForPaginationModel
|
||
{
|
||
Key = x,
|
||
Value = x.ToString()
|
||
})?.ToList(),
|
||
ParentPropertyName = "StudentState",
|
||
HideToolStripButton = new List<ToolStripButtonListNames>
|
||
{
|
||
ToolStripButtonListNames.toolStripButtonAdd
|
||
}
|
||
};
|
||
}
|
||
} |