Ejemplo n.º 1
0
        public async Task <IActionResult> SelectPurchaseOffers(int purchaseOfferID, int purchasesDetailsID, Boolean isSelected)
        {
            try
            {
                var userId = Convert.ToInt32(this.User.FindFirstValue(ClaimTypes.NameIdentifier));

                Boolean result = await _purchasesRepository.SelectPurchaseOffers(purchaseOfferID, purchasesDetailsID, isSelected, userId);

                if (result)
                {
                    return(Ok());
                }
                return(BadRequest());
            }
            catch (Exception ex)
            {
                //ModelState.AddModelError("error", ex.Message);
                return(BadRequest(ex.Message));
            }
        }