コード例 #1
0
 public void checkR() {
   if (English.isChecked()) {
     lenguaje = "en";
     Locale preferredLocale = org.zkoss.util.Locales.getLocale(lenguaje);
     session.setAttribute(org.zkoss.web.Attributes.PREFERRED_LOCALE, preferredLocale);
   } else if (Spanish.isChecked()) {
     lenguaje = "es";
     Locale preferredLocale = org.zkoss.util.Locales.getLocale(lenguaje);
     session.setAttribute(org.zkoss.web.Attributes.PREFERRED_LOCALE, preferredLocale);
   }
 }
コード例 #2
0
ファイル: BatchAuditWindow.java プロジェクト: hebut/jxkh
  public void onClick$submit() {
    JXKH_HYLW meeting = new JXKH_HYLW();
    for (int i = 0; i < meetingList.size(); i++) {
      meeting = meetingList.get(i);
      meetDeptList = jxkhHylwService.findMeetingDeptByMeetingId(meeting);
      int index = 0;
      // int tt = 0;
      for (int t = 1; t <= meetDeptList.size(); t++) {
        JXKH_HYLWDept dept = (JXKH_HYLWDept) meetDeptList.get(t - 1);
        if (user.getDept().getKdName().equals(dept.getName())) {
          index = dept.getRank();
        }
      }
      String s = meeting.getTempState();
      char[] myStr = s.toCharArray();
      if (pass.isChecked()) {
        myStr[index - 1] = '1';
        String s0 = new String(myStr);
        meeting.setTempState(s0);
        meeting.setLwState(JXKH_MEETING.First_Dept_Pass);
        jxkhHylwService.saveOrUpdate(meeting);

        int k = 1;
        String str = meeting.getTempState();
        for (int j = 0; j < meetDeptList.size(); j++) {
          if (str.charAt(j) != '1') k = 0;
        }
        if (k == 1) meeting.setLwState(JXKH_MEETING.DEPT_PASS);
      } else if (back.isChecked()) {
        myStr[index - 1] = '2';
        String s0 = new String(myStr);
        meeting.setTempState(s0);
        meeting.setLwState(JXKH_MEETING.DEPT_NOT_PASS);
      }
      jxkhHylwService.saveOrUpdate(meeting);
    }

    try {
      Messagebox.show("批量审核成功!", "提示", Messagebox.OK, Messagebox.INFORMATION);
    } catch (Exception e) {
      e.printStackTrace();
      try {
        Messagebox.show("批量审核失败,请重试!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e1) {
        e1.printStackTrace();
      }
    }
    this.onClose();
  }
コード例 #3
0
    /**
     * Method called when the onUpload event happens.
     *
     * @param Media
     *            Media to be imported.
     */
    public void importProject(Media media) {

        String file = media.getName();

        if (checkFileFormat(file)) {

            if (importCalendars.isChecked()) {

                try {
                    importCalendar(media.getStreamData(), file);
                    messages.showMessage(Level.INFO, _(file
                            + ": Calendar import successfully!"));
                } catch (InstanceNotFoundException e) {
                    messages.showMessage(Level.ERROR, _("Instance not found."));
                } catch (ValidationException e) {
                    messages.showMessage(Level.ERROR, e.getMessage());
                }

            } else if (importTasks.isChecked()) {
                importProject(media.getStreamData(), file);

                messages.showMessage(Level.INFO, _(file
                        + ": Task import successfully!"));

            } else if (importAll.isChecked()) {

                try {
                    importAll(media.getStreamData(), file);
                    messages.showMessage(Level.INFO, _(file
                            + ": Import successfully!"));
                } catch (InstanceNotFoundException e) {
                    messages.showMessage(Level.ERROR, _("Instance not found."));
                } catch (ValidationException e) {
                    messages.showMessage(Level.ERROR, e.getMessage());
                }

            } else {
                messages.showMessage(Level.WARNING,
                        _("Select one of the options."));
            }

        } else {
            messages.showMessage(Level.ERROR,
                    _("The only current supported formats are mpp and planner."));
        }

    }