Exemple #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);
        }
Exemple #2
0
 public async Task <NotificationInfo> GetNotification(int id, SportsType sportsType, NotificationType notificationType)
 {
     return(await _sqliteService.SelectAsync <NotificationInfo>(
                NotificationInfo.BuildPrimaryKey(id, sportsType, notificationType)));
 }