public void Start() { int choice = 1; while (choice != 0) { utils.Menu(); choice = utils.WhatList(); if (choice == 1) //prints out a list { Console.Clear(); utils.PrintFullList(repo.GetToDoItems()); } if (choice == 2) //add item choice { Console.Clear(); repo.AddItem(utils.NewItem()); utils.PrintFullList(repo.GetToDoItems()); } if (choice == 3) //edit item choice { Console.Clear(); utils.PrintFullList(repo.GetToDoItems()); repo.UpdateItem(utils.UpdateItem()); } if (choice == 4) //delete item choice { Console.Clear(); utils.PrintFullList(repo.GetToDoItems()); repo.DeleteItem(utils.DeleteItem()); utils.PrintFullList(repo.GetToDoItems()); } if (choice == 5) { utils.PrintFullList(repo.GetDoneItems()); } if (choice == 6) { utils.PrintFullList(repo.GetPendingItems()); //; } } }
public void PrintFullList() // self expainable method { Console.Clear(); Console.WriteLine("To Do List: "); ItemRepository list = new ItemRepository(); list.GetToDoItems(); foreach (ToDoItem s in list.GetToDoItems()) { string textStatus = "Pending"; if (s.Status == false) { textStatus = "Pending"; } if (s.Status == true) { textStatus = "Done"; } Console.WriteLine("{0} - {1} Status:" + textStatus, s.Id, s.Description, s.Status); } }