Пример #1
0
    def ongletEntreprise(self, option):
        """
        Formulaire de saisie des infos par entreprise
        """
        # print(self.ongletEntreprise.__doc__)
        # =self.labelTextbox('Raison sociale',50)
        self.mdi = QMdiArea()
        self.setCentralWidget(self.mdi)
        diaEntreprise = QMdiSubWindow()

        diaEntreprise.left = 10
        diaEntreprise.top = 10
        diaEntreprise.width = 500
        diaEntreprise.height = 200

        diaEntreprise.rSocLabel = QLabel('Raison sociale', diaEntreprise)
        diaEntreprise.rSocLabel.move(50, 50)
        diaEntreprise.rSocTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.rSocTxBox.move(200, 50)
        # self.rSocTxBox.resize(220,50)
        rSoc = diaEntreprise.rSocTxBox.text()
        # return(valorTextbox)
        # adrP=self.labelTextbox('Adresse personelle',75)
        diaEntreprise.adrPLabel = QLabel('Adresse personelle', diaEntreprise)
        diaEntreprise.adrPLabel.move(50, 75)
        diaEntreprise.adrPTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.adrPTxBox.move(200, 75)
        # self.adrPTxBox.resize(220,75)
        adrP = diaEntreprise.adrPTxBox.text()
        # cpVi=self.labelTextbox('Code postal - Ville',100)
        diaEntreprise.cpViLabel = QLabel('Code postal - Ville', diaEntreprise)
        diaEntreprise.cpViLabel.move(50, 100)
        diaEntreprise.cpViTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.cpViTxBox.move(200, 100)
        # self.cpViTxBox.resize(220,100)
        cpVi = diaEntreprise.cpViTxBox.text()
        # telf=self.labelTextbox('Téléphone',125)
        diaEntreprise.telfLabel = QLabel('Téléphone', diaEntreprise)
        diaEntreprise.telfLabel.move(50, 125)
        diaEntreprise.telfTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.telfTxBox.move(200, 125)
        # self.telfTxBox.resize(220,125)
        telf = diaEntreprise.telfTxBox.text()
        # emel=self.labelTextbox('email',150)
        diaEntreprise.emelLabel = QLabel('email', diaEntreprise)
        diaEntreprise.emelLabel.move(50, 150)
        diaEntreprise.emelTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.emelTxBox.move(200, 150)
        # self.emelTxBox.resize(220,150)
        emel = diaEntreprise.emelTxBox.text()
        # rpst=self.labelTextbox('représentant',175)
        diaEntreprise.rpstLabel = QLabel('représentant', diaEntreprise)
        diaEntreprise.rpstLabel.move(50, 175)
        diaEntreprise.rpstTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.rpstTxBox.move(200, 175)
        # self.rpstTxBox.resize(220,175)
        rpst = diaEntreprise.rpstTxBox.text()
        # grpm=self.labelTextbox('groupement',200)
        diaEntreprise.grpmLabel = QLabel('groupement', diaEntreprise)
        diaEntreprise.grpmLabel.move(50, 200)
        diaEntreprise.grpmTxBox = QLineEdit(diaEntreprise)
        diaEntreprise.grpmTxBox.move(200, 200)
        # self.grpmTxBox.resize(220,200)
        grpm = diaEntreprise.grpmTxBox.text()

        diaEntreprise.lRadioTout = QLabel("Tout")
        diaEntreprise.lRadioTout.move(140, 240)
        diaEntreprise.bRadioTout = QRadioButton()
        # self.bRadioTout.setGeometry(QRect(190, 240, 61, 20))
        diaEntreprise.bRadioTout.setObjectName("bRadioTout")

        diaEntreprise.lRadioGenre = QLabel("Genre")
        diaEntreprise.lRadioTout.move(210, 240)
        diaEntreprise.bRadioGenre = QRadioButton()
        # self.bRadioGenre.setGeometry(QRect(260, 240, 71, 20))
        diaEntreprise.bRadioGenre.setObjectName("bRadioGenre")

        diaEntreprise.bValide = QPushButton('Valider', diaEntreprise)
        diaEntreprise.bValide.setToolTip('Valider la saisie')
        diaEntreprise.bValide.move(300, 450)
        diaEntreprise.bValide.clicked.connect(self.accept)
        # self.bValide.clicked.connect(self.on_click)

        diaEntreprise.bCancel = QPushButton('Abandon', diaEntreprise)
        diaEntreprise.bCancel.setToolTip('Abandonner la saisie')
        diaEntreprise.bCancel.move(400, 450)
        if (diaEntreprise.bCancel.clicked.connect(self.reject)):
            diaEntreprise.close

        self.mdi.addSubWindow(diaEntreprise)

        diaEntreprise.show()

        # AppBDgestEnvoiLivres.ajoutStructure([rSoc,adrP,cpVi,telf,emel,rpst,grpm])
        if (option == "ajout"):
            AppBDgestEnvoiLivres.ajoutStructure(
                [rSoc, adrP, cpVi, telf, emel, rpst, grpm])
        elif (option == "recherche"):
            AppBDgestEnvoiLivres.recherche(
                Structure([rSoc, adrP, cpVi, telf, emel, rpst, grpm]))

        # print(self.ongletEntreprise.__module__)

        return ([rSoc, adrP, cpVi, telf, emel, rpst, grpm])
Пример #2
0
    def ongletContact(self, option):
        """
        Formulaire de saisie des infos par contact
        """
        # print(self.ongletContact.__doc__)
        self.mdi = QMdiArea()
        self.setCentralWidget(self.mdi)
        diaContact = QMdiSubWindow()

        diaContact.left = 10
        diaContact.top = 10
        diaContact.width = 500
        diaContact.height = 200

        # =self.labelTextbox('Raison sociale',50)
        diaContact.nomPLabel = QLabel('Nom prénom', diaContact)
        diaContact.nomPLabel.move(50, 50)
        diaContact.nomPTxBox = QLineEdit(diaContact)
        diaContact.nomPTxBox.move(200, 50)
        # self.rSocTxBox.resize(220,50)
        nomP = diaContact.nomPTxBox.text(
        )  # adrP=self.labelTextbox('Adresse personelle',75)
        diaContact.adrPLabel = QLabel('Adresse personelle', diaContact)
        diaContact.adrPLabel.move(50, 75)
        diaContact.adrPTxBox = QLineEdit(diaContact)
        diaContact.adrPTxBox.move(200, 75)
        # self.adrPTxBox.resize(220,75)
        adrP = diaContact.adrPTxBox.text()
        # cpVi=self.labelTextbox('Code postal - Ville',100)
        diaContact.cpViLabel = QLabel('Code postal - Ville', diaContact)
        diaContact.cpViLabel.move(50, 100)
        diaContact.cpViTxBox = QLineEdit(diaContact)
        diaContact.cpViTxBox.move(200, 100)
        # self.cpViTxBox.resize(220,100)
        cpVi = diaContact.cpViTxBox.text()
        # telf=self.labelTextbox('Téléphone',125)
        diaContact.telfLabel = QLabel('Téléphone', diaContact)
        diaContact.telfLabel.move(50, 125)
        diaContact.telfTxBox = QLineEdit(diaContact)
        diaContact.telfTxBox.move(200, 125)
        # self.telfTxBox.resize(220,125)
        telf = diaContact.telfTxBox.text()
        # emel=self.labelTextbox('email',150)
        diaContact.emelLabel = QLabel('email', diaContact)
        diaContact.emelLabel.move(50, 150)
        diaContact.emelTxBox = QLineEdit(diaContact)
        diaContact.emelTxBox.move(200, 150)
        # self.emelTxBox.resize(220,150)
        emel = diaContact.emelTxBox.text()
        # print(self.ongletContact.__module__)

        diaContact.bValide = QPushButton('Valider', diaContact)
        diaContact.bValide.setToolTip('Valider la saisie')
        diaContact.bValide.move(300, 200)
        diaContact.bValide.clicked.connect(self.accept)
        # self.bValide.clicked.connect(self.on_click)

        diaContact.bCancel = QPushButton('Abandon', diaContact)
        diaContact.bCancel.setToolTip('Abandonner la saisie')
        diaContact.bCancel.move(400, 200)
        diaContact.bCancel.clicked.connect(self.reject)

        self.mdi.addSubWindow(diaContact)

        diaContact.show()
        if (option == "ajout"):
            AppBDgestEnvoiLivres.ajoutContact([nomP, adrP, cpVi, telf, emel])
        elif (option == "recherche"):
            AppBDgestEnvoiLivres.recherche("contacts")

        return ([nomP, adrP, cpVi, telf, emel])