User.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Newtonsoft.Json;
  7. using FietsClient.JSONObjecten;
  8. namespace FietsClient
  9. {
  10. [Serializable]
  11. public class User
  12. {
  13. public string id { get; private set; }
  14. public string password { get; private set; }
  15. public List<Session> tests { get; private set; }
  16. public int age { get; private set; }
  17. public bool gender { get; private set; }
  18. public int weight { get; private set; }
  19. public bool isDoctor { get; private set; }
  20. //Create Patient
  21. public User(string id, string password, int age, bool gender, int weight)
  22. {
  23. this.id = id;
  24. this.password = password;
  25. this.tests = new List<Session>();
  26. this.age = age;
  27. this.gender = gender;
  28. this.weight = weight;
  29. this.isDoctor = false;
  30. }
  31. //Create Patient or Doctor
  32. public User(string id, string password, int age, bool gender, int weight, bool isDoctor)
  33. {
  34. this.id = id;
  35. this.password = password;
  36. this.tests = new List<Session>();
  37. this.age = age;
  38. this.gender = gender;
  39. this.weight = weight;
  40. this.isDoctor = isDoctor;
  41. }
  42. public void AddSession(Session session)
  43. {
  44. tests.Add(session);
  45. }
  46. public List<Session> GetSessions()
  47. {
  48. return tests;
  49. }
  50. }
  51. }