@Override
 protected String find() {
   this.grid =
       new SaidaMaterialBS()
           .pesquisar(this.saidaMaterialPesquisa, Utilitario.getUsuarioLogado().getEmpresaModel());
   Utilitario.addResultList(this.grid);
   return null;
 }
 public List<Material> completarMaterial(String query) {
   List<Material> materiais =
       new MaterialDAO()
           .autoCompletar(
               new Material(null, query + "%", query + "%"),
               Utilitario.getUsuarioLogado().getEmpresaModel());
   return materiais;
 }
  @Override
  protected void clearFields() {
    this.saidaMaterial = new SaidaMaterial();
    this.saidaMaterial.setLinhas(new ArrayList<SaidaMaterialLinha>());

    this.saidaMaterialPesquisa = new SaidaMaterial();
    this.saidaMaterialPesquisa.setDataInicial(new Date());
    this.saidaMaterialPesquisa.setDataFinal(new Date());
    this.alterar = false;
    this.comboCorKit =
        super.initCombo(
            new CorKitBS().pesquisar(new CorKit(), Utilitario.getUsuarioLogado().getEmpresaModel()),
            "id",
            "descricao");
  }
  @Override
  protected String insert() throws TSApplicationException {

    if (TSUtil.isEmpty(this.saidaMaterial.getLinhas())) {
      this.addErrorMessage("Adicione os itens!");
      super.setClearFields(false);
      super.setDefaultMessage(false);
      return null;
    }

    new SaidaMaterialBS()
        .inserir(this.saidaMaterial, Utilitario.getUsuarioLogado().getEmpresaModel());

    super.setClearFields(true);
    super.setDefaultMessage(true);

    return null;
  }
Exemple #5
0
package br.com.opensystems.faces;