コード例 #1
0
 /// <summary>
 /// Public setter used to set the nurse who took the measurements.
 /// If statement used to ensure only nurses take measurements.
 /// Exception is thrown if this is not the case.
 /// </summary>
 /// <param name="nurse"></param>
 public void setNurse(Nurse nurse)
 {
     if (!(nurse.getPost() == "Charge" || nurse.getPost() == "Registered" || nurse.getPost() == "Ancillary"))
     {
         throw new Exception("Must be a valid type of nurse.");
     }
     else
     {
         this.nurse = nurse;
     }
 }
コード例 #2
0
 /// <summary>
 /// Public setter used to set the nurse who administered the drug.
 /// If statement used to check the nurse who administers the drug is valid.
 /// Exception thrown if not.
 /// </summary>
 /// <param name="nurse">The nurse who administered the drug.</param>
 public void setNurse(Nurse nurse)
 {
     if (nurse.getPost() == "Ancillary")
     {
         throw new Exception("Ancillary nurses are not qualified to administer medication.");
     }
     else
     {
         this.nurse = nurse;
     }
 }