Add employee in GUI and set up a dictionary for it
This commit is contained in:
@@ -3,7 +3,7 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
ApplicationWindow
|
||||
{
|
||||
id: addmitarbeiter
|
||||
id: addMitarbeiter
|
||||
title: qsTr("Objekt - Neuer Mitarbeiter")
|
||||
|
||||
ColumnLayout
|
||||
@@ -31,6 +31,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: assignee
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
@@ -40,6 +41,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: wage
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
@@ -49,6 +51,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: duration
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
@@ -58,6 +61,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: cleanDays
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
@@ -67,6 +71,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: tasks
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label
|
||||
@@ -76,6 +81,7 @@ ApplicationWindow
|
||||
}
|
||||
TextField
|
||||
{
|
||||
id: output
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
@@ -90,11 +96,30 @@ ApplicationWindow
|
||||
Button
|
||||
{
|
||||
text: qsTr("Abbrechen")
|
||||
onClicked: addMitarbeiter.close()
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: qsTr("Hinzufügen")
|
||||
onClicked:
|
||||
{
|
||||
if (assignee.text.trim() !== "" && duration.text.trim() !== "" && wage.text.trim() !== "" && cleanDays.text.trim() !== "" && tasks.text.trim() !== "" && output.text.trim() !== "")
|
||||
{
|
||||
var ne = {
|
||||
"assignee": assignee.text.trim(),
|
||||
"duration": duration.text.trim(),
|
||||
"wage": wage.text.trim(),
|
||||
"cleandays": cleanDays.text.trim(),
|
||||
"tasks": tasks.text.trim(),
|
||||
"output": output.text.trim(),
|
||||
};
|
||||
addMitarbeiter.addNewEmployee(ne)
|
||||
addMitarbeiter.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signal addNewEmployee(var new_employee)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user