예제 #1
0
    def on_btnModificarHabitacion_clicked(self, widget):
        try:
            numero = variables.filahab[0].get_text()
            precio = variables.filahab[1].get_text()

            if variables.filarbt[0].get_active() == True:
                tipo = 'Simple'
            elif variables.filarbt[1].get_active() == True:
                tipo = 'Double'
            elif variables.filarbt[2].get_active() == True:
                tipo = 'Familiar'

            if variables.switch.get_active():
                ocupado = 'SI'
            else:
                ocupado = 'NO'

            registro = (numero, tipo, precio, ocupado)

            if numero != '' and precio != '':
                funcionesHab.modificarHab(registro)
                funcionesHab.listadohab(variables.listhabitaciones)
                funcionesHab.clearEntry(variables.filahab)

        except Exception as e:
            print("Error modificar habitacion", e)
예제 #2
0
    def on_TreeHabitaciones_cursor_changed(self, widget):
        try:
            model, iter = variables.treehabitaciones.get_selection(
            ).get_selected()

            funcionesHab.clearEntry(variables.filahab)

            if iter is not None:
                snumhab = model.get_value(iter, 0)
                stipo = model.get_value(iter, 1)
                sprecio = model.get_value(iter, 2)
                sprecio = round(sprecio, 2)

                variables.filahab[0].set_text(str(snumhab))
                variables.filahab[1].set_text(str(sprecio))

                if stipo == 'Simple':
                    variables.filarbt[0].set_active(True)
                elif stipo == 'Double':
                    variables.filarbt[1].set_active(True)
                elif stipo == 'Familiar':
                    variables.filarbt[2].set_active(True)

                ocupado = model.get_value(iter, 3)

                if ocupado == str('SI'):
                    variables.switch.set_active(True)
                else:
                    variables.switch.set_active(False)
        except Exception as e:
            print(e)
예제 #3
0
    def on_btnAltasHabitacion_clicked(self, widget):
        try:
            numero = variables.filahab[0].get_text()
            precio = variables.filahab[1].get_text()

            if variables.filarbt[0].get_active() == True:
                tipo = 'Simple'
            elif variables.filarbt[1].get_active() == True:
                tipo = 'Double'
            elif variables.filarbt[2].get_active() == True:
                tipo = 'Familiar'

            if variables.switch.get_active():
                ocupado = 'SI'
            else:
                ocupado = 'NO'

            print(ocupado)

            registro = (numero, tipo, precio, ocupado)

            if numero != '' and precio != '' and ocupado != '':
                funcionesHab.insertarhab(registro)
                funcionesHab.listadohab(variables.listhabitaciones)
                funcionesHab.clearEntry(variables.filahab)
                variables.cmbreserhabitacion.set_active(0)
                funcionesReservas.listadonumhab(self)

        except Exception as e:
            print("Error alta habitacion", e)
예제 #4
0
    def on_btnLimpiar_clicked(self, widget):

        try:

            funcionesCli.clearEntry(variables.filacli)
            funcionesHab.clearEntry(variables.filahab)
            funcionesReservas.clearEntry(variables.filareserva)

        except Exception as e:
            print('Error btnLimpiar', e)