public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Speaker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeakerExists(Speaker.SpeakerID)) { return(NotFound()); } else { throw; } } return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.SacramentPlan.Add(SacramentPlan); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Speaker.Add(Speaker); await _context.SaveChangesAsync(); return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Speaker = await _context.Speaker.FindAsync(id); if (Speaker != null) { _context.Speaker.Remove(Speaker); await _context.SaveChangesAsync(); } return(Redirect($"/SacramentPlans/Index?id={Speaker.SacramentPlanID}")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } SacramentPlan = await _context.SacramentPlan.FindAsync(id); if (SacramentPlan != null) { _context.SacramentPlan.Remove(SacramentPlan); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }