Exemple #1
0
        private void CancelAppointment()
        {
            if (SelectedIndex == null) //shouldnt be able to happen but to prevent crash --> return.
            {
                return;
            }
            int index         = int.Parse(SelectedIndex.ToString(), System.Globalization.CultureInfo.InvariantCulture);
            int appointmentID = int.Parse(FilteredAppointments.Rows[index][0].ToString(), System.Globalization.CultureInfo.InvariantCulture);

            string reason = CancellationReason("Reason For Appointment Cancellation?");

            if (reason == "")   // If user closes dialog box, operation is cancelled and appointment remains active
            {
                return;
            }

            PatientDBConverter.DeleteAppointment(appointmentID, reason); // Appointment Moved To Cancelled Schema
            Success("Success!", "Patient appointment has been cancelled.");
            InitialiseDataTable();                                       // To refresh table after adjustments --> triggering onpropertychange
        }