Bug 399 - Incorrect return when list studentJoinedEvent
Summary: Incorrect return when list studentJoinedEvent
Status: CONFIRMED
Alias: None
Product: Event Management System
Classification: Unclassified
Component: Backend (show other bugs)
Version: 1
Hardware: PC Windows
: --- enhancement
Assignee: mankitse3-c
URL:
Depends on:
Blocks:
 
Reported: 2020-11-10 23:21 HKT by mankitse3-c
Modified: 2020-11-11 00:06 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mankitse3-c 2020-11-10 23:21:02 HKT
List studentJoinedEvent command does not work. When I use the list studentJoinedEvent command, whatever I type 'all', 'pending' or 'end' at the end of the command, it will detect as a wrong command.

==========================================================================
Welcome to the Event Management System
Please input today date (e.g. 01-jan-2020).
10-Nov-2020
SystemDate confirm: 10-Nov-2020
Please enter your command: 
create student s12345678 cs mary chan F 19
Created student mary chan with StudentID: s12345678.
Please enter your command: 
list studentJoinedEvent s12345678 all
|s12345678|mary                |chan                |F  |Computer Science              |19 |

Wrong Command
List student joined event command should be "list studentJoinedEvent sXXXXXXXX all" or "list studentJoinedEvent sXXXXXXXX pending" or "list studentJoinedEvent sXXXXXXXX end"

Please enter your command: 
list studentJoinedEvent s12345678 pending
|s12345678|mary                |chan                |F  |Computer Science              |19 |

Wrong Command
List student joined event command should be "list studentJoinedEvent sXXXXXXXX all" or "list studentJoinedEvent sXXXXXXXX pending" or "list studentJoinedEvent sXXXXXXXX end"

Please enter your command: 
list studentJoinedEvent s12345678 end
|s12345678|mary                |chan                |F  |Computer Science              |19 |

Wrong Command
List student joined event command should be "list studentJoinedEvent sXXXXXXXX all" or "list studentJoinedEvent sXXXXXXXX pending" or "list studentJoinedEvent sXXXXXXXX end"

Please enter your command: 
==========================================================================
Comment 1 mankitse3-c 2020-11-11 00:06:42 HKT
if(cmdParts[3] == "all") {
..
}
else if(cmdParts[3] == "pending") {
..
}
else if(cmdParts[3] == "end") {
..
}

change to 

if(cmdParts[3].equals("all")) {
..
}
else if(cmdParts[3].equals("pending")) {
..
}
else if(cmdParts[3].equals("end")) {
..
}