def __init__(self, id): self.id = id super(AddFacility, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.bd = Orm() resens = self.bd.allresname() for res in resens: self.ui.comboBox.addItem(res) cons = self.bd.allconname() for con in cons: self.ui.comboBox_2.addItem(con) self.measure = self.bd.getmatwes(self.id) self.ui.comboBox_3.addItem("Да") self.ui.comboBox_3.addItem("Нет") self.ui.comboBox_4.addItem("Да") self.ui.comboBox_4.addItem("Нет") mer = "Ед. изм. " + str(self.measure) self.ui.label_6.setText(mer) self.ui.buttonBox.accepted.connect(self.add) self.ui.buttonBox.rejected.connect(self.close) self.bd = Orm()
def __init__(self, root, id=None, state=None): super().__init__(root) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows) self.ui.pushButton_2.clicked.connect(self.add) self.ui.pushButton.clicked.connect(self.delfac) self.setWindowModality(Qt.ApplicationModal) self.bd = Orm() self.state = state self.id = id if id: if self.state == 1: data = self.bd.allfac(self.id) elif self.state == 2: res = self.bd.getres(self.id) fio = res.name + " " + res.family[0] + ". " + res.patronymic[ 0] + '.' data = self.bd.resfacil(fio) elif self.state == 3: cons = self.bd.getcons(self.id) data = self.bd.consfacil(cons.facility) # self.id = id # data = self.bd.allfac(self.id) self.now(data) self.idfac = False
def __init__(self): super().__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows) self.state = 1 self.ui.pushButton.clicked.connect(self.addfac) self.ui.pushButton_2.clicked.connect(self.addmat) self.ui.pushButton_3.clicked.connect(self.delmat) self.ui.pushButton_4.clicked.connect(self.search) self.ui.pushButton_5.hide() self.ui.pushButton_5.clicked.connect(self.tomain) self.ui.pushButton_6.clicked.connect(self.update) # Материалы self.ui.pushButton_7.clicked.connect( self.constructionObject) # обьекты self.ui.pushButton_8.clicked.connect( self.responsible) # Ответсстевенные self.ui.pushButton_9.clicked.connect( self.addres) # добавить сотрудника self.ui.pushButton_10.clicked.connect(self.addcon) # добавить обьект self.ui.pushButton_9.hide() # добавить сотрудника self.ui.pushButton_10.hide() # добавить обьект self.bd = Orm() self.now(self.bd.allmat(), self.state) self.id = False
def __init__(self): super(AddResponsible, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.buttonBox.accepted.connect(self.add) self.ui.buttonBox.rejected.connect(self.close) self.bd = Orm()
def __init__(self): super(AddConstructionObject, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.buttonBox.accepted.connect(self.add) self.ui.buttonBox.rejected.connect(self.close) self.bd = Orm()
def __init__(self, root): super().__init__(root) self.win = root label = QtWidgets.QLabel('Введите название') self.edit = QtWidgets.QLineEdit() button = QtWidgets.QPushButton('Найти') button.clicked.connect(self.push) layout = QtWidgets.QVBoxLayout() layout.addWidget(label) layout.addWidget(self.edit) layout.addWidget(button) self.setLayout(layout) self.bd = Orm()
def __init__(self, id=None): super(AddPass, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.buttonBox.accepted.connect(self.add) self.ui.buttonBox.rejected.connect(self.close) self.bd = Orm() self.id = id if self.id: data = self.bd.get_change(self.id) self.ui.lineEdit_1.setText(str(data[0][1])) self.ui.lineEdit_2.setText(str(data[0][2])) self.ui.lineEdit_3.setText(str(data[0][3]))
def __init__(self): super(AddMaterial, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.comboBox.addItem("Да") self.ui.comboBox.addItem("Нет") self.ui.comboBox_2.addItem("Да") self.ui.comboBox_2.addItem("Нет") self.ui.buttonBox.accepted.connect(self.add) self.ui.buttonBox.rejected.connect(self.close) self.bd = Orm()
def __init__(self, parent=None): super().__init__(parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.tableWidget.setSelectionBehavior( QTableView.SelectionBehavior.SelectRows) self.ui.pushButton_1.clicked.connect(self.add_log) self.ui.pushButton_2.clicked.connect(self.del_log) self.ui.pushButton_3.clicked.connect(self.search) self.ui.pushButton_4.clicked.connect(self.to_main) self.ui.pushButton_5.clicked.connect(self.change_data) self.ui.pushButton_4.hide() self.id = False self.bd = Orm() self.now(self.bd.all_log())
def __init__(self, parent=None): super().__init__(parent) if not AdminPassword.chek_db(): label = QtWidgets.QLabel('Укажите пароль для доступа') self.chekAdmin = False else: label = QtWidgets.QLabel('Введите пароль') self.chekAdmin = True self.adb = AdminPassword() self.edit = QtWidgets.QLineEdit() button = QtWidgets.QPushButton('Ок') button.clicked.connect(self.push) layout = QtWidgets.QVBoxLayout() layout.addWidget(label) layout.addWidget(self.edit) layout.addWidget(button) self.setLayout(layout) self.bd = Orm()