public void viewReport() throws Exception {
    try {
      listb.getItems().clear();
      DosenSedangMenempuhStudiDAO dao = new DosenSedangMenempuhStudiDAOImpl();
      datas =
          dao.getData(
              (UKProgramStudi) cmbProgdi.getSelectedItem().getValue(),
              (JenjangStudi) cmbJenjangStudi.getSelectedItem().getValue());

      for (DosenSedangMenempuhStudi o : datas) {
        Listitem li = new Listitem();
        Listcell cell = new Listcell(o.getNama());
        li.appendChild(cell);
        cell = new Listcell(o.getProdi());
        li.appendChild(cell);
        cell = new Listcell(o.getJenjangStudi());
        li.appendChild(cell);
        cell = new Listcell(o.getTempat());
        li.appendChild(cell);
        listb.appendChild(li);
      }
      btnExport.setDisabled(false);

    } catch (Exception ex) {
      ex.printStackTrace();
      Messagebox.show(ex.getMessage());
    }
  }
  public Listitem crearFilas(Object objeto, Component componente) throws Exception {
    Listitem fila = new Listitem();

    final Maestro_manual maestro_manual = (Maestro_manual) objeto;

    fila.appendChild(new Listcell(maestro_manual.getId_manual() + ""));
    fila.appendChild(new Listcell(maestro_manual.getManual() + ""));
    fila.appendChild(
        new Listcell(
            Utilidades.getNombreElemento(
                maestro_manual.getTipo_manual(), "tipo_manual", getServiceLocator())));
    fila.appendChild(
        new Listcell(
            Utilidades.getNombreElemento(
                maestro_manual.getTipo_moneda(), "tipo_moneda", getServiceLocator())));

    Hlayout hlayout = new Hlayout();
    fila.setStyle("text-align: justify;nowrap:nowrap");
    Toolbarbutton toolbarbutton = new Toolbarbutton("Editar");
    toolbarbutton.setImage("/images/editar.gif");
    toolbarbutton.setTooltiptext("Editar registro");
    toolbarbutton.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          @Override
          public void onEvent(Event arg0) throws Exception {
            mostrarDatos(maestro_manual);
          }
        });
    hlayout.appendChild(toolbarbutton);
    toolbarbutton = new Toolbarbutton("Eliminar");
    toolbarbutton.setImage("/images/borrar.gif");
    toolbarbutton.setTooltiptext("Eliminar registro");
    toolbarbutton.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          @Override
          public void onEvent(Event arg0) throws Exception {
            Messagebox.show(
                "Esta seguro que desea eliminar este registro? ",
                "Eliminar Registro",
                Messagebox.YES + Messagebox.NO,
                Messagebox.QUESTION,
                new org.zkoss.zk.ui.event.EventListener<Event>() {
                  public void onEvent(Event event) throws Exception {
                    if ("onYes".equals(event.getName())) {
                      eliminarDatos(maestro_manual);
                      buscarDatos();
                    }
                  }
                });
          }
        });
    hlayout.appendChild(toolbarbutton);
    Listcell listcell = new Listcell();
    listcell.appendChild(hlayout);
    fila.appendChild(listcell);

    return fila;
  }
        @Override
        public void render(Listitem item, Object data) {
            Resource resource = (Resource) data;
            item.setValue(data);

            item.appendChild(new Listcell(resource.getShortDescription()));
        }
Пример #4
0
 public void render(Listitem item, Object data) throws Exception {
   WkTUser u = (WkTUser) data;
   Integer status = Integer.parseInt(u.getKuStatus());
   String[] statsString = {"未审查", "正常", "查封"};
   item.setValue(u);
   item.setHeight("25px");
   Listcell c0 = new Listcell(item.getIndex() + 1 + "");
   Listcell c1 = new Listcell(u.getKuLid());
   Listcell c2 = new Listcell(u.getKuName());
   Listcell c3 = new Listcell(u.getKuEmail());
   Listcell c4 = new Listcell(statsString[status]);
   Listcell c5 = new Listcell(DateUtil.getDateString(u.getKuRegdate()));
   Listcell c6 = new Listcell(DateUtil.getTimeString(u.getKuLtime()));
   Button b = new Button("角色");
   Listcell c7 = new Listcell();
   c7.appendChild(b);
   b.addEventListener(
       Events.ON_CLICK,
       new EventListener() {
         public void onEvent(Event event) throws Exception {
           Listitem c = (Listitem) event.getTarget().getParent().getParent();
           WkTUser u = (WkTUser) c.getValue();
           final UserRoleSelectWindow w =
               (UserRoleSelectWindow)
                   Executions.createComponents(
                       "/admin/system/user/userRoleSelect.zul", null, null);
           w.doHighlighted();
           w.initWindow(u);
         }
       });
   c7.setTooltiptext("点击进行角色管理");
   c1.addEventListener(Events.ON_CLICK, new InnerListener());
   c2.addEventListener(Events.ON_CLICK, new InnerListener());
   c1.setTooltiptext("点击进行用户编辑");
   c2.setTooltiptext("点击进行用户编辑");
   item.appendChild(c0);
   item.appendChild(c1);
   item.appendChild(c2);
   item.appendChild(c3);
   item.appendChild(c4);
   item.appendChild(c5);
   item.appendChild(c6);
   item.appendChild(c7);
 }
Пример #5
0
  // public Listitem agregarDetail(IBeanAbstracto dto, Listbox lista, int
  // span,
  // String widthEstado, boolean aplicaEstado, boolean aplicaDetail,
  // String lblcaption, String... nobreColumnas) {
  //
  // Listitem detail = new Listitem();
  // Listhead columnas = new Listhead();
  // Groupbox gbox = new Groupbox();
  // Caption caption = new Caption(lblcaption);
  // gbox.appendChild(caption);
  //
  // Listcell cell1 = new Listcell();
  // Listcell cell2 = new Listcell();
  // cell2.setSpan(span);
  // if (aplicaDetail) {
  // Listheader deta = new Listheader();
  // deta.setWidth("20px");
  // deta.setAlign("center");
  // columnas.appendChild(deta);
  // }
  //
  // for (String nombreColumna : nobreColumnas) {
  // columnas.appendChild(new Listheader(nombreColumna));
  // }
  // if (aplicaEstado) {
  // if (widthEstado != "" && widthEstado != null) {
  // Listheader estado = new Listheader("Estado");
  // estado.setAlign(CENTER);
  // estado.setWidth(widthEstado);
  // columnas.appendChild(estado);
  // } else {
  // Listheader estado = new Listheader("Estado");
  // estado.setAlign(CENTER);
  // estado.setWidth("70px");
  // columnas.appendChild(estado);
  // }
  //
  // }
  // lista.appendChild(columnas);
  // gbox.appendChild(lista);
  // gbox.setStyle("overflow:auto");
  // cell2.appendChild(gbox);
  // detail.appendChild(cell1);
  // detail.appendChild(cell2);
  // detail.setVisible(false);
  //
  // return detail;
  // }
  //
  @SuppressWarnings("deprecation")
  public Listitem agregarDetail(
      IBeanAbstracto dto,
      Listbox lista,
      int span,
      String widthEstado,
      String lblCaption,
      boolean aplicaEstado,
      boolean aplicaDetail,
      String... nobreColumnas) {

    Listitem detail = new Listitem();
    Listhead columnas = new Listhead();
    Groupbox gbox = new Groupbox();
    Caption caption = new Caption();
    if (lblCaption != null) caption.setLabel(lblCaption);

    Listcell cell1 = new Listcell();
    Listcell cell2 = new Listcell();
    cell2.setSpan(span);
    if (aplicaDetail) {
      Listheader deta = new Listheader();
      deta.setWidth("30px");
      deta.setAlign("center");
      columnas.appendChild(deta);
    }

    for (String nombreColumna : nobreColumnas) {
      columnas.appendChild(new Listheader(nombreColumna));
    }
    if (aplicaEstado) {
      if (widthEstado != "" && widthEstado != null) {
        Listheader estado = new Listheader("Estado");
        estado.setAlign(CENTER);
        estado.setWidth(widthEstado);
        columnas.appendChild(estado);
      } else {
        Listheader estado = new Listheader("Estado");
        estado.setAlign(CENTER);
        estado.setWidth("70px");
        columnas.appendChild(estado);
      }
    }
    lista.setFixedLayout(true);
    lista.appendChild(columnas);
    gbox.appendChild(caption);
    gbox.appendChild(lista);
    gbox.setHflex("true");
    gbox.setContentStyle("overflow-x:auto");
    cell2.appendChild(gbox);
    detail.appendChild(cell1);
    detail.appendChild(cell2);
    detail.setVisible(false);

    return detail;
  }
Пример #6
0
 public void viewReport() throws Exception {
   try {
     JadwalDosenDAO dao = new JadwalDosenDAOImpl();
     if (cmbNamaDosen.getValue() != null
         && cmbProgdi.getValue() != null
         && !cmbTahun.getSelectedItem().getValue().toString().isEmpty()
         && cmbSemester.getValue() != null) {
       datas =
           dao.getJadwalDosen(
               (Dosen) cmbNamaDosen.getSelectedItem().getValue(),
               (ProgramStudi) cmbProgdi.getSelectedItem().getValue(),
               cmbTahun.getSelectedItem().getValue().toString(),
               Integer.valueOf(cmbSemester.getSelectedItem().getValue().toString()));
       lstData.getItems().clear();
       for (JadwalDosen jd : datas) {
         Listitem item = new Listitem();
         item.setValue(jd);
         item.appendChild(new Listcell(jd.getJam()));
         item.appendChild(new Listcell(jd.getSenin()));
         item.appendChild(new Listcell(jd.getSelasa()));
         item.appendChild(new Listcell(jd.getRabu()));
         item.appendChild(new Listcell(jd.getKamis()));
         item.appendChild(new Listcell(jd.getJumat()));
         item.appendChild(new Listcell(jd.getSabtu()));
         lstData.appendChild(item);
       }
       btnExport.setDisabled(false);
     } else {
       Messagebox.show("Silahkan Input Parameter dengan benar");
       btnExport.setDisabled(true);
     }
   } catch (Exception ex) {
     Messagebox.show("Telah terjadi kesalahan..");
   }
 }
Пример #7
0
    @Override
    public void render(Listitem item, Object data) throws Exception {
      if (data == null) return;
      Jxkh_BusinessIndicator type = (Jxkh_BusinessIndicator) data;
      item.setValue(type);
      Listcell c0 = new Listcell();
      if (type.getKbName() == null) {
        c0.setLabel("--请选择--");
      } else {
        c0.setLabel(type.getKbName());
      }
      item.appendChild(c0);

      if (item.getIndex() == 0) item.setSelected(true);
    }
  public void adicionarProcedimiento(Map<String, Object> pcd) {
    String codigo_cups = (String) pcd.get("codigo_cups");
    String nombre_procedimiento = (String) pcd.get("nombre_procedimiento");

    String codigo_manual = (String) pcd.get("codigo_manual");

    Double valor_defecto = 0D;

    String tipo = lbxTipo_manual.getSelectedItem().getValue().toString();

    if (tipo.equals(IConstantes.TIPO_MANUAL_SOAT)) {
      valor_defecto = (Double) pcd.get("porcentaje_defecto");
    } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS01)) {
      valor_defecto = (Double) pcd.get("valoriss01_defecto");
    } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS04)) {
      valor_defecto = (Double) pcd.get("valoriss04_defecto");
    }

    Listitem listitem = new Listitem();
    listitem.setValue(pcd);

    listitem.appendChild(new Listcell());
    listitem.appendChild(new Listcell(codigo_cups));

    Textbox tbxCodigo_manual = new Textbox(codigo_manual != null ? codigo_manual : codigo_cups);
    tbxCodigo_manual.setHflex("1");
    Listcell listcell = new Listcell();
    listcell.appendChild(tbxCodigo_manual);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxCodigo_manual, pcd, "codigo_manual", null);
    pcd.put("codigo_manual", codigo_manual != null ? codigo_manual : codigo_cups);

    Textbox tbxNombre = new Textbox(nombre_procedimiento);
    tbxNombre.setHflex("1");
    tbxNombre.setReadonly(true);
    listcell = new Listcell();
    listcell.appendChild(tbxNombre);
    listitem.appendChild(listcell);

    Double valor = (Double) pcd.get("valor");

    Doublebox dbxValor = new Doublebox();
    dbxValor.setValue(valor != null ? valor : valor_defecto);
    dbxValor.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(dbxValor);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(dbxValor, pcd, "valor", null);
    pcd.put("valor", valor != null ? valor : valor_defecto);

    String grupo_uvr = (String) pcd.get("grupo_uvr");

    Textbox tbxGrupoUvr = new Textbox(grupo_uvr != null ? grupo_uvr : "");
    tbxGrupoUvr.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(tbxGrupoUvr);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxGrupoUvr, pcd, "grupo_uvr", null);
    pcd.put("grupo_uvr", grupo_uvr != null ? grupo_uvr : "");

    String nro_cuenta = (String) pcd.get("nro_cuenta");

    Textbox tbxNro_cuenta = new Textbox(nro_cuenta != null ? nro_cuenta : "");
    tbxNro_cuenta.setHflex("1");
    listcell = new Listcell();
    listcell.appendChild(tbxNro_cuenta);
    listitem.appendChild(listcell);

    Res.cargarAutomatica(tbxNro_cuenta, pcd, "nro_cuenta", null);
    pcd.put("nro_cuenta", nro_cuenta != null ? nro_cuenta : "");

    listboxProcedimientos.appendChild(listitem);
  }
  public void cari() throws Exception {
    Connection conn = getConn();
    try {
      PerusahaanDAO dao = new PerusahaanDAOImpl(conn);
      List<Perusahaan> list = dao.gets((Kecamatan) cmbKecamatan.getSelectedItem().getValue());
      lstHasil.getItems().clear();
      int no = 1;
      for (final Perusahaan p : list) {
        Listitem item = new Listitem();
        item.setValue(p);
        item.appendChild(new Listcell(p.getNamaPerusahaan()));
        item.appendChild(new Listcell(p.getNamaPimpinan()));
        item.appendChild(
            new Listcell(
                p.getAlamatJalan()
                    + ", "
                    + p.getKota()
                    + " Telp: "
                    + p.getTelp()
                    + " Fax: "
                    + p.getFax()));
        Toolbarbutton btnDetail = new Toolbarbutton();
        btnDetail.setId("btnDetail" + (no++));
        btnDetail.setImage("/img/detail.png");
        btnDetail.setTooltiptext("Klik di sini untuk Detail dan Perubahan data");
        btnDetail.addEventListener(
            "onClick",
            new EventListener() {

              public void onEvent(Event event) throws Exception {
                // panggil form edit
                Window win =
                    (Window)
                        Executions.createComponents("/zul/admin/editPerusahaan.zul", null, null);
                Textbox txtIdPerusahaan = (Textbox) win.getFellow("txtIdPerusahaan");
                txtIdPerusahaan.setValue(p.getId());
                win.doModal();
                cari();
              }
            });

        Toolbarbutton btnHapus = new Toolbarbutton();
        btnHapus.setId("btnHapus" + no++);
        btnHapus.setImage("/img/delete.png");
        btnHapus.setTooltiptext("Klik untuk mengahapus Perusahaan");
        btnHapus.addEventListener(
            "onClick",
            new EventListener() {

              public void onEvent(Event event) throws Exception {
                if (Messagebox.show(
                        "Hapus?", "Konfirmasi", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION)
                    == Messagebox.YES) {
                  Connection connDel = getConn();
                  try {
                    PerusahaanDAO daoDel = new PerusahaanDAOImpl(connDel);
                    daoDel.delete(p.getId());
                    cari();
                  } catch (Exception ex) {
                    Messagebox.show(ex.getMessage());
                  } finally {
                    connDel.close();
                  }
                }
              }
            });

        Listcell cellAksi = new Listcell();
        cellAksi.appendChild(btnDetail);
        cellAksi.appendChild(new Space());
        cellAksi.appendChild(btnHapus);
        item.appendChild(cellAksi);
        lstHasil.appendChild(item);
      }
    } catch (Exception ex) {
      Messagebox.show(ex.getMessage());
    } finally {
      conn.close();
    }
  }
Пример #10
0
    @Override
    public void render(Listitem item, Object data) throws Exception {

      if (data == null) return;
      final JXKH_QKLW meeting = (JXKH_QKLW) data;
      item.setValue(meeting);
      Listcell c0 = new Listcell();
      Listcell c1 = new Listcell(item.getIndex() + 1 + "");
      Listcell c2 =
          new Listcell(
              meeting.getLwName().length() <= 14
                  ? meeting.getLwName()
                  : meeting.getLwName().substring(0, 14) + "...");
      c2.setTooltiptext(meeting.getLwName());
      c2.setStyle("color:blue");
      c2.addEventListener(
          Events.ON_CLICK,
          new EventListener() {
            public void onEvent(Event event) throws Exception {
              Listitem item = (Listitem) event.getTarget().getParent();
              JXKH_QKLW meeting = (JXKH_QKLW) item.getValue();
              AddJournalWindow w =
                  (AddJournalWindow)
                      Executions.createComponents(
                          "/admin/personal/deptbusinessdata/artical/journal/addJournal.zul",
                          null,
                          null);
              try {
                w.setMeeting(meeting);
                w.setAudit("AUDIT");
                w.initWindow();
                w.doModal();
              } catch (SuspendNotAllowedException e) {
                e.printStackTrace();
              } catch (InterruptedException e) {
                e.printStackTrace();
              }
              if (isQuery) {
                onClick$query();
              } else {
                initWindow();
              }
            }
          });
      // 期刊类别
      Listcell c3 = new Listcell();
      if (meeting.getQkGrade() == null) c3.setLabel("");
      else c3.setLabel(meeting.getQkGrade().getKbName());
      // 积分年度
      Listcell c4 = new Listcell(meeting.getjxYear());
      // 该项得分
      Listcell c5 = new Listcell(meeting.getScore() == null ? "" : meeting.getScore().toString());
      // 填写人
      Listcell c6 = new Listcell();
      c6.setLabel(meeting.getLwWriter());
      // 审核状态
      Listcell c7 = new Listcell();
      c7.setTooltiptext("点击填写审核意见");
      if (meeting.getLwState() == null) {
        c7.setLabel("待审核");
        c7.setStyle("color:red");
      } else {
        switch (meeting.getLwState()) {
          case 0:
            c7.setLabel("待审核");
            c7.setStyle("color:red");
            break;
          case 1:
            c7.setLabel("部门通过");
            c7.setStyle("color:red");
            break;
          case 2:
            c7.setLabel("部门审核中");
            c7.setStyle("color:red");
            break;
          case 3:
            c7.setLabel("部门不通过");
            c7.setStyle("color:red");
            break;
          case 4:
            c7.setLabel("业务办通过");
            c7.setStyle("color:red");
            break;
          case 5:
            c7.setLabel("业务办不通过");
            c7.setStyle("color:red");
            break;
          case 6:
            c7.setLabel("归档");
            c7.setStyle("color:red");
            break;
          case 7:
            c7.setLabel("业务办暂缓通过");
            c7.setStyle("color:red");
            break;
        }
      }
      // 弹出审核意见事件
      c7.addEventListener(
          Events.ON_CLICK,
          new EventListener() {
            public void onEvent(Event event) throws Exception {
              AdviceWindow w =
                  (AdviceWindow)
                      Executions.createComponents(
                          "/admin/jxkh/audit/article/journal/advice.zul", null, null);
              try {
                w.setMeeting(meeting);
                w.initWindow();
                w.doModal();
              } catch (SuspendNotAllowedException e) {
                e.printStackTrace();
              } catch (InterruptedException e) {
                e.printStackTrace();
              }
              initWindow();
            }
          });
      item.appendChild(c0);
      item.appendChild(c1);
      item.appendChild(c2);
      item.appendChild(c3);
      item.appendChild(c4);
      item.appendChild(c5);
      item.appendChild(c6);
      item.appendChild(c7);
    }