Exemplo n.º 1
0
        public void GetRecurrence(ObservableCollection<NotificacionModel> notifs)
        {
            NotificationRepository _NotificationRepository = new NotificationRepository();
            long fechaSystema = long.Parse(String.Format("{0:yyyy:MM:dd:HH:mm:ss:fff}", DateTime.Now).Replace(":", ""));

            if (notifs.Count() !=0)
            {
                notifs.ToList().ForEach(p =>
                {
                    if (this.GetFUMRecurrencia(p) <= fechaSystema)
                    {
                        Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            this.GetParetWindows().GetScreenActive();
                            //actualizar la fecha por la del sistema
                            _NotificationRepository.UpdateNotificationRecurrencia(
                                new Model.NotificacionModel()
                                {
                                    IdNotificacion = p.IdNotificacion,
                                    Recurrencia =p.Recurrencia,
                                    FechaUltimaMuestra = new UNID().getNewUNID()
                                });
                        }));
                    }
                });

            }
        }
 public void GetNotificationsTest()
 {
     NotificationRepository target = new NotificationRepository(); // TODO: Inicializar en un valor adecuado
     UsuarioModel user = new UsuarioModel()
         {
             IdUsuario = 20130101120059002,
             NombreUsuario="*****@*****.**"
         }; // TODO: Inicializar en un valor adecuado
     ObservableCollection<NotificacionModel> expected = null; // TODO: Inicializar en un valor adecuado
     ObservableCollection<NotificacionModel> actual;
     actual = target.GetNotifications(user,1);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
 }
Exemplo n.º 3
0
        public void GetRefresh(ObservableCollection<NotificacionModel> notifs)
        {
            ObservableCollection<NotificacionModel> notifsMostradas = new ObservableCollection<NotificacionModel>();
            NotificationRepository _NotificationRepository = new NotificationRepository();

            if (notifs.Count() != 0)
            {
                int cont = 0;
                notifs.ToList().ForEach(p =>
                {
                    if (p.NotificacionActiva.Count() ==0)
                    {
                        cont++;
                        notifsMostradas.Add(p);
                    }

                });

                if (cont!=0)
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            this.GetParetWindows().GetScreenActive();
                        }));

                    if (notifsMostradas.Count != 0)
                        _NotificationRepository.UpdateNotificationActiva(notifsMostradas);
                }

            }
        }