/// <summary> /// Fetches a reminder. /// </summary> protected static void FetchReminder() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 14) + "FETCH REMINDER" + new string(' ', 15)); WriteLine(new string('-', 40)); //Get reminder id WriteLine("Enter reminder id: "); int id = int.Parse(ReadLine()); //Gets the reminder Reminder @reminder = RBusiness.FetchReminderById(id, CurrentUser); if (@reminder == null) { WriteLine($"There is no reminder with id {id}"); } else { WriteLine($"Listing the reminder with the id {id}..."); WriteLine($"{@reminder.ReminderId} {@reminder.Name} {@reminder.DueTime.ToString("g")}"); } MenuOrExit(); }
/// <summary> /// Modifies a reminder by its ID. /// </summary> protected static void ModifyReminder() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 17) + "MODIFY" + new string(' ', 17)); WriteLine(new string('-', 40)); //Gets reminder id WriteLine("Enter reminder id: "); int id = int.Parse(ReadLine()); //Gets the reminder Reminder @reminder = RBusiness.FetchReminderById(id, CurrentUser); WriteLine("Enter new title: "); @reminder.Name = ReadLine(); WriteLine("Enter new due time (e.g : 2009/02/26 18:37:58): "); @reminder.DueTime = DateTime.Parse(ReadLine()); RBusiness.ModifyReminder(@reminder, CurrentUser); WriteLine("Reminder successfully Modified"); MenuOrExit(); }