/// <summary> /// Menu Choices of what to do once you have selected the comment option. /// </summary> /// <param name="post"></param> public void MenuChoices(Post post) { Console.WriteLine("\nWhat would you like to do"); string[] choices = { "Like this post", "Unlike this post", "Comment on this post" }; int choice = ConsoleHelper.SelectChoice(choices); if (choice == 1) { post.Like(); Console.WriteLine("\nYour action has been recorded "); } else if (choice == 2) { post.Unlike(); Console.WriteLine("\nYour action has been recorded "); } else if (choice == 3) { Console.WriteLine("What comment would you like to add to this post "); string comment = Console.ReadLine(); post.AddComment(comment); Console.WriteLine("\nYour action has been recorded "); } }
public void InteractOptions(Post post) { Console.WriteLine("1.Like the post\n"); Console.WriteLine("2.Unlike the post\n"); Console.WriteLine("3.Comment on the post\n"); Console.Write("Which Options would you like to pick? > "); string value = Console.ReadLine(); Option = Convert.ToInt32(value); if (Option == 1) { post.Like(); Console.WriteLine("\nLiked!"); } else if (Option == 2) { post.Unlike(); Console.WriteLine("\nUnLiked!"); } else if (Option == 3) { Console.Write("\nLeave a Comment > "); string comment = Console.ReadLine(); post.AddComment(comment); Console.WriteLine("\nComment been added"); } }
/// <summary> /// Promts the user to enter a comment and adds it to a post. /// </summary> public static void AddComment(Post post) { Console.Write("\n Enter comment > "); string text = Console.ReadLine(); post.AddComment(text); BlueAlert = "\n -- Comment added --\n"; }
/// <summary> /// to add said comment onto anypost /// </summary> private void AddComment() { ConsoleHelper.OutputTitle("Add a comment"); int id = (int)ConsoleHelper.InputNumber("Now can you enter the id of post you want to comment on: "); Console.WriteLine("Please enter your comment: "); string comment = Console.ReadLine(); Post post = news.FindPost(id); post.AddComment(comment); }
/// <summary> /// where the user adds a Comment onto a post /// </summary> private void Comment() { Console.WriteLine("Comment on a Post"); Post post = FindPost(); post.Display(); Console.WriteLine("Please Enter your Comment"); string comment = Console.ReadLine(); post.AddComment(comment); }
/// <summary> /// a method to add a comment to a post /// </summary> private void AddComment() { ConsoleHelper.OutputTitle("Adding a Comment"); Post post = FindPost(); post.Display(); Console.WriteLine("Enter Comment > "); string comment = Console.ReadLine(); post.AddComment(comment); }
/// <summary> /// Adds a comment /// </summary> private void AddComment() { Console.WriteLine("Add a comment to a post"); Post post = FindPost(); post.Display(); Console.WriteLine("Enter your comment: "); string comment = Console.ReadLine(); post.AddComment(comment); }
public void AddComment(int id, string comment) { Post post = FindPost(id); if (post == null) { Console.WriteLine($"\nPost with ID number {id} doesn not exist"); } else { Console.WriteLine($"\nComment added to post ID {id}"); post.AddComment(comment); } }
/// <summary> /// Add comments based on the post id /// then add text on the post /// </summary> public void AddPostComment(int id, string text) { Post post = FindPost(id); if (post == null) { Console.WriteLine($"\nPost with ID: {id} does not exist!\n"); } else { Console.WriteLine($"\nThe following comment have been added to post {id}!\n"); post.AddComment(text); post.Display(); } }
/// <summary> /// Adds a comment to a post with particular id /// </summary> /// <param name="id"></param> public void AddComment(int id) { Post post = FindPost(id); if (post == null) { Console.WriteLine("Post with id ", id, " does not exist."); } else { Console.WriteLine("Adding a comment..."); Console.Write("Please enter your comment: "); string text = Console.ReadLine(); post.AddComment(text); } }
/// <summary> /// Add a comment to a post /// </summary> private void AddComment() { int id = (int)ConsoleHelper.InputNumber("\n\tPlease Enter The ID of the Post you wish to Comment on: "); Post post = news.FindPost(id); if (post != null) { Console.Write("\n\tPlease Enter Your Comment: "); string comment = Console.ReadLine(); post.AddComment(comment); } else { Console.WriteLine("Post Number Does Not Exsist"); } ConsoleHelper.OutputTitle("Comment Added"); }
/// <summary> /// This allows the user to add a comment /// on any existing post through inputing the ID /// </summary> private void AddComment() { int id = (int)ConsoleHelper.InputNumber(" Please enter " + "the ID of the Post you wish to Comment on > "); Post post = news.FindPost(id); if (post != null) { Console.Write(" Please Enter Your Comment > "); string comment = Console.ReadLine(); post.AddComment(comment); } else { Console.WriteLine(" This post does not exist"); } ConsoleHelper.OutputTitle(" Comment Added"); }
/// <summary> /// Adds a comment to a post with a given ID and comment /// by the user. /// </summary> public void AddComment(int id, string comment) { Post post = FindPostById(id); if (post == null) { Console.WriteLine($"\n\tPost with ID {id} doesn't exist."); } else if (comment == "") { Console.WriteLine($"\n\tNo comment has been entered."); } else { Console.WriteLine("\n\tComment has been added to post with " + $"ID {id}\n"); post.AddComment(comment); post.Display(); } }