/// <summary> /// Adds a new reminder to the reminder store /// </summary> /// <param name="model"></param> public void AddReminder(HoursReminderModel model) { var table = GetTableClient(); TableOperation insertOperation = TableOperation.Insert(model); table.Execute(insertOperation); }
public async Task SetReminder(IBotContext context, int contractHours, ConversationReference conversation) { string username = context.Activity.From.Name; if (_store.GetReminder(username) != null) { await context.PostAsync("I tried to set-up a reminder for you, but it was already there!"); } else { TokenCache tokenCache = TokenCacheFactory.GetTokenCache(); HoursReminderModel model = new HoursReminderModel(username, conversation, contractHours, tokenCache); _store.AddReminder(model); await context.PostAsync("Sure thing! I will remind you about booking your hours at the end of every week."); } }