Examples of AlquilerCancha


Examples of upc.iluminados.modelo.AlquilerCancha

  public void listar(){
   
    Usuario cli01=new Usuario();
    cli01=service.obtenerCliente("1");
   
    AlquilerCancha alquiler=(AlquilerCancha) service.listarConHis("","","");
  }
View Full Code Here

Examples of upc.iluminados.modelo.AlquilerCancha

         
          if (StringUtils.isEmpty(vo.getHoraInicio())) {
              throw new BaseExcepcion("Hora Inicio Requerido");
          }
 
          AlquilerCancha cancha = alquilerCanchaDAO.obtener(vo.getHorarioCancha().getId());
          if (cancha != null) {
              throw new BaseExcepcion("Identificador de Cancha ya existe");
          }
 
          alquilerCanchaDAO.insertar(vo);
View Full Code Here

Examples of upc.iluminados.modelo.AlquilerCancha

        }
    }

    public AlquilerCancha obtener(int idHorario) throws BaseExcepcion {
        System.out.println("UsuarioDAO: obtener(String nombre)");
        AlquilerCancha vo = null;
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "select idHorario, idUsuario,fecha,horaInicio,horaFin  from tb_alquilercancha where idHorario=?";
            con = (Connection) ConexionBD.obtenerConexion();
            stmt = (PreparedStatement) con.prepareStatement(query);
            stmt.setInt(1, idHorario);
            rs = stmt.executeQuery();
            if (rs.next()) {
                vo = new AlquilerCancha();;
//                vo.setId(rs.getInt(1));
//                vo.setNombre(rs.getString(2));
//                vo.setTarifaDiurna(rs.getDouble(3));
//                vo.setTarifaNocturna(rs.getDouble(4));
View Full Code Here

Examples of upc.iluminados.modelo.AlquilerCancha

    //Francisco
    public Collection<AlquilerCancha> listar(Integer idCliente) throws BaseExcepcion {
        System.out.println("AlquilerCanchaDAO: listar(Integer idCliente)");
        Collection<AlquilerCancha> lista = new ArrayList<AlquilerCancha>();
        AlquilerCancha vo = null;
        Usuario cliente = null;
        HorarioCancha horarioCancha = null;
        Cancha cancha = null;
       
       
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "SELECT a.fecha, a.horaInicio, a.horaFin, b.idUsuario, b.nombre, b.apellidoPaterno, b.apellidoMaterno, d.nombre as canchanombre "
                    + " FROM tb_alquilercancha a, tb_usuario b, tb_horariocancha c, tb_cancha d "
                    + " Where a.idUsuario = b.idUsuario and b.tipo = 2 and a.idHorario = c.idHorario and c.idCancha = d.idCancha ";
            if(idCliente!=null){
                query = query + " and idUsuario = " + idCliente;
            }
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            rs = stmt.executeQuery();
            while (rs.next()) {
                vo = new AlquilerCancha();
                cliente = new Usuario();
                horarioCancha = new HorarioCancha();
                cancha = new Cancha();
                
                vo.setCliente(cliente);
                vo.setHorarioCancha(horarioCancha);
                horarioCancha.setCancha(cancha);
               
                //AlquilerCancha
                vo.setFecha(rs.getString(1));
                vo.setHoraInicio(rs.getString(2));
                vo.setHoraFin(rs.getString(3));
               
                //Cliente
                cliente.setNombre(rs.getString(5));
               
                //Cancha
View Full Code Here

Examples of upc.iluminados.modelo.AlquilerCancha


  @Override
  public List<AlquilerCancha> listarConHis(String nombre, String fechadesde,
      String fechahasta) {
    AlquilerCancha alquiler01=new AlquilerCancha();
   
    /*cli01=buscarCliente(cli01) */
   
    Usuario cli01=new Usuario();
    cli01.setApellidoPaterno("Luque");
    cli01.setApellidoMaterno("Luque");
    cli01.setNombre("Abraham");
   
    List<AlquilerCancha> lista=new ArrayList<AlquilerCancha>();
   
    alquiler01.setCliente(cli01);
    alquiler01.setFecha("2012-07-03");
    alquiler01.setHoraInicio("16-00-00");
    alquiler01.setHoraFin("18-00-00");
   
   
    lista.add(alquiler01);
   
   
View Full Code Here

Examples of upc.iluminados.modelo.rest.AlquilerCancha

        }
    }

    public AlquilerCancha obtener(int idHorario, String fecha) throws BaseExcepcion {
        System.out.println("AlquilerCanchaDAO: obtener(String idHorario, String fecha)");
        AlquilerCancha vo = null;
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "select idHorario, idUsuario,fecha,horaInicio,horaFin  from tb_alquilercancha where idHorario=" + idHorario;
            query = query + " and fecha = '" + fecha + "'";
            System.out.println("AlquilerCanchaDAO: query=" + query);
            con = (Connection) ConexionBD.obtenerConexion();
            stmt = (PreparedStatement) con.prepareStatement(query);
//            stmt.setInt(1, idHorario);
//            stmt.setString(2, fecha);
            rs = stmt.executeQuery();
            if (rs.next()) {
                vo = new AlquilerCancha();
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new BaseExcepcion(e.getMessage());
        } finally {
View Full Code Here

Examples of upc.iluminados.modelo.rest.AlquilerCancha

    //Francisco
    public Collection<AlquilerCancha> listar(Integer idCliente) throws BaseExcepcion {
        System.out.println("AlquilerCanchaDAO: listar(Integer idCliente)");
        Collection<AlquilerCancha> lista = new ArrayList<AlquilerCancha>();
        AlquilerCancha vo = null;
        Usuario cliente = null;
        HorarioCancha horarioCancha = null;
        Cancha cancha = null;
       
       
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "SELECT a.fecha, a.horaInicio, a.horaFin, b.idUsuario, b.nombre, b.apellidoPaterno, b.apellidoMaterno, d.nombre as canchanombre "
                    + " FROM tb_alquilercancha a, tb_usuario b, tb_horariocancha c, tb_cancha d "
                    + " Where a.idUsuario = b.idUsuario and b.tipo = 2 and a.idHorario = c.idHorario and c.idCancha = d.idCancha ";
            if(idCliente!=null){
                query = query + " and idUsuario = " + idCliente;
            }
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            rs = stmt.executeQuery();
            while (rs.next()) {
                vo = new AlquilerCancha();
                cliente = new Usuario();
                horarioCancha = new HorarioCancha();
                cancha = new Cancha();
                
                vo.setCliente(cliente);
                vo.setHorarioCancha(horarioCancha);
                horarioCancha.setCancha(cancha);
               
                //AlquilerCancha
                vo.setFecha(rs.getString(1));
                vo.setHoraInicio(rs.getString(2));
                vo.setHoraFin(rs.getString(3));
               
                //Cliente
                cliente.setNombre(rs.getString(5));
               
                //Cancha
View Full Code Here

Examples of upc.iluminados.modelo.rest.AlquilerCancha

     
     
      List<AlquilerCancha> lista=new ArrayList<AlquilerCancha>();
     
     
        AlquilerCancha vo = null;
        Usuario cliente = null;
        HorarioCancha horarioCancha = null;
        Cancha cancha = null;
       
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
       
        int codigo=Integer.valueOf(nombre);
       
        try {
            String query = "SELECT t.idUsuario, u.nombre, u.apellidoPaterno,  t.fecha, t.horaInicio, t.horaFin FROM tb_alquilercancha t inner join tb_usuario u  on t.idUsuario=u.idUsuario ";
            if(nombre!=null){
                query = query + " where t.idUsuario = " + codigo;
            }
           
            System.out.println("consulta  : "+query);
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            rs = stmt.executeQuery();
            while (rs.next()) {
             
              System.out.println("dentro del query");
                vo = new AlquilerCancha();
                cliente = new Usuario();
                horarioCancha = new HorarioCancha();
                cancha = new Cancha();
                
                //vo.setCliente(cliente.setNombre(rs.getString(1)));
               
                cliente.setId(rs.getInt(1));
                cliente.setNombre(rs.getString(2));
                cliente.setApellidoPaterno(rs.getString(3));
                //vo.setHorarioCancha(horarioCancha);
                //horarioCancha.setCancha(cancha);
               
                //AlquilerCancha
                vo.setHorarioCancha(horarioCancha);
                vo.setCliente(cliente);
                vo.setFecha(rs.getString(4));
                vo.setHoraInicio(rs.getString(5));
                vo.setHoraFin(rs.getString(6));
               
                //Cliente
                //cliente.setNombre(rs.getString(1));
               
                //Cancha
View Full Code Here

Examples of upc.iluminados.modelo.rest.AlquilerCancha

    }

public List<AlquilerCancha> consultarHis() throws BaseExcepcion{
  List<AlquilerCancha> lista=new ArrayList<AlquilerCancha>();
 
  AlquilerCancha vo = null;
    Usuario cliente = null;
    HorarioCancha horarioCancha = null;
    Cancha cancha = null;
   
    Connection con = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
   
   
    try {
        String query = "SELECT t.idUsuario, u.nombre, u.apellidoPaterno,  t.fecha, t.horaInicio, t.horaFin FROM tb_alquilercancha t inner join tb_usuario u  on t.idUsuario=u.idUsuario ";
       
       
        System.out.println("consulta  : "+query);
        con = ConexionBD.obtenerConexion();
        stmt = con.prepareStatement(query);
        rs = stmt.executeQuery();
        while (rs.next()) {
         
          System.out.println("dentro del query");
            vo = new AlquilerCancha();
            cliente = new Usuario();
            horarioCancha = new HorarioCancha();
            cancha = new Cancha();
            
            //vo.setCliente(cliente.setNombre(rs.getString(1)));
           
            cliente.setId(rs.getInt(1));
            cliente.setNombre(rs.getString(2));
            cliente.setApellidoPaterno(rs.getString(3));
            //vo.setHorarioCancha(horarioCancha);
            //horarioCancha.setCancha(cancha);
           
            //AlquilerCancha
            vo.setHorarioCancha(horarioCancha);
            vo.setCliente(cliente);
            vo.setFecha(rs.getString(4));
            vo.setHoraInicio(rs.getString(5));
            vo.setHoraFin(rs.getString(6));
           
            //Cliente
            //cliente.setNombre(rs.getString(1));
           
            //Cancha
View Full Code Here

Examples of upc.iluminados.modelo.rest.AlquilerCancha

         
          if (StringUtils.isEmpty(vo.getHoraInicio())) {
              throw new BaseExcepcion("Hora Inicio Requerido");
          }
 
          AlquilerCancha cancha = alquilerCanchaDAO.obtener(vo.getHorarioCancha().getId(), vo.getFecha());
          if (cancha != null) {
              throw new BaseExcepcion("Cancha ya se encuentra alquilada en ese horario");
          }
 
          alquilerCanchaDAO.insertar(vo);
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.