Search in sources :

Example 1 with Dialog

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"));
    });
}
Also used : ResourceUploadDialog(com.cas.sim.tis.view.control.imp.preparation.ResourceUploadDialog) DrawingSelectDialog(com.cas.sim.tis.view.control.imp.jme.DrawingSelectDialog) ResourceUploadDialog(com.cas.sim.tis.view.control.imp.preparation.ResourceUploadDialog) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) FXML(javafx.fxml.FXML)

Example 2 with Dialog

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);
    });
}
Also used : DrawingSelectDialog(com.cas.sim.tis.view.control.imp.jme.DrawingSelectDialog) ResourceUploadDialog(com.cas.sim.tis.view.control.imp.preparation.ResourceUploadDialog) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) DrawingSelectDialog(com.cas.sim.tis.view.control.imp.jme.DrawingSelectDialog) FXML(javafx.fxml.FXML)

Example 3 with Dialog

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());
        }
    });
}
Also used : ClassAction(com.cas.sim.tis.action.ClassAction) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) Class(com.cas.sim.tis.entity.Class) IOException(java.io.IOException)

Example 4 with Dialog

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());
        }
    });
}
Also used : UserAction(com.cas.sim.tis.action.UserAction) User(com.cas.sim.tis.entity.User) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) IOException(java.io.IOException)

Example 5 with Dialog

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());
        }
    });
}
Also used : UserAction(com.cas.sim.tis.action.UserAction) User(com.cas.sim.tis.entity.User) Dialog(com.cas.sim.tis.view.control.imp.dialog.Dialog) IOException(java.io.IOException)

Aggregations

Dialog (com.cas.sim.tis.view.control.imp.dialog.Dialog)10 IOException (java.io.IOException)5 FXML (javafx.fxml.FXML)4 ClassAction (com.cas.sim.tis.action.ClassAction)2 UserAction (com.cas.sim.tis.action.UserAction)2 Class (com.cas.sim.tis.entity.Class)2 User (com.cas.sim.tis.entity.User)2 DrawingSelectDialog (com.cas.sim.tis.view.control.imp.jme.DrawingSelectDialog)2 ResourceUploadDialog (com.cas.sim.tis.view.control.imp.preparation.ResourceUploadDialog)2 PageController (com.cas.sim.tis.view.controller.PageController)2 LibraryAction (com.cas.sim.tis.action.LibraryAction)1 LibraryPublishAction (com.cas.sim.tis.action.LibraryPublishAction)1 TypicalCaseAction (com.cas.sim.tis.action.TypicalCaseAction)1 Library (com.cas.sim.tis.entity.Library)1 TypicalCase (com.cas.sim.tis.entity.TypicalCase)1 ExamMessage (com.cas.sim.tis.message.ExamMessage)1 ILeftContent (com.cas.sim.tis.view.control.ILeftContent)1 IPublish (com.cas.sim.tis.view.control.IPublish)1 ClassSelectDialog (com.cas.sim.tis.view.control.imp.classes.ClassSelectDialog)1 TypicalCaseSelectDialog (com.cas.sim.tis.view.control.imp.preparation.TypicalCaseSelectDialog)1