diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 0ee21eb..433ddf6 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -76,9 +76,15 @@ } 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_, String contactPerson1_, String position1_, String tel1_, String email1_, String contactPerson2_, String position2_, String tel2_, String email2_, String contactPerson3_, String position3_, String tel3_, String email3_, String contactPerson4_, String position4_, String tel4_, String email4_) { Map temp_if14; - if ((((state==0)&&!company_.equals(""))&&!(this.value.containsKey(company_)))) { - this.value.put(company_,new BusinessCardManagementElement(representative_, position_, establishment_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_)); - temp_if14 = this.value; + if ((state==0)&&!company_.isEmpty()) { + if (!(this.value.containsKey(company_))) { + this.value.put(company_, new BusinessCardManagementElement(representative_, position_, establishment_, address1_, address2_, businessdescription1_, businessdescription2_, companyoverview_, URL_, contactPerson1_, position1_, tel1_, email1_, contactPerson2_, position2_, tel2_, email2_, contactPerson3_, position3_, tel3_, email3_, contactPerson4_, position4_, tel4_, email4_)); + temp_if14 = this.value; + } else { + JPanel mainPanel = screen.getPresenter().getMainPanel(); + JOptionPane.showMessageDialog(mainPanel, "会社名は既に存在します。"); + temp_if14 = this.value; + } } else { temp_if14 = this.value; } diff --git a/src/CurScreen.java b/src/CurScreen.java index 71a9f16..30f08a4 100644 --- a/src/CurScreen.java +++ b/src/CurScreen.java @@ -79,7 +79,7 @@ if ((!company.equals("")&&!(businessCardManagement.containsKey(company)))) { temp_if8 = "企業一覧"; } else { - temp_if8 = "企業一覧"; + temp_if8 = this.value; } temp_if9 = temp_if8; } else {