something

This commit is contained in:
2024-12-10 14:25:37 +01:00
parent d25d4861f9
commit 6fd0c5e770
3 changed files with 9 additions and 9 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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)