something
This commit is contained in:
@@ -69,7 +69,7 @@ ColumnLayout
|
|||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
property string name: "street"
|
property string name: "street"
|
||||||
id: street
|
id: streetid
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onTextChanged: isEmptyField()
|
onTextChanged: isEmptyField()
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
@@ -191,8 +191,6 @@ ColumnLayout
|
|||||||
editable: false
|
editable: false
|
||||||
model: btm
|
model: btm
|
||||||
textRole: "display"
|
textRole: "display"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -244,6 +242,7 @@ ColumnLayout
|
|||||||
{
|
{
|
||||||
new_business = JsLib.addBusiness(businessGrid)
|
new_business = JsLib.addBusiness(businessGrid)
|
||||||
bm.addBusiness(new_business)
|
bm.addBusiness(new_business)
|
||||||
|
appLoader.source = "CustomerTables.qml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -251,6 +250,7 @@ ColumnLayout
|
|||||||
var new_contact = JsLib.addBusiness(addContactLayout)
|
var new_contact = JsLib.addBusiness(addContactLayout)
|
||||||
bm.addBusiness(new_business)
|
bm.addBusiness(new_business)
|
||||||
bm.setContact(new_contact)
|
bm.setContact(new_contact)
|
||||||
|
appLoader.source = "CustomerTables.qml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,13 +265,13 @@ ColumnLayout
|
|||||||
|
|
||||||
function isEmptyField()
|
function isEmptyField()
|
||||||
{
|
{
|
||||||
if (!firmenName.text.trim() || !street.text.trim() || !city.text.trim())
|
if (!firmenName.text.trim() || !streetid.text.trim())
|
||||||
{
|
{
|
||||||
saveBtn.enabled = false
|
saveBtn.enabled = false
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!postcode.editText.trim() || !postcode.currentText)
|
if (!postcode.editText.trim() || !postcode.currentText || !city.editText.trim() || !city.currentText)
|
||||||
saveBtn.enabled = false
|
saveBtn.enabled = false
|
||||||
else
|
else
|
||||||
saveBtn.enabled = true
|
saveBtn.enabled = true
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ class BusinessDAO:
|
|||||||
|
|
||||||
def addBusiness(self, data):
|
def addBusiness(self, data):
|
||||||
try:
|
try:
|
||||||
print(data)
|
|
||||||
self.__cur.callproc("addBusiness", (json.dumps(data),))
|
self.__cur.callproc("addBusiness", (json.dumps(data),))
|
||||||
self.__con.commit()
|
self.__con.commit()
|
||||||
print(self.__cur.fetchall())
|
|
||||||
except mariadb.Error as e:
|
except mariadb.Error as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ class BusinessModel(QAbstractTableModel):
|
|||||||
|
|
||||||
@Slot(dict)
|
@Slot(dict)
|
||||||
def addBusiness(self, business):
|
def addBusiness(self, business):
|
||||||
# BusinessDAO().addBusiness(business)
|
BusinessDAO().addBusiness(business)
|
||||||
BusinessDAO().addPlz()
|
#BusinessDAO().addPlz()
|
||||||
|
|
||||||
|
|
||||||
@Slot(dict)
|
@Slot(dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user