Bug 399

Summary: Incorrect return when list studentJoinedEvent
Product: Event Management System Reporter: mankitse3-c
Component: BackendAssignee: mankitse3-c
Status: CONFIRMED ---    
Severity: enhancement    
Priority: ---    
Version: 1   
Hardware: PC   
OS: Windows   

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")) {
..
}