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.DateTime
loginEnd
private static org.joda.time.DateTime
loginStart
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description org.joda.time.DateTime
getEndTime()
Getter method for the currently set log in end time.org.joda.time.DateTime
getStartTime()
Getter method for the currently set log in start time.private boolean
isValidLoginDate()
Checks if the current time is within the allocated time forStudent
s to log in.void
print()
Displays Login view forUser
, checks the credentials and then logs in the User if the credentials are valid.static void
setLoginTime(org.joda.time.DateTime start, org.joda.time.DateTime end)
Assigns the period of time that theStudent
can 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 theStudent
can log in.- Parameters:
start
- login time inDateTime
format.end
- logout time inDateTime
format.- 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 forStudent
s to log in.- Returns:
true
if current time is within allocated time.
-