Package br.com.moonjava.flight.model.base

Examples of br.com.moonjava.flight.model.base.VooModel


   */
  private class Clock implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
      List<Voo> lista = new VooModel().consultaPainel();
      showList(lista);

      conteudo.repaint();
      conteudo.validate();
    }
View Full Code Here


        request.set("preco", _preco);
        request.set("partida", _partida);
        request.set("chegada", _chegada);

        Voo pojo = new VooCreate(request).createInstance();
        boolean executed = new VooModel().criar(pojo);

        if (executed) {
          messageOK();
        } else {
          messageFailed();
View Full Code Here

    return impl;
  }

  @Override
  public Voo getVoo() {
    return new VooModel().consultarPorId(request.intParam("voo"));
  }
View Full Code Here

  }

  private class ConsultarHandler implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
      VooModel vooModel = new VooModel();
      PassagemModel passagemModel = new PassagemModel();

      RequestParamWrapper request = getParametersPassagem();
      String codBilhete = request.stringParam("codBilhete");

      passagem = passagemModel.consultarPorCodigoBilhete(codBilhete);

      if (passagem == null) {
        messagePassagemOff();
        return;
      }

      String verifCancel = passagem.getVoo().getCodigo();

      if (verifCancel == null) {
        messagemPasJaCancelada();
        refresh();
        return;
      }

      Status status = Status.DISPONIVEL;
      request.set("status", status);
      request.set("assento", 0);

      List<Voo> voos = vooModel.consultar(request);

      setList(voos);
      showList(voos);
      addVooTable();
    }
View Full Code Here

          Passagem pojo = new PassagemUpdate(request).createInstance();
          boolean updated = model.transferir(pojo);

          if (updated) {
            VooModel vooModel = new VooModel();
            vooModel.incrementarAssento(passagem.getVoo().getId());
            vooModel.decrementarAssento(voo.getId());
            messageOK();
            return;
          } else {
            messageDbOff();
            return;
View Full Code Here

          // Busca os vôos dessa aeronave, cancela as suas passagens,
          // deletar os vôos e, por fim, a aeronave
          for (int i = 0; i < rows.length; i++) {
            Aeronave pojo = list.get(rows[i]);
            VooModel vooModel = new VooModel();
            List<Voo> voos = vooModel.consultarPorAeronaveId(pojo.getId());

            for (Voo voo : voos) {
              new PassagemModel().cancelarPorVoo(voo);
            }
            vooModel.deletaPorAeronaveId(pojo.getId());
            new AeronaveModel().deletar(pojo.getId());
          }

          messageDeleteOK();
          refresh();
View Full Code Here

          req.set("codBilhete", codigos.get(i));
          req.set("pessoaFisica", pessoas.get(i).getId());
          Passagem pojo = new PassagemCreate(req).createInstance();
          boolean executed = new PassagemModel().vender(pojo);
          if (executed) {
            new VooModel().decrementarAssento(vooId);

            /** Location of a file to print **/
            String fileName = "abc.txt";

            /** Read the text content from this location **/
 
View Full Code Here

  @Override
  public Voo createInstance() {
    if (getDataDePartida().isBefore(getDataDeChegada()) &&
        getDataDePartida().isAfter(System.currentTimeMillis())) {
      VooModel impl = new VooModel(this);
      impl.setId(request.intParam("id"));
      return impl;
    } else {
      return null;
    }
  }
View Full Code Here

        if (confirmed == 0) {
          disableButtons();

          result = true;
          int[] rows = tabela.getSelectedRows();
          Voo vooModel = new VooModel();
          PassagemModel passagemModel = new PassagemModel();

          for (int i = 0; i < rows.length; i++) {
            Voo pojo = list.get(rows[i]);
            passagemModel.cancelarPorVoo(pojo);
            vooModel.deletar(pojo.getId());
          }

          messageDeleteOK();
          refresh();
        }
View Full Code Here

  public PainelController(ResourceBundle bundle) {
    super(bundle);
    showAll();

    List<Voo> lista = new VooModel().consultaPainel();
    showList(lista);
  }
View Full Code Here

TOP

Related Classes of br.com.moonjava.flight.model.base.VooModel

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.