private async Task ExecuteDeletePoofCommand(Model.Poof poof) { if (IsBusy) { return; } HockeyApp.MetricsManager.TrackEvent("Delete Poof"); try { LoadingMessage = "Deleting Poof..."; IsBusy = true; Poofs.Remove(poof); FilterPoofs(); SortPoofs(); await azureService.DeletePoof(poof); } catch (Exception ex) { Insights.Report(ex, Insights.Severity.Error); await CoreMethods.DisplayAlert("Sync Error", "Unable to sync Poofs, you may be offline", "OK"); } finally { IsBusy = false; } }
public async Task DeletePoof(Model.Poof poof, bool sync = false) { await Initialize(); await poofTable.DeleteAsync(poof); if (sync) { await SyncPoof(); } }
public async Task <Model.Poof> AddPoof(bool justified, string comment, string userId, bool sync = false) { await Initialize(); var poof = new Model.Poof { DateUtc = DateTime.UtcNow, Justified = justified, Comment = string.IsNullOrWhiteSpace(comment) ? "..." : comment, UserId = userId }; await poofTable.InsertAsync(poof); if (sync) { await SyncPoof(); } return(poof); }