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 void listarParameter() {
    lbxParameter.getChildren().clear();

    Listitem listitem = new Listitem();
    // listitem.setValue("id_manual");
    // listitem.setLabel("Id_manual");
    // lbxParameter.appendChild(listitem);

    // listitem = new Listitem();
    listitem.setValue("manual");
    listitem.setLabel("Manual");
    lbxParameter.appendChild(listitem);

    // listitem = new Listitem();
    // listitem.setValue("tipo_manual");
    // listitem.setLabel("Tipo_manual");
    // lbxParameter.appendChild(listitem);
    //
    // listitem = new Listitem();
    // listitem.setValue("tipo_moneda");
    // listitem.setLabel("Tipo_moneda");
    // lbxParameter.appendChild(listitem);

    if (lbxParameter.getItemCount() > 0) {
      lbxParameter.setSelectedIndex(0);
    }
  }
        @Override
        public void render(Listitem item, Object data) {
            Resource resource = (Resource) data;
            item.setValue(data);

            item.appendChild(new Listcell(resource.getShortDescription()));
        }
Example #4
0
 @Override
 public void render(final Listitem item, final Object data) throws Exception {
   CodeTable renderedAuthority = (CodeTable) data;
   Users user = (Users) ((Listitem) getParentComponent(item, Listitem.class)).getValue();
   List<Authority> authorityCollection = user.getAuthorityCollection();
   boolean select = false;
   for (Authority authority : authorityCollection) {
     CodeTable usersAuthority = authority.getAuthority();
     if (renderedAuthority.getCode().equals(usersAuthority.getCode())) {
       select = true;
       break;
     }
   }
   Bandbox bandbox = (Bandbox) getParentComponent(item, Bandbox.class);
   if (select) {
     if (bandbox.getText().length() > 0) {
       bandbox.setText(bandbox.getText() + ", ");
     }
     bandbox.setText(bandbox.getText() + renderedAuthority.getCode());
   }
   user.setAuthorities(bandbox.getText());
   item.setValue(data);
   item.setSelected(select);
   item.setLabel(renderedAuthority.getCode());
 }
Example #5
0
  /** Creates an new and unloaded listitem. */
  protected final Listitem newUnloadedItem(ListitemRenderer renderer, int index) {
    final ListModel model = _listbox.getModel();
    Listitem item = null;
    if (model instanceof GroupsListModel) {
      final GroupsListModel gmodel = (GroupsListModel) model;
      final GroupDataInfo info = gmodel.getDataInfo(index);
      switch (info.type) {
        case GroupDataInfo.GROUP:
          item = newListgroup(renderer);
          ((Listgroup) item).setOpen(!info.close);
          break;
        case GroupDataInfo.GROUPFOOT:
          item = newListgroupfoot(renderer);
          break;
        default:
          item = newListitem(renderer);
      }
    } else {
      item = newListitem(renderer);
    }
    ((LoadStatus) item.getExtraCtrl()).setLoaded(false);
    ((LoadStatus) item.getExtraCtrl()).setIndex(index);

    newUnloadedCell(renderer, item);
    return item;
  }
  /** 批量删除topN报告 */
  public void onClick$delete(Event event) {
    if (topNList.getSelectedCount() <= 0) {
      try {
        Messagebox.show("请选择报告!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e) {
      }
      return;
    }
    try {
      int ret =
          Messagebox.show(
              "你确认要删除选中的记录吗?", "询问", Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);
      if (ret == Messagebox.CANCEL) return;
      Set<Listitem> items = topNList.getSelectedItems();
      if (items == null || items.size() == 0) return;
      Iterator itr = items.iterator();
      this.iniFile = new IniFile(INI_FILE);
      if (iniFile == null) return;
      for (; itr.hasNext(); ) {
        Listitem item = (Listitem) itr.next();
        iniFile.deleteSection(item.getId());
        IniFile iniGen = new IniFile("reportTopN." + item.getId() + ".ini");
        try {
          iniGen.load();
        } catch (Exception e) {

        }
        List<String> sections = iniGen.getSectionList();
        for (String section : sections) {
          if (section.equalsIgnoreCase("TempSection(Please_modify_it)")) continue;
          Map<String, String> value = iniGen.getFmap().get(section);
          String fileType = value.get("fileType");
          String filePath = TopNLogListmodel.getfilename(section, fileType);
          File f = new File(filePath);
          if (!f.exists()) continue;
          f.delete();
          if (fileType.equals("html")) {
            f.delete();
            Toolkit.getToolkit().deleteFolder(filePath + "_files");
          }
          iniGen.deleteSection(section);
        }
        iniGen.saveChange();
      }

      iniFile.saveChange(); // 1252396986281
    } catch (Exception e) {
      e.printStackTrace();
    }
    View view = Toolkit.getToolkit().getSvdbView(Executions.getCurrent().getDesktop());
    String loginname = view.getLoginName();
    String minfo =
        loginname + " " + "在" + OpObjectId.topn_report.name + "中进行了  " + OpTypeId.del.name + "操作。";
    AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.del, OpObjectId.topn_report);
    // 刷新页面
    refreshInifile();
    refreshiControl();
    this.topNGenerateTime.getItems().clear();
  }
  public void render(Listitem item, Object data) throws Exception {
    SecRole role = (SecRole) data;
    Listcell listCell = new Listcell(role.getName());
    listCell.setParent(item);

    item.setValue(role.getId());
    item.setAttribute(Constants.DATA, data);
  }
  /**
   * 生成报告按钮事件
   *
   * @param event
   * @throws Exception
   */
  public void onClick$CreateReportBtn(Event event) throws Exception {

    if (topNList.getSelectedItem() == null) {
      try {
        Messagebox.show("请选择报告!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      return;
    }

    View view = Toolkit.getToolkit().getSvdbView(event.getTarget().getDesktop());
    String loginname = view.getLoginName();
    Listitem item = topNList.getSelectedItem();
    String section = item.getId();
    this.iniFile = new IniFile(INI_FILE);
    try {
      this.iniFile.load();
    } catch (Exception e) {
    }
    Map<String, String> reportDefine = this.iniFile.getSectionData(section);
    String Period = reportDefine.get("Period");
    String filetype = reportDefine.get("fileType");
    if (filetype == null) {
      filetype = "html";
    }
    Date tmStart = null;
    Date tmEnd = new Date();

    if (Period.equals("Month")) tmStart = Toolkit.getToolkit().delDay(new Date(), 30);
    else if (Period.equals("Week")) tmStart = Toolkit.getToolkit().delDay(new Date(), 7);
    else if (Period.equals("Day")) tmStart = Toolkit.getToolkit().delDay(new Date(), 1);
    else {
      Toolkit.getToolkit().showError("报告区间不支持:");
      return;
    }

    TopNReport tmpTopNReport = new TopNReport(section, reportDefine, tmStart, tmEnd, view, false);

    //	    tmpTopNReport.createReport();
    Thread thread = new Thread(tmpTopNReport);
    thread.setName("TopNReport -- TopNReport.java");
    thread.start();
    final Window win =
        (Window) Executions.createComponents("/main/progress/topnprogress.zul", null, null);
    win.setAttribute("topnreport", tmpTopNReport);
    win.setAttribute("filetype", filetype);
    win.setAttribute("reportname", tmpTopNReport.strReportName);
    win.doModal();
    // AMedia(String name, String format, String ctype, URL url, String charset)
    // 刷新日志数据

    // addlog
    //		View view = Toolkit.getToolkit().getSvdbView(event.getTarget().getDesktop());
    String minfo = loginname + " " + "在" + OpObjectId.topn_report.name + "中进行了手动生成报告操作.";
    AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.add, OpObjectId.topn_report);
    onSelecttopNList(event);
  }
Example #9
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 public Set<T> getSelecionados() {
   Collection<Listitem> selecionados = lbSelecionados.getItems();
   Set<T> selec = new HashSet();
   for (Listitem item : selecionados) {
     selec.add((T) item.getValue());
   }
   return selec;
 }
Example #10
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;
  }
 protected void editProcess(final ProcessSummaryType process) throws Exception {
   Listitem cbi = this.nativeTypesLB.getSelectedItem();
   VersionSummaryType version = process.getVersionSummaries().get(0);
   String nativeType = cbi.getLabel();
   String annotation = Constants.INITIAL_ANNOTATION;
   String readOnly = "false";
   this.mainC.editProcess(
       process, version, nativeType, annotation, readOnly, new HashSet<RequestParameterType<?>>());
   cancel();
 }
Example #12
0
 private Listitem newListitem(ListitemRenderer renderer) {
   Listitem item = null;
   if (renderer instanceof ListitemRendererExt)
     item = ((ListitemRendererExt) renderer).newListitem(_listbox);
   if (item == null) {
     item = new Listitem();
     item.applyProperties();
   }
   return item;
 }
 public void quitarItemsSeleccionados() {
   Set<Listitem> listado_items = listboxProcedimientos.getSelectedItems();
   for (Listitem listitem : listado_items) {
     Map<String, Object> pcd = (Map<String, Object>) listitem.getValue();
     Long id_procedimiento = (Long) pcd.get("id_procedimiento");
     mapa_datos_procedimientos.remove(id_procedimiento);
     procedimientos_seleccionados.remove(id_procedimiento + "");
   }
   renderizarMapaDatos();
   verificarSeleccion();
 }
 protected boolean validarLista2() {
   boolean noVacio = true;
   for (int i = 0; i < ltbAccionesInspector.getItemCount(); i++) {
     Listitem listItem = ltbAccionesInspector.getItemAtIndex(i);
     if (listItem.isSelected()) {
       Datebox date = (Datebox) listItem.getChildren().get(5).getChildren().get(0);
       Date fecha = date.getValue();
       if (fecha == null) noVacio = false;
     }
   }
   return noVacio;
 }
  /*
   * 批量删除日志
   */
  public void onClick$btnBatchDeleteGen(Event event) throws Exception {
    if (topNGenerateTime.getSelectedCount() == 0) {

      try {
        Messagebox.show("请选择报告!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      return;
    }
    try {
      int ret =
          Messagebox.show(
              "你确认要删除选中的记录吗?", "提示", Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);

      if (ret == Messagebox.CANCEL) return;
    } catch (Exception e) {
      e.printStackTrace();
    }
    Listitem topNlist = topNList.getSelectedItem();
    Iterator it = topNGenerateTime.getSelectedItems().iterator();
    try {
      while (it.hasNext()) {
        Listitem item = (Listitem) it.next();
        TopNLogBean logbean = (TopNLogBean) item.getValue();
        String section = logbean.getTitle();
        String filetype = logbean.getFiletype();
        String finame = TopNLogListmodel.getfilename(section, filetype);
        String reportid = topNlist.getId();
        IniFile inifile = new IniFile("reportTopN." + reportid + ".ini");
        inifile.load();
        for (String key : inifile.getSectionList()) {
          if (key.equals(section)) {
            inifile.deleteSection(section);
            inifile.saveChange();
            File file = new File(finame);
            File folder = new File(finame + "_files");
            if (file.exists()) {
              file.delete();
            }
            if (folder.exists()) {
              Toolkit.getToolkit().deleteFolder(finame + "_files");
            }
          }
        }
      }
    } catch (Exception e) {
      throw e;
    }
    // 刷新数据
    onSelecttopNList(event);
  }
 @Listen("onLeitorDelete = #lb_leitor")
 public void onClick(ForwardEvent event) {
   System.out.println("Apagando um funcionario leitor");
   Button bt_apagar = (Button) event.getOrigin().getTarget();
   Listcell celula = (Listcell) bt_apagar.getParent().getParent();
   Listitem item = (Listitem) celula.getParent();
   Leitor leitorApagar = (Leitor) item.getValue();
   lb_leitor.removeChild(item);
   String nome = leitorApagar.getNome();
   leitorDao.delete(leitorApagar);
   System.out.println("Apagando um funcionario leitor");
   Clients.showNotification("Os dados do funcionario " + nome + " foram apagados");
 }
 @Listen("onLeitorUpdate = #lb_leitor")
 public void onClickAlterarLeitor(ForwardEvent event) {
   Button btn_confirmarLeitor = (Button) event.getOrigin().getTarget();
   Listcell celula = (Listcell) btn_confirmarLeitor.getParent().getParent();
   Listitem itemAlterar = (Listitem) celula.getParent();
   Leitor op = (Leitor) itemAlterar.getValue();
   Map<String, Object> arguments = new HashMap<String, Object>();
   arguments.put("funAlterar", op);
   arguments.put("lb_leitor", lb_leitor);
   Window win =
       (Window) Executions.createComponents("/registos/alteracaoLeitor.zul", null, arguments);
   win.doHighlighted();
 }
  @Listen("onContadorEscolhe = #lb_contador")
  public void escolheContador(ForwardEvent event) {
    Map<String, Object> arg = (Map) rw_dadosLeitura.getValue();
    Row rw_contador = (Row) arg.get("rw_contador");
    Textbox tb_escolherContador = (Textbox) arg.get("tb_contador");
    Listitem selectedItem = (Listitem) event.getOrigin().getTarget().getParent().getParent();
    selectedContador = (Contador) selectedItem.getValue();

    rw_contador.setValue(selectedContador);
    tb_escolherContador.setText("" + (selectedContador).getNumero());

    winescolher.detach();
  }
Example #19
0
 private void doWriteComponentsToBeanVer(TVerifikasi tVerifikasi) {
   if (listbox_NamaPelaksana.getSelectedItem() != null) {
     Listitem itempelaksana = listbox_NamaPelaksana.getSelectedItem();
     ListModelList lml = (ListModelList) listbox_NamaPelaksana.getListModel();
     VHrEmployeePelaksana vHrEmployeePelaksana =
         (VHrEmployeePelaksana) lml.get(itempelaksana.getIndex());
     if (!vHrEmployeePelaksana.getEmployee_name().equalsIgnoreCase("Silakan pilih")) {
       tVerifikasi.setNik_pelaksana(vHrEmployeePelaksana.getEmployee_no());
     }
     if (!vHrEmployeePelaksana.getEmployee_no().equalsIgnoreCase("555")) {
       tVerifikasi.setNik_pelaksana(vHrEmployeePelaksana.getEmployee_no());
     }
   }
 }
Example #20
0
 public void onClick$submit() {
   ulist.clear();
   Object[] items = listbox2.getItems().toArray();
   for (int i = 0; i < items.length; i++) {
     Listitem item = (Listitem) items[i];
     ulist.add((WkTUser) item.getValue());
   }
   if (type == 0) {
     voteList.addAll(ulist);
   } else {
     voterList.addAll(ulist);
   }
   Events.postEvent(Events.ON_CHANGE, this, null);
 }
Example #21
0
        public void render(Listitem item, final Object data) {
          final Listbox listbox = (Listbox) item.getParent();
          final Template tm = listbox.getTemplate("model");
          if (tm == null) {
            item.setLabel(Objects.toString(data));
            item.setValue(data);
          } else {
            final Component[] items =
                tm.create(
                    listbox,
                    item,
                    new VariableResolver() {
                      public Object resolveVariable(String name) {
                        return "each".equals(name) ? data : null;
                      }
                    });
            if (items.length != 1)
              throw new UiException(
                  "The model template must have exactly one item, not " + items.length);

            final Listitem nli = (Listitem) items[0];
            if (nli.getValue() == null) // template might set it
            nli.setValue(data);
            item.setAttribute("org.zkoss.zul.model.renderAs", nli);
            // indicate a new item is created to replace the existent one
            item.detach();
          }
        }
Example #22
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..");
   }
 }
Example #23
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);
    }
Example #24
0
  public void setMultiple(Listgroup group, boolean value) {
    for (Iterator<Listitem> it = group.getItems().iterator(); it.hasNext(); ) {
      Listitem item = it.next();
      if (((Listcell) item.getFirstChild()).getFirstChild() != null) {
        item.setSelected(value);
        ((Checkbox) ((Listcell) item.getFirstChild()).getFirstChild()).setChecked(value);
        habilitarButtons(!value);
      }
    }

    if (idZBtnDuplicar != null) {
      if (((Checkbox) group.getFirstChild().getFirstChild()).isChecked())
        idZBtnDuplicar.setDisabled(true);
    }
  }
 public void verificarSeleccion() {
   List<Listitem> listado_items = listboxProcedimientos.getItems();
   if (!listado_items.isEmpty()) {
     boolean todos = true;
     for (Listitem listitem : listado_items) {
       if (!listitem.isSelected()) {
         todos = false;
         break;
       }
     }
     checkboxSeleccionar_todos.setChecked(todos);
   } else {
     checkboxSeleccionar_todos.setChecked(false);
   }
 }
  /**
   * 批量允许按钮功能
   *
   * @param event
   */
  public void onClick$batchAllow(Event event) {
    if (topNList.getSelectedCount() <= 0) {
      try {
        Messagebox.show("请选择报告!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      return;
    }

    Set<Listitem> items = topNList.getSelectedItems();
    if (items == null || items.size() == 0) return;
    Iterator itr = items.iterator();
    this.iniFile = new IniFile(INI_FILE);
    if (iniFile == null) return;
    try {
      iniFile.load();
    } catch (Exception e1) {
      e1.printStackTrace();
    }
    for (; itr.hasNext(); ) {
      Listitem item = (Listitem) itr.next();
      try {
        iniFile.setKeyValue(item.getId(), "Deny", "No"); // 允许
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    try {
      iniFile.saveChange();
    } catch (Exception e) {
      e.printStackTrace();
    }

    View view = Toolkit.getToolkit().getSvdbView(event.getTarget().getDesktop());
    String loginname = view.getLoginName();
    String minfo =
        loginname
            + " "
            + "在"
            + OpObjectId.topn_report.name
            + "中进行了  "
            + OpTypeId.enable.name
            + "操作。";
    AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.enable, OpObjectId.topn_report);
    // 刷新页面
    refreshiControl();
  }
Example #27
0
 @Listen("onClick = #btnRemover")
 public void removerItem() {
   if (ltbPedidos.getItemCount() != 0) {
     if (ltbPedidos.getSelectedItems().size() == 1) {
       Listitem listItem = ltbPedidos.getSelectedItem();
       TabDetalles modelo = listItem.getValue();
       int i = listItem.getIndex();
       ltbPedidos.removeItemAt(i);
       listaDetalle.remove(modelo);
       ltbPedidos.renderAll();
       Double cantidad = txtTotal.getValue();
       if (cantidad == null) cantidad = (double) 0;
       txtTotal.setValue(cantidad - modelo.getImpNot());
     } else msj.mensajeAlerta(Mensaje.editarSoloUno);
   } else msj.mensajeAlerta(Mensaje.noHayRegistros);
 }
Example #28
0
  public void render(Listitem lstm, Object o) throws Exception {
    EmployeeFamily emp = (EmployeeFamily) o;
    Listcell cell = null;

    if (emp.getRelation() != null) cell = new Listcell(emp.getRelation().toString());
    else cell = new Listcell("");
    cell.setParent(lstm);

    cell = new Listcell(emp.getName());
    cell.setParent(lstm);

    cell = new Listcell(emp.getBirthPlace().toString());
    cell.setParent(lstm);

    cell = new Listcell(emp.getBirthDate().toString());
    cell.setParent(lstm);

    if (emp.getEducation() != null) cell = new Listcell(emp.getEducation().toString());
    else cell = new Listcell("");
    cell.setParent(lstm);

    cell = new Listcell(emp.getJobTitle());
    cell.setParent(lstm);

    cell = new Listcell(emp.getCompany());
    cell.setParent(lstm);

    cell = new Listcell(emp.getCompany());
    cell.setParent(lstm);

    lstm.setAttribute("data", emp);
  }
  @Listen("onSeleccion = #divCatalogoInforme")
  public void seleccion() {
    Informe informe = catalogo.objetoSeleccionadoDelCatalogo();
    ltbAcciones.getItems().clear();
    List<PlanAccion> planes = servicioPlanAccion.buscarPorInformeyTipo(informe, "normal");
    if (!planes.isEmpty()) {
      ltbAcciones.setModel(new ListModelList<PlanAccion>(planes));
      ltbAcciones.setCheckmark(false);
      ltbAcciones.setMultiple(false);
      ltbAcciones.setCheckmark(true);
      ltbAcciones.setMultiple(true);
      ltbAcciones.renderAll();
      if (ltbAcciones.getItemCount() != 0) {
        for (int i = 0; i < ltbAcciones.getItemCount(); i++) {
          Listitem listItem = ltbAcciones.getItemAtIndex(i);
          PlanAccion plan = listItem.getValue();
          if (plan.getEstado().equals("Finalizado")) listItem.setSelected(true);
          else listItem.setSelected(false);
        }
      }
    }

    ltbAccionesInspector.getItems().clear();
    List<PlanAccion> planes2 = servicioPlanAccion.buscarPorInformeyTipo(informe, "inspector");
    if (!planes.isEmpty()) {
      ltbAccionesInspector.setModel(new ListModelList<PlanAccion>(planes2));
      ltbAccionesInspector.setCheckmark(false);
      ltbAccionesInspector.setMultiple(false);
      ltbAccionesInspector.setCheckmark(true);
      ltbAccionesInspector.setMultiple(true);
      ltbAccionesInspector.renderAll();
      if (ltbAccionesInspector.getItemCount() != 0) {
        for (int i = 0; i < ltbAccionesInspector.getItemCount(); i++) {
          Listitem listItem = ltbAccionesInspector.getItemAtIndex(i);
          PlanAccion plan = listItem.getValue();
          if (plan.getEstado().equals("Finalizado")) listItem.setSelected(true);
          else listItem.setSelected(false);
        }
      }
    }
    lblOrdenamientos.setValue(informe.getOrdenamientos());
    lblFuncionario.setValue(informe.getFuncionario());
    if (informe.getFechaVisita() != null)
      lblFechaVisita.setValue(formatoFecha.format(informe.getFechaVisita()));
    lblCodigo.setValue(informe.getCodigo());
    lblCedula.setValue(informe.getPacienteA().getCedula());
    lblFicha.setValue(informe.getPacienteA().getFicha());
    lblNombre.setValue(
        informe.getPacienteA().getPrimerNombre()
            + " "
            + informe.getPacienteA().getPrimerApellido());
    lblDescripcion.setValue(informe.getFgad());
    lblTipo.setValue(informe.getFga());
    dtbFecha.setValue(informe.getFa());
    codigoInforme = informe.getIdInforme();
    catalogo.setParent(null);
  }
  public void listarParameter() {
    lbxParameter.getChildren().clear();

    Listitem listitem = new Listitem();
    listitem.setValue("codigo");
    listitem.setLabel("Codigo");
    lbxParameter.appendChild(listitem);

    listitem = new Listitem();
    listitem.setValue("numero_solicitud");
    listitem.setLabel("Numero_solicitud");
    lbxParameter.appendChild(listitem);

    if (lbxParameter.getItemCount() > 0) {
      lbxParameter.setSelectedIndex(0);
    }
  }