RegistrationViewModel.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using ReactiveUI;
  4. using YtYtAvalonia.Models;
  5. namespace YtYtAvalonia.ViewModels
  6. {
  7. public class RegistrationViewModel : ReactiveObject
  8. {
  9. /*string login = "";
  10. string password = "";
  11. string surname = "";
  12. string name = "";
  13. string patronymic = "";
  14. int day;
  15. int month;
  16. int year;
  17. string email = "";
  18. int phone;
  19. public string Login { get => login; set => login = value; }
  20. public string Password { get => password; set => password = value; }
  21. public string Surname { get => surname; set => surname = value; }
  22. public string Name { get => name; set => name = value; }
  23. public string Patronymic { get => patronymic; set => patronymic = value; }
  24. public int Day { get => day; set => day = value; }
  25. public int Month { get => month; set => month = value; }
  26. public int Year { get => year; set => year = value; }
  27. public string Email { get => email; set => email = value; }
  28. public int Phone { get => phone; set => phone = value; }*/
  29. SuharevaContext myConnection;
  30. User currentUser;
  31. public RegistrationViewModel(SuharevaContext myConnection)
  32. {
  33. this.myConnection = myConnection;
  34. CurrentUser = new User();
  35. myConnection.Add(CurrentUser);
  36. myConnection.SaveChanges();
  37. }
  38. public User CurrentUser { get => currentUser; set => currentUser = value; }
  39. }
  40. }