From 6fd0c5e77052be69774ea09568090e79a575328ad55c82dd653dc3b58c443520 Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Tue, 10 Dec 2024 14:25:37 +0100 Subject: [PATCH] something --- Gui/AddCustomer.qml | 10 +++++----- lib/DB/BusinessDAO.py | 4 ++-- lib/DB/BusinessModel.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gui/AddCustomer.qml b/Gui/AddCustomer.qml index cb0a74b..4dcd783 100644 --- a/Gui/AddCustomer.qml +++ b/Gui/AddCustomer.qml @@ -69,7 +69,7 @@ ColumnLayout TextField { property string name: "street" - id: street + id: streetid Layout.fillWidth: true onTextChanged: isEmptyField() placeholderText: "Pflichtfeld" @@ -191,8 +191,6 @@ ColumnLayout editable: false model: btm textRole: "display" - - } Label { @@ -244,6 +242,7 @@ ColumnLayout { new_business = JsLib.addBusiness(businessGrid) bm.addBusiness(new_business) + appLoader.source = "CustomerTables.qml" } else { @@ -251,6 +250,7 @@ ColumnLayout var new_contact = JsLib.addBusiness(addContactLayout) bm.addBusiness(new_business) bm.setContact(new_contact) + appLoader.source = "CustomerTables.qml" } } @@ -265,13 +265,13 @@ ColumnLayout function isEmptyField() { - if (!firmenName.text.trim() || !street.text.trim() || !city.text.trim()) + if (!firmenName.text.trim() || !streetid.text.trim()) { saveBtn.enabled = false } else { - if (!postcode.editText.trim() || !postcode.currentText) + if (!postcode.editText.trim() || !postcode.currentText || !city.editText.trim() || !city.currentText) saveBtn.enabled = false else saveBtn.enabled = true diff --git a/lib/DB/BusinessDAO.py b/lib/DB/BusinessDAO.py index 7ecba97..349c82e 100644 --- a/lib/DB/BusinessDAO.py +++ b/lib/DB/BusinessDAO.py @@ -15,10 +15,10 @@ class BusinessDAO: def addBusiness(self, data): try: - print(data) + self.__cur.callproc("addBusiness", (json.dumps(data),)) self.__con.commit() - print(self.__cur.fetchall()) + except mariadb.Error as e: print(str(e)) diff --git a/lib/DB/BusinessModel.py b/lib/DB/BusinessModel.py index 76c50a3..d4ebb93 100644 --- a/lib/DB/BusinessModel.py +++ b/lib/DB/BusinessModel.py @@ -108,8 +108,8 @@ class BusinessModel(QAbstractTableModel): @Slot(dict) def addBusiness(self, business): - # BusinessDAO().addBusiness(business) - BusinessDAO().addPlz() + BusinessDAO().addBusiness(business) + #BusinessDAO().addPlz() @Slot(dict)