public void SeeAll() { Console.Clear(); DailyNoteRepository noteRepo = new DailyNoteRepository("xrisidiary.txt"); List <DailyNoteEntity> notes = noteRepo.GetAll(); Console.Write("****************************\n"); foreach (DailyNoteEntity i in notes) { Console.WriteLine("Date:{0}", i.Date); Console.WriteLine("ID:{0}", i.ID); Console.WriteLine("Description:{0}", i.Description); Console.Write("****************************\n"); } Console.ReadKey(true); Console.Clear(); MainView nowview = new MainView(); nowview.ShowMenu(); }
public void Add() { Console.Clear(); DailyNoteEntity note = new DailyNoteEntity(); Console.Write($"Date: {DateTime.Now}"); note.Date = DateTime.Now; Console.Write("\nWrite note ID: "); note.ID = int.Parse(Console.ReadLine()); Console.Write("Description: "); note.Description = Console.ReadLine(); DailyNoteRepository noteRepo = new DailyNoteRepository("xrisidiary.txt"); noteRepo.Save(note); Console.Clear(); Console.WriteLine("Note saved successfully"); Console.ReadKey(true); Console.Clear(); MainView nowview = new MainView(); nowview.ShowMenu(); }