コード例 #1
0
ファイル: PriceConverter.cs プロジェクト: Sparkjop/vc-modules
        public static coreModel.Price ToCoreModel(this googleModel.Price price)
        {
            var retVal = new coreModel.Price();

            retVal.InjectFrom(price);
            retVal.Currency = price.Currency;
            return(retVal);
        }
コード例 #2
0
 public static googleModel.Price ToGoogleModel(this coreModel.Price price)
 {
     var retVal = new googleModel.Price();
     retVal.InjectFrom(price);
     retVal.Value = price.List.ToString(CultureInfo.InvariantCulture);
     retVal.Currency = price.Currency.ToString();
     return retVal;
 }
コード例 #3
0
        public static coreModel.Price ToCoreModel(this googleModel.Price price)
        {
            var retVal = new coreModel.Price();

            retVal.InjectFrom(price);
            retVal.Currency = (CurrencyCodes)Enum.Parse(typeof(CurrencyCodes), price.Currency);
            return(retVal);
        }
コード例 #4
0
ファイル: PriceConverter.cs プロジェクト: Sparkjop/vc-modules
        public static googleModel.Price ToGoogleModel(this coreModel.Price price)
        {
            var retVal = new googleModel.Price();

            retVal.InjectFrom(price);
            retVal.Value    = price.List.ToString(CultureInfo.InvariantCulture);
            retVal.Currency = price.Currency.ToString();
            return(retVal);
        }
コード例 #5
0
        private bool TryGetProductPrice(string productId, out GooglePrice productPrice)
        {
            var prices = _pricingService.EvaluateProductPrices(new PriceEvaluationContext {
                ProductIds = new string[] { productId }
            });

            if (prices == null)
            {
                productPrice = null;
                return(false);
            }

            productPrice = prices.First(x => x.Currency == "USD").ToGoogleModel();
            return(true);
        }