Example #1
0
    def on_btnModifhab_clicked(self, widget):
        """
        Evento que modifica los datos de una habitacion
        :return: Void
        """
        try:
            numhab = variables.filahab[0].get_text()
            prezo = variables.filahab[1].get_text()
            if variables.switch.get_active():
                libre = 'SI'
            else:
                libre = 'NO'

            if variables.filarbt[0].get_active():
                tipo = 'simple'
            elif variables.filarbt[1].get_active():
                tipo = 'doble'
            elif variables.filarbt[2].get_active():
                tipo = 'family'
            else:
                pass
            registro = (prezo, tipo, libre)
            if numhab != '':
                funcioneshab.modifhab(registro, numhab)
                funcioneshab.listadohab(variables.listhab)
                funcioneshab.limpiarentry(variables.filahab)
            else:
                variables.vError.show()
                variables.lblMensajeVentanaError.set_text(
                    "Falta el número de habitación")
        except:
            print('error modif hab')
Example #2
0
    def on_btnModifhab_clicked(self, widget):
        """
        Gestiona el botón modificar en la ventana de habitaciones.
        Modifica una habitación.
        :param widget:
        :return: No devuelve nada.

        """
        try:
            numhab = variables.filahab[0].get_text()
            prezo = variables.filahab[1].get_text()
            if variables.switch.get_active():
                libre = 'SI'
            else:
                libre = 'NO'

            if variables.filarbt[0].get_active():
                tipo = 'simple'
            elif variables.filarbt[1].get_active():
                tipo = 'doble'
            elif variables.filarbt[2].get_active():
                tipo = 'family'
            else:
                pass
            registro = (prezo, tipo, libre)
            if numhab != '':
                funcioneshab.modifhab(registro, numhab)
                funcioneshab.listadohab(variables.listhab)
                funcioneshab.limpiarentry(variables.filahab)
            else:
                print('falta el numhab')
        except:
            print('error modif hab')
Example #3
0
    def on_btnModifhab_clicked(self, widget):
        try:
            numhab = variables.filahab[0].get_text()
            prezo = variables.filahab[1].get_text()
            if variables.switch.get_active():
                libre = 'SI'
            else:
                libre = 'NO'

            if variables.filarbt[0].get_active():
                tipo = 'simple'
            elif variables.filarbt[1].get_active():
                tipo = 'doble'
            elif variables.filarbt[2].get_active():
                tipo = 'family'
            else:
                pass
            registro = (prezo, tipo, libre)
            if numhab != '':
                funcioneshab.modifhab(registro, numhab)
                funcioneshab.listadohab(variables.listhab)
                funcioneshab.limpiarentry(variables.filahab)
            else:
                print('falta el numhab')
        except:
            print('error modif hab')
Example #4
0
    def on_btnModifhab_clicked(self, widget):
        '''
        Se encarga de recoger los datos actualizados de una habitacion para modificarla
        @param widget:
        @return:
        '''
        try:
            numhab = variables.filahab[0].get_text()
            prezo = variables.filahab[1].get_text()
            if variables.switch.get_active():
                libre = 'SI'
            else:
                libre = 'NO'

            if variables.filarbt[0].get_active():
                tipo = 'simple'
            elif variables.filarbt[1].get_active():
                tipo = 'doble'
            elif variables.filarbt[2].get_active():
                tipo = 'family'
            else:
                pass
            registro = (prezo, tipo, libre)
            if numhab != '':
                funcioneshab.modifhab(registro, numhab)
                funcioneshab.listadohab(variables.listhab)
                funcioneshab.limpiarentry(variables.filahab)
            else:
                print('falta el numhab')
        except:
            print('error modif hab')
Example #5
0
 def on_btnModificarHab_clicked(self, widget):
     try:
         id = variables.filahab[0].get_text()
         if variables.filahab[1][0].get_active():
             tipo = 'Simple'
         if variables.filahab[1][1].get_active():
             tipo = 'Double'
         if variables.filahab[1][2].get_active():
             tipo = 'Family'
         prezo = variables.filahab[2].get_text()
         registro = (id, tipo, prezo)
         print(registro)
         if id != '' and tipo != '' and prezo != '':
             funcioneshab.modifhab(registro)
             funcioneshab.ponerListadoEnGUI()
         else:
             print('Algún campo está vacío')
     except Exception as e:
         print('Detalles: ', e)
Example #6
0
    def on_btnModifhab_clicked(self, widget):
        """
        Modifica los datos de una habitacion seleccionada en el treeview.

        Modifica los datos de una habitacion seleccionada en el treeview
        cambiando los datos en los entries, al finalizar carga de nuevo el
        treeview y borra los entries.

        :param widget:
        :return: void

        """
        try:
            numhab = variables.filahab[0].get_text()
            prezo = variables.filahab[1].get_text()
            if variables.switch.get_active():
                libre = 'SI'
            else:
                libre = 'NO'

            if variables.filarbt[0].get_active():
                tipo = 'simple'
            elif variables.filarbt[1].get_active():
                tipo = 'doble'
            elif variables.filarbt[2].get_active():
                tipo = 'family'
            else:
                pass
            registro = (prezo, tipo, libre)
            if numhab != '':
                funcioneshab.modifhab(registro, numhab)
                funcioneshab.listadohab(variables.listhab)
                funcioneshab.limpiarentry(variables.filahab)
            else:
                print('falta el numhab')
        except:
            print('error modif hab')