diff --git a/Louis'-Pharmacy_CNSA212-FP/frmMedication.cs b/Louis'-Pharmacy_CNSA212-FP/frmMedication.cs index 13b0482..18babd7 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmMedication.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmMedication.cs @@ -120,6 +120,9 @@ namespace Louis__Pharmacy_CNSA212_FP Dosage = txtDosage.Text; if (Dosage.Length > 30) + { + throw new Exception(); + } else if (Dosage.Length < 1) { throw new Exception(); } @@ -162,6 +165,9 @@ namespace Louis__Pharmacy_CNSA212_FP { MedicationName = txtName.Text; if (MedicationName.Length>60) + { + throw new Exception(); + }else if (MedicationName.Length < 1) { throw new Exception(); } diff --git a/Louis'-Pharmacy_CNSA212-FP/frmPrescription.cs b/Louis'-Pharmacy_CNSA212-FP/frmPrescription.cs index cbc9da8..9327efa 100644 --- a/Louis'-Pharmacy_CNSA212-FP/frmPrescription.cs +++ b/Louis'-Pharmacy_CNSA212-FP/frmPrescription.cs @@ -420,8 +420,7 @@ namespace Louis__Pharmacy_CNSA212_FP if (txtMaxRefills.Text.Length > 0) { numRefills = int.Parse(txtMaxRefills.Text); - } - if (numRefills < 0) + }else { throw new Exception(); }