public int AppointmentAccepted(AppointmentModel appointmentModel) { int result = 0; try { //Change Appointment Status to accepted PractitionerData dataLayer = new PractitionerData(); AppointmentModel model = new AppointmentModel(); //model is with appointmentdatestring and appointmenttimestring and PatientId model = dataLayer.AppointmentAccepted(appointmentModel); if (!model.PatientId.Equals(Guid.Empty)) { //Get PatientId to retrieve email PatientData patientDataLayer = new PatientData(); string patientEmailAddress = patientDataLayer.GetPatientEmail(model.PatientId); result = SentAppointmentAcceptedNotificationEmail(patientEmailAddress, model.AppointmentDateString, model.AppointmentTimeString); } } catch (Exception err) { new LogHelper().LogMessage("PractitionerBusiness.AppointmentAccepted : " + err); } return(result); }