Exemple #1
0
        public void DeleteFromDB()
        {
            // If no row was selected
            if (SelectedRow == null)
            {
                Alert("No Row Selected!", "No record selected. Please select a record before attempting to delete a patient record.");
                return;
            }
            int patientID = int.Parse(Patients.Rows[(int)SelectedRow][0].ToString(), System.Globalization.CultureInfo.InvariantCulture);

            PatientDBConverter.DeleteRecord(patientID);
            // Refreshes DataGrid view, Resets selected row to null
            SelectedRow = null;
            Success("Database Updated.", "Changes to the database were successfully updated.");
            UpdateDB();
        }