public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Notices = await _context.Notices .Include(n => n.NoticeStatus) .Include(n => n.NoticeType).FirstOrDefaultAsync(m => m.NoticeId == id); if (Notices == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Notices = await _context.Notices.FindAsync(id); if (Notices != null) { _context.Notices.Remove(Notices); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public static void QueueNotification(WLC.Models.WLCRacesContext context, WLC.Models.Notices Notice) { if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Social) { NotifyForSocial(context, Notice); } if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Informational) { NotifyForInformation(context, Notice); } if (Notice.NoticeTypeId == (int)NoticeTypeEnum.Emergency) { NotifyForEmergency(context, Notice); } }