Safer : set partyId only if all is OK

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@834033 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2009-11-09 12:34:23 +00:00
parent 7abd273780
commit d45dff2ac0
@@ -139,7 +139,6 @@ public class ClientProfile extends XPage implements ActionListener {
m_nameEdit.requestFocusInWindow();
m_dialog.showDialog(this);
if (!cancelled) {
m_trans.setPartyId(m_partyId);
GenericValue person = null;
try {
person = m_trans.getSession().getDelegator().findByPrimaryKey("Person", UtilMisc.toMap("partyId", m_partyId));
@@ -153,6 +152,7 @@ public class ClientProfile extends XPage implements ActionListener {
if (UtilValidate.isEmpty(result)) {
m_pos.getPromoStatusBar().displayClient(person.getString("lastName"));
m_pos.getPromoStatusBar().addPromoCode(cardId);
m_trans.setPartyId(m_partyId);
} else {
m_pos.showDialog("dialog/error/exception", result);
}