예제 #1
0
        public async Task <IActionResult> PostInventoryMaster([FromBody] InventoryMaster InventoryMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            //_context.InventoryMaster.Add(InventoryMaster);


            try
            {
                //await _context.SaveChangesAsync();
                await _inventory.AddInventory(InventoryMaster);
            }
            catch (DbUpdateException)
            {
                if (InventoryMasterExists(InventoryMaster.InventoryID))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetInventoryMaster", new { id = InventoryMaster.InventoryID }, InventoryMaster));
        }
예제 #2
0
 public int AddInventory(BllInventoryTable BIModel)
 {
     return(dal.AddInventory(BIModel));
 }