コード例 #1
0
    def updateStrStreet(self, n_street):

        if n_street != "":
            address_id = self.getStrAddressID()
            cursor = self.connection.cursor()

            update = ('UPDATE ADDRESS SET street="{}" WHERE id={};'.format(
                n_street, address_id))
            cursor.execute(update)
            self.connection.commit()

        else:
            nameError = UpdateManagerErrors.NameErrorWindow(self.getUsername())
            nameError.show()
            self.close()
コード例 #2
0
    def updateLastName(self, new_l_name):

        if new_l_name != "":
            cursor = self.connection.cursor()

            update = (
                'UPDATE USERR SET last_name="{}" WHERE username="******";'.format(
                    new_l_name, self.getUsername()))
            cursor.execute(update)
            self.connection.commit()

        else:
            nameError = UpdateManagerErrors.NameErrorWindow(self.getUsername())
            nameError.show()
            self.close()
コード例 #3
0
    def updateHouseNum(self, n_street_num):

        if CheckRegistration.validHouseNum(n_street_num):
            address_id = self.getStrAddressID()
            cursor = self.connection.cursor()

            update = ('UPDATE ADDRESS SET house_number={} WHERE id={};'.format(
                n_street_num, address_id))
            cursor.execute(update)
            self.connection.commit()

        else:
            houseError = UpdateManagerErrors.HouseErrorWindow(
                self.getUsername())
            houseError.show()
            self.close()
コード例 #4
0
    def updateStrMng(self, n_name):

        if n_name != "":
            store_id = self.getStoreID()
            cursor = self.connection.cursor()

            update = (
                'UPDATE GROCERYSTORE SET store_name="{}" WHERE store_id={};'.
                format(n_name, store_id))
            cursor.execute(update)
            self.connection.commit()

        else:
            nameError = UpdateManagerErrors.NameErrorWindow(self.getUsername())
            nameError.show()
            self.close()
コード例 #5
0
    def updateEmail(self, n_email):

        if CheckRegistration.validEmail(n_email):
            cursor = self.connection.cursor()

            update = (
                'UPDATE USERR SET email="{}" WHERE username="******";'.format(
                    n_email, self.getUsername()))
            cursor.execute(update)
            self.connection.commit()

        else:
            emailError = UpdateManagerErrors.EmailErrorWindow(
                self.getUsername())
            emailError.show()
            self.close()
コード例 #6
0
    def updatePassword(self, n_password, n_conf_password):

        if CheckRegistration.validPassword(n_password, n_conf_password):
            cursor = self.connection.cursor()

            update = (
                'UPDATE USERR SET password="******" WHERE username="******";'.format(
                    n_password, self.getUsername()))
            cursor.execute(update)
            self.connection.commit()

        else:
            passError = UpdateManagerErrors.PasswordErrorWindow(
                self.getUsername())
            passError.show()
            self.close()
コード例 #7
0
    def updatePhone(self, n_phone):

        if (len(n_phone) == 10 and n_phone.isdigit()):
            store_id = self.getStoreID()
            cursor = self.connection.cursor()

            update = (
                'UPDATE GROCERYSTORE SET phone={} WHERE store_id={};'.format(
                    n_phone, store_id))
            cursor.execute(update)
            self.connection.commit()

        else:
            emailError = UpdateManagerErrors.EmailErrorWindow(
                self.getUsername())
            emailError.show()
            self.close()
コード例 #8
0
    def updateUsername(self, n_username):

        if CheckRegistration.validUsername(n_username):
            cursor = self.connection.cursor()

            update = (
                'UPDATE USERR SET username="******" WHERE username="******";'.format(
                    n_username, self.getUsername()))
            cursor.execute(update)
            self.connection.commit()

            self.setUsername(n_username)

        else:
            userError = UpdateManagerErrors.UsernameErrorWindow(
                self.getUsername())
            userError.show()
            self.close()