Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmpt-370-group-project-group26
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eyan Cunningham (esc568)
cmpt-370-group-project-group26
Commits
472f3086
Commit
472f3086
authored
2 years ago
by
Michael Kish (mik586)
Browse files
Options
Downloads
Patches
Plain Diff
Revert "more input error checks"
This reverts commit
e16e6ba2
parent
28fc6783
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Revert "more input error checks"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SchedulerApp/src/main/java/com/example/schedulerapp/Controller.java
+9
-54
9 additions, 54 deletions
...pp/src/main/java/com/example/schedulerapp/Controller.java
with
9 additions
and
54 deletions
SchedulerApp/src/main/java/com/example/schedulerapp/Controller.java
+
9
−
54
View file @
472f3086
...
...
@@ -111,12 +111,6 @@ public class Controller {
TextField
timeOffReason
;
@FXML
Label
timeOffResponse
;
@FXML
TextField
addEmployeeEmail
;
@FXML
TextField
addEmployeePhoneNumber
;
@FXML
CheckBox
addEmployeeManager
;
boolean
isDaily
;
...
...
@@ -579,32 +573,10 @@ public class Controller {
public
void
addEmployeeClicked
(
MouseEvent
mouseEvent
)
{
String
firstName
=
addFirstName
.
getText
();
String
lastName
=
addLastName
.
getText
();
String
addEmail
=
addEmployeeEmail
.
getText
();
String
addPhoneNumber
=
addEmployeePhoneNumber
.
getText
();
boolean
addManager
=
addEmployeeManager
.
isSelected
();
if
(
firstName
.
isBlank
()
||
firstName
.
isEmpty
()){
showErrorMessage
(
"First name is blank. Please try again."
);
}
else
if
(
lastName
.
isEmpty
()
||
lastName
.
isBlank
()){
showErrorMessage
(
"Last name is blank. Please try again."
);
}
else
if
(
addEmail
.
isBlank
()
||
addEmail
.
isBlank
()){
showErrorMessage
(
"Email is blank. Please try again."
);
}
else
if
(
addPhoneNumber
.
isBlank
()
||
addPhoneNumber
.
isEmpty
()){
showErrorMessage
(
"Phone number is blank. Please try again"
);
}
else
if
(
addPhoneNumber
.
contains
(
"."
)
||
addPhoneNumber
.
contains
(
"-"
)
||
addPhoneNumber
.
contains
(
","
)
||
addPhoneNumber
.
contains
(
"/"
)){
showErrorMessage
(
"Phone number has illegal character. Please try again"
);
}
else
{
model
.
addEmployee
(
firstName
,
lastName
);
//int id = model.addEmployee(firstName, lastName);
//model.editEmployee(id,firstName,lastName,addManager,addEmail,addPhoneNumber,0.0f);
model
.
notifySubscribers
();
}
model
.
addEmployee
(
firstName
,
lastName
);
System
.
out
.
println
(
"Employee "
+
firstName
+
" "
+
lastName
+
" added to Staff. Welcome "
+
firstName
+
"!"
);
model
.
notifySubscribers
();
}
public
void
editEmployeeClicked
(
MouseEvent
mouseEvent
)
{
...
...
@@ -805,12 +777,10 @@ public class Controller {
VBox
tempVBox
=
new
VBox
();
tempVBox
.
setSpacing
(
20
);
tempVBox
.
setPadding
(
new
Insets
(
30
));
Label
positionLabel
=
new
Label
(
"Enter Position: "
);
TextField
tempPositionText
=
new
TextField
();
Label
wageLabel
=
new
Label
(
"Enter Wage: "
);
TextField
tempWageText
=
new
TextField
();
TextField
tempPositionText
=
new
TextField
(
"Enter Position Here"
);
TextField
tempWageText
=
new
TextField
(
"Enter Wage Here"
);
Button
addPositionSubmit
=
new
Button
(
"Submit"
);
tempVBox
.
getChildren
().
addAll
(
positionLabel
,
tempPositionText
,
wageLabel
,
tempWageText
,
addPositionSubmit
);
tempVBox
.
getChildren
().
addAll
(
tempPositionText
,
tempWageText
,
addPositionSubmit
);
Scene
tempScene
=
new
Scene
(
tempVBox
);
Stage
tempStage
=
new
Stage
();
tempStage
.
setScene
(
tempScene
);
...
...
@@ -818,23 +788,8 @@ public class Controller {
addPositionSubmit
.
setOnMouseClicked
(
new
EventHandler
<
MouseEvent
>()
{
@Override
public
void
handle
(
MouseEvent
mouseEvent
)
{
String
position
=
tempPositionText
.
getText
();
String
wage
=
tempWageText
.
getText
();
if
(
position
.
isEmpty
()
||
position
.
isBlank
()){
showErrorMessage
(
"Position is blank. Please try again."
);
}
else
if
(
wage
.
isBlank
()
||
wage
.
isEmpty
()){
showErrorMessage
(
"Wage is blank. Please try again."
);
}
else
{
try
{
Float
.
parseFloat
(
wage
);
System
.
out
.
println
(
model
.
addPosition
(
position
,
Float
.
parseFloat
(
wage
)));
tempStage
.
close
();
}
catch
(
NumberFormatException
e
){
showErrorMessage
(
"Wage is not a valid. Please try again."
);
}
}
System
.
out
.
println
(
model
.
addPosition
(
tempPositionText
.
getText
(),
Float
.
parseFloat
(
tempWageText
.
getText
())));
tempStage
.
close
();
}
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment