def database_visits(self): self.Visits.show() self.Main.hide() self.Edit_doctors.hide() self.Edit_discount.hide() self.Edit_patients.hide() self.Edit_medicines.hide() self.Edit_discount.hide() self.Patients.hide() self.Doctors.hide() self.Medicines.hide() self.Discount.hide() self.Visits.show() self.pushButton_vis_show.clicked.connect(self.load_visits) self.pushButton_vis_add.clicked.connect(self.add_visits) # self.pushButton_vis_edit.clicked.connect(self.edit_discount) # self.pushButton_vis_del.clicked.connect(self.delete_discount) # self.pushButton_vis_search.clicked.connect(self.search_discount) # self.pushButton_vis_menu.clicked.connect(self.creation) self.tableWidget_visits.setRowCount(0) for row_number, row_data in enumerate( Database_module.read_from_db_vis()): self.tableWidget_visits.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_visits.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data))) self.tableWidget.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_pat()): self.tableWidget.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget.setItem(row_number, column_number, QtWidgets.QTableWidgetItem(str(data))) self.tableWidget_2.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_doc()): self.tableWidget_2.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_2.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data))) self.tableWidget_3.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_dis()): self.tableWidget_3.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_3.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data)))
def add_visits(self): self.Main.hide() self.Visits.hide() self.Patients.hide() self.Medicines.hide() self.Doctors.hide() self.Discount.hide() self.Edit_medicines.hide() self.Edit_discount.hide() self.Edit_doctors.hide() self.Edit_visits.show() self.lineEdit_5.hide() self.label_37.hide() self.pushButton_37.hide() self.pushButton_35.clicked.connect(self.add_visits2) self.pushButton_36.clicked.connect(self.database_visits) self.tableWidget_4.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_pat()): self.tableWidget_4.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_4.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data))) self.tableWidget_5.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_doc()): self.tableWidget_5.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_5.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data))) self.tableWidget_6.setRowCount(0) for row_number, row_data in enumerate(Database_module.read_vis_dis()): self.tableWidget_6.insertRow(row_number) for column_number, data in enumerate(row_data): self.tableWidget_6.setItem( row_number, column_number, QtWidgets.QTableWidgetItem(str(data)))