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