Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 public int AddInventory(BllInventoryTable BIModel)
 {
     return(dal.AddInventory(BIModel));
 }