AddEmployeesViewModel.cs 634 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Acosta.Models;
  5. using Acosta.Views;
  6. using Avalonia.Controls;
  7. using ReactiveUI;
  8. namespace Acosta.ViewModels
  9. {
  10. public class AddEmployeesViewModel : ReactiveObject
  11. {
  12. SuharevaContext myC;
  13. Employee? currentUser;
  14. public AddEmployeesViewModel(SuharevaContext myC)
  15. {
  16. this.myC = myC;
  17. CurrentUser = new Employee();
  18. myC.Add(CurrentUser);
  19. }
  20. public List<Role> Roles => myC.Roles.ToList();
  21. public Employee? CurrentUser { get => currentUser; set => currentUser = value; }
  22. }
  23. }