added BusinessDAO

This commit is contained in:
2024-12-04 16:56:20 +01:00
parent 6e91637792
commit 50720596c6
11 changed files with 303 additions and 34668 deletions

View File

@@ -3,6 +3,8 @@ import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Fusion
import "../js/qmldict.js" as JsLib
ColumnLayout
{
Layout.fillWidth: true
@@ -17,6 +19,7 @@ ColumnLayout
}
CheckBox
{
id: checkAddContact
text: qsTr("Ansprechpartner hinzufügen")
Layout.alignment: Qt.AlignRight
checked: false
@@ -30,6 +33,7 @@ ColumnLayout
spacing: 45
GridLayout
{
id: businessGrid
columns: 2
Layout.fillWidth: true
Layout.fillHeight: true
@@ -37,6 +41,7 @@ ColumnLayout
Label
{
id: lblFirmenName
text: qsTr("Firmenname")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
@@ -46,6 +51,10 @@ ColumnLayout
id: firmenName
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
onTextChanged: isEmptyField()
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
@@ -58,6 +67,9 @@ ColumnLayout
{
id: street
Layout.fillWidth: true
onTextChanged: isEmptyField()
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
{
@@ -67,8 +79,14 @@ ColumnLayout
ComboBox
{
id: postcode
Layout.fillWidth: true
editable: true
onCurrentTextChanged: isEmptyField()
onEditTextChanged: isEmptyField()
model: ["test", "test2", "test3"]
}
Label
@@ -78,8 +96,11 @@ ColumnLayout
}
TextField
{
id: location
id: city
Layout.fillWidth: true
onTextChanged: isEmptyField(city)
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
@@ -137,10 +158,22 @@ ColumnLayout
Layout.fillWidth: true
}
Label
{
text: qsTr("Typ")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
Layout.fillWidth: true
editable: true
}
Label
{
text: qsTr("Info")
Layout.alignment: Qt.AlignRight | Qt.AlignTop
}
ScrollView
{
Layout.fillWidth: true
@@ -213,6 +246,7 @@ ColumnLayout
id: jobdescription
Layout.fillWidth: true
editable: true
}
Label
{
@@ -256,6 +290,7 @@ ColumnLayout
id: rank
Layout.fillWidth: true
editable: true
}
Label
{
@@ -267,6 +302,7 @@ ColumnLayout
id: invoice
Layout.fillWidth: true
editable: true
objectName: "combo"
}
Label
{
@@ -278,6 +314,7 @@ ColumnLayout
id: due
Layout.fillWidth: true
editable: true
}
}
}
@@ -293,7 +330,13 @@ ColumnLayout
}
Button
{
id: saveBtn
text: qsTr("Speichern")
enabled: false
onClicked:
{
JsLib.addBusiness(businessGrid)
}
}
}
@@ -302,4 +345,20 @@ ColumnLayout
id: spacer3
Layout.fillHeight: true
}
function isEmptyField()
{
if (!firmenName.text.trim() || !street.text.trim() || !city.text.trim())
{
saveBtn.enabled = false
}
else
{
if (!postcode.editText.trim() || !postcode.currentText)
saveBtn.enabled = false
else
saveBtn.enabled = true
}
}
}