public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(ReceivedInterloan).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReceivedInterloanExists(ReceivedInterloan.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.SuppliedInterloan.Add(SuppliedInterloan); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } ReceivedInterloan = await _context.ReceivedInterloan.FindAsync(id); if (ReceivedInterloan != null) { _context.ReceivedInterloan.Remove(ReceivedInterloan); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }