Skip to content

Commit

Permalink
sw20-tug#8 NOTE_008 Mark as completed [ZZ, WS]
Browse files Browse the repository at this point in the history
zzoorrii authored May 13, 2020
1 parent cd5653f commit 31a9a1e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/asd_morning_9/note/JsonParser.java
Original file line number Diff line number Diff line change
@@ -441,6 +441,29 @@ private int getNewId()
return 0;
}

public void markAsCompleted(int id)
{
try
{
int it;
for(it = 0; it < notes_.size(); it++)
{
Note item = notes_.get(it);

if (item.getId() == id)
{
item.setCompleted(true);
item.setDate_when_completed();
return;
}
}
}
catch (Exception e)
{
System.out.println("[ERROR IN MARK AS COMPLETED] " + e.getMessage());
}
}


}

0 comments on commit 31a9a1e

Please sign in to comment.