public void displayMenu() { int choice = 0; while (choice != 9) { ConsoleHelper.OutputText("1. Add a message post\n" + "2. Add a photo or image post\n" + "3. Display all posts\n" + "4. Display posts by date\n" + "5. Display posts by author\n" + "6. Remove a post\n" + "7. Add comments for a post\n" + "8. like unlike posts\n" + "9. unlike posts\n" + "10. select post\n" + "11. Quit\n"); choice = ConsoleHelper.getMark(1, 11); if (choice == 1) { postMessage(); } else if (choice == 2) { postImage(); } else if (choice == 3) { displayAll(); } else if (choice == 4) { displayByDate(); } else if (choice == 5) { displayByAuthor(); } else if (choice == 6) { removePost(); } else if (choice == 7) { addComment(); } else if (choice == 8) { likePosts(); } else if (choice == 9) { unlikePosts(); } else if (choice == 10) { selectPost(); } } }
///<summary> /// Method dislikes posts. ///</summary> private void unlikePosts() { bool like = false; ConsoleHelper.OutputText("Enter Post ID: "); int postID = ConsoleHelper.getMark(1, 10); newsFeed.UnlikePost(postID); }
///<summary> /// Method adds comments. ///</summary> private void addComment() { ConsoleHelper.OutputText("Enter Post ID: "); int postID = ConsoleHelper.getMark(1, 10); ConsoleHelper.OutputText("Enter Comment: "); string comment = ConsoleHelper.InputText(); newsFeed.AddComment(postID, comment); }
///<summary> /// Method allows student marks to be entered. ///</summary> private void enterStudentMarks() { while (true) { ConsoleHelper.OutputText("Enter mark for student " + nextStudentID + " from 0 to 100, -1 to quit"); int mark = ConsoleHelper.getMark(-1, 100); if (mark == -1) { break; } addStudent(mark); } }