BicepBuddyApp/src/main/java/User/UserController.java
public void validateSignup(String fName, String lname, String email, String phone, String age,
			String gender, String prefGender, String goals, String freq,
			String timeOfDay, String style, String weight, String exp, String pass,
			String confPass) {
		if(fName.isEmpty() || lname.isEmpty() || email.isEmpty() || pass.isEmpty() ||
		   confPass.isEmpty()) {
			new ErrorGUI("Required fields: first name, last name, email, password");
			return;
		}

		if(!pass.contentEquals(confPass)) {
			new ErrorGUI("Make the passwords match to create account.");
			return;
		}

		try {
			if(!phone.isEmpty()) {
				Long.parseLong(phone);
			}
			if(!age.isEmpty()) {
				Integer.parseInt(age);
			}
		}
		catch(NumberFormatException e) {
			new ErrorGUI("Phone and/or Age must be integer values ONLY.");
			return;
		}
		//we got here because their stuff was accepted
		Master.appLogger.info(":: User's signup information was accepted.");

		createUser(fName, lname, email, phone, age, gender, prefGender, goals,
				   freq, timeOfDay, style, weight, exp, pass);

	}
/**
	 * Validate signup, but checking that all required fields have correct data.
	 *
	 * @param fName the f name
	 * @param lname the lname
	 * @param email the email
	 * @param phone the phone
	 * @param age the age
	 * @param gender the gender
	 * @param prefGender the pref gender
	 * @param goals the goals
	 * @param freq the freq
	 * @param timeOfDay the time of day
	 * @param style the style
	 * @param weight the weight
	 * @param exp the exp
	 * @param pass the pass
	 * @param confPass the conf pass
	 */
Validate signup, but checking that all required fields have correct data.
Validate signup but checking that all required fields have correct data .
public void validateSignup(String fName, String lname, String email, String phone, String age,
			String gender, String prefGender, String goals, String freq,
			String timeOfDay, String style, String weight, String exp, String pass,
			String confPass) {
		if(fName.isEmpty() || lname.isEmpty() || email.isEmpty() || pass.isEmpty() ||
		   confPass.isEmpty()) {
			new ErrorGUI("Required fields: first name, last name, email, password");
			return;
		}
		if(!pass.contentEquals(confPass)) {
			new ErrorGUI("Make the passwords match to create account.");
			return;
		}
		try {
			if(!phone.isEmpty()) {
				Long.parseLong(phone);
			}
			if(!age.isEmpty()) {
				Integer.parseInt(age);
			}
		}
		catch(NumberFormatException e) {
			new ErrorGUI("Phone and/or Age must be integer values ONLY.");
			return;
		}
		Master.appLogger.info(":: User's signup information was accepted.");
		createUser(fName, lname, email, phone, age, gender, prefGender, goals,
				   freq, timeOfDay, style, weight, exp, pass);
	}
public void validateSignup ( String fName , String lname , String email , String phone , String age , String gender , String prefGender , String goals , String freq , String timeOfDay , String style , String weight , String exp , String pass , String confPass ) { if ( fName . isEmpty ( ) || lname . isEmpty ( ) || email . isEmpty ( ) || pass . isEmpty ( ) || confPass . isEmpty ( ) ) { new ErrorGUI ( "Required fields: first name, last name, email, password" ) ; return ; } if ( ! pass . contentEquals ( confPass ) ) { new ErrorGUI ( "Make the passwords match to create account." ) ; return ; } try { if ( ! phone . isEmpty ( ) ) { Long . parseLong ( phone ) ; } if ( ! age . isEmpty ( ) ) { Integer . parseInt ( age ) ; } } catch ( NumberFormatException e ) { new ErrorGUI ( "Phone and/or Age must be integer values ONLY." ) ; return ; } Master . appLogger . info ( ":: User's signup information was accepted." ) ; createUser ( fName , lname , email , phone , age , gender , prefGender , goals , freq , timeOfDay , style , weight , exp , pass ) ; }
Validate signup, but checking that all required fields have correct data.
Validate signup but checking that all required fields have correct data .
//we got here because their stuff was accepted