Exemplo n.º 1
0
class Ui_PersonelSil(QtWidgets.QDialog):
    signal = QtCore.pyqtSignal(int)
    def __init__(self):
        super(Ui_PersonelSil, self).__init__()
        self.yaz = VbagKur()
        self.setupUi()

    def setupUi(self):
        self.setObjectName("PersonelSil")
        self.resize(452, 197)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/rolix/dialog-error.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(icon)
        self.label = QtWidgets.QLabel(self)
        self.label.setGeometry(QtCore.QRect(10, 10, 121, 121))
        self.label.setText("")
        self.label.setPixmap(QtGui.QPixmap(":/rolix/dialog-error.png"))
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.listWidget = QtWidgets.QListWidget(self)
        self.listWidget.setGeometry(QtCore.QRect(120, 10, 311, 141))
        self.listWidget.setObjectName("listWidget")
        self.pushButton = QtWidgets.QPushButton(self)
        self.pushButton.setGeometry(QtCore.QRect(360, 160, 73, 23))
        self.pushButton.setObjectName("pushButton")
        self.personel_bul()

        self.retranslateUi()
        self.pushButton.clicked.connect(self.perisil)
        self.listWidget.itemDoubleClicked['QListWidgetItem*'].connect(self.perisil)
        QtCore.QMetaObject.connectSlotsByName(self)

    def personel_bul(self):
        sorgu = self.yaz.kolon_oku("ad", "personel")
        for i in range(len(sorgu)):
            self.listWidget.addItem(sorgu[i][0])

    def perisil(self):
        if mes.per_sil(self.listWidget.currentItem().text()) == True:
            self.yaz.kayit_sil("personel", "ad", self.listWidget.currentItem().text())
            self.listWidget.clear()
            self.personel_bul()
            self.on_changed_value(1)
        else:
            pass


    def retranslateUi(self):
        _translate = QtCore.QCoreApplication.translate
        self.setWindowTitle(_translate("PersonelSil", "Personel Sil"))
        self.pushButton.setText(_translate("PersonelSil", "Sil"))

    def on_changed_value(self, value):
        self.signal.emit(value)
Exemplo n.º 2
0
class Ui_BolgeYerSil(QtWidgets.QDialog):
    signal = QtCore.pyqtSignal(int)

    def __init__(self):
        super(Ui_BolgeYerSil, self).__init__()
        self.yaz = VbagKur()
        self.setupUi()

    def setupUi(self):
        self.setObjectName("BolgeYerSil")
        self.resize(632, 316)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/rolix/docky.png"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.setWindowIcon(icon)
        self.label = QtWidgets.QLabel(self)
        self.label.setGeometry(QtCore.QRect(10, 10, 91, 61))
        self.label.setText("")
        self.label.setPixmap(
            QtGui.QPixmap(":/rolix/scalable/package-remove.svg"))
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.groupBox = QtWidgets.QGroupBox(self)
        self.groupBox.setGeometry(QtCore.QRect(10, 80, 300, 225))
        self.groupBox.setObjectName("groupBox")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.listWidget = QtWidgets.QListWidget(self.groupBox)
        self.listWidget.setObjectName("listWidget")
        self.gridLayout_2.addWidget(self.listWidget, 0, 0, 1, 1)
        self.groupBox_2 = QtWidgets.QGroupBox(self)
        self.groupBox_2.setGeometry(QtCore.QRect(320, 80, 300, 225))
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout.setObjectName("gridLayout")
        self.listWidget_2 = QtWidgets.QListWidget(self.groupBox_2)
        self.listWidget_2.setObjectName("listWidget_2")
        self.gridLayout.addWidget(self.listWidget_2, 0, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(self)
        self.label_2.setGeometry(QtCore.QRect(100, 10, 511, 51))
        self.label_2.setObjectName("label_2")
        self.bilgi_listele()

        self.retranslateUi()
        self.listWidget.itemDoubleClicked.connect(self.silb)
        self.listWidget_2.itemDoubleClicked.connect(self.sily)
        QtCore.QMetaObject.connectSlotsByName(self)

    def bilgi_listele(self):
        self.listWidget.addItems(
            self.yaz.coklu_tup_temizle(self.yaz.kolon_oku("ad, kod", "bolge")))
        self.listWidget_2.addItems(
            self.yaz.coklu_tup_temizle(self.yaz.kolon_oku("ad", "yer")))

    def silb(self):
        if mes.yerbolsil(self.listWidget.currentItem().text()) == True:
            kay_no = self.yaz.komut(
                "select kod from bolge where ad='{}'".format(
                    self.listWidget.currentItem().text()))
            self.yaz.isle("delete from yer where kod ='{}'".format(kay_no[0]))
            self.yaz.kayit_sil("bolge", "ad",
                               self.listWidget.currentItem().text())
            self.listWidget.clear()
            self.listWidget_2.clear()
            self.bilgi_listele()
            self.on_changed_value(1)
        else:
            pass

    def sily(self):
        if mes.yerbolsil(self.listWidget_2.currentItem().text()) == True:
            self.yaz.kayit_sil("yer", "ad",
                               self.listWidget_2.currentItem().text())
            self.listWidget.clear()
            self.listWidget_2.clear()
            self.bilgi_listele()
            self.on_changed_value(2)
        else:
            pass

    def retranslateUi(self):
        _translate = QtCore.QCoreApplication.translate
        self.setWindowTitle(_translate("BolgeYerSil", "Bölge Ve Yer Sil"))
        self.groupBox.setTitle(_translate("BolgeYerSil", "Bölge Listesi"))
        self.groupBox_2.setTitle(_translate("BolgeYerSil", "Yer Listesi"))
        self.label_2.setText(
            _translate(
                "BolgeYerSil",
                "Veritabanından silmek istediğiniz Bölge veya Yer bilgisinin üzerine çift tıklayınız."
            ))

    def on_changed_value(self, value):
        self.signal.emit(value)
Exemplo n.º 3
0
class Ui_YerEkle(QtWidgets.QDialog):
    signal = QtCore.pyqtSignal(int)
    def __init__(self):
        super(Ui_YerEkle, self).__init__()
        self.yaz = VbagKur()
        self.setupUi()

    def setupUi(self):
        self.setObjectName("YerEkle")
        self.resize(367, 140)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/rolix/docky.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(icon)
        self.label = QtWidgets.QLabel(self)
        self.label.setGeometry(QtCore.QRect(10, 10, 100, 100))
        self.label.setText("")
        self.label.setPixmap(QtGui.QPixmap(":/rolix/docky.png"))
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(self)
        self.label_2.setGeometry(QtCore.QRect(140, 20, 60, 20))
        self.label_2.setObjectName("label_2")
        self.comboBox = QtWidgets.QComboBox(self)
        self.comboBox.setGeometry(QtCore.QRect(220, 20, 130, 22))
        self.comboBox.setObjectName("comboBox")
        self.label_3 = QtWidgets.QLabel(self)
        self.label_3.setGeometry(QtCore.QRect(140, 60, 60, 20))
        self.label_3.setObjectName("label_3")
        self.lineEdit = QtWidgets.QLineEdit(self)
        self.lineEdit.setGeometry(QtCore.QRect(220, 60, 130, 20))
        self.lineEdit.setObjectName("lineEdit")
        self.pushButton = QtWidgets.QPushButton(self)
        self.pushButton.setGeometry(QtCore.QRect(278, 95, 75, 23))
        self.pushButton.setObjectName("pushButton")
        self.bolge_listele()

        self.retranslateUi()
        self.pushButton.clicked.connect(self.yekle)
        QtCore.QMetaObject.connectSlotsByName(self)

    def bolge_listele(self):
        soru = self.yaz.kolon_oku("ad", "bolge")
        sonuc = self.yaz.veri_duzenle(soru)
        for i in range(len(sonuc)):
            self.comboBox.addItem(sonuc[i])

    def yekle(self):
        b = self.comboBox.currentText()
        vtbolge = self.yaz.tek_oku("bolge", "ad", b)
        self.yaz.yer_ekle(self.lineEdit.text(), vtbolge[0][1])
        mesaj = self.lineEdit.text() + " veritabanına eklendi."
        mes.uyari(mesaj, "Bilgilendirme")
        self.lineEdit.clear()
        self.on_changed_value(2)


    def retranslateUi(self):
        _translate = QtCore.QCoreApplication.translate
        self.setWindowTitle(_translate("YerEkle", "Yer ekle"))
        self.label_2.setText(_translate("YerEkle", "Bölgesi"))
        self.label_3.setText(_translate("YerEkle", "Yer Adı"))
        self.pushButton.setText(_translate("YerEkle", "Ekle"))

    def on_changed_value(self, value):
        self.signal.emit(value)