updateRole.setUserId(updateModel.getUserId());
updateModel.addRole(updateRole);
}
// タスクを実行する
final UserDelegater udl = new UserDelegater();
int maxEstimation = ClientContext.getInt("task.default.maxEstimation");
int delay = ClientContext.getInt("task.default.delay");
String message = null;
Component c = getFrame();
Task task = new Task<Boolean>(c, message, PROGRESS_NOTE, maxEstimation) {
@Override
protected Boolean doInBackground() throws Exception {
logger.debug("ChangePassword doInBackground");
int cnt = udl.updateUser(updateModel);
return cnt > 0 ? true : false;
}
@Override
protected void succeeded(Boolean result) {
logger.debug("ChangePassword succeeded");
if (udl.isNoError()) {
//
// Project を更新する
//
Project.getProjectStub().setUserModel(updateModel);
DolphinPrincipal principal = new DolphinPrincipal();
principal.setUserId(updateModel.idAsLocal());
principal.setFacilityId(updateModel.getFacilityModel().getFacilityId());
Project.getProjectStub().setUserId(updateModel.idAsLocal());
Project.getProjectStub().setDolphinPrincipal(principal);
JOptionPane.showMessageDialog(getFrame(),
SUCCESS_MESSAGE,
ClientContext.getFrameTitle(getName()),
JOptionPane.INFORMATION_MESSAGE);
} else {
JOptionPane.showMessageDialog(getFrame(),
udl.getErrorMessage(),
ClientContext.getFrameTitle(getName()),
JOptionPane.WARNING_MESSAGE);
}
}
};