Exemplo n.º 1
0
        public async Task <ActionResult> AlertsByUserAsync(string Id)
        {
            IQueryable <Alert> alerts = (from row in applicationDbContext.Alerts
                                         where row.CreatedById.Equals(Id)
                                         select row);
            JsonAlertViewModel json = await GetJsonAlert(alerts);

            return(View("Alerts", json));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> SearchAlertAsync(string tag)
        {
            if (tag == null)
            {
                return(RedirectToAction("Alerts"));
            }
            JsonAlertViewModel json = await GetJsonAlertViewAsync(tag);

            return(View("Alerts", json));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> OpenNotification(int?notifId)
        {
            if (notifId == null)
            {
                return(RedirectToAction("Alerts"));
            }

            var notification = (from row in applicationDbContext.Notifications where
                                row.Id == notifId select row).FirstOrDefault();

            notification.Seen = true;

            applicationDbContext.Notifications.Remove(notification);
            applicationDbContext.SaveChanges();

            JsonAlertViewModel json = await GetAlertJsonById(notification.AlertId);

            return(View("Alerts", json));
        }