forked from nus-cs2113-AY2122S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from tanweili/WeiLi-RefactorViewAppt
Refactor view appt
- Loading branch information
Showing
9 changed files
with
254 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/seedu/duke/helper/command/FindAppointmentCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package seedu.duke.helper.command; | ||
|
||
import seedu.duke.assets.AppointmentList; | ||
import seedu.duke.assets.List; | ||
import seedu.duke.status.Status; | ||
|
||
public class FindAppointmentCommand extends Command { | ||
public FindAppointmentCommand(String[] parameterArray) { | ||
super(parameterArray); | ||
} | ||
|
||
public Status execute(List appointmentList) { | ||
if (appointmentList instanceof AppointmentList) { | ||
switch (parameterArray[0]) { | ||
case "id": | ||
((AppointmentList) appointmentList).findById(parameterArray); | ||
break; | ||
case "patient nric": | ||
((AppointmentList) appointmentList).findByPatientNric(parameterArray); | ||
break; | ||
case "patient name": | ||
((AppointmentList) appointmentList).findByPatientName(parameterArray); | ||
break; | ||
case "doctor nric": | ||
((AppointmentList) appointmentList).findByDoctorNric(parameterArray); | ||
break; | ||
case "doctor name": | ||
((AppointmentList) appointmentList).findByDoctorName(parameterArray); | ||
break; | ||
case "date": | ||
((AppointmentList) appointmentList).findByAppointmentDate(parameterArray); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
return Status.FIND_MEDICINE_SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.