Examples of Venda


Examples of br.com.sistelecom.entity.Venda

  }

  public void novoRegistro() {
    if (validarDadosFormulario()) {
      try {
        final Venda venda = new Venda();
        venda.setIdCliente(this.getIdCliente());
        venda.setIdFuncionario(this.getIdFuncionario());
        venda.setDataVenda(new Date());
       
        final ItensController controllerItem = this.getItensController();
       
        for(Itens item: this.getItensController().getLista()){
          controllerItem.salvarItens(item)
View Full Code Here

Examples of br.com.sistelecom.entity.Venda

  public void excluirRegistro(ActionEvent evento) {
   
    final String id = ((HtmlActionParameter)((HtmlAjaxCommandButton)evento.getSource()).getChildren().get(0)).getValue().toString();
    int idVenda = Integer.parseInt(id);
   
    final Venda venda = this.getDao().obterPorId(idVenda);
   
    try {
      if(venda != null){
        this.getDao().excluir(venda);
        FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO,"Pedido excluído com sucesso.",""));
View Full Code Here

Examples of br.com.sistelecom.entity.Venda

  /**
   * @return the venda
   */
  public Venda getVenda() {
    if(venda == null){
      this.venda = new Venda();
    }
    return venda;
  }
View Full Code Here

Examples of br.com.sistelecom.entity.Venda

      rs = ps.executeQuery();
      if (!rs.next()) {
        throw new Exception("Não foi encontrado o pedido com esse id: " + id);
      }
     
      Venda venda = new Venda();
      venda.setIdVenda(id);
      venda.setIdCliente(rs.getInt(2));
      venda.setIdFuncionario(rs.getInt(3));
      venda.setDataVenda(rs.getDate(4));
     
      return venda;
     
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of br.edu.puc.campinas.si.pw.pucstore.model.Venda

   
    if(this.session.getCarrinho() != null) {
     
      if(this.session.getCarrinho().size() > 0) {
       
        Venda venda = new Venda();
        int codVenda = this.vendaNegocio.gerarCodigoVenda();
        venda.setCodVenda(codVenda);
        venda.setCodUsuario(0);
       
        this.vendaNegocio.adicionar(venda);
       
        for(Produto prod : this.session.getCarrinho()) {
         
View Full Code Here

Examples of br.edu.puc.campinas.si.pw.pucstore.model.Venda

  }

  @Override
  public Venda popularEntidade(ResultSet rs) throws Exception {

    Venda venda = new Venda();
   
    venda.setCodUsuario(rs.getInt("cod_usuario"));
    venda.setCodVenda(rs.getInt("cod_venda"));
   
    return venda;
   
  }
View Full Code Here

Examples of com.loja.model.Venda

      venda.setData(new Date());
      for (ItemVenda itemVenda : this.itensVenda) {
        venda.adicionaProduto(itemVenda);
      }
      entityManager.persist(venda);
      setVenda(new Venda());
      setQuantidade(null);
      load();
  }
View Full Code Here

Examples of com.loja.model.Venda

    itemVenda.setQtde(new BigDecimal(20.00));
   
    vendaService.setProduto(produtoSalvo);
    vendaService.setQuantidade(new BigDecimal(20.00));
   
    Venda venda = new Venda();
    venda.setColaborador(colaboradorSalvo);
    venda.setData(new Date());
    venda.setCliente(clienteSalvo);
    vendaService.adicionar();
    vendaService.setVenda(venda);
    vendaService.save();
    vendaSalva = venda;
    vendaService.setVenda(vendaSalva);
    System.out.println(vendaService.getProduto().getEstoque());
    Assert.assertEquals(venda.getItensVenda().size(), 1);
    Assert.assertEquals(vendaService.getProduto().getEstoque(), new BigDecimal(880.00));
   
  }
View Full Code Here

Examples of com.loja.model.Venda

  }
 
  @Test
  public void edit() throws VendaEstoqueInsuficienteException, VendaEstoqueMinimoAtingidoException {
    vendaService.find(vendaSalva.getId());
    Venda venda = vendaService.getVenda();
    vendaService.editar();
    venda.setData(new Date());
    venda.setItensVenda(new ArrayList<ItemVenda>());
   
    ItemVenda itemVenda1 = new ItemVenda();
    itemVenda1.setProduto(produtoSalvo);
    itemVenda1.setQtde(new BigDecimal(100.00));
   
    venda.adicionaProduto(itemVenda1);
    vendaService.save();
  }
View Full Code Here

Examples of com.loja.model.Venda

    this.record();
    ItemVenda itemVenda = new ItemVenda();
    itemVenda.setProduto(produtoSalvo);
    itemVenda.setQtde(new BigDecimal(901.00));
   
    Venda venda = new Venda();
    venda.setColaborador(colaboradorSalvo);
    venda.setData(new Date());
    venda.setCliente(clienteSalvo);
    vendaService.setVenda(venda);
    vendaService.getVenda().adicionaProduto(itemVenda);
    vendaService.save();
    vendaService.setVenda(vendaSalva);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.