Examples of Cpf


Examples of br.com.benefrancis.controle.CPF

        PF pf = new PF();
        pf.setNome("Benefrancis do Nascimento");
        pf.setEmail("benefrancis@gmail.com");
        pf.setSenha("root");

        DocReceita cpf = new CPF(" 248. 788. 918-74 ");
        pf.setDocReceita(cpf);
        cpf.setPessoa(pf);



        if (pf.existe(cpf) == true) {
            throw new RuntimeException("<br><center><font face='verdana' color='red'   size='2'><br />já existe usuário cadastrado com o CPF ou CNPJ informado</font></center><br>");
View Full Code Here

Examples of br.com.caelum.stella.tinytype.CPF

  @Override
  public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
      throws HibernateException, SQLException {
    String name = rs.getString(names[0]);
    return rs.wasNull() ? null : new CPF(name);
  }
View Full Code Here

Examples of br.com.caelum.stella.tinytype.CPF

  @Test
  public void shouldSaveAndLoadEntityMappedWithCpfUserType(){
    Session session = factory.openSession();
    Transaction transaction = session.beginTransaction();
    PessoaFisica pessoa = new PessoaFisica();
    CPF cpf = new CPF("555.555.555-55");
    pessoa.setCpf(cpf);
    session.save(pessoa);
    transaction.commit();
    session.flush();
    session.close();
View Full Code Here

Examples of br.com.caelum.stella.tinytype.CPF

  }

  public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
      throws HibernateException, SQLException {
    String name = resultSet.getString(names[0]);
    return resultSet.wasNull() ? null : new CPF(name);
  }
View Full Code Here

Examples of br.com.moonjava.flight.util.CPF

  public void consultar_usuario_por_cpf() {
    UsuarioDAO dao = new UsuarioDAO();
    EncryptPassword encrypt = new EncryptPassword();

    CPF cpf = CPF.parse("222.222.222-22");
    Usuario res = dao.consultarPorCpf(cpf);
    assertThat(res.getPerfil(), equalTo(Perfil.SUPERVISOR));
    assertThat(res.getLogin(), equalTo("teste2"));
    assertThat(res.getSenha(), equalTo(encrypt.toEncryptMD5("teste2")));
  }
View Full Code Here

Examples of br.com.moonjava.flight.util.CPF

          !senha.isEmpty()) {

        try {

          // CPF continua invalido
          CPF _cpf = null;
          try {
            _cpf = CPF.parse(cpf);
          } catch (Exception e) {
            messageCpfInvalidExecption();
            return;
          }

          UsuarioModel usuarioModel = new UsuarioModel();
          Usuario usuario = usuarioModel.consultarPorCpf(_cpf);

          if (usuario != null) {
            messageUsuarioExistente();
          } else {
            PessoaFisicaModel pessoaFisicaModel = new PessoaFisicaModel();
            PessoaFisica pf = pessoaFisicaModel.consultarPorCPF(_cpf);

            // Cria uma PF
            if (pf == null) {
              long _telResidencial = 0;
              long _telCelular = 0;
              LocalDate date = null;
              if (VerifierString.isBirthDay(nascimento, bundle)) {
                date = FormatDateTime.parseToLocalDate(nascimento, getCountry());
              } else {
                throw new Exception();
              }
              try {
                _telResidencial = Long.parseLong(telResidencial);
                _telCelular = Long.parseLong(telCelular);
              } catch (Exception e) {
                messageTelResidencialParseExecption();
                throw new Exception();
              }

              request.set("nascimento", date);
              request.set("cpf", _cpf.getDigito());
              request.set("telResidencial", _telResidencial);
              request.set("telCelular", _telCelular);

              PessoaFisica pojo = new PessoaFisicaCreate(request).createInstance();
              boolean executed = pessoaFisicaModel.criar(pojo);
View Full Code Here

Examples of br.com.moonjava.flight.util.CPF

      PassagemModel modelPassagem = new PassagemModel();
      String valor = request.stringParam("valor").replace(",", ".");
      boolean status = false;

      if (!valor.equals("0.0")) {
        CPF _cpf = null;
        try {
          _cpf = CPF.parse(request.stringParam("cpf"));
          request.set("passagem", passagem.getId());
          request.set("banco", Integer.parseInt(request.stringParam("banco")));
          request.set("agencia", Integer.parseInt(request.stringParam("agencia")));
          request.set("conta", Integer.parseInt(request.stringParam("conta")));
          request.set("valor", Double.parseDouble(valor));
          request.set("cpf", _cpf.getDigito());
          Reembolso reembolso = new ReembolsoCreate(request).createInstance();

          status = model.criar(reembolso);
        } catch (Exception e2) {
          return;
View Full Code Here

Examples of br.com.moonjava.flight.util.CPF

          !senha.isEmpty()) {

        try {

          // CPF continua invalido
          CPF _cpf = null;
          try {
            _cpf = CPF.parse(cpf);
          } catch (Exception e1) {
            messageCpfInvalidExecption();
            return;
          }

          long _telResidencial = 0;
          long _telCelular = 0;

          try {
            _telResidencial = Long.parseLong(telResidencial);
            _telCelular = Long.parseLong(telCelular);
          } catch (Exception e2) {
            messageTelResidencialParseExecption();
            throw new Exception();
          }

          LocalDate date = FormatDateTime.parseToLocalDate(nascimento, getCountry());
          if (VerifierString.isBirthDay(nascimento, bundle)) {
            date = FormatDateTime.parseToLocalDate(nascimento, getCountry());
          } else {
            throw new Exception();
          }

          requestPf.set("nascimento", date);
          requestPf.set("cpf", _cpf.getDigito());
          requestPf.set("telResidencial", _telResidencial);
          requestPf.set("telCelular", _telCelular);

          PessoaFisica pojoPF = new PessoaFisicaUpdate(requestPf).createInstance();
          new PessoaFisicaModel().atualizar(pojoPF);
View Full Code Here

Examples of br.com.objectos.comuns.base.br.Cpf

  public void deve_formatar_cpf() {
    int inicio = 4;
    int fim = 17;
    int tamanho = 14;
    Cpf valor = Cpf.valueOf(63455179762l);

    writer = new ColunaCadastroDaEmpresa(inicio, fim).set(valor);
    String res = writer.get();

    assertThat(res.length(), equalTo(tamanho));
View Full Code Here

Examples of br.com.objectos.comuns.base.br.Cpf

  @Test(expectedExceptions = { NullPointerException.class })
  public void caso_cadastro_seja_null_lancar_excecao() {
    int inicio = 0;
    int fim = 0;
    Cpf valor = null;

    writer = new ColunaCadastroDaEmpresa(inicio, fim).set(valor);
    writer.get();
  }
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.