User.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 Server.JSONObjecten;
  8. namespace Server
  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. public User()
  21. {
  22. }
  23. //Create Patient
  24. public User(string id, string password, int age, bool gender, int weight)
  25. {
  26. this.id = id;
  27. this.password = password;
  28. this.tests = new List<Session>();
  29. this.age = age;
  30. this.gender = gender;
  31. this.weight = weight;
  32. this.isDoctor = false;
  33. }
  34. //Create Patient or Doctor
  35. public User(string id, string password, int age, bool gender, int weight, bool isDoctor)
  36. {
  37. this.id = id;
  38. this.password = password;
  39. this.tests = new List<Session>();
  40. this.age = age;
  41. this.gender = gender;
  42. this.weight = weight;
  43. this.isDoctor = isDoctor;
  44. }
  45. public void AddSession(Session session)
  46. {
  47. tests.Add(session);
  48. }
  49. public List<Session> GetSessions()
  50. {
  51. return tests;
  52. }
  53. }
  54. }