something
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user