public async Task <ActionResult <BCPurchOrder> > PostBCPurchOrder(BCPurchOrder bCPurchOrder) { _context.BCPurchOrder.Add(bCPurchOrder); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBCPurchOrder", new { id = bCPurchOrder.EntryNo }, bCPurchOrder)); }
public async Task <IActionResult> PutBCPurchOrder(int id, BCPurchOrder bCPurchOrder) { if (id != bCPurchOrder.EntryNo) { return(BadRequest()); } _context.Entry(bCPurchOrder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BCPurchOrderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }