Package MySTARS
Class LoginView
java.lang.Object
MySTARS.View
MySTARS.LoginView
public final class LoginView extends View
Initial View seen by
User. Used to log in the User to the System.- Since:
- 2020-11-1
- Version:
- 1.0
- Author:
- Bhargav, Kah Ee
-
Field Summary
Fields Modifier and Type Field Description private static org.joda.time.DateTimeloginEndprivate static org.joda.time.DateTimeloginStart -
Constructor Summary
-
Method Summary
Modifier and Type Method Description org.joda.time.DateTimegetEndTime()Getter method for the currently set log in end time.org.joda.time.DateTimegetStartTime()Getter method for the currently set log in start time.private booleanisValidLoginDate()Checks if the current time is within the allocated time forStudents to log in.voidprint()Displays Login view forUser, checks the credentials and then logs in the User if the credentials are valid.static voidsetLoginTime(org.joda.time.DateTime start, org.joda.time.DateTime end)Assigns the period of time that theStudentcan log in.
-
Field Details
-
loginStart
private static org.joda.time.DateTime loginStart -
loginEnd
private static org.joda.time.DateTime loginEnd
-
-
Constructor Details
-
Method Details
-
getStartTime
public org.joda.time.DateTime getStartTime()Getter method for the currently set log in start time.- Returns:
- date in dd/MM/yyyy, time in HH:mm:ss.
-
getEndTime
public org.joda.time.DateTime getEndTime()Getter method for the currently set log in end time.- Returns:
- date in dd/MM/yyyy, time in hh:mm:ss.
-
print
public void print() -
setLoginTime
public static void setLoginTime(org.joda.time.DateTime start, org.joda.time.DateTime end) throws java.lang.ExceptionAssigns the period of time that theStudentcan log in.- Parameters:
start- login time inDateTimeformat.end- logout time inDateTimeformat.- Throws:
java.lang.Exception- Exception if Start time is after end time.
-
isValidLoginDate
private boolean isValidLoginDate()Checks if the current time is within the allocated time forStudents to log in.- Returns:
trueif current time is within allocated time.
-