using CoreModels.Enums.Department;
using DepartmentContract.BindingModels;
using DepartmentContract.Logics.IGenericEntityLogic;
using DepartmentContract.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using ToolsDesktop.Controls;
using ToolsDesktop.Enums;
using ToolsDesktop.Interfaces;
using ToolsDesktop.Models;
using ToolsModule.Enums;
namespace DepartmentWindowsDesktop.EntityControls
{
///
/// Реализация контрола для списка студентов
///
public partial class ControlStudentList :
GenericControlEntityList,
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().ToList().Select(x =>
new PageNamesForPaginationModel
{
Key = x,
Value = x.ToString()
})?.ToList(),
ParentPropertyName = "StudentState",
HideToolStripButton = new List
{
ToolStripButtonListNames.toolStripButtonAdd
}
};
}
}