2022-03-18 22:08:29 +04:00
|
|
|
|
using CoreModels.Enums.Department;
|
2022-03-19 22:48:13 +04:00
|
|
|
|
using DepartmentContract.BindingModels;
|
|
|
|
|
using DepartmentContract.Logics.IGenericEntityLogic;
|
|
|
|
|
using DepartmentContract.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2022-03-18 22:48:14 +04:00
|
|
|
|
using ToolsDesktop.Controls;
|
|
|
|
|
using ToolsDesktop.Enums;
|
|
|
|
|
using ToolsDesktop.Interfaces;
|
|
|
|
|
using ToolsDesktop.Models;
|
2022-03-18 22:38:52 +04:00
|
|
|
|
using ToolsModule.Enums;
|
2021-04-12 16:57:29 +04:00
|
|
|
|
|
|
|
|
|
namespace DepartmentWindowsDesktop.EntityControls
|
|
|
|
|
{
|
2022-03-18 22:08:29 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Реализация контрола для списка студентов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class ControlStudentList :
|
2022-03-19 22:48:13 +04:00
|
|
|
|
GenericControlEntityList<StudentGetBindingModel, StudentSetBindingModel, StudentListViewModel, StudentViewModel, IStudentLogic>,
|
2021-04-12 16:57:29 +04:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|