コード例 #1
0
ファイル: Delete.cshtml.cs プロジェクト: seddypdx/WLC
        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());
        }
コード例 #2
0
ファイル: Delete.cshtml.cs プロジェクト: seddypdx/WLC
        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"));
        }
コード例 #3
0
ファイル: NotificationService.cs プロジェクト: seddypdx/WLC
        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);
            }
        }