Правки
This commit is contained in:
parent
4546884a33
commit
4863480b53
@ -1,5 +1,6 @@
|
||||
using ShoeStore.Entities;
|
||||
using ShoeStore.Repositories;
|
||||
using ShoeStore.Repositories.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -40,15 +41,23 @@ public partial class FormEmployee : Form
|
||||
}
|
||||
}
|
||||
|
||||
public FormEmployee()
|
||||
public FormEmployee(IEmployeeRepository employeeRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
|
||||
|
||||
}
|
||||
|
||||
private void ButtonSave_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (numericUpDownNumStorage.Value <= 0 || numericUpDownStorageSize.Value <= 0)
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_employeeId.HasValue)
|
||||
{
|
||||
_employeeRepository.UpdateEmployee(CreateEmployee(_employeeId.Value));
|
||||
|
Loading…
x
Reference in New Issue
Block a user