Package info.wesleyjefferson.encomendas.shared

Examples of info.wesleyjefferson.encomendas.shared.Encomenda


  @Override
  public Encomenda insert(TipoTransporte tipoTransporte, String localOrigem,
      String localDestino, Double peso) {
    counter++;
   
    Encomenda enc = new Encomenda();
    enc.setTipoTransporte(tipoTransporte);
    enc.setLocalOrigem(localOrigem);
    enc.setLocalDestino(localDestino);
    enc.setPeso(peso);
    enc.setId(counter);
   
    getRepositorio().add(enc);
   
    return enc;
  }
View Full Code Here


          for (int i = 0; i < result.size(); i++) {
            if(i % 2 == 0){
                 layout.getRowFormatter().addStyleName(i+1, "alterna");
            }
           
            final Encomenda enc = result.get(i);
            layout.setText(i+1, 0, enc.getLocalOrigem());
            layout.setText(i+1, 1, enc.getLocalDestino());
            layout.setText(i+1, 2, enc.getTipoTransporte().toString());
            layout.setText(i+1, 3, enc.getPeso().toString() + " kg");
            layout.setText(i+1, 4, enc.getPrazo().toString() + " dias");
            layout.setText(i+1, 5, "R$" + enc.getPreco().toString());
           
            if(remover){
              layout.setWidget(i+1, 6, new Button("Remover", new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                  servico.delete(enc.getId(), new AsyncCallback<Void>() {
   
                    @Override
                    public void onFailure(Throwable caught) {
                      Alerta.exibeErro("Erro inesperado ao remover a encomenda");
                    }
View Full Code Here

    return enc;
  }

  @Override
  public void delete(int id) {
    Encomenda enc = null;
    for (Encomenda encomenda : getRepositorio()) {
      if(encomenda.getId() == id){
        enc = encomenda;
        break;
      }
View Full Code Here

TOP

Related Classes of info.wesleyjefferson.encomendas.shared.Encomenda

Copyright © 2018 www.massapicom. 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.