AuthPageViewModel.cs 642 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using Practikaoy.Models;
  4. using ReactiveUI;
  5. namespace Practikaoy.ViewModels
  6. {
  7. public class AuthPageViewModel : ReactiveObject
  8. { Sazonova2Context ConnectBD = new Sazonova2Context();
  9. string _log;
  10. string _pas;
  11. int _port;
  12. public string Loginn
  13. {
  14. get => _log; set => _log = value;
  15. }
  16. public string Pass
  17. {
  18. get => _pas; set => _pas = value;
  19. }
  20. public bool PiklsPerson (ref int ex)
  21. {
  22. foreach(User item in ConnectBD.Users)
  23. {
  24. if (item.Login == Loginn && item.Passs == Pass)
  25. { ex = item.IdUser;
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. }
  32. }