Example #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Sacrament_Plan = await _context.Sacrament_Plan.FirstOrDefaultAsync(m => m.ID == id);

            if (Sacrament_Plan == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            //ISpeakers = _context.Speaker.Where(s => s.Sacrament_PlanID == id);
            Sacrament_Plan = await _context.Sacrament_Plan
                             .Include(p => p.Speakers).FirstOrDefaultAsync(m => m.ID == id);

            if (Sacrament_Plan == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Sacrament_Plan = await _context.Sacrament_Plan.FindAsync(id);

            if (Sacrament_Plan != null)
            {
                _context.Sacrament_Plan.Remove(Sacrament_Plan);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }