]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Always remove contact instance from admin helper bean after linking it to avoid confusion
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 13:03:04 +0000 (15:03 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 20:21:58 +0000 (22:21 +0200)
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java

index c5f937f5a63cd4f5716bc14d16cd344868196ef0..9e5a44624ea9d5e19dcaaf9afbb139f169154095 100644 (file)
@@ -133,6 +133,9 @@ public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRe
                        if (this.adminHelper.getContact() instanceof Contact) {
                                // Link customer
                                updatedCustomer = this.adminCustomerBean.linkCustomer(customer);
+
+                               // Remove contact instance
+                               this.adminHelper.setContact(null);
                        } else {
                                // Add new customer instance
                                updatedCustomer = this.adminCustomerBean.addCustomer(customer);
index c92a4cc986557534acb6638944056127db828b81..e1d40d3274d01f19fa11de12313f29380554c67f 100644 (file)
@@ -233,6 +233,9 @@ public class PizzaAdminUserWebRequestBean implements PizzaAdminUserWebRequestCon
                        if (this.adminHelper.getContact() instanceof Contact) {
                                // Link contact with this user
                                updatedUser = this.userBean.linkUser(user);
+
+                               // Remove contact instance
+                               this.adminHelper.setContact(null);
                        } else {
                                // Add new contact
                                updatedUser = this.userBean.addUser(user);