Guest User

Untitled

a guest
Jan 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace DistrictAgent.Model
  6. {
  7. public class School
  8. {
  9. private int id;
  10. private Parish parish;
  11. private SubCounty subCounty;
  12. private County county;
  13. private District district;
  14.  
  15. private string name;
  16. private Location location;
  17. private int establishedYear;
  18. private string code;
  19. private OwnerShip ownerShip;
  20. private SchoolType schoolType;
  21. private FundingSource fundingSource;
  22. private BoardingType boardingType;
  23. private RegistryStatus registryStatus;
  24. private SchoolGrade schoolGrade;
  25. private FoundingBody foundingBody;
  26. private DistanceSchool distanceSchool;
  27. private DistanceDEO distanceDEO;
  28. private bool closed;
  29. private string pobox;
  30. private string town;
  31. private string email;
  32. private string website;
  33. private string phone;
  34. private string fax;
  35. private string uneb;
  36. private string mps;
  37. private string address;
  38.  
  39. private IList<AttendanceRecord> attendanceRecords;
  40.  
  41. /// <summary>
  42. /// gets or sets the attendance records
  43. /// </summary>
  44. public virtual IList<AttendanceRecord> AttendanceRecords
  45. {
  46. get { return this.attendanceRecords; }
  47. set { this.attendanceRecords = value; }
  48. }
  49.  
  50. public virtual void AddAttendanceRecord(AttendanceRecord aRecord)
  51. {
  52. if (aRecord == null)
  53. return;
  54.  
  55. if (AttendanceRecords == null)
  56. AttendanceRecords = new List<AttendanceRecord>();
  57.  
  58. AttendanceRecords.Add(aRecord);
  59. aRecord.School = this;
  60. }
  61.  
  62. public virtual void RemoveAttendanceRecord(AttendanceRecord aRecord)
  63. {
  64. if (aRecord == null || AttendanceRecords == null || AttendanceRecords.Count == 0)
  65. return;
  66.  
  67. AttendanceRecords.Remove(aRecord);
  68. }
  69.  
  70. /// <summary>
  71. /// gets or sets the id of the school
  72. /// </summary>
  73. public virtual int Id
  74. {
  75. get { return this.id; }
  76. set { this.id = value; }
  77. }
  78.  
  79. /// <summary>
  80. /// gets or sets the parish
  81. /// </summary>
  82. public virtual Parish Parish
  83. {
  84. get { return this.parish; }
  85. set { this.parish = value; }
  86. }
  87.  
  88. /// <summary>
  89. /// gets or sets the subcounty
  90. /// </summary>
  91. public virtual SubCounty SubCounty
  92. {
  93. get { return this.subCounty; }
  94. set { this.subCounty = value; }
  95. }
  96.  
  97. /// <summary>
  98. /// gets or sets the county
  99. /// </summary>
  100. public virtual County County
  101. {
  102. get { return this.county; }
  103. set { this.county = value; }
  104. }
  105.  
  106. /// <summary>
  107. /// gets or sets the district
  108. /// </summary>
  109. public virtual District District
  110. {
  111. get { return this.district; }
  112. set { this.district = value; }
  113. }
  114.  
  115. /// <summary>
  116. /// gets or sets the name of the school
  117. /// </summary>
  118. public virtual string Name
  119. {
  120. get { return this.name; }
  121. set { this.name = value; }
  122. }
  123.  
  124. /// <summary>
  125. /// gets or sets the location
  126. /// </summary>
  127. public virtual Location Location
  128. {
  129. get { return this.location; }
  130. set { this.location = value; }
  131. }
  132.  
  133. /// <summary>
  134. /// gets or sets the established year
  135. /// </summary>
  136. public virtual int EstablishedYear
  137. {
  138. get { return this.establishedYear; }
  139. set { this.establishedYear = value; }
  140. }
  141.  
  142. /// <summary>
  143. /// gets or sets the code
  144. /// </summary>
  145. public virtual string Code
  146. {
  147. get { return this.code; }
  148. set { this.code = value; }
  149. }
  150.  
  151. /// <summary>
  152. /// gets or sets the ownership
  153. /// </summary>
  154. public virtual OwnerShip OwnerShip
  155. {
  156. get { return this.ownerShip; }
  157. set { this.ownerShip = value; }
  158. }
  159.  
  160. /// <summary>
  161. /// gets or sets the school type
  162. /// </summary>
  163. public virtual SchoolType SchoolType
  164. {
  165. get { return this.schoolType; }
  166. set { this.schoolType = value; }
  167. }
  168.  
  169. /// <summary>
  170. /// gets or sets the funding source
  171. /// </summary>
  172. public virtual FundingSource FundingSource
  173. {
  174. get { return this.fundingSource; }
  175. set { this.fundingSource = value; }
  176. }
  177.  
  178. /// <summary>
  179. /// gets or sets the boarding type
  180. /// </summary>
  181. public virtual BoardingType BoardingType
  182. {
  183. get { return this.boardingType; }
  184. set { this.boardingType = value; }
  185. }
  186.  
  187. /// <summary>
  188. /// gets or sets the registry status
  189. /// </summary>
  190. public virtual RegistryStatus RegistryStatus
  191. {
  192. get { return this.registryStatus; }
  193. set { this.registryStatus = value; }
  194. }
  195.  
  196. /// <summary>
  197. /// gets or sets the school grade
  198. /// </summary>
  199. public virtual SchoolGrade SchoolGrade
  200. {
  201. get { return this.schoolGrade; }
  202. set { this.schoolGrade = value; }
  203. }
  204.  
  205. /// <summary>
  206. /// gets or sets the founding body
  207. /// </summary>
  208. public virtual FoundingBody FoundingBody
  209. {
  210. get { return this.foundingBody; }
  211. set { this.foundingBody = value; }
  212. }
  213.  
  214. /// <summary>
  215. /// gets or sets the distance school
  216. /// </summary>
  217. public virtual DistanceSchool DistanceSchool
  218. {
  219. get { return this.distanceSchool; }
  220. set { this.distanceSchool = value; }
  221. }
  222.  
  223. /// <summary>
  224. /// gets or sets the distance deo
  225. /// </summary>
  226. public virtual DistanceDEO DistanceDEO
  227. {
  228. get { return this.distanceDEO; }
  229. set { this.distanceDEO = value; }
  230. }
  231.  
  232. /// <summary>
  233. /// gets or sets the closed
  234. /// </summary>
  235. public virtual Boolean IsClosed
  236. {
  237. get { return this.closed; }
  238. set { this.closed = value; }
  239. }
  240.  
  241. /// <summary>
  242. /// gets or sets the pobox
  243. /// </summary>
  244. public virtual string POBOX
  245. {
  246. get { return this.pobox; }
  247. set { this.pobox = value; }
  248. }
  249.  
  250. /// <summary>
  251. /// gets or sets the town
  252. /// </summary>
  253. public virtual string Town
  254. {
  255. get { return this.town; }
  256. set { this.town = value; }
  257. }
  258.  
  259. /// <summary>
  260. /// gets or sets the email
  261. /// </summary>
  262. public virtual string Email
  263. {
  264. get { return this.email; }
  265. set { this.email = value; }
  266. }
  267.  
  268. /// <summary>
  269. /// gets or sets the website
  270. /// </summary>
  271. public virtual string Website
  272. {
  273. get { return this.website; }
  274. set { this.website = value; }
  275. }
  276.  
  277. /// <summary>
  278. /// gets or sets the phone number
  279. /// </summary>
  280. public virtual string Phone
  281. {
  282. get { return this.phone; }
  283. set { this.phone = value; }
  284. }
  285.  
  286. /// <summary>
  287. /// gets or sets the fax
  288. /// </summary>
  289. public virtual string Fax
  290. {
  291. get { return this.fax; }
  292. set { this.fax = value; }
  293. }
  294.  
  295. /// <summary>
  296. /// gets or sets the uneb centre number
  297. /// </summary>
  298. public virtual string Uneb
  299. {
  300. get { return this.uneb; }
  301. set { this.uneb = value; }
  302. }
  303.  
  304. /// <summary>
  305. /// gets or sets the mps
  306. /// </summary>
  307. public virtual string MPS
  308. {
  309. get { return this.mps; }
  310. set { this.mps = value; }
  311. }
  312.  
  313. /// <summary>
  314. /// gets or sets the address
  315. /// </summary>
  316. public virtual string Address
  317. {
  318. get { return this.address; }
  319. set { this.address = value; }
  320. }
  321.  
  322. public override string ToString()
  323. {
  324. return Name + " - " + Id;
  325. }
  326.  
  327. public override bool Equals(object obj)
  328. {
  329. if (obj is School)
  330. {
  331. if (this.Id.Equals(((School)obj).Id))
  332. return true;
  333. else
  334. return false;
  335. }
  336. else
  337. return false;
  338. }
  339. }
  340. }
Add Comment
Please, Sign In to add comment