diff --git a/src/BusinessCardManagement.java b/src/BusinessCardManagement.java index 6dafaf8..50e3406 100644 --- a/src/BusinessCardManagement.java +++ b/src/BusinessCardManagement.java @@ -72,9 +72,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; } @@ -376,19 +382,23 @@ public void delete(String curScreen, String wid, int state, String key) { if (state == 0) { - this.value.remove(key); - String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); - String result = this.result.getValue(); - this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); - this.widget.updateDataFromBusinessCardManagement(searchCriteriaScreen, result, this.getValue(), searchCriteriaScreen, result); - String w2d109ad3739d4744a1874ac179fc38b9 = this.w2d109ad3739d4744a1874ac179fc38b9.getValue(); - String companyList = this.companyList.getValue(); - this.widget = screenTemplates.getScreenTemplate(companyList).getWidgets1().getWidget1(w2d109ad3739d4744a1874ac179fc38b9); - this.widget.updateDataFromBusinessCardManagement4(companyList, w2d109ad3739d4744a1874ac179fc38b9, this.getValue()); - String w4ca84254d30c423ab8e449171a5b5123 = this.w4ca84254d30c423ab8e449171a5b5123.getValue(); - String searchScreen = this.searchScreen.getValue(); - this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); - this.widget.updateDataFromBusinessCardManagement2(searchScreen, w4ca84254d30c423ab8e449171a5b5123, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); + JPanel mainPanel = screen.getPresenter().getMainPanel(); + int ret = JOptionPane.showConfirmDialog(mainPanel, key + "を削除しますか?", "削除確認", JOptionPane.YES_NO_OPTION); + if (ret == JOptionPane.YES_OPTION) { + this.value.remove(key); + String searchCriteriaScreen = this.searchCriteriaScreen.getValue(); + String result = this.result.getValue(); + this.widget = screenTemplates.getScreenTemplate(searchCriteriaScreen).getWidgets1().getWidget1(result); + this.widget.updateDataFromBusinessCardManagement(searchCriteriaScreen, result, this.getValue(), searchCriteriaScreen, result); + String w2d109ad3739d4744a1874ac179fc38b9 = this.w2d109ad3739d4744a1874ac179fc38b9.getValue(); + String companyList = this.companyList.getValue(); + this.widget = screenTemplates.getScreenTemplate(companyList).getWidgets1().getWidget1(w2d109ad3739d4744a1874ac179fc38b9); + this.widget.updateDataFromBusinessCardManagement4(companyList, w2d109ad3739d4744a1874ac179fc38b9, this.getValue()); + String w4ca84254d30c423ab8e449171a5b5123 = this.w4ca84254d30c423ab8e449171a5b5123.getValue(); + String searchScreen = this.searchScreen.getValue(); + this.widget = screenTemplates.getScreenTemplate(searchScreen).getWidgets1().getWidget1(w4ca84254d30c423ab8e449171a5b5123); + this.widget.updateDataFromBusinessCardManagement2(searchScreen, w4ca84254d30c423ab8e449171a5b5123, this.getValue(), w4ca84254d30c423ab8e449171a5b5123, searchScreen); + } } } diff --git a/src/CurScreen.java b/src/CurScreen.java index 1beb3cf..e1078df 100644 --- a/src/CurScreen.java +++ b/src/CurScreen.java @@ -90,7 +90,7 @@ if ((!company.equals("")&&!(businessCardManagement.containsKey(company)))) { temp_if8 = "企業一覧"; } else { - temp_if8 = "企業一覧"; + temp_if8 = this.value; } temp_if9 = temp_if8; } else { diff --git a/src/SwingPresenter.java b/src/SwingPresenter.java index d3fa86c..1aa8b62 100644 --- a/src/SwingPresenter.java +++ b/src/SwingPresenter.java @@ -154,7 +154,7 @@ for(int j = 1; j < columnsData.length; j++) { Object cellValue = rowData.get(columnsData[j]); if(cellValue == null) { - tableData[rowCount][j] = "error"; + tableData[rowCount][j] = ""; } else { tableData[rowCount][j] = rowData.get(columnsData[j]).toString(); } @@ -163,7 +163,7 @@ for(int j = 0; j < columnsData.length; j++) { Object cellValue = rowData.get(columnsData[j]); if(cellValue == null) { - tableData[rowCount][j] = "error"; + tableData[rowCount][j] = ""; } else { tableData[rowCount][j] = rowData.get(columnsData[j]).toString(); } @@ -321,7 +321,7 @@ for(int j = 1; j < columnsData.length; j++) { Object cellValue = rowData.get(columnsData[j]); if(cellValue == null) { - tableData[rowCount][j] = "error"; + tableData[rowCount][j] = ""; } else { tableData[rowCount][j] = rowData.get(columnsData[j]).toString(); } @@ -330,7 +330,7 @@ for(int j = 0; j < columnsData.length; j++) { Object cellValue = rowData.get(columnsData[j]); if(cellValue == null) { - tableData[rowCount][j] = "error"; + tableData[rowCount][j] = ""; } else { tableData[rowCount][j] = rowData.get(columnsData[j]).toString(); } diff --git a/src/Widget1.java b/src/Widget1.java index 60a534b..dd27f99 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -1,3 +1,4 @@ +import javax.swing.*; import java.util.*; public class Widget1 { @@ -55,7 +56,7 @@ private W2d109ad3739d4744a1874ac179fc38b9 w2d109ad3739d4744a1874ac179fc38b9; private W4ca84254d30c423ab8e449171a5b5123 w4ca84254d30c423ab8e449171a5b5123; - public Widget1(String type, String text, boolean visible, int x, int y, int width, int height, int state, Map> data, List columns, String primaryKeyName, SwingPresenter presenter) { + public Widget1(String type, String text, boolean visible, int x, int y, int width, int height, int state, Map> data, List columns, String primaryKeyName, SwingPresenter presenter) { this.type = type; this.text = text; this.visible = visible;