protected override void GetAll() { All(); Console.WriteLine("------- ADDITIONAL MENU --------"); Console.WriteLine("------------- [Y]ES ------------"); Console.WriteLine("------------- [N]O -------------"); var addmenu = Console.ReadLine(); if (addmenu.ToUpper() == "Y") { DetailMenuVIew detailMenu = new DetailMenuVIew(); detailMenu.View(); } else { BaseView taskManager = new TaskManagerView(); taskManager.View(); } }
private void GetAllComments(Entities.Task task) { var logedUser = AuthenticationService.LoggedUser; CommentRepo repo = new CommentRepo("comments.txt"); var coms = repo.GetAll(); Console.Clear(); foreach (var com in coms) { if (com.ParentId == task.Id) { Console.Write("Created by ID: "); Console.WriteLine(com.CreatedBy); Console.Write("Comments: "); Console.WriteLine(com.Comments); Console.WriteLine("###############################"); } } Console.ReadKey(); Console.Clear(); DetailMenuVIew detailMenu = new DetailMenuVIew(); detailMenu.PrintRepo(task); }
internal void AddComment(Entities.Task task) { Console.Clear(); CommentRepo repo = new CommentRepo("comments.txt"); Comment com = new Comment(); Console.WriteLine("***************************"); Console.WriteLine("***** ADD NEW COMMENT *****"); Console.Write("Comment: "); com.Comments = Console.ReadLine(); com.ParentId = Convert.ToInt32(task.Id); com.CreatedBy = Convert.ToInt32(AuthenticationService.LoggedUser.Id); repo.Save(com); Console.Clear(); Console.WriteLine("*******************************"); Console.WriteLine("********* COMPLETED!!! ********"); Console.WriteLine("*******************************"); Thread.Sleep(1500); Console.Clear(); DetailMenuVIew detailMenu = new DetailMenuVIew(); detailMenu.PrintRepo(task); }