Advertisement
Guest User

Untitled

a guest
Jun 12th, 2015
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Linq;
  6. using System.Web;
  7.  
  8. namespace MyMedicalRecord_2.Models
  9. {
  10. public class Patient
  11. {
  12. [Key]//primary key
  13. public int PatientID { get; set; }
  14. public int Height { get; set; }
  15. public int Age { get; set; }
  16. public string Name { get; set; }
  17. //adding primary key IDs so the controller sees the properties
  18. public int PatientWeightID { get; set; }
  19. public int PatientJabID { get; set; }
  20. public int PatientExercisesID { get; set; }
  21. public int PatientBloodTestID { get; set; }
  22. public int OperationID { get; set; }
  23. public int PatientAllergyID { get; set; }
  24. public int PatientHealthConditionID { get; set; }
  25. //establishing relationships
  26. public virtual ICollection<PatientAllergy> PatientAllergies { get; set; }
  27. public virtual PatientWeight Weight { get; set; }
  28. public virtual ICollection<PatientOperation> Operation { get; set; }
  29. public virtual ICollection<PatientHealthCondition> ConditionName { get; set; }
  30. public virtual ICollection<PatientBloodTest> test { get; set; }
  31. public virtual ICollection<PatientExercises> exercise { get; set; }
  32. public virtual ICollection<PatientJab> jab { get; set; }
  33. }
  34. }
  35.  
  36.  
  37. using System;
  38. using System.Collections.Generic;
  39. using System.Linq;
  40. using System.Text;
  41. using System.ComponentModel.DataAnnotations;
  42. using System.ComponentModel.DataAnnotations.Schema;
  43.  
  44. namespace MyMedicalRecord_2.Models
  45. {
  46. public class PatientAllergy
  47. {
  48. [Key]
  49. public int PatientAllergyID { get; set; }
  50.  
  51. [ForeignKey("PatientID")]
  52. public int PatientID { get; set; }
  53.  
  54. public string AllergyType { get; set; }
  55.  
  56. public virtual ICollection<Patient> Patient { get; set; }
  57. }
  58. }
  59.  
  60. using System;
  61. using System.Collections.Generic;
  62. using System.Linq;
  63. using System.Text;
  64. using System.ComponentModel.DataAnnotations;
  65. using System.ComponentModel.DataAnnotations.Schema;
  66.  
  67. namespace MyMedicalRecord_2.Models
  68. {
  69. public class PatientBloodTest
  70. {
  71. [Key]
  72. public int PatientBloodTestID { get; set; }
  73.  
  74. [ForeignKey("PatientID")]
  75. public int PatientID { get; set; }
  76.  
  77. public string TestType { get; set; }
  78. public DateTime DateTaken { get; set; }
  79. public virtual ICollection<Patient> Patient { get; set; }
  80. }
  81. }
  82.  
  83. using System;
  84. using System.Collections.Generic;
  85. using System.Linq;
  86. using System.Text;
  87. using System.ComponentModel.DataAnnotations;
  88. using System.ComponentModel.DataAnnotations.Schema;
  89.  
  90. namespace MyMedicalRecord_2.Models
  91. {
  92. public class PatientExercises
  93. {
  94. [Key]
  95. public int PatientExercisesID { get; set; }
  96.  
  97. [ForeignKey("PatientID")]
  98. public int PatientID { get; set; }
  99.  
  100. public int Swimming { get; set; }
  101. public int Walking { get; set; }
  102. public int Gym { get; set; }
  103. public string Month { get; set; }
  104. public virtual ICollection<Patient> Patient { get; set; }
  105. }
  106. }
  107.  
  108.  
  109. using System;
  110. using System.Collections.Generic;
  111. using System.Linq;
  112. using System.Text;
  113. using System.ComponentModel.DataAnnotations;
  114. using System.ComponentModel.DataAnnotations.Schema;
  115.  
  116. namespace MyMedicalRecord_2.Models
  117. {
  118. public class PatientHealthCondition
  119. {
  120. [Key]
  121. public int PatientHealthConditionID { get; set; }
  122. [ForeignKey("PatientID")]
  123. public int PatientID { get; set; }
  124.  
  125. public string Name { get; set; }
  126. public virtual ICollection<Patient> Patient { get; set; }
  127. }
  128. }
  129.  
  130. using System;
  131. using System.Collections.Generic;
  132. using System.Linq;
  133. using System.Text;
  134. using System.ComponentModel.DataAnnotations;
  135. using System.ComponentModel.DataAnnotations.Schema;
  136.  
  137. namespace MyMedicalRecord_2.Models
  138. {
  139. public class PatientJab
  140. {
  141. [Key]
  142. public int PatientJabID { get; set; }
  143.  
  144. [ForeignKey("PatientID")]
  145. public int PatientID { get; set; }
  146.  
  147. public string Type { get; set; }
  148. public DateTime DateDone { get; set; }
  149. public virtual ICollection<Patient> Patient { get; set; }
  150. }
  151. }
  152.  
  153. using System;
  154. using System.Collections.Generic;
  155. using System.Linq;
  156. using System.Text;
  157. using System.ComponentModel.DataAnnotations;
  158. using System.ComponentModel.DataAnnotations.Schema;
  159.  
  160. namespace MyMedicalRecord_2.Models
  161. {
  162. public class PatientOperation
  163. {
  164. [Key]
  165. public int OperationID { get; set; }
  166.  
  167. [ForeignKey("PatientID")]
  168. public int PatientID { get; set; }
  169.  
  170. public string Name { get; set; }
  171. public virtual ICollection<Patient> Patient { get; set; }
  172. }
  173. }
  174. using System;
  175. using System.Collections.Generic;
  176. using System.ComponentModel.DataAnnotations;
  177. using System.ComponentModel.DataAnnotations.Schema;
  178. using System.Linq;
  179. using System.Text;
  180.  
  181.  
  182. namespace MyMedicalRecord_2.Models
  183. {
  184. public class PatientWeight
  185. {
  186. [Key]
  187. public int PatientWeightID { get; set; }
  188.  
  189. [ForeignKey("PatientID")]
  190. public int PatientID { get; set; }
  191.  
  192. public DateTime DateChecked { get; set; }
  193. public double Weight { get; set; }
  194.  
  195. public virtual Patient patient { get; set; }
  196. }
  197. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement