From 7c7629b4efefa6496bc34483d2dd449983e14483 Mon Sep 17 00:00:00 2001 From: EggMan20339 <99349302+EggMan20339@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:32:03 -0500 Subject: [PATCH] added catches for when someone tries to delete a forign hey referenced in a prescription --- Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs index b596024..de40a46 100644 --- a/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs +++ b/Louis'-Pharmacy_CNSA212-FP/PharmacyDataTier.cs @@ -344,7 +344,7 @@ namespace Louis__Pharmacy_CNSA212_FP } catch (Exception ex) { - throw new ArgumentException(ex.Message); + MessageBox.Show(Patient_id + " Has an Associated Prescriptions. Could Not Delete", "Error", MessageBoxButtons.OK); } finally { @@ -374,7 +374,7 @@ namespace Louis__Pharmacy_CNSA212_FP } catch (Exception ex) { - throw new ArgumentException(ex.Message); + MessageBox.Show(Physician_id + " Has an Associated Prescriptions. Could Not Delete", "Error", MessageBoxButtons.OK); } finally { @@ -404,7 +404,7 @@ namespace Louis__Pharmacy_CNSA212_FP } catch (Exception ex) { - throw new ArgumentException(ex.Message); + MessageBox.Show(medID + " Has an Associated Prescriptions. Could Not Delete", "Error", MessageBoxButtons.OK); } finally { @@ -434,7 +434,7 @@ namespace Louis__Pharmacy_CNSA212_FP } catch (Exception ex) { - throw new ArgumentException(ex.Message); + MessageBox.Show(precID + " Has an Associated Prescriptions. Could Not Delete", "Error", MessageBoxButtons.OK); } finally {