Package br.com.sistelecom.entity

Examples of br.com.sistelecom.entity.Cargo


 
  public void carregarRegistro(ActionEvent evento) {
    final String id = ((HtmlActionParameter)((HtmlAjaxCommandButton)evento.getSource()).getChildren().get(0)).getValue().toString();
    int idCargo = Integer.parseInt(id);

    final Cargo cargo = this.getDao().obterPorId(idCargo);

    this.getCargo().setIdCargo(cargo.getIdCargo());
    this.getCargo().setNomeCargo(cargo.getNomeCargo());
  }
View Full Code Here


 
  public void excluirRegistro(ActionEvent evento) {
    final String id = ((HtmlActionParameter)((HtmlAjaxCommandButton)evento.getSource()).getChildren().get(0)).getValue().toString();
    int idCargo = Integer.parseInt(id);
   
    final Cargo cargo = this.getDao().obterPorId(idCargo);
   
    try {
      if(cargo != null){
        this.getDao().excluir(cargo);
        this.listarTodos();
View Full Code Here

    }
    return true;
  }
 
  public void limpar() {
    this.cargo = new Cargo();
  }
View Full Code Here

  /**
   * @return the cargo
   */
  public Cargo getCargo() {
    if (this.cargo == null) {
      this.cargo = new Cargo();
    }
    return cargo;
  }
View Full Code Here

    try{
      ps = conn.prepareStatement("select * from cargo");
      rs = ps.executeQuery();
      List<Cargo> list = new ArrayList<Cargo>();
      while(rs.next()) {
        list.add(new Cargo(rs.getInt(1), rs.getString(2)));
      }
      return list;
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

      rs = ps.executeQuery();
      if (!rs.next()) {
        throw new Exception("Não foi encontrado o cargo com esse id: " + id);
      }
     
      Cargo cargo = new Cargo();
      cargo.setIdCargo(id);
      cargo.setNomeCargo(rs.getString(2));
     
      return cargo;
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of br.com.sistelecom.entity.Cargo

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.