diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 24c217b..cc0e717 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -33,6 +33,14 @@ return this.value.get(companyName); } public void updateFromState(String scId, String wid, int state, String company_, String company, String representative_, String representative, String position_, String position, String establishment_, String establishment, String address1_, String address1, String address2_, String address2, String businessdescription1_, String businessdescription1, String businessdescription2_, String businessdescription2, String companyoverview_, String companyoverview, String URL_, String URL) { + Map temp_if15; + if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { + this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, businessdescription1_, representative_, URL_, companyoverview_, businessdescription2_)); + temp_if15 = this.value; + } else { + temp_if15 = this.value; + } + this.value = temp_if15; String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -45,16 +53,16 @@ String searchScreen = this.searchScreen.getValue(); this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); - Map temp_if15; - if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { - this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, businessdescription1_, representative_, URL_, companyoverview_, businessdescription2_)); - temp_if15 = this.value; - } else { - temp_if15 = this.value; - } - this.value = temp_if15; } public void updateFromState2(String scId, String wid, int state, String company_, String representative_, String position_, String establishment_, String address1_, String address2_, String businessdescription1_, String businessdescription2_, String companyoverview_, String URL_) { + Map temp_if14; + if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { + this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, businessdescription1_, representative_, URL_, companyoverview_, businessdescription2_)); + temp_if14 = this.value; + } else { + temp_if14 = this.value; + } + this.value = temp_if14; String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -67,16 +75,16 @@ String searchScreen = this.searchScreen.getValue(); this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); - Map temp_if14; - if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { - this.value.put(company_,new BusinessCardManagementElement(address2_, address1_, establishment_, position_, "", representative_, URL_, "", "")); - temp_if14 = this.value; - } else { - temp_if14 = this.value; - } - this.value = temp_if14; } public void updateFromState3(String scId, String wid, int state, String editcompany_, String editcompany, String editrepresentative_, String editrepresentative, String editposition_, String editposition, String editestablish_, String editestablish, String editaddress1_, String editaddress1, String editaddress2_, String editaddress2, String editbusiness1_, String editbusiness1, String editbusiness2_, String editbusiness2, String editcompanydetail_, String editcompanydetail, String editURL_, String editURL) { + Map temp_if16; + if ((((state==0)&&!editcompany_.equals(""))&&this.value.containsKey(editcompany_))) { + this.value.put(editcompany_,new BusinessCardManagementElement(editaddress2_, editaddress1_, editestablish_, editposition_, editbusiness1_, editrepresentative_, editURL_, editcompanydetail_, editbusiness2_)); + temp_if16 = this.value; + } else { + temp_if16 = this.value; + } + this.value = temp_if16; String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -89,16 +97,9 @@ String searchScreen = this.searchScreen.getValue(); this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); - Map temp_if16; - if ((((state==0)&&!editcompany_.equals(""))&&this.value.containsKey(editcompany_))) { - this.value.put(editcompany_,new BusinessCardManagementElement(editaddress2_, editaddress1_, editestablish_, editposition_, editbusiness1_, editrepresentative_, editURL_, editcompanydetail_, editbusiness2_)); - temp_if16 = this.value; - } else { - temp_if16 = this.value; - } - this.value = temp_if16; } public void addBusinessCardManagement(String scId, String wid, String representative, String position, String establishment, String address1, String address2, String businessDescription1, String businessDescription2, String companyOverview, String URL, String companyName) { + this.value.put(companyName,new BusinessCardManagementElement(address2, address1, establishment, position, businessDescription1, representative, URL, companyOverview, businessDescription2)); String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); String result = this.result.getValue(); this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); @@ -111,6 +112,5 @@ String searchScreen = this.searchScreen.getValue(); this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); this.widget.updateDataFromBusinessCardManagement2(scId, wid, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); - this.value.put(companyName,new BusinessCardManagementElement(address2, address1, establishment, position, businessDescription1, representative, URL, companyOverview, businessDescription2)); } } \ No newline at end of file diff --git a/src/Screen.java b/src/Screen.java index 8c45171..e9312a5 100644 --- a/src/Screen.java +++ b/src/Screen.java @@ -42,6 +42,8 @@ } public void updateFromCurScreen(String curScreen, Map screenTemplate) { this.presenter.screenUpdate(getValue(), screenTemplate); - setValue(screenTemplate); + if (screenId == null || !screenId.equals(curScreen)) { + setValue(screenTemplate); + } } } \ No newline at end of file