Exemplo n.º 1
0
        public ActionResult AddItem(AssetDTO assetDTO)
        {
            var doesAssetAlreadyExist = _service.SearchInventory(assetDTO);

            if (doesAssetAlreadyExist)
            {
                return(Json(new { success = false, responseText = "This Asset Already Exists. Please Try Again" }));
            }
            else
            {
                _service.CreateAsset(assetDTO);
                return(Json(new { success = true, responseText = "The Asset Was Added" }));
            }
        }
        public ActionResult <Asset> Create(Asset asset)
        {
            asset = _assetService.CreateAsset(asset);

            return(asset);
        }