public static void CheckNameValid(string name) { var minAmount = 3; var maxAmount = 50; if (!Validation.CheckStringWithinLengthRange(minAmount, maxAmount, name)) { throw new System.Exception("The name entered for the bill was out of range. Name length must lie between " + minAmount + " and " + maxAmount + " characters."); } if (!Validation.CheckStringOnlyLetters(name)) { throw new System.Exception("The name entered for the bill contains invalid characters."); } }