Esempio n. 1
0
 public void RemoveReminder(Reminder reminder)
 {
     try
     {
         Database.Remove <Reminder>(Reminder.DocumentName(reminder.GuildId, reminder.ReminderNumber));
         Reminders.Remove(reminder);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Esempio n. 2
0
 //NOTE: Reminder ID is discarded and re-set here
 public void AddReminder(Reminder reminder)
 {
     reminder.ReminderNumber = Reminders.Any() ? Reminders.Max(x => x.ReminderNumber) + 1 : 1;
     Reminders.Add(reminder);
     Database.Store(reminder, Reminder.DocumentName(reminder.GuildId, reminder.ReminderNumber));
 }