diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..99ae653
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..b0a8b4f
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..dc44ec1
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1516100498139
+
+
+ 1516100498139
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client/pom.xml b/client/pom.xml
index c5e1ee4..165cc04 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -13,13 +13,14 @@
3.1.0.RELEASE
+
org.slf4j
slf4j-api
diff --git a/client/src/main/java/steveonjava/client/CustomerEditorController.java b/client/src/main/java/steveonjava/client/CustomerEditorController.java
new file mode 100644
index 0000000..0fc16be
--- /dev/null
+++ b/client/src/main/java/steveonjava/client/CustomerEditorController.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2012, Stephen Chin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL STEPHEN CHIN OR ORACLE CORPORATION BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package steveonjava.client;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.TextField;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CustomerEditorController implements DialogController {
+ @Autowired
+ private CustomerModel model;
+ private FXMLDialog dialog;
+ private ScreensConfiguration screens;
+
+ public void setDialog(FXMLDialog dialog) {
+ this.dialog = dialog;
+ }
+
+ @FXML
+ TextField firstName;
+ @FXML
+ TextField lastName;
+
+ @FXML
+ public void register() {
+ model.addCustomer(firstName.getText(), lastName.getText());
+ dialog.close();
+ }
+
+ @FXML
+ public void close() {
+ dialog.close();
+ }
+
+ @FXML
+ public void cancel() {
+ dialog.close();
+ }
+}
diff --git a/client/src/main/java/steveonjava/client/LoginController.java b/client/src/main/java/steveonjava/client/LoginController.java
index 0972113..f37ae24 100644
--- a/client/src/main/java/steveonjava/client/LoginController.java
+++ b/client/src/main/java/steveonjava/client/LoginController.java
@@ -74,6 +74,12 @@ public void login() {
screens.showScreen(screens.customerDataScreen());
}
+ @FXML
+ public void register() {
+ dialog.close();
+ screens.registerDialog().show();
+ }
+
@FXML
public void employee() {
username.setText("employee");
diff --git a/client/src/main/java/steveonjava/client/ScreensConfiguration.java b/client/src/main/java/steveonjava/client/ScreensConfiguration.java
index cc5fed1..becebe5 100644
--- a/client/src/main/java/steveonjava/client/ScreensConfiguration.java
+++ b/client/src/main/java/steveonjava/client/ScreensConfiguration.java
@@ -84,12 +84,24 @@ AddCustomerController addCustomerController() {
return new AddCustomerController();
}
+ @Bean
+ @Scope("prototype")
+ CustomerEditorController customerEditorController() {
+ return new CustomerEditorController();
+ }
+
@Bean
@Scope("prototype")
FXMLDialog loginDialog() {
return new FXMLDialog(loginController(), getClass().getResource("Login.fxml"), primaryStage, StageStyle.UNDECORATED);
}
+ @Bean
+ @Scope("prototype")
+ FXMLDialog registerDialog() {
+ return new FXMLDialog(customerEditorController(), getClass().getResource("customer_editor.fxml"), primaryStage, StageStyle.UNDECORATED);
+ }
+
@Bean
@Scope("prototype")
LoginController loginController() {
diff --git a/client/src/main/resources/steveonjava/client/AddCustomer.fxml b/client/src/main/resources/steveonjava/client/AddCustomer.fxml
index fa741bb..8f06679 100644
--- a/client/src/main/resources/steveonjava/client/AddCustomer.fxml
+++ b/client/src/main/resources/steveonjava/client/AddCustomer.fxml
@@ -6,8 +6,12 @@
+
-
+
@@ -20,6 +24,7 @@
+