Package Control

Examples of Control.CanjearPuntos


    private void IdentificacionTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_IdentificacionTActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_IdentificacionTActionPerformed

    private void AceptarBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AceptarBActionPerformed
        CanjearPuntos canjepuntos = new CanjearPuntos();
        int tipoid = identificacion.getSelectedIndex();
        Usuario UsuarioPrueba = canjepuntos.Usuarioexiste(Long.parseLong(IdentificacionT.getText()), tipoid);
        Canjes canjeactual = new Canjes();
        CanjearPuntos realizarcanje = new CanjearPuntos();
        String estadolabel;
        if (realizarcanje.id(UsuarioPrueba).equals("El usuario no existe")) {
            JOptionPane.showMessageDialog(null, realizarcanje.id(UsuarioPrueba), "Error", JOptionPane.ERROR_MESSAGE);
            IdentificacionT.setText("0");
        } else {           
            String estado;
            String nombrepremio;
            int can = Integer.parseInt(cantidadTF.getText());
            nombrepremio = (String) PremiosLD.getSelectedItem();
            Usuario user = new Usuario();
            if (tipoid == 1) {
                user.setIdentificacion(Long.parseLong(IdentificacionT.getText()));
            } else {
                user.setCodigo(Long.parseLong(IdentificacionT.getText()));
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(1).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(1).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText(estadolabel);
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(2).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(2).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba, can,
                            canjepuntos, tipoid, user , nombrepremio,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(0).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(0).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(4).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(4).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(3).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(3).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(9).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(9).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(8).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(8).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(7).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(7).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(6).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(6).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                    estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
                                if (estadolabel.equals("Puntos Insuficientes")){
                                    jLabel2.setForeground(Color.red);
                                    jLabel2.setText("Puntos Insuficientes");
                                }
                            }
                }else{
                    jLabel2.setForeground(Color.red);
                    jLabel2.setText("La cantidad ingresada no esta disponible");
                }
            }
            if (nombrepremio.equals(city.getEstaciones().get(y).getPremios().get(5).getNombre())) {
                premio = city.getEstaciones().get(y).getPremios().get(5).getNombre();
                estado = canjepuntos.premiosDispd(c, y, can, nombrepremio,ciudad);
                if (estado.equals("Continue")) {
                   estadolabel=realizarcanje.hacercanje(canjeactual,UsuarioPrueba,can, canjepuntos,
                            tipoid, user, nombrepremio ,estacion,ciudad,premio,c,y);
                            if (estadolabel.equals("La accion se ha realizado satisfactoriamente")){
                                jLabel2.setForeground(Color.green);
                                jLabel2.setText("La accion se ha realizado satisfactoriamente");
                            }else{
View Full Code Here

TOP

Related Classes of Control.CanjearPuntos

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.