Package src.util
Class database
java.lang.Object
src.util.database
Database-Class used to write and read Data from the Database
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkAvailable
(String username, String email) Check if the username and email are availablestatic boolean
createAppointment
(user user, appointment appointment) Create an Appointmentstatic user
createUser
(user user) Create Userstatic boolean
deleteAppointment
(appointment appointment) Delete an Appointmentstatic boolean
deleteUser
(user user) Delete Userstatic ArrayList<appointment>
getAppointments
(user user) Get all Appointments of Userstatic ArrayList<appointment>
Get all Appointments that hasn't got an reminder email.Get all symptomsstatic user
Get userstatic user
getUserofAppointment
(int AppointmentID) Get User of AppointmentGet all users (to display them on the Admin Tab)static user
Login Method - Check if the user exist and if the password is correctstatic boolean
reminderSend
(appointment appointment) Save in the Database that the Remindermail of an Appointment was sentstatic boolean
shiftAppointment
(appointment appointment) Shift an Appointmentstatic boolean
updateUser
(user user) Update User
-
Constructor Details
-
database
public database()
-
-
Method Details
-
createAppointment
Create an Appointment- Parameters:
user
- the patient of the appointmentappointment
- the appointment object- Returns:
- true if the appointment was successfully created, otherwise false
-
shiftAppointment
Shift an Appointment- Parameters:
appointment
- the appointment object- Returns:
- true if the appointment was successfully shifted, otherwise false
-
deleteAppointment
Delete an Appointment- Parameters:
appointment
- the appointment object- Returns:
- true if the appointment was successfully deleted, otherwise false
-
getAppointments
Get all Appointments of User- Parameters:
user
- the user- Returns:
- ArrayList of Appointments of the user
-
getReminderNotSendAppointments
Get all Appointments that hasn't got an reminder email.- Returns:
- ArrayList of Appointments that hasn't got an reminder mail
-
reminderSend
Save in the Database that the Remindermail of an Appointment was sent- Parameters:
appointment
- the appointment for which the reminder-mail was sent- Returns:
- true if the remindercheck changed in the database, otherwise false
-
getUsersAsString
Get all users (to display them on the Admin Tab)- Returns:
- arraylist of all users
-
getUser
Get user- Parameters:
username
-- Returns:
- user object or null if user dosent exist
-
getUserofAppointment
Get User of Appointment- Parameters:
AppointmentID
-- Returns:
- the user of the appointment
-
createUser
Create User- Parameters:
user
- the new user- Returns:
- the new user with the updated id
-
updateUser
Update User- Parameters:
user
- the updated user object- Returns:
- true if the user was updated, otherwise false
-
login
Login Method - Check if the user exist and if the password is correct- Parameters:
username
-passwordCheck
- the password- Returns:
- user object and null if the username or password is wrong
-
checkAvailable
Check if the username and email are available- Parameters:
username
-email
-- Returns:
- true if the username and email are available, otherwise false
-
deleteUser
Delete User- Parameters:
user
- the user to delete- Returns:
- true if the user was deleted, otherwise false
-
getSymptoms
Get all symptoms- Returns:
- arraylist of all symptoms
-