use of com.cas.sim.tis.view.control.imp.dialog.Dialog in project TeachingInSimulation by ScOrPiOzzy.
the class DrawingController method showUploadDrawingDialog.
@FXML
private void showUploadDrawingDialog() {
Dialog<Integer> dialog = new Dialog<>();
dialog.setDialogPane(new ResourceUploadDialog(ResourceType.DRAWING));
dialog.setTitle(MsgUtil.getMessage("typical.case.drawings.upload"));
dialog.setPrefSize(640, 330);
dialog.initOwner(stage);
dialog.showAndWait().ifPresent(id -> {
if (id == null) {
return;
}
// 记录到数据库
addDrawings(id);
AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("ftp.upload.success"));
});
}
use of com.cas.sim.tis.view.control.imp.dialog.Dialog in project TeachingInSimulation by ScOrPiOzzy.
the class DrawingController method showSelectDrawingDialog.
@FXML
private void showSelectDrawingDialog() {
Dialog<Integer> dialog = new Dialog<>();
dialog.setDialogPane(new DrawingSelectDialog());
dialog.setTitle(MsgUtil.getMessage("typical.case.drawings.select"));
dialog.setPrefSize(640, 540);
dialog.initOwner(stage);
dialog.showAndWait().ifPresent(id -> {
if (id == null) {
return;
}
// 记录到数据库
addDrawings(id);
});
}
use of com.cas.sim.tis.view.control.imp.dialog.Dialog in project TeachingInSimulation by ScOrPiOzzy.
the class ClassList method modify.
private void modify(int id) {
Class clazz = SpringUtil.getBean(ClassAction.class).findClass(id);
Dialog<Class> dialog = new Dialog<>();
dialog.setDialogPane(new ClassModifyDialog(clazz));
dialog.setTitle(MsgUtil.getMessage("class.dialog.modify"));
dialog.setPrefSize(635, 320);
dialog.showAndWait().ifPresent(obj -> {
if (obj == null) {
return;
}
try {
SpringUtil.getBean(ClassAction.class).modifyClass(obj);
AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("alert.information.data.update.success"));
pagination.reload();
} catch (Exception e) {
e.printStackTrace();
AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
LOG.error("修改Class对象失败,Class编号{}:{}", obj.getId(), e.getMessage());
}
});
}
use of com.cas.sim.tis.view.control.imp.dialog.Dialog in project TeachingInSimulation by ScOrPiOzzy.
the class StudentList method modify.
private void modify(int id) {
User student = SpringUtil.getBean(UserAction.class).findUserByID(id);
Dialog<User> dialog = new Dialog<>();
dialog.setDialogPane(new TeacherModifyDialog(student));
dialog.setTitle(MsgUtil.getMessage("student.dialog.modify"));
dialog.setPrefSize(635, 320);
dialog.showAndWait().ifPresent(user -> {
if (user == null) {
return;
}
try {
SpringUtil.getBean(UserAction.class).modifyUser(user);
AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("alert.information.data.update.success"));
pagination.reload();
} catch (Exception e) {
e.printStackTrace();
AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
LOG.error("修改User对象失败,User编号{}:{}", user.getId(), e.getMessage());
}
});
}
use of com.cas.sim.tis.view.control.imp.dialog.Dialog in project TeachingInSimulation by ScOrPiOzzy.
the class TeacherList method modify.
private void modify(int id) {
User teacher = SpringUtil.getBean(UserAction.class).findUserByID(id);
Dialog<User> dialog = new Dialog<>();
dialog.setDialogPane(new TeacherModifyDialog(teacher));
dialog.setTitle(MsgUtil.getMessage("teacher.dialog.modify"));
dialog.setPrefSize(635, 320);
dialog.showAndWait().ifPresent(user -> {
if (user == null) {
return;
}
try {
SpringUtil.getBean(UserAction.class).modifyUser(user);
AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("alert.information.data.update.success"));
pagination.reload();
} catch (Exception e) {
e.printStackTrace();
AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
LOG.error("修改User对象失败,User编号{}:{}", user.getId(), e.getMessage());
}
});
}
Aggregations