2023-04-04 22:42:28 +04:00
|
|
|
|
using CarServiceContracts.BusinessLogicsContracts;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
namespace CarServiceView
|
|
|
|
|
{
|
|
|
|
|
public partial class FormRegistrationWorker : Form
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
private readonly IWorkerLogic _workerLogic;
|
|
|
|
|
public FormRegistrationWorker(ILogger<FormRegistrationWorker> logger, IWorkerLogic workerLogic)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_workerLogic = workerLogic;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
private void buttonRegister_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2023-04-05 14:28:28 +04:00
|
|
|
|
try
|
2023-04-04 22:42:28 +04:00
|
|
|
|
{
|
2023-04-05 14:28:28 +04:00
|
|
|
|
_workerLogic.Create(new()
|
|
|
|
|
{
|
|
|
|
|
Login = textBoxLogin.Text,
|
|
|
|
|
Password = textBoxPassword.Text,
|
|
|
|
|
Name = textBoxName.Text,
|
|
|
|
|
Surname = textBoxSurname.Text
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
2023-04-04 22:42:28 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|