Example #1
0
        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;
            }
        }
Example #2
0
        public async Task DeletePoof(Model.Poof poof, bool sync = false)
        {
            await Initialize();

            await poofTable.DeleteAsync(poof);

            if (sync)
            {
                await SyncPoof();
            }
        }
Example #3
0
        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);
        }