Package Modelo

Examples of Modelo.Alquiler


    public void leerAlquileres(LinkedHashMap<Integer, Alquiler> mapaAlquileres, JTable jTableAlquileres) {
        if (jTableAlquileres.isValid()) {
            limpiarAlquileres(jTableAlquileres);
            try {
                for (Integer i : mapaAlquileres.keySet()) {
                    Alquiler a = mapaAlquileres.get(i);
                    String[] array = a.getFechaRetiro().toString().split("-");
                    String fechaRetiro = array[2] + "/" + array[1] + "/" + array[0];
                    array = a.getFechaDevolucion().toString().split("-");
                    String fechaDevolucion = array[2] + "/" + array[1] + "/" + array[0];
                    Object elemento[] = {a.getId(), a.getDni(), fechaRetiro, fechaDevolucion};
                    DefaultTableModel temp = (DefaultTableModel) jTableAlquileres.getModel();
                    temp.addRow(elemento);
                }
            } catch (ArrayIndexOutOfBoundsException e) {
                JOptionPane.showMessageDialog(jTableAlquileres, "No existen alquileres registrados en este ejemplar.");
View Full Code Here


                if (!alquileres.containsKey(Integer.parseInt(id.getText()))) {
                    Integer numeroID = Integer.parseInt(id.getText());
                    Integer numeroDNI = Integer.parseInt(dni.getText());
                    DateTime fechaRetiro = new DateTime(retiro.getText());
                    DateTime fechaDevolucion = new DateTime(devolucion.getText());
                    Alquiler a = new Alquiler(numeroID, numeroDNI, fechaRetiro, fechaDevolucion);
                    alquileres.put(numeroID, a);
                    JOptionPane.showMessageDialog(null, "El alquiler ha sido creado con exito.");
                } else {
                    JOptionPane.showMessageDialog(null, "El ID del alquiler ya existe, ingrese otro ID.");
                }
View Full Code Here

            if (id && dni && retiro && devolucion && existe) {
                Integer ejemplar = Integer.parseInt(jTextFieldEjemplar.getText());
                Ejemplar e = mapaEjemplares.get(ejemplar);
                LinkedHashMap<Integer, Alquiler> alquileres = e.getAlquileres();
                Integer numeroID = Integer.parseInt(jTextFieldID.getText());
                Alquiler a = alquileres.get(numeroID);
                Integer numeroDNI = Integer.parseInt(jTextFieldDNI.getText());
                a.setDni(numeroDNI);
                a.setFechaRetiro(new DateTime(jTextFieldFechaRetiro.getText()));
                a.setFechaDevolucion(new DateTime(jTextFieldFechaDevolucion.getText()));
                actualizarAlquileres(mapaEjemplares, cb, jt);
                JOptionPane.showMessageDialog(null, "Alquiler modificado con exito.");
            } else {
                StringBuilder st = new StringBuilder();
                st.append("Datos invalidos:");
View Full Code Here

TOP

Related Classes of Modelo.Alquiler

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.