Ejemplo n.º 1
0
        public async Task <IActionResult> UpdatePrice([FromQuery] int id, decimal newPrice)
        {
            var isSuccessful = await _manageProductService.UpdatePrice(id, newPrice);

            if (isSuccessful)
            {
                return(Ok());
            }
            return(BadRequest());
        }
        public async Task<IActionResult> UpdatePrice(int id, decimal newPrice)
        {
            var isSuccessful = await _manageProductService.UpdatePrice(id, newPrice);
            if (isSuccessful)
                return Ok();

            return BadRequest();
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> UpdatePrice(PriceUpdateRequest request)
        {
            var productId = await _manageProductService.UpdatePrice(request);

            if (productId <= 0)
            {
                return(Ok(false));
            }
            return(Ok(true));
        }
        public async Task <IActionResult> UpdatePrice(int productId, decimal newPrice)
        {
            var isSuccessful = await _manageProductService.UpdatePrice(productId, newPrice);

            if (!isSuccessful)
            {
                return(BadRequest());
            }
            return(Accepted());
        }
Ejemplo n.º 5
0
        public async Task <ActionResult> UpdatePrice(int productId, decimal newPrice)
        {
            var isUpdated = await _manageProductService.UpdatePrice(productId, newPrice);

            if (isUpdated)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> UpdatePrice([FromQuery] int productId, [FromQuery] decimal newPrice)
        {
            var result = await _manageProductService.UpdatePrice(productId, newPrice);

            if (!result)
            {
                return(BadRequest());
            }
            return(Ok());
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> UpdatePrice(int productId, decimal newPrice)
        {
            bool isSuccess = await _manageProductService.UpdatePrice(productId, newPrice);

            if (isSuccess)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> UpdatePrice(int productId, decimal newPrice)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var affectedResult = await _manageProductService.UpdatePrice(productId, newPrice);

            if (affectedResult)
            {
                return(Ok());
            }
            return(BadRequest());
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> UpdatePrice([FromForm] int id, [FromForm] decimal newPrice)
        {
            var result = await _manageProduct.UpdatePrice(id, newPrice);

            return(new OkObjectResult(result));
        }