User.cs 919 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MyWpfApp.models
  7. {
  8. public class User
  9. {
  10. UserTable userTable;
  11. LoginedTable loginedTable;
  12. public User(LoginedTable loginedTable)
  13. {
  14. LoginedTable = loginedTable;
  15. UserTable = Globals.MyGlobalConnection.UserTable.FirstOrDefault(x => x.ID == loginedTable.ID);
  16. }
  17. public User()
  18. {
  19. LoginedTable = new LoginedTable();
  20. UserTable = new UserTable();
  21. }
  22. public string Password { set=>LoginedTable.Password=value.GetHashCode(); }
  23. public UserTable UserTable { get { userTable.ID = loginedTable.ID; return userTable; } set => userTable = value; }
  24. public LoginedTable LoginedTable { get => loginedTable; set => loginedTable = value; }
  25. }
  26. }