2023-05-04 23:45:15 +04:00
|
|
|
|
using ConfectioneryBusinessLogic.BusinessLogics;
|
|
|
|
|
using ConfectioneryContracts.BindingModels;
|
|
|
|
|
using ConfectioneryContracts.BusinessLogicsContracts;
|
2023-05-04 21:14:24 +04:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ConfectioneryView
|
|
|
|
|
{
|
|
|
|
|
public partial class FormMails : Form
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
private readonly IMessageInfoLogic _logic;
|
|
|
|
|
|
2023-05-04 23:45:15 +04:00
|
|
|
|
|
2023-05-04 21:14:24 +04:00
|
|
|
|
public FormMails(ILogger<FormMails> logger, IMessageInfoLogic logic)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_logic = logic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FormViewMail_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-05-04 23:45:15 +04:00
|
|
|
|
dataGridView.FillAndConfigGrid(_logic.ReadList(null));
|
2023-05-04 21:14:24 +04:00
|
|
|
|
_logger.LogInformation("Загрузка списка писем");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError(ex, "Ошибка загрузки писем");
|
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
|
|
|
|
MessageBoxIcon.Error);
|
|
|
|
|
}
|
2023-05-04 23:45:15 +04:00
|
|
|
|
}
|
2023-05-04 21:14:24 +04:00
|
|
|
|
}
|
|
|
|
|
}
|