Skip to content

Commit

Permalink
solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Golder12 committed Sep 15, 2021
2 parents c2426f1 + b5a0364 commit b9a5fef
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions src/org/pahappa/systems/views/IReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,25 @@ public static void printIncidents(List<Incident> incidents, String type){

/**
* This method helps to call the update method to update an incident.
* @param incidents
* @param chosen
* @param incident
* @return
*/
public static Incident check(List<Incident> incidents, int chosen) {
public static Incident check(Incident incident) {
Scanner sc = new Scanner(System.in);
for (Incident item : incidents) {
if (item.getCounter() == chosen) {
System.out.println("Enter the new Title: ");
item.setTitle(sc.nextLine());
System.out.println("Choose 1 for Corruption Incident or 2 for Intervention incident");
int type3 = sc.nextInt();
sc.nextLine();
if (type3 == 1) {
item.setType(Type.RED_FLAG);
} else if (type3 == 2) {
item.setType(Type.INTERVENTION);
}
System.out.println("Enter the new Comment");
item.setComment(sc.nextLine());
return item;
}
System.out.println("Enter the new Title: ");
incident.setTitle(sc.nextLine());
System.out.println("Choose 1 for Corruption Incident or 2 for Intervention incident");
int type3 = sc.nextInt();
sc.nextLine();
if (type3 == 1) {
incident.setType(Type.RED_FLAG);
} else if (type3 == 2) {
incident.setType(Type.INTERVENTION);
}
return null;
System.out.println("Enter the new Comment");
incident.setComment(sc.nextLine());
return incident;

}

/**
Expand Down Expand Up @@ -119,7 +114,7 @@ public static void main(String[] args) throws Exception {
"Users can also report on things that needs government intervention...........\n" +
"*****************************************************\n" +
"WHAT WOULD YOU LIKE TO DO {SELECT AN OPTION}.\n");
boolean i =true;
boolean i =true;
while (i){
System.out.println("1. Get Incidents\n" +
"2. Create Record\n" +
Expand Down Expand Up @@ -235,7 +230,7 @@ public static void main(String[] args) throws Exception {
System.out.println("===== Please Choose the number of the incident to edit =====");
printIncidents(serviceHelper.getAllIncidents());
int chosen = sc.nextInt();
System.out.println(check(serviceHelper.getAllIncidents(), chosen));
System.out.println(check(serviceHelper.getAllIncidents().get(chosen-1)));

break;
case 4:
Expand Down

0 comments on commit b9a5fef

Please sign in to comment.