60 lines
1.5 KiB
C#
Raw Normal View History

2024-05-06 20:26:16 +04:00
using Microsoft.Extensions.Logging;
using StudentEnrollmentContracts.BusinessLogicContracts;
namespace StudentEnrollmentView
{
public partial class FormStudents : Form
{
private readonly ILogger _logger;
private readonly IStudentLogic _logic;
public FormStudents(ILogger<FormStudents> logger, IStudentLogic logic)
{
InitializeComponent();
_logger = logger;
_logic = logic;
}
private void FormStudents_Load(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
try
{
var list = _logic.ReadList(null);
if (list != null)
{
dataGridView.DataSource = list;
dataGridView.Columns["Id"].Visible = false;
dataGridView.Columns["ExamPoints"].Visible = false;
}
_logger.LogInformation("Загрузка компонентов");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки компонентов");
}
}
private void buttonAdd_Click(object sender, EventArgs e)
{
}
private void buttonUpd_Click(object sender, EventArgs e)
{
}
private void buttonDel_Click(object sender, EventArgs e)
{
}
private void buttonRef_Click(object sender, EventArgs e)
{
}
}
}