Esempio n. 1
0
class GUI:
    def __init__(self, database_connection):
        self.database_connection = database_connection
        self.rowNumber = -1
        self.rows = {}
        self.X = ""
        self.H = 'No'
        self.B = 'No'

        self.root = tk.Tk()
        self.root.title('')
        canvas = tk.Canvas(self.root, height=600, width=1500)
        canvas.pack()
        self.frame = tk.Frame(self.root)
        self.frame.place(relx=0, rely=0, relwidth=0.5, relheight=1)
        self.tframe = tk.Frame(self.root)
        self.tframe.place(relx=0.5, rely=0.0, relwidth=0.5, relheight=0.5)

        # table build
        self.table = TableCanvas(self.tframe,
                                 rows=2,
                                 cols=4,
                                 cellwidth=175,
                                 state="readonly")
        self.table_value = TableCanvas(self.frame,
                                       rows=2,
                                       cols=6,
                                       cellwidth=117,
                                       state="readonly")
        self.table_value.show()

        self.table.bind('<ButtonRelease-1>',
                        self.clicked)  # Bind the click release event

        self.table.model.columnlabels['1'] = "VerifiedDate"
        self.table.model.columnlabels['2'] = "Program"
        self.table.model.columnlabels['3'] = "OrdPhysician"
        self.table.model.columnlabels['4'] = "BandQ"
        self.table.show()

        self.table_value.model.columnlabels['1'] = "Total Protein"
        self.table_value.model.columnlabels['2'] = "Albumin"
        self.table_value.model.columnlabels['3'] = "Alpha1"
        self.table_value.model.columnlabels['4'] = "Alpha2"
        self.table_value.model.columnlabels['5'] = "Beta"
        self.table_value.model.columnlabels['6'] = "Gamma"

        self.hframe = tk.Frame(self.root)
        self.hframe.place(relx=0.5, rely=0.5, relwidth=0.5, relheight=0.57)
        self.History = tk.Label(
            self.frame,
            text='Does this patient have a previous history?',
            font=15)
        self.History.place(relx=0.13, rely=0.22, relwidth=0.8, relheight=0.1)
        self.var1 = tk.IntVar()
        self.var1.set('no')
        self.button_Y_H = tk.Radiobutton(self.frame,
                                         text="Yes",
                                         font=8,
                                         variable=self.var1,
                                         value='yes',
                                         command=self.HY)
        self.button_N_H = tk.Radiobutton(self.frame,
                                         text="No",
                                         font=8,
                                         variable=self.var1,
                                         value='no',
                                         command=self.HN)
        self.button_Y_H.place(relx=0.35,
                              rely=0.35,
                              relwidth=0.10,
                              relheight=0.05)
        self.button_N_H.place(relx=0.55,
                              rely=0.35,
                              relwidth=0.10,
                              relheight=0.05)
        self.Band = tk.Label(
            self.frame,
            text='Is there a band present in the current study?',
            font=15)
        self.Band.place(relx=0.13, rely=0.42, relwidth=0.8, relheight=0.1)
        self.var2 = tk.IntVar()
        self.var2.set('no')
        self.button_Y_B = tk.Radiobutton(self.frame,
                                         text="Yes",
                                         font=8,
                                         variable=self.var2,
                                         value='yes',
                                         command=self.BY)
        self.button_N_B = tk.Radiobutton(self.frame,
                                         text="No",
                                         font=8,
                                         variable=self.var2,
                                         value='no',
                                         command=self.BN)
        self.button_Y_B.place(relx=0.35,
                              rely=0.53,
                              relwidth=0.10,
                              relheight=0.05)
        self.button_N_B.place(relx=0.55,
                              rely=0.53,
                              relwidth=0.10,
                              relheight=0.05)
        self.comment = tk.Text(self.frame, height=30, width=10)
        self.comment.place(relx=0.13, rely=0.60, relwidth=0.8, relheight=0.35)
        self.button_next = tk.Button(self.frame,
                                     text="Next",
                                     font=8,
                                     command=self.next_row)
        self.button_next.place(relx=0.9,
                               rely=0.22,
                               relwidth=0.1,
                               relheight=0.1)
        self.button_prev = tk.Button(self.frame,
                                     text="Previous",
                                     font=8,
                                     command=self.prev_row)
        self.button_prev.place(relx=0.06,
                               rely=0.22,
                               relwidth=0.1,
                               relheight=0.1)
        self.button_close = tk.Button(self.frame,
                                      text="Close",
                                      font=8,
                                      command=self.close)
        self.button_close.place(relx=0.473,
                                rely=0.95,
                                relwidth=0.07,
                                relheight=0.05)
        self.button_pickday = tk.Button(self.frame,
                                        text="Pick Day",
                                        font=8,
                                        command=self.pickDate)
        self.button_pickday.place(relx=0.4,
                                  rely=0.15,
                                  relwidth=0.1,
                                  relheight=0.05)
        self.history_comment = tk.Text(self.hframe, height=30, width=10)
        self.history_comment.place(relx=0.1,
                                   rely=0.1,
                                   relwidth=0.8,
                                   relheight=0.6)

        self.attending = tk.Label(self.hframe, text='', font=15)
        self.attending.place(relx=0.125,
                             rely=0.75,
                             relwidth=0.8,
                             relheight=0.1)

        self.date_label = tk.Label(self.frame, text='', font=15)
        self.date_label.place(relx=0.5,
                              rely=0.15,
                              relwidth=0.16,
                              relheight=0.05)

        # TODO default date to today's date
        default_date = '09-08-2016'
        self.update_date(default_date)

    def update_date(self, new_date):
        self.rows = database_connection.get_rows_for_date(new_date)
        self.date_label.config(text=new_date)
        self.rowNumber = 0
        self.resetTK()

    def close(self):
        self.root.destroy()

    def next_row(self):
        if self.rowNumber == len(self.rows) - 1:
            return
        self.rowNumber = self.rowNumber + 1
        self.thisRowData = self.rows[self.rowNumber]
        self.var1.set('no')
        self.var2.set('no')
        self.H = 'No'
        self.B = 'No'
        self.updateTK()

    def prev_row(self):
        if self.rowNumber == 0:
            return
        self.rowNumber = self.rowNumber - 1
        self.thisRowData = self.rows[self.rowNumber]
        self.var1.set('no')
        self.var2.set('no')
        self.H = 'No'
        self.B = 'No'
        self.updateTK()

    def resetTK(self):
        self.rowNumber = -1
        self.thisRowData = None
        self.next_row()
        self.updateTK()

    def pickDate(self):
        calendarPopupFrame = tk.Toplevel()
        calendarObject = Calendar(calendarPopupFrame, self)

    def HY(self):
        self.H = 'Yes'
        self.updateTK()

    def HN(self):
        self.H = 'No'
        self.updateTK()

    def BY(self):
        self.B = 'Yes'
        self.updateTK()

    def BN(self):
        self.B = 'No'
        self.updateTK()

    def clicked(self, event):  # Click event callback function.
        self.updateHistoryComment()

    def updateHistoryComment(self):
        currentPatientHistoryRecord = self.getCurrentPatientHistoryRecord()
        if currentPatientHistoryRecord is None:
            return

        self.attending.config(
            text=currentPatientHistoryRecord.signout_pathologist)
        self.history_comment.delete('1.0', tk.END)
        self.history_comment.insert(
            tk.END, str(currentPatientHistoryRecord.interpretation))
        self.table.redrawTable()

    def getCurrentPatientHistoryRecord(self):
        currentTableRecord = self.table.get_currentRecord()
        for ph in self.patient_history:
            if currentTableRecord['1'] == ph.get_formatted_verified_time() and \
                    currentTableRecord['2'] == ph.get_program_description() and \
                    currentTableRecord['3'] == ph.ordering_provider and \
                    currentTableRecord['4'] == ph.band_concentration:
                return ph
        return None

    def updateTK(self):
        # update button text
        self.History.config(text='Case ' + str(self.thisRowData.seq) +
                            ': Does ' + self.thisRowData.patientName +
                            ' have a previous history?')

        # update history comment and attending
        self.attending.config(text='')
        self.history_comment.delete('1.0', tk.END)
        self.history_comment.insert(tk.END, str(''))

        self.table_value.model.setValueAt(self.thisRowData.pt, 0, 0)
        self.table_value.model.setValueAt(self.thisRowData.getAbsAlbuminText(),
                                          0, 1)
        self.table_value.model.setValueAt(self.thisRowData.getAbsAlpha1Text(),
                                          0, 2)
        self.table_value.model.setValueAt(self.thisRowData.getAbsAlpha2Text(),
                                          0, 3)
        self.table_value.model.setValueAt(self.thisRowData.getAbsBetaText(), 0,
                                          4)
        self.table_value.model.setValueAt(self.thisRowData.getAbsGammaText(),
                                          0, 5)

        self.table_value.model.setValueAt(
            str(self.thisRowData.getRelAlbuminText()), 1, 1)
        self.table_value.model.setValueAt(
            str(self.thisRowData.getRelAlpha1Text()), 1, 2)
        self.table_value.model.setValueAt(
            str(self.thisRowData.getRelAlpha2Text()), 1, 3)
        self.table_value.model.setValueAt(
            str(self.thisRowData.getRelBetaText()), 1, 4)
        self.table_value.model.setValueAt(
            str(self.thisRowData.getRelGammaText()), 1, 5)

        self.table_value.redrawTable()
        # update suggested comment
        new_comment = ""
        try:
            new_comment = CommentInterpreter.CM(self.thisRowData, self.H,
                                                self.B)
        except:
            new_comment = "An error occurred when trying to create the comment"
        self.comment.delete('1.0', tk.END)
        self.comment.insert(tk.END, str(new_comment))

        # update historical table
        self.table.model.deleteRows()
        self.table.clearSelected()
        self.table.redrawTable()

        if self.thisRowData.mrn is None:
            return

        self.patient_history = database_connection.get_history(
            str(self.thisRowData.mrn))

        # add a row for each new history element
        for ph in self.patient_history:
            new_row_index = self.table.model.addRow() - 1
            self.table.model.setValueAt(ph.verified_time.strftime("%Y-%m-%d"),
                                        new_row_index, 0)
            self.table.model.setValueAt(ph.get_program_description(),
                                        new_row_index, 1)
            self.table.model.setValueAt(ph.ordering_provider, new_row_index, 2)
            self.table.model.setValueAt(ph.band_concentration, new_row_index,
                                        3)

        self.table.setSelectedRow(0)
        self.updateHistoryComment()

    def mainloop(self):
        self.root.mainloop()
Esempio n. 2
0
class VehiclesTab(Frame):
    def __init__(self, notebook):

        super().__init__(notebook,
                         bg="#%02x%02x%02x" % (166, 185, 180),
                         highlightthickness=1,
                         highlightbackground="black")

        #TÍTULO DE LA PESTAÑA
        Label(self,
              text="LISTA DE VEHÍCULOS REGISTRADOS",
              font=("Verdana", 16, "bold"),
              bg="#%02x%02x%02x" % (166, 185, 180)).place(relx="0.05",
                                                          rely="0.05")

        #CREA TABLA DE VEHÍCULOS
        self.tableFrame = Frame(self)
        self.model = TableModel()
        self.model.addColumn(colname="DOMINIO")
        self.model.columnwidths["DOMINIO"] = 90
        self.model.addColumn(colname="TITULAR")
        self.model.columnwidths["TITULAR"] = 90
        self.model.addColumn(colname="TIPO")
        self.model.addColumn(colname="MARCA")
        self.model.addColumn(colname="MODELO")
        self.model.columnwidths["MODELO"] = 90
        self.model.addColumn(colname="AÑO")
        self.model.columnwidths["AÑO"] = 75
        self.model.addColumn(colname="VIN")
        self.model.columnwidths["VIN"] = 200
        self.vehiclesTable = TableCanvas(self.tableFrame,
                                         model=self.model,
                                         width=790,
                                         thefont=("Arial", 10),
                                         read_only=True)
        self.vehiclesTable.show()
        self.tableFrame.place(relx="0.10", rely="0.15")
        self.showVehicles()

        #BOTÓN PARA CERRAR LAS PESTAÑAS DE VEHÍCULO
        Button(self,
               text="Cerrar Menú",
               font=("Verdana", 12),
               command=lambda: self.close(notebook)).place(relx="0.85",
                                                           rely="0.05")

        #BOTÓN PARA AÑADIR REGISTRO
        Button(self,
               text='AÑADIR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createAddVehicleTab()).place(relx=0.1,
                                                                     rely=0.7)

        #BOTÓN PARA MODIFICAR REGISTRO
        Button(self,
               text='MODIFICAR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createModifyVehicleTab()).place(
                   relx=0.39, rely=0.7)

        #BOTÓN PARA ELIMINAR REGISTRO
        Button(self,
               text='ELIMINAR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createDeleteVehicleToplevel()).place(
                   relx=0.68, rely=0.7)

    #FUNCIÓN PARA CARGAR LA TABLE DE VEHÍCULOS
    def showVehicles(self):
        vehicles = DBManager().getAllVehicles()
        self.model.deleteRows()
        dataModel = {}
        for vehicle in vehicles:
            dataModel[vehicle[0]] = {
                'DOMINIO': vehicle[0],
                'TITULAR': vehicle[6],
                'TIPO': vehicle[1],
                'MARCA': vehicle[2],
                'MODELO': vehicle[3],
                'AÑO': str(vehicle[4]),
                'VIN': vehicle[5]
            }
        self.model.importDict(dataModel)
        self.vehiclesTable.redraw()
        #self.vehiclesTable.adjustColumnWidths()

    #DEVUELVE LA FILA SELECCIONADA
    def getSelectedRow(self):
        return (self.vehiclesTable.get_currentRecord())

    #CIERRA EL PANEL ACTUAL Y REALIZA LOS CAMBIOS CORRESPONDIENTES.
    #PARA CERRAR EL PANEL, LOS PANELES DE CREACIÓN, MODIFICACIÓN Y ELIMINACIÓN DEBEN ESTAR CERRADOS
    def close(self, notebook):
        if notebook.addVehicleFlag == 0 and notebook.modifyVehicleFlag == 0 and notebook.deleteVehicleFlag == 0:
            notebook.container.vehiclesFlag = 0
            notebook.container.principalFrame.searchBox["state"] = "normal"
            notebook.container.principalFrame.search()
            notebook.destroy()
        else:
            messagebox.showwarning(
                "Advertencia",
                "Para poder cerrar el menú no debe haber ninguna pestaña abierta"
            )
Esempio n. 3
0
class PersonsTab(Frame):
    def __init__(self, notebook):

        #CARACTERÍSTICAS DE LA PESTAÑA
        super().__init__(notebook,
                         bg="#%02x%02x%02x" % (166, 185, 180),
                         highlightthickness=1,
                         highlightbackground="black")
        width = notebook.cget("width") * 3 / 5
        height = notebook.cget("height")

        #TÍTULO DEL PANEL
        Label(self,
              text="LISTA DE PERSONAS REGISTRADAS",
              font=("Verdana", 16, "bold"),
              bg="#%02x%02x%02x" % (166, 185, 180)).place(relx="0.05",
                                                          rely="0.05")

        #BOTÓN PARA CERRAR EL PANEL DE PESTAÑAS
        Button(self,
               text="Cerrar Menú",
               font=("Verdana", 12),
               command=lambda: self.close(notebook)).place(relx="0.85",
                                                           rely="0.05")

        #CREA LA TABLA DE PERSONAS
        self.tableFrame = Frame(self)
        self.model = TableModel()
        self.model.addColumn(colname="DNI")
        self.model.columnwidths["DNI"] = 90
        self.model.addColumn(colname="APELLIDO")
        self.model.columnwidths["APELLIDO"] = 90
        self.model.addColumn(colname="NOMBRES")
        self.model.addColumn(colname="FECHA DE NAC.")
        self.model.columnwidths["FECHA DE NAC."] = 130
        self.model.addColumn(colname="DOMICILIO")
        self.model.columnwidths["DOMICILIO"] = 147
        self.model.addColumn(colname="NACIONALIDAD")
        self.model.columnwidths["NACIONALIDAD"] = 120
        self.model.addColumn(colname="CATEGORÍA")
        self.model.columnwidths["CATEGORÍA"] = 90
        self.model.addColumn(colname="TIPO SANGRE")
        self.model.columnwidths["TIPO SANGRE"] = 110
        self.personsTable = TableCanvas(self.tableFrame,
                                        model=self.model,
                                        width=900,
                                        thefont=("Arial", 10),
                                        read_only=True)
        self.personsTable.show()
        self.tableFrame.place(relx="0.05", rely="0.15")

        self.showPersons()

        #BOTÓN PARA AÑADIR REGISTRO
        Button(self,
               text='AÑADIR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createAddPersonTab()).place(relx=0.1,
                                                                    rely=0.7)

        #BOTÓN PARA MODIFICAR REGISTRO
        Button(self,
               text='MODIFICAR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createModifyPersonTab()).place(
                   relx=0.4, rely=0.7)

        #BOTÓN PARA ELIMINAR REGISTRO
        Button(self,
               text='ELIMINAR REGISTRO',
               width=20,
               font=("Verdana", 14),
               command=lambda: notebook.createDeletePersonToplevel()).place(
                   relx=0.7, rely=0.7)

    #FUNCIÓN PARA OBTENER Y CARGAR LAS PERSONAS REGISTRADAS
    def showPersons(self):
        persons = DBManager().getAllPersons()
        self.model.deleteRows()
        dataModel = {}
        for person in persons:
            birthdate = "%02d-%02d-%4d" % (person[3].day, person[3].month,
                                           person[3].year)
            dataModel[person[0]] = {
                'DNI': person[0],
                'APELLIDO': person[1],
                'NOMBRES': person[2],
                'FECHA DE NAC.': birthdate,
                'DOMICILIO': person[4],
                'NACIONALIDAD': person[5],
                'CATEGORÍA': person[6],
                'TIPO SANGRE': person[7]
            }
        self.model.importDict(dataModel)
        self.personsTable.redraw()

    #OBTIENE LA FILA SELECCIONADA
    def getSelectedRow(self):
        return (self.personsTable.get_currentRecord())

    #CERRAR LA PESTAÑA Y ACCIONES COMPLEMENTARIAS
    def close(self, notebook):
        if notebook.addPersonFlag == 0 and notebook.modifyPersonFlag == 0 and notebook.deletePersonFlag == 0:
            notebook.container.personsFlag = 0
            notebook.container.principalFrame.searchBox["state"] = "normal"
            notebook.container.principalFrame.search()
            notebook.destroy()
        else:
            #PARA PODER CERRAR EL PANEL, LAS PESTAÑAS DEBEN ESTAR CERRADAS
            messagebox.showwarning(
                "Advertencia",
                "Para poder cerrar el menú no debe haber ninguna pestaña abierta"
            )
class ResultSearchTab(Frame):
    def __init__(self, frame):

        #CARACTERÍSTICAS DEL PANEL
        width = frame.cget("width") * 3 / 5
        height = frame.cget("height")
        bgcolor1 = "#%02x%02x%02x" % (157, 168, 244)
        super().__init__(frame,
                         bg=bgcolor1,
                         highlightthickness=1,
                         highlightbackground="black")

        #TITULO DE VENTANA
        Label(self,
              text="DATOS DEL VEHÍCULO",
              font=("Verdana", 14, "bold"),
              bg=bgcolor1).place(relx=0.35, rely=0.04)

        #PANEL DE DATOS DEL VEHÍCULO
        dataVehicle = Frame(self, bg=bgcolor1, width=width, height=100)
        dataVehicle.place(relx=0.02, rely=0.1)
        bgcolor2 = "#%02x%02x%02x" % (198, 204, 249)

        Label(dataVehicle,
              text="Dominio",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=1, column=1)
        Label(dataVehicle,
              text="Tipo",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=1, column=3)
        Label(dataVehicle,
              text="N° de Motor",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=1, column=5)
        Label(dataVehicle,
              text="Marca",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=2, column=1)
        Label(dataVehicle,
              text="Modelo",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=2, column=3)
        Label(dataVehicle,
              text="Año",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=2, column=5)
        Label(dataVehicle,
              text="Titular",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=3, column=1)
        Label(dataVehicle,
              text="DNI",
              width=15,
              bg=bgcolor1,
              relief="groove",
              borderwidth=4,
              font=("Verdana", 11, "italic")).grid(row=3, column=5)

        #DOMINIO
        self.domainLabel = Label(dataVehicle,
                                 font=("Verdana", 12, "italic"),
                                 width=15,
                                 bg=bgcolor2)
        self.domainLabel.grid(row=1, column=2)

        #TIPO DE VEHÍCULO
        self.kindLabel = Label(dataVehicle,
                               font=("Verdana", 12, "italic"),
                               width=15,
                               bg=bgcolor2)
        self.kindLabel.grid(row=1, column=4)

        #NÚMERO DE MOTOR
        self.engineLabel = Label(dataVehicle,
                                 font=("Verdana", 12, "italic"),
                                 width=20,
                                 bg=bgcolor2)
        self.engineLabel.grid(row=1, column=6)

        #MARCA
        self.brandLabel = Label(dataVehicle,
                                font=("Verdana", 12, "italic"),
                                width=15,
                                bg=bgcolor2)
        self.brandLabel.grid(row=2, column=2)

        #MODELO
        self.modelLabel = Label(dataVehicle,
                                font=("Verdana", 12, "italic"),
                                width=15,
                                bg=bgcolor2)
        self.modelLabel.grid(row=2, column=4)

        #AÑO
        self.yearLabel = Label(dataVehicle,
                               font=("Verdana", 12, "italic"),
                               width=20,
                               bg=bgcolor2)
        self.yearLabel.grid(row=2, column=6)

        #TITULAR
        self.titularLabel = Label(dataVehicle,
                                  font=("Verdana", 12, "italic"),
                                  anchor="w",
                                  width=45,
                                  bg=bgcolor2)
        self.titularLabel.grid(row=3, column=2, columnspan=3)

        #DNI DEL TITULAR
        self.dniLabel = Label(dataVehicle,
                              font=("Verdana", 12, "italic"),
                              width=20,
                              bg=bgcolor2)
        self.dniLabel.grid(row=3, column=6)

        #CREA TABLA DE INFRACCIONES
        self.tableFrame = Frame(self)
        self.model = TableModel()
        self.model.addColumn(colname="ID")
        self.model.columnwidths["ID"] = 80
        self.model.addColumn(colname="DNI RESPONSABLE")
        self.model.columnwidths["DNI RESPONSABLE"] = 90
        self.model.addColumn(colname="CAUSA")
        self.model.addColumn(colname="AGENTE")
        self.model.addColumn(colname="FECHA")
        self.model.addColumn(colname="LUGAR")
        self.model.addColumn(colname="MONTO")
        self.model.columnwidths["MONTO"] = 70
        self.model.addColumn(colname="PAGADO")
        self.model.columnwidths["PAGADO"] = 70
        self.infractionsTable = TableCanvas(self.tableFrame,
                                            model=self.model,
                                            width=938,
                                            thefont=("Arial", 10),
                                            read_only=True)
        self.infractionsTable.show()
        self.tableFrame.place(x="20", rely="0.35")

        #CREA MENSAJE DE ESTADO DE CUENTA
        self.message = StringVar()
        self.debtLabel = Label(self,
                               textvariable=self.message,
                               font=("Verdana", 12))
        self.debtLabel.place(x="30", rely="0.30")

    #FUNCIÓN QUE DEVUELVE LA FILA SELECCIONADA
    def getSelectedRow(self):
        return (self.infractionsTable.get_currentRecord())

    #FUNCIÓN QUE CARGA EL PANEL Y LA TABLA DE INFRACCIONES CON LOS DATOS CORRESPONDIENTES
    def showData(self, data):
        self.model.deleteRows()
        dataModel = {}

        if data != None:
            self.domainLabel.configure(text=data[0])
            self.kindLabel.configure(text=data[1])
            self.brandLabel.configure(text=data[2])
            self.modelLabel.configure(text=data[3])
            self.yearLabel.configure(text=data[4])
            self.engineLabel.configure(text=data[5])
            self.titularLabel.configure(text=data[7] + ", " + data[8])
            self.dniLabel.configure(text=data[6])

            infractions = DBManager().getInfractions(data[0])
            self.debt = 0.00
            for infraction in infractions:
                isPay = 'NO'
                if (infraction[8] == 1):
                    isPay = 'SI'
                dateandhour = "%02d-%02d-%4d %02d:%02d" % (
                    infraction[5].day, infraction[5].month, infraction[5].year,
                    infraction[5].hour, infraction[5].minute)
                dateandhourpaid = "-"
                if (infraction[9] != None):
                    dateandhourpaid = "%02d-%02d-%4d %02d:%02d" % (
                        infraction[9].day, infraction[9].month,
                        infraction[9].year, infraction[9].hour,
                        infraction[9].minute)
                dataModel[infraction[0]] = {
                    'ID': "%07d" % (infraction[0]),
                    'DNI RESPONSABLE': str(infraction[1]),
                    'CAUSA': str(infraction[3]),
                    'AGENTE': str(infraction[4]),
                    'FECHA': dateandhour,
                    'LUGAR': str(infraction[6]),
                    'MONTO': "%.2f" % (infraction[7]),
                    'PAGADO': isPay,
                    'FECHA PAGO': dateandhourpaid
                }
                if (infraction[8] == 0):
                    self.debt = self.debt + float(infraction[7])
            if (self.debt > 0):
                self.message.set("Presenta una deuda de $ " + str(self.debt))
            else:
                self.message.set("No presenta deudas.")
        #SI LA BÚSQUEDA NO ARROJA RESULTADOS, LOS CAMPOS SE MUESTRAN EN BLANCO
        else:
            self.domainLabel.configure(text="")
            self.kindLabel.configure(text="")
            self.brandLabel.configure(text="")
            self.modelLabel.configure(text="")
            self.yearLabel.configure(text="")
            self.engineLabel.configure(text="")
            self.titularLabel.configure(text="")
            self.dniLabel.configure(text="")
            self.message.set("")

        #ACTUALIZA EL CONTENIDO DE LA TABLA
        self.model.importDict(dataModel)
        self.infractionsTable.redraw()
        self.infractionsTable.autoResizeColumns()