DepartmentProject/DepartmentPortal/AcademicProgressWindowsDesktop/EntityControls/StudentAcademicProgress/ControlStudentAcademicProgressList.cs

52 lines
2.3 KiB
C#
Raw Permalink Normal View History

using AcademicProgressBusinessLogic.BindingModels;
using AcademicProgressBusinessLogic.BusinessLogics;
using AcademicProgressBusinessLogic.ViewModels;
using DesktopTools.Controls;
using ModuleTools.Enums;
using DesktopTools.Interfaces;
using DesktopTools.Models;
using System;
using System.Collections.Generic;
using DesktopTools.Enums;
using System.Windows.Forms;
namespace AcademicProgressWindowsDesktop.EntityControls.StudentAcademicProgress
{
/// <summary>
/// Реализация контрола для списка успеваемости студентов
/// </summary>
public partial class ControlStudentAcademicProgressList : GenericControlEntityList<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel, StudentAcademicProgressListViewModel, StudentAcademicProgressViewModels, StudentAcademicProgressBusinessLogic>,
IGenericControlEntityList
{
public ControlStudentAcademicProgressList()
{
InitializeComponent();
Title = "Учет успеваемости студентов";
ControlId = new Guid("9879dbb5-3b29-4971-9574-b4c13d5470c6");
AccessOperation = AccessOperation.Учет_успеваемости;
ControlViewEntityElement = new ControlStudentAcademicProgressElement();
_genericControlViewEntityList = this;
}
public IControl GetInstanceGenericControl() => new ControlStudentAcademicProgressList() { ControlId = Guid.NewGuid() };
public ControlViewEntityListConfiguration GetConfigControl() => new()
{
PaginationOn = false,
HideToolStripButton = new List<ToolStripButtonListNames>
{
ToolStripButtonListNames.toolStripButtonSearch
},
ControlOnMoveElem = new Dictionary<string, (string Title, EventHandler Event)>
{
{ "ToolStripMenuItemLoadScore", ("Выгрузить оценки из 1С:Университет", (object sender, EventArgs e) => { LoadScore(); }) }
}
};
private void LoadScore()
{
MessageBox.Show("Оценки успешно выгружены!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}