示例#1
0
 public List<Material> completarMaterial(String query) {
   List<Material> materiais =
       new MaterialDAO()
           .autoCompletar(
               new Material(null, query + "%", query + "%"),
               Utilitario.getUsuarioLogado().getEmpresaModel());
   return materiais;
 }
示例#2
0
 @Override
 protected String find() {
   this.grid =
       new SaidaMaterialBS()
           .pesquisar(this.saidaMaterialPesquisa, Utilitario.getUsuarioLogado().getEmpresaModel());
   Utilitario.addResultList(this.grid);
   return null;
 }
示例#3
0
  @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");
  }
示例#4
0
  @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;
  }