Package entidades

Examples of entidades.Preso


                try {
                    validarDatos();
                    Persona per = new Persona();
                    copyUItoModel(per);

                    p = new Preso();
                    p.setPersona(per);

                    p.setFoto(bufferFoto);
                    p.setHuellaDigital(bufferHuella);
                    ec.persist(per, false);
View Full Code Here


        System.out.println("salio de no de de wdwwdew");
    }
    private void limpiarLista(List<Preso> listaR){
        for (int i = 0; i < listaR.size(); i++) {
            Preso preso = listaR.get(i);
            for (int j = 0; j < listaR.size(); j++) {
                Preso preso1 = listaR.get(j);
                    if (i!=j){
                        if (preso.equals(preso1)){
                            listaR.remove(j);
                        }
                    }
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                try {
                    validarDatos();
                    if (JOptionPane.showConfirmDialog(CondenaController.this, "Desea Guardar?", "Condena", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
                        Preso p;                   
                        Condena condena = new Condena();
                       
                        condena.setFechaCreacion(fechaDateChooser.getDate());
                        condena.setJuez(String.valueOf(juezField.getText()));
                        condena.setFechaHasta(fechaHastaDateChooser.getDate());
                       
                        Integer nro = Integer.valueOf(nroPresoField.getText());
                        p = (Preso) ec.createQuery("select p from Preso p where p.nroPreso = :nro", Preso.class).setParameter("nro", nro).getSingleResult();
                        condena.setPreso(p);
                       
                        ec.persist(condena, false);
                        for (int i = 0; i < agregados.size(); i++) {
                            MotivosDelPreso motivo = agregados.get(i);
                            if (motivo.getPreso().getNropreso() == condena.getPreso().getNropreso()) {
                                motivo.setCondena(condena);
                                ec.updateEntity(motivo, false);
                            }
                        }
                        TipoEstadoPreso tep = (TipoEstadoPreso) ec.createQuery("select t from TipoEstadoPreso t where t.descripcion = 'Condenado'", TipoEstadoPreso.class).getSingleResult();
                        EstadoPreso estPre = new EstadoPreso(p, tep, new Timestamp(new Date().getTime()));
                        ec.persist(estPre,commit);
                       
                        listener.onPanelClose();
                    }
                }catch (UIValidateException ex) {
                    JOptionPane.showMessageDialog(CondenaController.this,ex.getMessage());
                }
            }
        });
        //no es lo que quiero que haga, pero por el momento nos sirve hacerlo asi, que nos cargue todos los quitados
        agregarButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (motivosList.getSelectedIndex() >= 0){
                    agregados.add(quitados.get(motivosList.getSelectedIndex()));
                    quitados.remove(motivosList.getSelectedIndex());

                    refrescarLista(listModelMotivos, quitados);
                    refrescarLista(listModelAgregados, agregados);
                }
                /*
                listModelAgregados.addElement(motivosList.getSelectedValue());
                listModelMotivos.removeElement(motivosList.getSelectedValue());
                 *
                 */
            }
        });

        quitarButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (motivosAgregadosList.getSelectedIndex() >= 0) {
                    quitados.add(agregados.get(motivosAgregadosList.getSelectedIndex()));
                    agregados.remove(motivosAgregadosList.getSelectedIndex());

                    refrescarLista(listModelMotivos, quitados);
                    refrescarLista(listModelAgregados, agregados);
                }
                /*
                listModelMotivos.addElement(motivosAgregadosList.getSelectedValue());
                listModelAgregados.removeElement(motivosAgregadosList.getSelectedValue());
                 *
                 */
            }
        });

        buscarButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (nroPresoField.getText().isEmpty()) {
                    //Llamo pantalla buscar preso
                    SelectorPopUp<Preso> popUp = new SelectorPopUp<Preso>(PrincipalController.instanciaControllerPrincipal(), new EntitySelectionListener<Preso>() {

                        @Override
                        public void onEntitySelected(Preso entity) {
                            retornarDatosPreso(entity);

                            setNroPresoField(entity.getNropreso());
                            //JOptionPane.showInputDialog(entity.getApellido());
                           
                        }

                        @Override
                        public void onNotEntitySelected() {
                            //throw new UnsupportedOperationException("Not supported yet.");
                            System.out.println("Salio por cancelar");
                        }
                    }, VistasCarceles.PRESO_LISTA_VIEW, Preso.class);
                    popUp.showPopUp();
                } else {
                    Integer nro = getNroPreso();

                    Preso p = new Preso();
                    p.setId(nro);

                    retornarDatosPreso(p);
                }
            }

View Full Code Here

                if (nroPresoText.getText().isEmpty())
                    JOptionPane.showMessageDialog(MotivosDelPresoController.this, "El campo Nro de Preso aún no ha sido completado");
                else {
                    if (JOptionPane.showConfirmDialog(MotivosDelPresoController.this, "Desea Guardar?", "Guardar", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                        Integer id = Integer.valueOf(nroPresoText.getText());
                        Preso p = (Preso) ec.createQuery("select p from Preso p where p.nroPreso = :id", Preso.class).setParameter("id",id).getSingleResult();
               
                        for (int i = 0; i < agregados.size(); i++){
                            MotivosDelPreso motivo = new MotivosDelPreso();
               
                            motivo.setCondena(null);
View Full Code Here

                   
                    if (JOptionPane.showConfirmDialog(VisitasController.this, "Desea Guardar?", "Gestion Visitas", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                        Visita visita = new Visita();
                       
                        Integer nro = Integer.valueOf(nroPresoField.getText());
                        Preso p = (Preso) ec.createQuery("select p from Preso p where p.nroPreso = :nro", Preso.class).setParameter("nro", nro).getSingleResult();
                       
                        visita.setPreso(p);
                        visita.setApellidoVisita(apellidoField.getText());
                        visita.setNombreVisita(nombreField.getText());
                        visita.setFechaVisita(fechaDateChooser.getDate());
View Full Code Here

    String tipooperacion;
    EntityController ec;
   
    public HistoricoPresoListPanelController() {
        ec = EntityController.getInstance();
        preso = new Preso();
        setVisible(true);
        //addButtonHandler();
    }
View Full Code Here

TOP

Related Classes of entidades.Preso

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.