Exemple #1
0
 public void onClick$query() {
   Integer year;
   if (yearlist.getSelectedItem() != null) {
     year = Integer.parseInt(yearlist.getSelectedItem().getLabel());
   } else {
     Date now = new Date();
     year = now.getYear() + 1900;
   }
   List tlist =
       zbteacherService.findByYear(
           year, getXyUserRole().getKdId(), tnoSearch.getValue(), nameSearch.getValue());
   if (tlist != null) {
     teacherlist.setModel(new ListModelList(tlist));
   } else {
     teacherlist.setModel(new ListModelList());
   }
 }
Exemple #2
0
  public void onClick$addTeacher() {
    if (yearlist.getSelectedItem() == null) {
      try {
        Messagebox.show("请选择有效的年份!", "提示", Messagebox.OK, Messagebox.EXCLAMATION);
      } catch (InterruptedException e) {
        System.out.println("年份");
      }
      return;
    }
    Map arg = new HashMap();
    final Integer year = Integer.parseInt(yearlist.getSelectedItem().getLabel());
    arg.put("year", year);
    arg.put("xyuserrole", getXyUserRole());
    //		System.out.println(Teacher.getRoleId( getSchoolDept().getKdId())+"---");
    arg.put(
        "role",
        (WkTRole)
            xyUserRoleService.get(WkTRole.class, Teacher.getRoleId(getSchoolDept().getKdId())));
    final AddTeacherWindow win =
        (AddTeacherWindow)
            Executions.createComponents("/admin/kyjf/gljs/addteacher.zul", null, arg);
    win.setTitle("管理指标分解人员");
    win.doHighlighted();
    win.initWindow();
    win.addEventListener(
        Events.ON_CHANGE,
        new EventListener() {

          public void onEvent(Event arg0) throws Exception {
            List slist = win.getSelectUser();
            for (int i = 0; i < slist.size(); i++) {
              Teacher t = (Teacher) slist.get(i);
              Zbteacher Zt = new Zbteacher();
              Zt.setKuId(t.getKuId());
              Zt.setKdId(getXyUserRole().getKdId());
              Zt.setZtYear(year);
              zbteacherService.save(Zt);
            }
            win.detach();
            onClick$query();
          }
        });
  }
Exemple #3
0
 @Override
 public void initWindow() {
   yearlist.initCqYearlist(getXyUserRole().getDept().getKdSchid());
   Date now = new Date();
   List tlist =
       zbteacherService.findByYear(
           now.getYear() + 1900,
           getXyUserRole().getKdId(),
           tnoSearch.getValue(),
           nameSearch.getValue());
   if (tlist != null) {
     teacherlist.setModel(new ListModelList(tlist));
   } else {
     teacherlist.setModel(new ListModelList());
   }
 }