Exemplo n.º 1
0
        public async Task <bool> DeleteNotification(int id, SportsType sportsType, NotificationType notificationType)
        {
            var found = await _sqliteService.SelectAsync <NotificationInfo>(
                NotificationInfo.BuildPrimaryKey(id, sportsType, notificationType));

            var ret = await _sqliteService.DeleteAsync <NotificationInfo>(found.PrimaryKey);

            Debug.Assert(ret != 0);

            //NotificationCenter.Current.Cancel(found.Id);

            found.SetIsAlarmed(false);

            string message = this.BuildNotificationMessage(found.SportsType, found.NotificationType);

            MessagingCenter.Send(this, message, found);

            UserDialogs.Instance.Toast(LocalizeString.Cancle_Alarm);
            return(true);
        }
Exemplo n.º 2
0
        public async Task <bool> RemoveBookmark <T>(T item, SportsType sportsType, PageDetailType bookmarkType, bool showToastMsg = true) where T : ISQLiteStorable, IBookmarkable, new()
        {
            item.Order        = 0;
            item.StoredTime   = DateTime.UtcNow;
            item.IsBookmarked = false;

            var ret = await _sqliteService.DeleteAsync <T>(item.PrimaryKey);

            Debug.Assert(ret != 0);

            string message = this.BuildBookmarkMessage(sportsType, bookmarkType);

            MessagingCenter.Send(this, message, item);

            if (showToastMsg)
            {
                UserDialogs.Instance.Toast(LocalizeString.Delete_Bookmark);
            }

            return(true);
        }