// To protect from overposting attacks, enable the specific properties you want to bind to. // For more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(ScriptureJournalEntry).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ScriptureJournalEntryExists(ScriptureJournalEntry.ScriptureJournalEntryID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Scripture.Add(Scripture); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { ScriptureJournalEntry.Date = DateTime.Now; if (!ModelState.IsValid) { return(Page()); } _context.ScriptureJournalEntry.Add(ScriptureJournalEntry); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { // if (!ModelState.IsValid) // { // return Page(); // } Scripture.Date = DateTime.Now; _context.Scripture.Add(Scripture); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Scripture = await _context.Scripture.FindAsync(id); if (Scripture != null) { _context.Scripture.Remove(Scripture); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Journal = await _context.Journal.FindAsync(id); if (Journal != null) { _context.Journal.Remove(Journal); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }