/// <summary> /// Lists all reminders. /// </summary> protected static void ListAllReminders() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 12) + "LIST ALL REMINDERS" + new string(' ', 13)); WriteLine(new string('-', 40)); //Gets all reminders and lists them List <Reminder> reminders = RBusiness.ListAllReminders(CurrentUser); if (reminders.Count > 0) { foreach (Reminder @reminder in reminders) { WriteLine($"{@reminder.ReminderId} {@reminder.Name} {@reminder.DueTime.ToString("g")}"); } } else { WriteLine("No reminders found!"); } MenuOrExit(); }
/// <summary> /// List all reminder on a certain date. /// </summary> protected static void ListAllRemindersByDate() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 13) + "REMINDERS BY DATE" + new string(' ', 13)); WriteLine(new string('-', 40)); //Gets the reminder data WriteLine("Enter your due time (e.g 2009/02/26):"); DateTime inputDate = DateTime.Parse(ReadLine()); List <Reminder> reminders = RBusiness.ListAllRemindersByDate(inputDate, CurrentUser); WriteLine($"Listing all reminders on {inputDate.ToString("d")}..."); if (reminders.Count > 0) { foreach (Reminder @reminder in reminders) { WriteLine($"{@reminder.ReminderId} {@reminder.Name} {@reminder.DueTime.ToString("g")}"); } } else { WriteLine("No reminders found!"); } MenuOrExit(); }
/// <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(); }
/// <summary> /// Adds the reminder. /// </summary> protected static void AddReminder() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 15) + "ADD REMINDER" + new string(' ', 16)); WriteLine(new string('-', 40)); //Makes an empty reminder Reminder @reminder = new Reminder(); //Gets the reminder data WriteLine("Enter reminder title: "); @reminder.Name = ReadLine(); WriteLine("Enter reminder due time (e.g 2009/02/26 18:37:58): "); @reminder.DueTime = DateTime.Parse(ReadLine()); @reminder.UserId = CurrentUser.UserId; RBusiness.AddReminder(@reminder); WriteLine("Reminder successfully added"); MenuOrExit(); }
static void LR() { LucroReal s1; Console.WriteLine("Digite o valor do seu faturamento: "); double fat = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); Console.WriteLine("Digite o valor do Lucro Trimestral: "); Console.Write($"Valor do primeiro mês: "); double f1 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); Console.Write($"Valor do segundo mês: "); double f2 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); Console.Write($"Valor do terceiro mês: "); double f3 = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); Console.Write("Digite o valor das entradas tributáveis: "); double app = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); Console.Write("Houve prejuízo acumulado? : (s/n) "); char p = char.Parse(Console.ReadLine()); double prej = 0.0; p = char.ToUpper(p); if (p == 'S') { Console.Write("Digite o valor do prejuízo"); prej = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); } Console.WriteLine("Qual o tipo de atividade da sua empresa? (C/S)"); char ativ = char.Parse(Console.ReadLine()); if (ativ == 'S') { s1 = new RServices(); s1.Revenue = fat; s1.Appetizer = app; s1.Prejudice = prej; s1.QuarterProfit.Add(f1); s1.QuarterProfit.Add(f2); s1.QuarterProfit.Add(f3); } else { s1 = new RBusiness(); s1.Revenue = fat; s1.Appetizer = app; s1.Prejudice = prej; s1.QuarterProfit.Add(f1); s1.QuarterProfit.Add(f2); s1.QuarterProfit.Add(f3); } Console.WriteLine(s1); }
/// <summary> /// Removes all reminders. /// </summary> protected static void RemoveAllReminders() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 8) + "REMOVE ALL REMINDERS" + new string(' ', 8)); WriteLine(new string('-', 40)); RBusiness.RemoveAllReminders(CurrentUser); WriteLine("All reminders have successfully been removed"); MenuOrExit(); }
/// <summary> /// Delete a reminder bu its ID. /// </summary> protected static void DeleteReminder() { //Clears the console window Clear(); WriteLine(new string('-', 40)); WriteLine(new string(' ', 17) + "DELETE" + new string(' ', 17)); WriteLine(new string('-', 40)); //Gets the reminder id WriteLine("Enter reminder id: "); int id = int.Parse(ReadLine()); //Removes the reminder RBusiness.RemoveReminder(id, CurrentUser); WriteLine("Reminder successfully deleted"); MenuOrExit(); }