Package upc.iluminados.modelo.rest

Examples of upc.iluminados.modelo.rest.Usuario


    service = (ServiciosRegistrarDuenio) fabrica.getBean("clienteServiciosRegistrarDuenio");
  }
 
    @Test
  public void registrar() throws BaseExcepcion{
      Usuario duenio = new Usuario();
      service.registrar(duenio);
  }
View Full Code Here


        }
    }
   
     public Usuario obtener(String correo, String clave) throws BaseExcepcion {
        System.out.println("UsuarioDAO: obtener(String correo, String clave)");
        Usuario vo = null;
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "select idUsuario, nombre, apellidoPaterno, apellidoMaterno, tipo from tb_usuario where correo=? and clave = ?";
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            stmt.setString(1, correo);
            stmt.setString(2, clave);
            rs = stmt.executeQuery();
            if (rs.next()) {
              vo = new Usuario();
                vo.setId(rs.getInt(1));
                vo.setNombre(rs.getString(2));
                vo.setApellidoPaterno(rs.getString(3));
                vo.setApellidoMaterno(rs.getString(4));
              vo.setTipo(rs.getInt(5));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new BaseExcepcion(e.getMessage());
        } finally {
View Full Code Here

        return vo;
    }

    public Usuario obtenerCorreo(String correo) throws BaseExcepcion {
        System.out.println("UsuarioDAO: obtener(String correo)");
        Usuario vo = null;
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "select idUsuario, nombre, apellidoPaterno, apellidoMaterno from tb_usuario where correo=? ";
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            stmt.setString(1, correo);
            rs = stmt.executeQuery();
            if (rs.next()) {
                vo = new Usuario();
                vo.setId(rs.getInt(1));
                vo.setNombre(rs.getString(2));
                vo.setApellidoPaterno(rs.getString(3));
                vo.setApellidoMaterno(rs.getString(4));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new BaseExcepcion(e.getMessage());
        } finally {
View Full Code Here

        return vo;
    }

    public Usuario obtenerdni(String dni) throws BaseExcepcion {
        System.out.println("UsuarioDAO: obtener(String dni)");
        Usuario vo = null;
        Connection con = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        try {
            String query = "select idUsuario, nombre, apellidoPaterno, apellidoMaterno from tb_usuario where dni=? ";
            con = ConexionBD.obtenerConexion();
            stmt = con.prepareStatement(query);
            stmt.setString(1, dni);
            rs = stmt.executeQuery();
            if (rs.next()) {
              vo = new Usuario();
                vo.setId(rs.getInt(1));
                vo.setNombre(rs.getString(2));
                vo.setApellidoPaterno(rs.getString(3));
                vo.setApellidoMaterno(rs.getString(4));
              vo.setTipo(rs.getInt(5));
            }
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw new BaseExcepcion(e.getMessage());
        } finally {
View Full Code Here

            throw new BaseExcepcion("Apellido Paterno Requerido");
        }
        if (StringUtils.isEmpty(vo.getApellidoMaterno())) {
            throw new BaseExcepcion("Apellido Materno Requerido");
        }
        Usuario usuario = usuarioDAO.obtenerCorreo(vo.getCorreo());
        if (usuario != null) {
            throw new BaseExcepcion("El correo ya existe");
        }
        if (usuarioDAO.obtenerdni(vo.getDni()) != null) {
            throw new BaseExcepcion("El DNI ya existe");
View Full Code Here

TOP

Related Classes of upc.iluminados.modelo.rest.Usuario

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.