Package Dados

Examples of Dados.Paciente


    }// </editor-fold>//GEN-END:initComponents

    private void jButtonCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastrarActionPerformed
        //Insere o novo paciente
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
        Paciente novo = new Paciente();
        novo.setRG(jTextFieldRG.getText());
        novo.setEmail(jTextFieldEmail.getText());
        novo.setEndereco(jTextFieldEndereco.getText());
        novo.setNome(jTextFieldNome.getText());
        novo.setTelefone(jTextFieldTelefone.getText());
        java.util.Date data = new java.util.Date();
        novo.setCadastro(new Date(data.getTime()));
        try {
            novo.setNascimento(new java.sql.Date(formato.parse(jFormattedTextFieldDataNascimento.getText()).getTime()));
        } catch (ParseException ex) {
            Logger.getLogger(Cadastro.class.getName()).log(Level.SEVERE, null, ex);
        }
       
        novo.save();
       
        //Volta para o menu principal
        CardLayout cardLayout = (CardLayout) this.getParent().getLayout();
        cardLayout.show(getParent(),JanelaDaAplicacao.MENUPRINCIPAL);
    }//GEN-LAST:event_jButtonCadastrarActionPerformed
View Full Code Here

TOP

Related Classes of Dados.Paciente

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.