Esempio n. 1
0
        public async Task <IHttpActionResult> SetNotificationsIdentifier(NotificationsIdentifierModel model)
        {
            var person = SecurityPrincipal.Current;
            var role   = person.Role;

            model.PersonType = role;
            await _notificationsService.PersistNotificationToken(model);

            return(Ok(true));
        }
        public async Task SaveNotificationIdentifier(NotificationsIdentifierModel model)
        {
            var fieldExist = _edFiDb.NotificationsTokens.FirstOrDefault(n => n.PersonUniqueId.Equals(model.PersonUniqueId) && n.DeviceUuid.Equals(model.DeviceUUID));

            if (fieldExist != null && fieldExist.Token != model.Token)
            {
                fieldExist.Token            = model.Token;
                fieldExist.LastModifiedDate = DateTime.Now;
            }
            else
            {
                _edFiDb.NotificationsTokens.Add(new NotificationsToken()
                {
                    PersonUniqueId = model.PersonUniqueId,
                    Token          = model.Token,
                    PersonType     = model.PersonType,
                    DeviceUuid     = model.DeviceUUID
                });
            }
            await _edFiDb.SaveChangesAsync();
        }
Esempio n. 3
0
 public async Task PersistNotificationToken(NotificationsIdentifierModel model)
 {
     await _notificationsRepository.SaveNotificationIdentifier(model);
 }
 public Task SaveNotificationIdentifier(NotificationsIdentifierModel model)
 {
     throw new NotImplementedException();
 }