Validate applicant and call database procedure
This commit is contained in:
@@ -7,12 +7,7 @@ ColumnLayout {
|
||||
id: colPar
|
||||
|
||||
function checkFields() {
|
||||
if (radio.children[1].checked) {
|
||||
if (!personalData.checkPersonalField())
|
||||
saveBtn.enabled = false;
|
||||
else
|
||||
saveBtn.enabled = true;
|
||||
} else if (!personalData.checkPersonalField())
|
||||
if (!personalData.checkPersonalField())
|
||||
saveBtn.enabled = false;
|
||||
else
|
||||
saveBtn.enabled = true;
|
||||
@@ -49,20 +44,6 @@ ColumnLayout {
|
||||
personalData.requiredField();
|
||||
}
|
||||
}
|
||||
Row {
|
||||
id: radio
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
//Layout.columnSpan: 2
|
||||
RadioButton {
|
||||
checked: true
|
||||
text: qsTr("Bewerber")
|
||||
}
|
||||
RadioButton {
|
||||
text: qsTr("Mitarbeiter")
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 50
|
||||
@@ -121,22 +102,8 @@ ColumnLayout {
|
||||
text: qsTr("Speichern")
|
||||
|
||||
onClicked: {
|
||||
var new_applicant;
|
||||
if (radio.children[0].checked) {
|
||||
// Ein Bewerber
|
||||
new_applicant = JsLib.parseForm(personalData);
|
||||
employee_model.addEmployee(new_applicant, true);
|
||||
// appLoader.source = "EmployeeTable.qml"
|
||||
// console.log(JSON.stringify (new_applicant))
|
||||
} else {
|
||||
// Ein Mitarbeiter
|
||||
// console.log(personalData, bankAccount, nationalInsurance, applicantVarious)
|
||||
new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious);
|
||||
employee_model.addEmployee(new_applicant, false);
|
||||
// var new_contact = JsLib.addApplicant(addContactLayout)
|
||||
// contact_model.addContact(new_contact)
|
||||
// console.log(JSON.stringify (new_applicant))
|
||||
}
|
||||
const new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious);
|
||||
employee_model.addEmployee(new_applicant, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user