User.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. namespace FietsLibrary.JSONObjecten
  8. {
  9. [Serializable]
  10. public class User
  11. {
  12. public string id { get; private set; }
  13. public string password { get; private set; }
  14. public List<Session> tests { get; private set; }
  15. public int age { get; private set; }
  16. public bool gender { get; private set; }
  17. public int weight { get; private set; }
  18. public bool isDoctor { get; private set; }
  19. public User()
  20. {
  21. }
  22. //Create Patient
  23. public User(string id, string password, int age, bool gender, int weight)
  24. {
  25. this.id = id;
  26. this.password = password;
  27. this.tests = new List<Session>();
  28. this.age = age;
  29. this.gender = gender;
  30. this.weight = weight;
  31. this.isDoctor = false;
  32. }
  33. //Create Patient or Doctor
  34. public User(string id, string password, int age, bool gender, int weight, bool isDoctor)
  35. {
  36. this.id = id;
  37. this.password = password;
  38. this.tests = new List<Session>();
  39. this.age = age;
  40. this.gender = gender;
  41. this.weight = weight;
  42. this.isDoctor = isDoctor;
  43. }
  44. public void AddSession(Session session)
  45. {
  46. tests.Add(session);
  47. }
  48. public List<Session> GetSessions()
  49. {
  50. return tests;
  51. }
  52. }
  53. }