pos++;
}
else if (pos==1) {
DbConnVO vo = createConn();
vo.setCheckDbVersion(true);
Response res = ClientUtils.getData("createConfigFile",vo);
if (!res.isError()) {
Boolean b = (Boolean)((VOResponse)res).getVo();
if (b.booleanValue()) {
pos=4;
cardLayout1.show(mainPanel,"END");
dxButton.setEnabled(false);
exitButton.setEnabled(false);
sxButton.setEnabled(false);
endLabel.setText("Database structure creation has successfully completed.");
dxButton.setText("End");
dxButton.setEnabled(true);
return;
}
}
sxButton.setEnabled(true);
cardLayout1.show(mainPanel,"APPSETUP");
pos++;
sxButton.setEnabled(true);
}
else if (pos==2) {
if (companyCodeTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a company code",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (companyDescrTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a company description (e.g. corporate name...)",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (languageCodeTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a language code (e.g. 'EN', 'IT', ...)",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (companyCodeTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a language description (e.g. 'English', 'Italiano', ...)",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (adminPasswdTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a password for administrator user",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (currencyCodeTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a currency code",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (symbTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a currency symbol",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (decSymTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a decimal symbol for the currency",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (thTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify a thousand symbol for the currency",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
if (decTF.getText().trim().length()==0) {
JOptionPane.showMessageDialog(
this,
"You must specify the number of decimal for the currency",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
pos++;
cardLayout1.show(mainPanel,"VARIANTS");
}
else if (pos==3) {
pos++;
cardLayout1.show(mainPanel,"END");
dxButton.setEnabled(false);
exitButton.setEnabled(false);
sxButton.setEnabled(false);
new Thread() {
public void run() {
if (!saveSettings()) {
cardLayout1.show(mainPanel,"DB");
pos = 1;
dxButton.setEnabled(true);
exitButton.setEnabled(true);
return;
}
endLabel.setText("Database structure creation has successfully completed.");
dxButton.setText("End");
dxButton.setEnabled(true);
}
}.start();
}
else if (pos==4) {
setVisible(false);
Response res = ClientUtils.getData("getBeansFactoryName",new Object[0]);
if (res.isError()) {
JOptionPane.showMessageDialog(
this,
res.getErrorMessage(),
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}