Validate applicant and call database procedure
This commit is contained in:
@@ -6,6 +6,20 @@ import TeroStyle
|
||||
ColumnLayout {
|
||||
readonly property int fieldM: 235
|
||||
readonly property int fieldS: 110
|
||||
readonly property bool valid: city.acceptableInput && email.acceptableInput && firstname.acceptableInput && lastname.acceptableInput && mobile.acceptableInput && phone.acceptableInput && postcode.acceptableInput && formofaddress.acceptableInput && title.acceptableInput
|
||||
readonly property var value: QtObject {
|
||||
readonly property string city: (city.editText ? city.editText : city.currentText) ?? ""
|
||||
readonly property string email: email.text
|
||||
readonly property string firstname: firstname.text
|
||||
readonly property string formofaddress: formofaddress.currentText ?? ""
|
||||
readonly property string houseno: houseno.text ?? ""
|
||||
readonly property string lastname: lastname.text
|
||||
readonly property string mobile: mobile.text
|
||||
readonly property string phone: phone.text
|
||||
readonly property string postcode: (postcode.editText ? postcode.editText : postcode.currentText) ?? ""
|
||||
readonly property string street: (street.editText ? street.editText : street.currentText) ?? ""
|
||||
readonly property string title: title.currentText
|
||||
}
|
||||
|
||||
spacing: Dimensions.l
|
||||
|
||||
@@ -34,31 +48,43 @@ ColumnLayout {
|
||||
onCurrentTextChanged: {
|
||||
switch (title.currentIndex) {
|
||||
case 1:
|
||||
salutation.text = "Sehr geehrter Herr ";
|
||||
formofaddress.text = "Sehr geehrter Herr ";
|
||||
break;
|
||||
case 2:
|
||||
salutation.text = "Sehr geehrte Frau ";
|
||||
formofaddress.text = "Sehr geehrte Frau ";
|
||||
break;
|
||||
default:
|
||||
salutation.text = "Guten Tag ";
|
||||
formofaddress.text = "Guten Tag ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Field {
|
||||
label: qsTr("Vorname*")
|
||||
label: qsTr("Vorname")
|
||||
mandatory: true
|
||||
|
||||
TextField {
|
||||
id: firstname
|
||||
|
||||
implicitWidth: fieldM
|
||||
placeholderText: "Max"
|
||||
placeholderText: qsTr("Max")
|
||||
|
||||
validator: NotEmptyValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
Field {
|
||||
label: qsTr("Nachname*")
|
||||
label: qsTr("Nachname")
|
||||
mandatory: true
|
||||
|
||||
TextField {
|
||||
id: lastname
|
||||
|
||||
implicitWidth: fieldM
|
||||
placeholderText: qsTr("Mustermann")
|
||||
|
||||
validator: NotEmptyValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +92,8 @@ ColumnLayout {
|
||||
spacing: Dimensions.m
|
||||
|
||||
Field {
|
||||
id: street
|
||||
|
||||
label: qsTr("Straße")
|
||||
|
||||
TextField {
|
||||
@@ -74,6 +102,8 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
Field {
|
||||
id: houseno
|
||||
|
||||
label: qsTr("Hausnummer")
|
||||
|
||||
TextField {
|
||||
@@ -86,6 +116,8 @@ ColumnLayout {
|
||||
|
||||
ComboBox {
|
||||
id: postcode
|
||||
|
||||
currentIndex: -1
|
||||
editable: true
|
||||
implicitWidth: fieldS
|
||||
model: address_model
|
||||
@@ -97,14 +129,19 @@ ColumnLayout {
|
||||
}
|
||||
Field {
|
||||
label: qsTr("Ort")
|
||||
mandatory: true
|
||||
|
||||
ComboBox {
|
||||
id: city
|
||||
|
||||
currentIndex: -1
|
||||
editable: true
|
||||
implicitWidth: fieldM
|
||||
model: address_model
|
||||
textRole: "city"
|
||||
|
||||
validator: NotEmptyValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,10 +162,12 @@ ColumnLayout {
|
||||
label: qsTr("Telefonnummer")
|
||||
|
||||
TextField {
|
||||
id: phone
|
||||
|
||||
implicitWidth: fieldM
|
||||
placeholderText: "+49 1234 567890"
|
||||
|
||||
validator: PhoneNumberValidator {
|
||||
validator: OptionalPhoneNumberValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,10 +175,12 @@ ColumnLayout {
|
||||
label: qsTr("Mobil")
|
||||
|
||||
TextField {
|
||||
id: mobile
|
||||
|
||||
implicitWidth: fieldM
|
||||
placeholderText: "+49 123 4567891011"
|
||||
|
||||
validator: PhoneNumberValidator {
|
||||
validator: OptionalPhoneNumberValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,10 +188,12 @@ ColumnLayout {
|
||||
label: qsTr("E-Mail Adresse")
|
||||
|
||||
TextField {
|
||||
id: email
|
||||
|
||||
implicitWidth: fieldM
|
||||
placeholderText: "tero@example.org"
|
||||
|
||||
validator: EmailAddressValidator {
|
||||
validator: OptionalEmailAddressValidator {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +201,7 @@ ColumnLayout {
|
||||
label: qsTr("Briefanrede")
|
||||
|
||||
TextField {
|
||||
id: salutation
|
||||
id: formofaddress
|
||||
|
||||
implicitWidth: fieldM
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user