Package maissocial.entidade

Examples of maissocial.entidade.ProfPis


    public void salvarProfPis(ProfPis pp) throws Exception, ProfPisJaCadastradaException{
        if( pp == null || pp.getNome() == null || pp.getNome().equals("") || pp.getStatus() == 0){
            throw  new Exception("Parâmetros Inválidos!");
        }

        ProfPis pp2 = this.ppRep.pesquisarProfPisPorNome(pp.getNome());
        if(pp2 == null){
            this.ppRep.salvarProfPis(pp);
        }else{
            throw new ProfPisJaCadastradaException("Profifional do Pis já cadastrado!");
        }
View Full Code Here


    public void alterarProfPis(ProfPis pp) throws Exception, ProfPisJaCadastradaException{
        if( pp == null || pp.getNome() == null || pp.getNome().equals("") || pp.getStatus() == 0){
            throw  new Exception("Parâmetros Inválidos!");
        }

        ProfPis pp2 = this.ppRep.pesquisarProfPisPorNome(pp.getNome());
        if(pp2 == null){
            this.ppRep.alterarProfPis(pp);
        }else{
            throw new ProfPisJaCadastradaException("Profissional do Pis já cadastrado!");
        }
View Full Code Here

            throw new ProfPisJaCadastradaException("Profissional do Pis já cadastrado!");
        }
    }

    public ProfPis pesquisarProfPisPorCodigo(int cod){
        ProfPis pp = this.ppRep.pesquisarProfPisPorCodigo(cod);
        return pp;
    }
View Full Code Here

        ProfPis pp = this.ppRep.pesquisarProfPisPorCodigo(cod);
        return pp;
    }

     public ProfPis pesquisarProfPisPorCpf(String cpf){
        ProfPis pp = this.ppRep.pesquisarProfPisPorCpf(cpf);
        return pp;
    }
View Full Code Here

        ProfPis pp = this.ppRep.pesquisarProfPisPorCpf(cpf);
        return pp;
    }

    public ProfPis pesquisarProfPisPorNome(String nome){
        ProfPis pp = this.ppRep.pesquisarProfPisPorNome(nome);
        return pp;
    }
View Full Code Here

    public static void main(String[] args){


        Profissao pf = null;
        Logradouro lg = null;
        ProfPis pp = null;

        try {
            pf = Fachada.getInstance().getProfissaoControle().pesquisarProfissaoPorCodigo(1);
            lg = Fachada.getInstance().getLogradouroControle().pesquisarLogradouroPorCodigo(1);

            pp = new ProfPis (pf, lg, "TOINHO DAS MENINAS", "12312312312", "12121211", "SSP/PE", 11111111, 22222222, 1);

            Fachada.getInstance().getProfPisControle().salvarProfPis(pp);
            JOptionPane.showMessageDialog(null, "Profissional Pis cadastrado com sucesso!");
            ProfPis pp2 = Fachada.getInstance().getProfPisControle().pesquisarProfPisPorCodigo(1);
            System.out.print(pp2.getNome());

        } catch (Exception ex) {
            Logger.getLogger(ProfPisGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

        Session session = factory.openSession();
        Transaction trans = session.beginTransaction();

        trans.begin();

        ProfPis pp = pesquisarProfPisPorCodigo(cod);
        session.delete(pp);

        trans.commit();
        session.close();
    }
View Full Code Here

        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {prof_pis.*} FROM prof_pis {prof_pis} WHERE cod_prof_pis = "+cod);

        query.addEntity("prof_pis", ProfPis.class);

        ProfPis pp = null;
        if(query.list().size() > 0){
            pp = (ProfPis) query.list().get(0);
        }
        session.close();
        return pp;
View Full Code Here

        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {prof_pis.*} FROM prof_pis {prof_pis} WHERE cpf = "+cpf);

        query.addEntity("prof_pis", ProfPis.class);

        ProfPis pp = null;
        if(query.list().size() > 0){
            pp = (ProfPis) query.list().get(0);
        }
        session.close();
        return pp;
View Full Code Here

        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {prof_pis.*} FROM prof_pis {prof_pis} WHERE nome like '"+nome+"'");

        query.addEntity("prof_pis", ProfPis.class);

        ProfPis pp = null;
        if(query.list().size() > 0){
            pp = (ProfPis) query.list().get(0);
        }
        session.close();
        return pp;
View Full Code Here

TOP

Related Classes of maissocial.entidade.ProfPis

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.