Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Team 14 - IDATT1002
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Eirik Steira
Team 14 - IDATT1002
Commits
508f8793
Commit
508f8793
authored
5 years ago
by
Mads Lundegaard
Browse files
Options
Downloads
Patches
Plain Diff
Added signup methods on controller
parent
df41b0c2
No related branches found
Branches containing commit
No related tags found
2 merge requests
!104
Weekly merge to Master
,
!72
Remove service test
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/NTNU/IDATT1002/controllers/SignUp.java
+23
-4
23 additions, 4 deletions
src/main/java/NTNU/IDATT1002/controllers/SignUp.java
with
23 additions
and
4 deletions
src/main/java/NTNU/IDATT1002/controllers/SignUp.java
+
23
−
4
View file @
508f8793
package
NTNU.IDATT1002.controllers
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.Optional
;
import
NTNU.IDATT1002.App
;
import
NTNU.IDATT1002.models.User
;
import
NTNU.IDATT1002.service.UserService
;
import
javafx.event.ActionEvent
;
import
javafx.scene.control.Button
;
import
javafx.scene.control.DatePicker
;
...
...
@@ -26,6 +30,7 @@ public class SignUp {
public
TextField
signup_phoneCode
;
public
TextField
signup_phoneNr
;
public
DatePicker
signup_birthDate
;
public
UserService
userService
=
new
UserService
();
public
Button
signup_btn
;
...
...
@@ -35,8 +40,22 @@ public class SignUp {
* @throws IOException
*/
public
void
signup
(
ActionEvent
actionEvent
)
throws
IOException
{
//TODO: Verify that all fields is properly filled
//TODO: Register new user in database
App
.
setRoot
(
"login"
);
String
username
=
signup_username
.
getText
();
String
firstName
=
signup_firstName
.
getText
();
String
lastName
=
signup_lastName
.
getText
();
String
email
=
signup_email
.
getText
();
String
password
=
signup_password
.
getText
();
String
phoneCode
=
signup_phoneCode
.
getText
();
String
phoneNr
=
signup_phoneNr
.
getText
();
//TODO: Find out how to take date as a Date object
Date
date
=
new
Date
(
System
.
currentTimeMillis
());
if
(
userService
.
createUser
(
email
,
username
,
firstName
,
lastName
,
phoneCode
,
phoneNr
,
date
,
password
).
isPresent
())
{
//TODO: Return message to user to confirm that user has been succsessfully registered
App
.
setRoot
(
"login"
);
}
//TODO: Verify that all fields is properly filled. I think this will be done by Usermodel.
}
}
\ No newline at end of file
}
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