public Boolean ChangeAppointmentStatus(int appointmentId)
 {
     try
     {
         appointmentBusinessLayer = new AppointmentBusinessLayer();
         appointment          = appointmentBusinessLayer.GetAppointmentById(appointmentId);
         patientBusinessLayer = new PatientBusinessLayer();
         appointment.Status   = AppointmentStatus.Closed;
         appointment          = patientBusinessLayer.UpdateAppointment(appointment);
         return(true);
     }catch (Exception e)
     {
         Database.ExceptionHandler.PrintException(e, new StackTrace(true));
         throw e;
     }
 }
 public int EditAppointment(AppointmentListViewModel appointmentListViewModel, int Role)
 {
     try
     {
         appointmentBusinessLayer = new AppointmentBusinessLayer();
         patientBusinessLayer     = new PatientBusinessLayer();
         appointment = appointmentBusinessLayer.GetAppointmentById(appointmentListViewModel.Id);
         if (Role == 1)
         {
             appointment.Status = appointmentListViewModel.Status;
             appointment        = patientBusinessLayer.UpdateAppointment(appointment);
         }
         else if (Role == 3)
         {
             appointment.Status = (appointmentListViewModel.isCancelled) ? AppointmentStatus.Cancelled : AppointmentStatus.Pending;
             appointment        = patientBusinessLayer.UpdateAppointment(appointment);
         }
         return(appointment.DoctorId);
     }catch (Exception e)
     {
         Database.ExceptionHandler.PrintException(e, new StackTrace(true));
         throw e;
     }
 }