Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addCustomerData() {
- boolean validInput = false;
- String first_name = "";
- String last_name = "";
- String address1 = "";
- String address2 = "";
- int zone_ID = 0;
- while (!validInput) {
- if(input.hasNext()){
- first_name = input.nextLine();
- validInput = true;
- }
- }
- validInput = false;
- while (!validInput) {
- if(input.hasNext()){
- last_name = input.nextLine();
- validInput = true;
- }
- }
- validInput = false;
- while (!validInput) {
- if(input.hasNext()){
- address1 = input.nextLine();
- validInput = true;
- }
- }
- validInput = false;
- while (!validInput) {
- if(input.hasNext()){
- address2 = input.nextLine();
- validInput = true;
- }
- validInput = false;
- while (!validInput) {
- if(input.hasNext()){
- zone_ID = input.nextInt();
- validInput = true;
- }
- }
- }
- customer.setFirstName(first_name);
- customer.setLastName(last_name);
- customer.setAddress1(address1);
- customer.setAddress2(address2);
- customer.setZone_ID(zone_ID);
- // Assuming all fields are valid
- controller.addCustomerData(customer);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement