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