Esempio n. 1
0
 /// <see cref="PersonDAL.GetPersonByPatientID(Patient)"/>
 public Person GetPersonByPatientID(Patient patient)
 {
     if (patient == null || patient.ID == null)
     {
         throw new ArgumentNullException("patient and its id cannot be null");
     }
     return(PersonDAL.GetPersonByPatientID(patient));
 }
Esempio n. 2
0
        /// <summary>
        /// Deletes the given Patient and their Person from the db
        /// </summary>
        /// <param name="patient">Patient to delete</param>
        /// <returns>Whether or not the Patient was deleted</returns>
        public bool DeletePatient(Patient patient)
        {
            Person person = PersonDAL.GetPersonByPatientID(patient);

            using (TransactionScope scope = new TransactionScope())
            {
                PatientDAL.DeletePatient(patient);
                PersonDAL.DeletePerson(person);
                scope.Complete();
            }
            return(true);
        }