def export_to_exel(self): hat_data = [ "ФИО", "Общежитие", "Комната", "Пол", "Адрес регистрации", "Телефон", "Серия и номер паспорта", "Форма обучения", "Шифр Договора", "Дата начала", "Дата конца", "Льгота", "Стоимость" ] students_mas = dbd.list_off_all_students() export_file = xlwt.Workbook() sheet = export_file.add_sheet("Клиенты") i, j = 0, 0 for elem in hat_data: sheet.write(i, j, elem) j += 1 i, j = 1, 0 for student in students_mas: sheet.write(i, j, student[1]["ФИО"]) if student[1]["Общежитие"] != "": sheet.write(i, j + 1, student[1]["Общежитие"]) else: sheet.write(i, j + 1, "-") if student[1]["Комната"] != "": sheet.write(i, j + 2, student[1]["Комната"]) else: sheet.write(i, j + 2, "-") sheet.write(i, j + 3, student[1]["Пол"]) sheet.write(i, j + 4, student[1]["Адрес регистрации"]) sheet.write(i, j + 5, student[1]["Телефон"]) sheet.write(i, j + 6, student[1]["Паспорт"]) sheet.write(i, j + 7, student[1]["Форма обучения"]) contract_code = dbd.get_students_contract_num2(student[0]) if contract_code != "": contract = dbd.search_contract_by_code(contract_code) sheet.write(i, j + 8, contract[2]["Шифр"]) sheet.write(i, j + 9, contract[2]["Дата начала"]) sheet.write(i, j + 10, contract[2]["Дата конца"]) sheet.write(i, j + 11, contract[2]["Льгота"]) sheet.write(i, j + 12, int(contract[2]["Стоимость"])) else: sheet.write(i, j + 8, "-") sheet.write(i, j + 9, "-") sheet.write(i, j + 10, "-") sheet.write(i, j + 11, "-") sheet.write(i, j + 12, "-") i += 1 try: os.mkdir("exports") except: pass export_file.save("exports/Клиенты.xls") from success_action import Ui_Error self.window = QtWidgets.QMainWindow() self.ui = Ui_Error() self.ui.setupUi(self.window) self.window.show()
def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show()
def openAdd_contract(self): from add_contract import Ui_add_contract self.window = QtWidgets.QMainWindow() self.ui = Ui_add_contract() self.ui.setupUi(self.window) self.window.show()
class Ui_add_client(object): def openAdd_contract(self): from add_contract import Ui_add_contract self.window = QtWidgets.QMainWindow() self.ui = Ui_add_contract() self.ui.setupUi(self.window) self.window.show() def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def add_client(self): fio = self.FIO_line.text() passport = self.serial_line.text() + self.number_line.text() address = self.addres_line.text() phone = self.phone_line.text() educ_form = self.FormBox.currentText() sex = self.SexBox.currentText() database.add_student(fio, phone, passport, address, educ_form, sex, 301, 1) self.FIO_line.clear() self.serial_line.clear() self.number_line.clear() self.addres_line.clear() self.phone_line.clear() self.FormBox.setCurrentIndex(-1) self.SexBox.setCurrentIndex(-1) def setupUi(self, add_client): add_client.setObjectName("add_client") add_client.resize(680, 500) add_client.setMinimumSize(QtCore.QSize(680, 500)) add_client.setMaximumSize(QtCore.QSize(680, 500)) self.centralwidget = QtWidgets.QWidget(add_client) self.centralwidget.setObjectName("centralwidget") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(60, 80, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label.setFont(font) self.label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label.setObjectName("label") self.FIO_line = QtWidgets.QLineEdit(self.centralwidget) self.FIO_line.setGeometry(QtCore.QRect(220, 80, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.FIO_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.FIO_line.setFont(font) self.FIO_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.FIO_line.setText("") self.FIO_line.setObjectName("FIO_line") self.label_2 = QtWidgets.QLabel(self.centralwidget) self.label_2.setGeometry(QtCore.QRect(60, 140, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_2.setFont(font) self.label_2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_2.setObjectName("label_2") self.serial_line = QtWidgets.QLineEdit(self.centralwidget) self.serial_line.setGeometry(QtCore.QRect(220, 140, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.serial_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.serial_line.setFont(font) self.serial_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.serial_line.setObjectName("serial_line") self.label_3 = QtWidgets.QLabel(self.centralwidget) self.label_3.setGeometry(QtCore.QRect(60, 200, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_3.setFont(font) self.label_3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_3.setObjectName("label_3") self.number_line = QtWidgets.QLineEdit(self.centralwidget) self.number_line.setGeometry(QtCore.QRect(220, 200, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.number_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.number_line.setFont(font) self.number_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.number_line.setObjectName("number_line") self.label_4 = QtWidgets.QLabel(self.centralwidget) self.label_4.setGeometry(QtCore.QRect(60, 260, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_4.setFont(font) self.label_4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_4.setObjectName("label_4") self.addres_line = QtWidgets.QLineEdit(self.centralwidget) self.addres_line.setGeometry(QtCore.QRect(220, 260, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.addres_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.addres_line.setFont(font) self.addres_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.addres_line.setText("") self.addres_line.setObjectName("addres_line") self.phone_line = QtWidgets.QLineEdit(self.centralwidget) self.phone_line.setGeometry(QtCore.QRect(220, 320, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.phone_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.phone_line.setFont(font) self.phone_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.phone_line.setObjectName("phone_line") self.label_5 = QtWidgets.QLabel(self.centralwidget) self.label_5.setGeometry(QtCore.QRect(60, 320, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_5.setFont(font) self.label_5.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_5.setObjectName("label_5") self.label_6 = QtWidgets.QLabel(self.centralwidget) self.label_6.setGeometry(QtCore.QRect(60, 380, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_6.setFont(font) self.label_6.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_6.setObjectName("label_6") self.label_7 = QtWidgets.QLabel(self.centralwidget) self.label_7.setGeometry(QtCore.QRect(60, 440, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_7.setFont(font) self.label_7.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.label_7.setObjectName("label_7") self.FormBox = QtWidgets.QComboBox(self.centralwidget) self.FormBox.setGeometry(QtCore.QRect(220, 380, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.FormBox.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.FormBox.setFont(font) self.FormBox.setToolTip("") self.FormBox.setStatusTip("") self.FormBox.setStyleSheet("background-color: rgb(135, 206, 235);") self.FormBox.setEditable(False) self.FormBox.setMaxCount(2) self.FormBox.setIconSize(QtCore.QSize(16, 16)) self.FormBox.setModelColumn(0) self.FormBox.setObjectName("FormBox") self.FormBox.addItem("") self.FormBox.addItem("") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(60, 20, 561, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.add_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.add_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.add_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.add_client_btn.setFont(font) self.add_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.add_client_btn.setObjectName("add_client_btn") self.add_client_btn.clicked.connect(self.add_client) self.horizontalLayout.addWidget(self.add_client_btn) self.add_contract_btn = QtWidgets.QPushButton(self.layoutWidget) self.add_contract_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.add_contract_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.add_contract_btn.setFont(font) self.add_contract_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.add_contract_btn.setObjectName("add_contract_btn") self.add_contract_btn.clicked.connect(self.openAdd_contract) self.add_contract_btn.clicked.connect(add_client.close) self.horizontalLayout.addWidget(self.add_contract_btn) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.back_to_client_btn.clicked.connect(add_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.SexBox = QtWidgets.QComboBox(self.centralwidget) self.SexBox.setGeometry(QtCore.QRect(220, 440, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.SexBox.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.SexBox.setFont(font) self.SexBox.setToolTip("") self.SexBox.setStatusTip("") self.SexBox.setStyleSheet("background-color: rgb(135, 206, 235);") self.SexBox.setEditable(False) self.SexBox.setMaxCount(2) self.SexBox.setIconSize(QtCore.QSize(16, 16)) self.SexBox.setModelColumn(0) self.SexBox.setObjectName("SexBox") self.SexBox.addItem("") self.SexBox.addItem("") add_client.setCentralWidget(self.centralwidget) self.retranslateUi(add_client) self.FormBox.setCurrentIndex(-1) self.SexBox.setCurrentIndex(-1) QtCore.QMetaObject.connectSlotsByName(add_client) def retranslateUi(self, add_client): _translate = QtCore.QCoreApplication.translate add_client.setWindowTitle( _translate("add_client", "Добавление клиента")) self.label.setText(_translate("add_client", "ФИО")) self.label_2.setText(_translate("add_client", "Паспорт серия")) self.label_3.setText(_translate("add_client", "Паспорт номер")) self.label_4.setText(_translate("add_client", "Адрес прописки")) self.label_5.setText(_translate("add_client", "Телефон")) self.label_6.setText(_translate("add_client", "Форма обучения")) self.label_7.setText(_translate("add_client", "Пол")) self.FormBox.setCurrentText(_translate("add_client", "")) self.FormBox.setItemText(0, _translate("add_client", "Бюджет")) self.FormBox.setItemText(1, _translate("add_client", "Платное обучение")) self.add_client_btn.setText(_translate("add_client", "Добавить")) self.add_contract_btn.setText( _translate("add_client", "Добавить договор")) self.back_to_client_btn.setText( _translate("add_client", "Вернуться в меню клиента")) self.SexBox.setCurrentText(_translate("add_client", "")) self.SexBox.setItemText(0, _translate("add_client", "Мужской")) self.SexBox.setItemText(1, _translate("add_client", "Женский"))
class Ui_del_client(object): def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def fill_list(self): '''заполняет список''' self.Client_list.clear() fio = self.FIO_line.text() code = self.Contract_number_line.text() if fio != "": mas = dbd.search_student_by_fio(fio) if code != "": mas = dbd.search_student_by_code(code) i = 1 for person in mas: self.Client_list.addItem(str(i) + '. ФИО: ' + person[1]['ФИО'] + '\n' \ + 'Общежитие: ' + str(person[1]['Общежитие']) + '\n' \ + 'Адрес прописки: ' + str(person[1]['Адрес регистрации']) + '\n' \ + 'Комната: ' + str(person[1]['Комната']) \ + ' Пол: ' + str(person[1]['Пол']) + '\n') i = i + 1 def delete_one(self): fio = self.FIO_line.text() code = self.Contract_number_line.text() if fio != "": mas = dbd.search_student_by_fio(fio) if code != "": mas = dbd.search_student_by_code(code) n = self.Client_list.currentRow() i = -1 for person in mas: if i == n-1: dic = person[0] if person[1]['Общежитие'] != '': if person[1]['Комната'] != 'queue' and '': way = "dormitory"+str(person[1]['Общежитие']) + "/" + "rooms"+"/" + str(person[1]['Комната']+"/" + "members"+"/" + person[0]) else: way = "dormitory"+str(person[1]['Общежитие']) + "/"+ "rooms"+"/" + "queue"+"/" + person[0] else: way = "queue"+"/" + person[0] break i = i+1 dbd.delete_student(dic, way) self.FIO_line.clear() self.Contract_number_line.clear() self.Client_list.clear() def setupUi(self, del_client): del_client.setObjectName("del_client") del_client.resize(680, 300) del_client.setMinimumSize(QtCore.QSize(680, 300)) del_client.setMaximumSize(QtCore.QSize(680, 300)) self.centralwidget = QtWidgets.QWidget(del_client) self.centralwidget.setObjectName("centralwidget") self.label_FIO = QtWidgets.QLabel(self.centralwidget) self.label_FIO.setGeometry(QtCore.QRect(60, 80, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO.setFont(font) self.label_FIO.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO.setObjectName("label_FIO") self.FIO_line = QtWidgets.QLineEdit(self.centralwidget) self.FIO_line.setGeometry(QtCore.QRect(220, 80, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.FIO_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.FIO_line.setFont(font) self.FIO_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.FIO_line.setText("") self.FIO_line.setObjectName("FIO_line") self.Contract_number_line = QtWidgets.QLineEdit(self.centralwidget) self.Contract_number_line.setGeometry(QtCore.QRect(220, 140, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.Contract_number_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Contract_number_line.setFont(font) self.Contract_number_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.Contract_number_line.setObjectName("Contract_number_line") self.label_contract = QtWidgets.QLabel(self.centralwidget) self.label_contract.setGeometry(QtCore.QRect(60, 140, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_contract.setFont(font) self.label_contract.setAlignment(QtCore.Qt.AlignCenter) self.label_contract.setObjectName("label_contract") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(120, 20, 431, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.find_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.find_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.find_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.find_client_btn.setFont(font) self.find_client_btn.setStyleSheet("background-color: rgb(135, 206, 235);") self.find_client_btn.setObjectName("find_client_btn") self.horizontalLayout.addWidget(self.find_client_btn) self.find_client_btn.clicked.connect(self.fill_list) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet("background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.back_to_client_btn.clicked.connect(del_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.label_FIO_2 = QtWidgets.QLabel(self.centralwidget) self.label_FIO_2.setGeometry(QtCore.QRect(60, 110, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO_2.setFont(font) self.label_FIO_2.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO_2.setObjectName("label_FIO_2") self.red_client_btn = QtWidgets.QPushButton(self.centralwidget) self.red_client_btn.setGeometry(QtCore.QRect(500, 220, 175, 40)) self.red_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.red_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.red_client_btn.setFont(font) self.red_client_btn.setStyleSheet("background-color: rgb(135, 206, 235);") self.red_client_btn.setObjectName("red_client_btn") self.Client_list = QtWidgets.QListWidget(self.centralwidget) self.red_client_btn.clicked.connect(self.delete_one) self.Client_list.setGeometry(QtCore.QRect(60, 200, 420, 80)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(21) sizePolicy.setHeightForWidth(self.Client_list.sizePolicy().hasHeightForWidth()) self.Client_list.setSizePolicy(sizePolicy) self.Client_list.setMinimumSize(QtCore.QSize(420, 80)) self.Client_list.setMaximumSize(QtCore.QSize(420, 80)) self.Client_list.setSizeIncrement(QtCore.QSize(0, 80)) self.Client_list.setBaseSize(QtCore.QSize(0, 80)) font = QtGui.QFont() font.setFamily("MS Shell Dlg 2") font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Client_list.setFont(font) self.Client_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored) self.Client_list.setObjectName("Client_list") del_client.setCentralWidget(self.centralwidget) self.retranslateUi(del_client) QtCore.QMetaObject.connectSlotsByName(del_client) def retranslateUi(self, del_client): _translate = QtCore.QCoreApplication.translate del_client.setWindowTitle(_translate("del_client", "Удаление клиента")) self.label_FIO.setText(_translate("del_client", "Введите ФИО")) self.label_contract.setText(_translate("del_client", "Номер договора")) self.find_client_btn.setText(_translate("del_client", "Найти")) self.back_to_client_btn.setText(_translate("del_client", "Вернуться в меню клиента")) self.label_FIO_2.setText(_translate("del_client", "или")) self.red_client_btn.setText(_translate("del_client", "Удалить"))
class Ui_red_client(object): def fill_list(self): '''заполняет список''' self.Client_list.clear() fio = self.FIO_line.text() code = self.Contract_number_line.text() if fio != "": mas = dbd.search_student_by_fio(fio) if code != "": mas = dbd.search_student_by_code(code) i = 1 for person in mas: self.Client_list.addItem(str(i) + '. ФИО: ' + person[1]['ФИО'] + '\n' \ + 'Общежитие: ' + str(person[1]['Общежитие']) + '\n' \ + 'Адрес прописки: ' + str(person[1]['Адрес регистрации']) + '\n' \ + 'Комната: ' + str(person[1]['Комната']) \ + ' Пол: ' + str(person[1]['Пол']) + '\n') i = i + 1 def redaction(self): # добавляет в буфер студента, который будет редактироваться, в red_client_2 из буфера забираются данные и буфер удаляется fio = self.FIO_line.text() code = self.Contract_number_line.text() if fio != "": mas = dbd.search_student_by_fio(fio) if code != "": mas = dbd.search_student_by_code(code) n = self.Client_list.currentRow() i = -1 for person in mas: if i == n - 1: dic = person[0] hostel = str(person[1]['Общежитие']) fio = str(person[1]['ФИО']) phone = person[1]['Телефон'] passport = person[1]['Паспорт'] address = person[1]['Адрес регистрации'] educ_form = person[1]['Форма обучения'] sex = person[1]['Пол'] if 'Комната' in person[1]: room = person[1]['Комната'] else: room = '' i = i + 1 dbd.add_student_buffer(dic, fio, phone, passport, address, educ_form, sex, room, hostel) self.FIO_line.clear() self.Contract_number_line.clear() self.Client_list.clear() def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def openRed_client_2(self): from red_client_2 import Ui_red_client_2 self.window = QtWidgets.QMainWindow() self.ui = Ui_red_client_2() self.ui.setupUi(self.window) self.window.show() def setupUi(self, red_client): red_client.setObjectName("red_client") red_client.resize(680, 300) red_client.setMinimumSize(QtCore.QSize(680, 300)) red_client.setMaximumSize(QtCore.QSize(680, 300)) self.centralwidget = QtWidgets.QWidget(red_client) self.centralwidget.setObjectName("centralwidget") self.label_FIO = QtWidgets.QLabel(self.centralwidget) self.label_FIO.setGeometry(QtCore.QRect(60, 80, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO.setFont(font) self.label_FIO.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO.setObjectName("label_FIO") self.FIO_line = QtWidgets.QLineEdit(self.centralwidget) self.FIO_line.setGeometry(QtCore.QRect(220, 80, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.FIO_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.FIO_line.setFont(font) self.FIO_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.FIO_line.setText("") self.FIO_line.setObjectName("FIO_line") self.Contract_number_line = QtWidgets.QLineEdit(self.centralwidget) self.Contract_number_line.setGeometry(QtCore.QRect(220, 140, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.Contract_number_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Contract_number_line.setFont(font) self.Contract_number_line.setStyleSheet( "background-color: rgb(135, 206, 235);") self.Contract_number_line.setObjectName("Contract_number_line") self.label_contract = QtWidgets.QLabel(self.centralwidget) self.label_contract.setGeometry(QtCore.QRect(60, 140, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_contract.setFont(font) self.label_contract.setAlignment(QtCore.Qt.AlignCenter) self.label_contract.setObjectName("label_contract") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(120, 20, 431, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.find_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.find_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.find_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.find_client_btn.setFont(font) self.find_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.find_client_btn.setObjectName("find_client_btn") self.find_client_btn.clicked.connect(self.fill_list) self.horizontalLayout.addWidget(self.find_client_btn) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.back_to_client_btn.clicked.connect(red_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.label_FIO_2 = QtWidgets.QLabel(self.centralwidget) self.label_FIO_2.setGeometry(QtCore.QRect(60, 110, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO_2.setFont(font) self.label_FIO_2.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO_2.setObjectName("label_FIO_2") self.red_client_btn = QtWidgets.QPushButton(self.centralwidget) self.red_client_btn.setGeometry(QtCore.QRect(500, 220, 175, 40)) self.red_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.red_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.red_client_btn.setFont(font) self.red_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.red_client_btn.setObjectName("red_client_btn") self.red_client_btn.clicked.connect(self.redaction) self.red_client_btn.clicked.connect(self.openRed_client_2) self.red_client_btn.clicked.connect(red_client.close) self.Client_list = QtWidgets.QListWidget(self.centralwidget) self.Client_list.setGeometry(QtCore.QRect(60, 200, 420, 80)) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(21) sizePolicy.setHeightForWidth( self.Client_list.sizePolicy().hasHeightForWidth()) self.Client_list.setSizePolicy(sizePolicy) self.Client_list.setMinimumSize(QtCore.QSize(420, 80)) self.Client_list.setMaximumSize(QtCore.QSize(420, 80)) self.Client_list.setSizeIncrement(QtCore.QSize(0, 80)) self.Client_list.setBaseSize(QtCore.QSize(0, 80)) font = QtGui.QFont() font.setFamily("MS Shell Dlg 2") font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Client_list.setFont(font) self.Client_list.setSizeAdjustPolicy( QtWidgets.QAbstractScrollArea.AdjustIgnored) self.Client_list.setObjectName("Client_list") red_client.setCentralWidget(self.centralwidget) self.retranslateUi(red_client) QtCore.QMetaObject.connectSlotsByName(red_client) def retranslateUi(self, red_client): _translate = QtCore.QCoreApplication.translate red_client.setWindowTitle( _translate("red_client", "Редактирование клиента")) self.label_FIO.setText(_translate("red_client", "Введите ФИО")) self.label_contract.setText(_translate("red_client", "Номер договора")) self.find_client_btn.setText(_translate("red_client", "Найти")) self.back_to_client_btn.setText( _translate("red_client", "Вернуться в меню клиента")) self.label_FIO_2.setText(_translate("red_client", "или")) self.red_client_btn.setText(_translate("red_client", "Редактирование"))
class Ui_list_client(object): def fill_list(self): '''заполняет список''' mas = dbd.list_off_all_students() i = 1 for person in mas: self.Client_info.addItem(str(i) + '. ФИО: ' + person[1]['ФИО'] + '\n' \ + 'Адрес прописки: ' + str(person[1]['Адрес регистрации']) + '\n' \ + 'Общежитие: ' + str(person[1]['Общежитие']) + '\n' \ + 'Комната: ' + str(person[1]['Комната']) + '\n' \ + 'Пол: ' + person[1]['Пол'] + '\n') i = i + 1 def export_to_exel(self): hat_data = [ "ФИО", "Общежитие", "Комната", "Пол", "Адрес регистрации", "Телефон", "Серия и номер паспорта", "Форма обучения", "Шифр Договора", "Дата начала", "Дата конца", "Льгота", "Стоимость" ] students_mas = dbd.list_off_all_students() export_file = xlwt.Workbook() sheet = export_file.add_sheet("Клиенты") i, j = 0, 0 for elem in hat_data: sheet.write(i, j, elem) j += 1 i, j = 1, 0 for student in students_mas: sheet.write(i, j, student[1]["ФИО"]) if student[1]["Общежитие"] != "": sheet.write(i, j + 1, student[1]["Общежитие"]) else: sheet.write(i, j + 1, "-") if student[1]["Комната"] != "": sheet.write(i, j + 2, student[1]["Комната"]) else: sheet.write(i, j + 2, "-") sheet.write(i, j + 3, student[1]["Пол"]) sheet.write(i, j + 4, student[1]["Адрес регистрации"]) sheet.write(i, j + 5, student[1]["Телефон"]) sheet.write(i, j + 6, student[1]["Паспорт"]) sheet.write(i, j + 7, student[1]["Форма обучения"]) contract_code = dbd.get_students_contract_num2(student[0]) if contract_code != "": contract = dbd.search_contract_by_code(contract_code) sheet.write(i, j + 8, contract[2]["Шифр"]) sheet.write(i, j + 9, contract[2]["Дата начала"]) sheet.write(i, j + 10, contract[2]["Дата конца"]) sheet.write(i, j + 11, contract[2]["Льгота"]) sheet.write(i, j + 12, int(contract[2]["Стоимость"])) else: sheet.write(i, j + 8, "-") sheet.write(i, j + 9, "-") sheet.write(i, j + 10, "-") sheet.write(i, j + 11, "-") sheet.write(i, j + 12, "-") i += 1 try: os.mkdir("exports") except: pass export_file.save("exports/Клиенты.xls") from success_action import Ui_Error self.window = QtWidgets.QMainWindow() self.ui = Ui_Error() self.ui.setupUi(self.window) self.window.show() def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def setupUi(self, list_client): list_client.setObjectName("list_client") list_client.resize(480, 491) list_client.setMinimumSize(QtCore.QSize(300, 300)) list_client.setMaximumSize(QtCore.QSize(1000, 500)) self.centralwidget = QtWidgets.QWidget(list_client) self.centralwidget.setObjectName("centralwidget") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(20, 20, 445, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.import_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.import_client_btn.setMinimumSize(QtCore.QSize(213, 40)) self.import_client_btn.setMaximumSize(QtCore.QSize(213, 16777215)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.import_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.import_client_btn.setFont(font) self.import_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.import_client_btn.setObjectName("import_client_btn") self.horizontalLayout.addWidget(self.import_client_btn) self.horizontalLayout.addWidget(self.import_client_btn) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(213, 40)) self.back_to_client_btn.setMaximumSize(QtCore.QSize(213, 16777215)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.import_client_btn.clicked.connect(self.export_to_exel) self.back_to_client_btn.clicked.connect(list_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.Client_info = QtWidgets.QListWidget(self.centralwidget) self.Client_info.setGeometry(QtCore.QRect(20, 89, 440, 371)) self.Client_info.setAutoFillBackground(False) self.Client_info.setStyleSheet("font: 75 10pt \"MS Shell Dlg 2\";\n" "selection-color: rgb(85, 170, 255);") self.Client_info.setObjectName("Client_info") item = QtWidgets.QListWidgetItem() item = QtWidgets.QListWidgetItem() list_client.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(list_client) self.statusbar.setObjectName("statusbar") list_client.setStatusBar(self.statusbar) self.retranslateUi(list_client) QtCore.QMetaObject.connectSlotsByName(list_client) self.fill_list() def retranslateUi(self, list_client): _translate = QtCore.QCoreApplication.translate list_client.setWindowTitle(_translate("list_client", "Список клиентов")) self.import_client_btn.setText( _translate("list_client", "Экспортировать в Excel")) self.back_to_client_btn.setText( _translate("list_client", "Вернуться в меню клиента")) __sortingEnabled = self.Client_info.isSortingEnabled() self.Client_info.setSortingEnabled(False) self.Client_info.setSortingEnabled(__sortingEnabled)
class Ui_list_client(object): def fill_list(self): '''заполняет список''' mas = dbd.list_student() for person in mas: self.Client_info.addItem('ФИО: ' + person[3]['ФИО'] + '\n' \ + 'Общежитие: ' + person[1] + ', Комната: ' + person[2] + '\n' \ + 'Пол: ' + person[3]['Пол']) def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def setupUi(self, list_client): list_client.setObjectName("list_client") list_client.resize(480, 491) list_client.setMinimumSize(QtCore.QSize(300, 300)) list_client.setMaximumSize(QtCore.QSize(1000, 500)) self.centralwidget = QtWidgets.QWidget(list_client) self.centralwidget.setObjectName("centralwidget") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(20, 20, 445, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.import_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.import_client_btn.setMinimumSize(QtCore.QSize(213, 40)) self.import_client_btn.setMaximumSize(QtCore.QSize(213, 16777215)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.import_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.import_client_btn.setFont(font) self.import_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.import_client_btn.setObjectName("import_client_btn") self.horizontalLayout.addWidget(self.import_client_btn) self.horizontalLayout.addWidget(self.import_client_btn) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(213, 40)) self.back_to_client_btn.setMaximumSize(QtCore.QSize(213, 16777215)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.back_to_client_btn.clicked.connect(list_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.Client_info = QtWidgets.QListWidget(self.centralwidget) self.Client_info.setGeometry(QtCore.QRect(20, 89, 440, 371)) self.Client_info.setAutoFillBackground(False) self.Client_info.setStyleSheet("font: 75 10pt \"MS Shell Dlg 2\";\n" "selection-color: rgb(85, 170, 255);") self.Client_info.setObjectName("Client_info") item = QtWidgets.QListWidgetItem() item = QtWidgets.QListWidgetItem() list_client.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(list_client) self.statusbar.setObjectName("statusbar") list_client.setStatusBar(self.statusbar) self.retranslateUi(list_client) QtCore.QMetaObject.connectSlotsByName(list_client) self.fill_list() def retranslateUi(self, list_client): _translate = QtCore.QCoreApplication.translate list_client.setWindowTitle(_translate("list_client", "Список клиентов")) self.import_client_btn.setText( _translate("list_client", "Импортировать в Excel")) self.back_to_client_btn.setText( _translate("list_client", "Вернуться в меню клиента")) __sortingEnabled = self.Client_info.isSortingEnabled() self.Client_info.setSortingEnabled(False) self.Client_info.setSortingEnabled(__sortingEnabled)
class Ui_red_client(object): def openClient(self): from Client import Ui_Client self.window = QtWidgets.QMainWindow() self.ui = Ui_Client() self.ui.setupUi(self.window) self.window.show() def openRed_client_2(self): from red_client_2 import Ui_red_client_2 self.window = QtWidgets.QMainWindow() self.ui = Ui_red_client_2() self.ui.setupUi(self.window) self.window.show() def setupUi(self, red_client): red_client.setObjectName("red_client") red_client.resize(680, 300) red_client.setMinimumSize(QtCore.QSize(680, 300)) red_client.setMaximumSize(QtCore.QSize(680, 300)) self.centralwidget = QtWidgets.QWidget(red_client) self.centralwidget.setObjectName("centralwidget") self.label_FIO = QtWidgets.QLabel(self.centralwidget) self.label_FIO.setGeometry(QtCore.QRect(60, 80, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO.setFont(font) self.label_FIO.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO.setObjectName("label_FIO") self.FIO_line = QtWidgets.QLineEdit(self.centralwidget) self.FIO_line.setGeometry(QtCore.QRect(220, 80, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.FIO_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.FIO_line.setFont(font) self.FIO_line.setStyleSheet("background-color: rgb(135, 206, 235);") self.FIO_line.setText("") self.FIO_line.setObjectName("FIO_line") self.Contract_number_line = QtWidgets.QLineEdit(self.centralwidget) self.Contract_number_line.setGeometry(QtCore.QRect(220, 140, 400, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.Contract_number_line.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Contract_number_line.setFont(font) self.Contract_number_line.setStyleSheet( "background-color: rgb(135, 206, 235);") self.Contract_number_line.setObjectName("Contract_number_line") self.label_contract = QtWidgets.QLabel(self.centralwidget) self.label_contract.setGeometry(QtCore.QRect(60, 140, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_contract.setFont(font) self.label_contract.setAlignment(QtCore.Qt.AlignCenter) self.label_contract.setObjectName("label_contract") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(120, 20, 431, 42)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(17) self.horizontalLayout.setObjectName("horizontalLayout") self.find_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.find_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.find_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.find_client_btn.setFont(font) self.find_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.find_client_btn.setObjectName("find_client_btn") self.horizontalLayout.addWidget(self.find_client_btn) self.back_to_client_btn = QtWidgets.QPushButton(self.layoutWidget) self.back_to_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.back_to_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.back_to_client_btn.setFont(font) self.back_to_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.back_to_client_btn.setObjectName("back_to_client_btn") self.back_to_client_btn.clicked.connect(self.openClient) self.back_to_client_btn.clicked.connect(red_client.close) self.horizontalLayout.addWidget(self.back_to_client_btn) self.label_FIO_2 = QtWidgets.QLabel(self.centralwidget) self.label_FIO_2.setGeometry(QtCore.QRect(60, 110, 130, 30)) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.label_FIO_2.setFont(font) self.label_FIO_2.setAlignment(QtCore.Qt.AlignCenter) self.label_FIO_2.setObjectName("label_FIO_2") self.red_client_btn = QtWidgets.QPushButton(self.centralwidget) self.red_client_btn.setGeometry(QtCore.QRect(480, 210, 195, 40)) self.red_client_btn.setMinimumSize(QtCore.QSize(150, 40)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(135, 206, 235)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.red_client_btn.setPalette(palette) font = QtGui.QFont() font.setPointSize(11) font.setBold(True) font.setWeight(75) self.red_client_btn.setFont(font) self.red_client_btn.setStyleSheet( "background-color: rgb(135, 206, 235);") self.red_client_btn.setObjectName("red_client_btn") self.red_client_btn.clicked.connect(self.openRed_client_2) self.red_client_btn.clicked.connect(red_client.close) self.Client_list = QtWidgets.QListWidget(self.centralwidget) self.Client_list.setGeometry(QtCore.QRect(60, 200, 400, 60)) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(21) sizePolicy.setHeightForWidth( self.Client_list.sizePolicy().hasHeightForWidth()) self.Client_list.setSizePolicy(sizePolicy) self.Client_list.setMinimumSize(QtCore.QSize(400, 30)) self.Client_list.setMaximumSize(QtCore.QSize(400, 60)) self.Client_list.setSizeIncrement(QtCore.QSize(0, 30)) self.Client_list.setBaseSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setFamily("MS Shell Dlg 2") font.setPointSize(11) font.setBold(True) font.setWeight(75) self.Client_list.setFont(font) self.Client_list.setSizeAdjustPolicy( QtWidgets.QAbstractScrollArea.AdjustIgnored) self.Client_list.setObjectName("Client_list") red_client.setCentralWidget(self.centralwidget) self.retranslateUi(red_client) QtCore.QMetaObject.connectSlotsByName(red_client) def retranslateUi(self, red_client): _translate = QtCore.QCoreApplication.translate red_client.setWindowTitle( _translate("red_client", "Редактирование клиента")) self.label_FIO.setText(_translate("red_client", "Введите ФИО")) self.label_contract.setText(_translate("red_client", "Номер договора")) self.find_client_btn.setText(_translate("red_client", "Найти")) self.back_to_client_btn.setText( _translate("red_client", "Вернуться в меню клиента")) self.label_FIO_2.setText(_translate("red_client", "или")) self.red_client_btn.setText(_translate("red_client", "Редактировать"))