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)); }
public async Task <ActionResult> SearchAlertAsync(string tag) { if (tag == null) { return(RedirectToAction("Alerts")); } JsonAlertViewModel json = await GetJsonAlertViewAsync(tag); return(View("Alerts", json)); }
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)); }