/// <summary author="Wes Richardson" created="2019/03/07">
        /// Validtes and passes updated appointment data to the appointment accessor
        /// </summary>
        public bool UpdateAppointment(Appointment appointment)
        {
            int  rows    = 0;
            bool results = false;

            try
            {
                validateAppointmentData(appointment);
                if (appointmentValid)
                {
                    rows = _appointmentAccessor.UpdateAppointment(appointment);
                    if (rows > 0)
                    {
                        results = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }

            return(results);
        }
예제 #2
0
 /// <summary>
 /// Creator: Thomas Dupuy
 /// Created: 2020/04/15
 /// Approver: Michael Thompson
 /// This method updates an appointment
 /// </summary>
 /// <remarks>
 /// Updater: Mohamed Elamin
 /// Updated: 2020/04/20
 /// Update: I Added param, returns tags for the comments. And updated the date format
 /// </remarks>
 /// <param name="oldAppointment"></param>
 /// <param name="newAppointment"></param>
 /// <returns>rows count</returns>
 public int EditAppointment(Appointment oldAppointment, Appointment newAppointment)
 {
     try
     {
         return(_appointmentAccessor.UpdateAppointment(oldAppointment, newAppointment));
     }
     catch (Exception ex)
     {
         throw new ApplicationException("Data not found.", ex);
     }
 }