Rework so employee dont use repos but servies

This commit is contained in:
Alex Pedersen
2026-07-30 10:23:27 +02:00
parent 6df185d519
commit 9497afe262
26 changed files with 630 additions and 125 deletions

View File

@@ -11,7 +11,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Database.Repository;
using Pos.Service;
namespace Pos.Setting
{
@@ -21,6 +21,8 @@ namespace Pos.Setting
public partial class DeleteEmployeeWindow : Window
{
private int _employeeId;
private readonly EmployeeService _employeeService =
new EmployeeService();
public DeleteEmployeeWindow(int employeeId, string staffName)
{
@@ -31,9 +33,8 @@ namespace Pos.Setting
private void btnYes_Click(object sender, RoutedEventArgs e)
{
EmployeeRepository employeeRepository = new EmployeeRepository();
employeeRepository.Delete(_employeeId);
this.Close();
_employeeService.ArchiveEmployee(_employeeId);
Close();
}
private void btnNo_Click(object sender, RoutedEventArgs e)