public JsonResult GetFuelCost(int destinationID, int productID, int quality, int amount) { try { var source = SessionHelper.CurrentEntity; var destination = entityRepository.GetById(destinationID); var productType = (ProductTypeEnum)productID; var fuelCost = giftService.GetNeededFuelToSendGift(source, destination, productType, quality, amount); return(JsonData(fuelCost)); } catch (Exception e) { return(JsonError("Undefined error")); } }