Package entidades

Examples of entidades.PermisoDeRol


         Rol r3 = new Rol("Operador");
        controller.persist(r3);
       
       
       
        PermisoDeRol deRol1 = new PermisoDeRol(r, CarcelConstants.ALTA_ROL);
        PermisoDeRol deRol2 = new PermisoDeRol(r, CarcelConstants.ALTA_USUARIO);
        PermisoDeRol deRol3 = new PermisoDeRol(r, CarcelConstants.BAJA_ROL);
        PermisoDeRol deRol4 = new PermisoDeRol(r, CarcelConstants.BAJA_USUARIO);
        PermisoDeRol deRol5 = new PermisoDeRol(r, CarcelConstants.MODIFICACION_ROL);
        PermisoDeRol deRol6 = new PermisoDeRol(r, CarcelConstants.MODIFICAR_USUARIO);
       
        controller.persist(deRol1);
        controller.persist(deRol2);
        controller.persist(deRol3);
        controller.persist(deRol4);
View Full Code Here


    private void cargarListaAsignada(Rol r) {
        List<PermisoDeRol> lista = ec.createQuery("select pr from PermisoDeRol pr where pr.rol = :rol order by pr.permiso.codigo", PermisoDeRol.class).setParameter("rol", r).getResultList();
        agregados = new ArrayList<Permiso>();
        for (int i = 0; i < lista.size(); i++) {
            PermisoDeRol permisoDeRol = lista.get(i);
            Permiso permiso = permisoDeRol.getPermiso();
            agregados.add(permiso);
            listModelAgregados.addElement(permiso.getCodigo() + "-" + permiso.getDescripcion());
        }
    }
View Full Code Here

            if (JOptionPane.showConfirmDialog(RolController.this, "Desea Guardar?", "Condena", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                rol.setDescripcion(descripcion.getText());
                ec.persist(rol, false);

                for (int i = 0; i < agregados.size(); i++) {
                    PermisoDeRol permisoderol = new PermisoDeRol();
                    permisoderol.setRol(rol);
                    permisoderol.setPermiso(agregados.get(i));
                    ec.persist(permisoderol, true);
                }
                JOptionPane.showMessageDialog(RolController.this, "Rol Ingresado satisfactoriamente");
                listener.onPanelClose();
            }
View Full Code Here

               
                rol.setDescripcion(descripcion.getText());
                ec.updateEntity(rol, false);

                for (int i = 0; i < agregados.size(); i++) {
                    PermisoDeRol permisoderol = new PermisoDeRol();
                    permisoderol.setRol(rol);
                    permisoderol.setPermiso(agregados.get(i));
                    ec.persist(permisoderol, true);
                }
                JOptionPane.showMessageDialog(RolController.this, "Rol modificado satisfactoriamente");
                listener.onPanelClose();
            }
View Full Code Here

    }
   
    private void bajar_permisos(){
        List<PermisoDeRol> lista = ec.createQuery("select pr from PermisoDeRol pr where pr.rol = :rol", PermisoDeRol.class).setParameter("rol", rol).getResultList();
        for (int i = 0; i < lista.size(); i++){
            PermisoDeRol pr = lista.get(i);
            ec.deleteEntity(pr, false);
        }
    }
View Full Code Here

TOP

Related Classes of entidades.PermisoDeRol

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.