当前位置: 首页>>代码示例>>C#>>正文


C# CurrencyType类代码示例

本文整理汇总了C#中CurrencyType的典型用法代码示例。如果您正苦于以下问题:C# CurrencyType类的具体用法?C# CurrencyType怎么用?C# CurrencyType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CurrencyType类属于命名空间,在下文中一共展示了CurrencyType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RaiseRateChanging

 public static void RaiseRateChanging(CurrencyType currencyRiseChanger)
 {
     ((System.Collections.Generic.IEnumerable<CurrencyWapper>)CurrencyTable).ForEach<CurrencyWapper>(delegate(CurrencyWapper p)
     {
         p.RaiseRateChanged();
     });
 }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:7,代码来源:CurrencyHelper.cs

示例2: ConvertCurrency

        public ActionResult ConvertCurrency(double amount, CurrencyType convertFrom, CurrencyType convertTo)
        {
            double multiplier = GetMultiplier(convertFrom, convertTo);
            double convertedAmount = amount * multiplier;

            return Json(convertedAmount, JsonRequestBehavior.AllowGet);
        }
开发者ID:BeMac,项目名称:VCIApplicantScreening,代码行数:7,代码来源:HomeController.cs

示例3: ConvertTo

        public static decimal ConvertTo(decimal fromAmount, CurrencyType fromCurrencyType, CurrencyType toCurrencyType, Currency[] currencies)
        {
            if (fromCurrencyType == toCurrencyType)
                return fromAmount;

            if ((fromCurrencyType != CurrencyType.CZK && currencies.All(c => c.CurrencyType != fromCurrencyType)) ||
                toCurrencyType != CurrencyType.CZK && currencies.All(c => c.CurrencyType != toCurrencyType))
            {
                throw new Exception(String.Format(ValidationResource.Currency_CannotProccessCurrencyChange_ErrorMessage, fromCurrencyType, toCurrencyType));
            }

            decimal amountTo = fromAmount;
            Currency currency;

            // Převod konta na CZK
            if (fromCurrencyType != CurrencyType.CZK)
            {
                currency = currencies.Single(c => c.CurrencyType == fromCurrencyType);
                amountTo = amountTo * currency.ExchangeRateToCZK;
            }

            // Převod konta na aktuální měnu
            if (toCurrencyType != CurrencyType.CZK)
            {
                currency = currencies.Single(c => c.CurrencyType == toCurrencyType);
                amountTo = amountTo / currency.ExchangeRateToCZK;
            }

            return amountTo;
        }
开发者ID:MulderFox,项目名称:Main,代码行数:30,代码来源:Currency.cs

示例4: QuerySettings

		public QuerySettings(string origin, string destination = "-", DateTime? departDate = null, DateTime? returnDate = null, CurrencyType currency = CurrencyType.RUB)
            : this(origin, destination)
		{
			Currency = currency;
			DepartDate = departDate;
			ReturnDate = returnDate;
        }
开发者ID:nikitadev,项目名称:TravelpayoutsAPI,代码行数:7,代码来源:QuerySettings.cs

示例5: requestLimitedPurchase

        public LimitedPurchaseResponse requestLimitedPurchase(String XRSFToken, int productID, CurrencyType currency, int expectedPrice, int expectedSellerID, int userAssetID, String cookies)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.roblox.com/api/item.ashx?rqtype=purchase&productID=" + productID + "&expectedCurrency=" + ((currency == CurrencyType.ROBUX) ? "1" : "2") + "&expectedPrice=" + expectedPrice + "&expectedSellerID=" + expectedSellerID + "&userAssetID=" + userAssetID);

            request.KeepAlive = true;
            request.Accept = "*/*";
            request.Headers.Add("Origin", @"http://www.roblox.com");
            request.Headers.Add("X-CSRF-TOKEN", XRSFToken);
            request.UserAgent = RobloxUtils.UserAgent;
            request.ContentType = "application/json; charset=utf-8";
            request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
            request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.8");
            request.Headers.Set(HttpRequestHeader.Cookie, cookies);

            request.Method = "POST";
            request.ServicePoint.Expect100Continue = false;

            string body = @"";
            byte[] postBytes = Encoding.UTF8.GetBytes(body);
            request.ContentLength = postBytes.Length;
            Stream stream = request.GetRequestStream();
            stream.Write(postBytes, 0, postBytes.Length);
            stream.Close();
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            using (Stream receiveStream = RobloxUtils.decodeStream(response))
            {
                using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8))
                {
                    String s = readStream.ReadToEnd();
                    return JsonConvert.DeserializeObject<LimitedPurchaseResponse>(s);
                }
            }
        }
开发者ID:ext0,项目名称:RobloxSharp,代码行数:33,代码来源:RobloxPurchaseHandler.cs

示例6: AccountDTO

 public AccountDTO(Int32 accountID, Decimal balance, CurrencyType currency, Int32 client_ClientID)
 {
     this.AccountID = accountID;
     this.Balance = balance;
     this.Currency = currency;
     this.Client_ClientID = client_ClientID;
 }
开发者ID:kzfabi,项目名称:EntitiesToDTOs,代码行数:7,代码来源:DTOs.cs

示例7: requestAssetPurchase

        internal bool requestAssetPurchase(String token, long assetID, int expectedPrice, CurrencyType currency, String cookies)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://m.roblox.com/Catalog/ProcessPurchase");

            request.KeepAlive = true;
            request.Accept = "text/html, */*; q=0.01";
            request.Headers.Add("Origin", @"https://m.roblox.com");
            request.Headers.Add("X-Requested-With", @"XMLHttpRequest");
            request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36";
            request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
            request.Referer = "https://m.roblox.com/items/295133189";
            request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
            request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.8");
            request.Headers.Set(HttpRequestHeader.Cookie, cookies);
            request.Method = "POST";
            request.ServicePoint.Expect100Continue = false;

            string body = @"__RequestVerificationToken=" + token + "&CurrencyType=" + ((currency == CurrencyType.ROBUX) ? "1" : "2") + "&AssetID="+assetID+"&UserAssetOptionID=0&ExpectedPrice="+expectedPrice;
            byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
            request.ContentLength = postBytes.Length;
            Stream stream = request.GetRequestStream();
            stream.Write(postBytes, 0, postBytes.Length);
            stream.Close();

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            using (BufferedStream receiveStream = new BufferedStream(response.GetResponseStream()))
            {
                using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8))
                {
                    String s = readStream.ReadToEnd();
                    return s.Contains("successfully");
                }
            }
        }
开发者ID:VanityRBX,项目名称:RobloxSharp,代码行数:34,代码来源:RobloxPurchaseHandler.cs

示例8: FixedFeeCurrencyWallet

        public FixedFeeCurrencyWallet(decimal entryFixedFee, decimal exitFixedFee, CurrencyType currencyType, IExchange exchange)
        {
            _entryFixedFee = entryFixedFee;
            _exitFixedFee = exitFixedFee;
            Currency = currencyType;

            _exchange = exchange;
        }
开发者ID:jamez1,项目名称:botcoin,代码行数:8,代码来源:FixedFeeCurrencyWallet.cs

示例9: GeneratePaymentAddress

        public GeneratePaymentAddress(int userID, CurrencyType currency)
        {
            Check.Argument.IsNotNegativeOrZero(userID, "userID");
            Check.Argument.IsNotNegativeOrZero((int)currency, "currency");

            this.UserID = userID;
            this.Currency = currency;
        }
开发者ID:timfun,项目名称:DotPay,代码行数:8,代码来源:PaymentAddressCommands.cs

示例10: GetRate

			public override decimal GetRate(CurrencyType @from, CurrencyType to) {
				if(ExchangeRates.ContainsKey(@from) && ExchangeRates[@from].ContainsKey(to))
					return ExchangeRates[@from][to];
				if(ExchangeRates.ContainsKey(to) && ExchangeRates[to].ContainsKey(@from))
					return 1m / ExchangeRates[to][@from];

				throw new UnknownExchangeRateException(String.Format("Exchange rate between '{0}' and '{1}' not known", @from.Code, to.Code));
			}
开发者ID:kylewlacy,项目名称:electrolyte.net,代码行数:8,代码来源:Money.cs

示例11: PercentageFeeCurrencyWallet

        public PercentageFeeCurrencyWallet(decimal entryPercentFee, decimal exitPercentFee, CurrencyType currencyWallet, IExchange exchange)
        {
            _exchange = exchange;
            _entryPercentFee = entryPercentFee;
            _exitPercentFee = exitPercentFee;

            Currency = currencyWallet;
        }
开发者ID:jamez1,项目名称:botcoin,代码行数:8,代码来源:PercentageFeeCurrencyWallet.cs

示例12: PaymentTransactionConfirmed

 public PaymentTransactionConfirmed(int paymentTransactionID,string txID, int confirmations, CurrencyType currencyType, int byUserID = 0)
 {
     this.PaymentTransactionID = paymentTransactionID;
     this.TxID = txID;
     this.Confirmations = confirmations;
     this.Currency = currencyType;
     this.ByUserID = byUserID;
 }
开发者ID:timfun,项目名称:DotPay,代码行数:8,代码来源:PaymentTransactionEvents.cs

示例13: CreateAccount

        public CreateAccount(CurrencyType currency, int userID)
        {
            Check.Argument.IsNotNegativeOrZero(userID, "userID");
            Check.Argument.IsNotNull(currency, "currency");

            this.Currency = currency;
            this.UserID = userID;
        }
开发者ID:timfun,项目名称:DotPay,代码行数:8,代码来源:AccountCommands.cs

示例14: SwitchCurrency

        public TinyMoneyManager.CurrencyConverterByWebService.Currency SwitchCurrency(CurrencyType localVer)
        {
            TinyMoneyManager.CurrencyConverterByWebService.Currency cNY = TinyMoneyManager.CurrencyConverterByWebService.Currency.CNY;
            switch (localVer)
            {
                case CurrencyType.CNY:
                    return cNY;

                case CurrencyType.USD:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.USD;

                case CurrencyType.NTD:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.TWD;

                case CurrencyType.HKD:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.HKD;

                case CurrencyType.AUD:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.AUD;

                case CurrencyType.EUR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.EUR;

                case CurrencyType.JPY:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.JPY;

                case CurrencyType.GBP:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.GBP;

                case CurrencyType.MYR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.MYR;

                case CurrencyType.SGD:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.SGD;

                case CurrencyType.THP:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.THB;

                case CurrencyType.PKR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.PKR;

                case CurrencyType.INR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.INR;

                case CurrencyType.KRW:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.KRW;

                case CurrencyType.IDR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.IDR;

                case CurrencyType.BYR:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.RUB;

                case CurrencyType.PHP:
                    return TinyMoneyManager.CurrencyConverterByWebService.Currency.PHP;
            }
            return cNY;
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:58,代码来源:CurrencySettingViewModel.cs

示例15: GetInsideTransferBySequenceNo

        public InsideTransferModel GetInsideTransferBySequenceNo(string seqNo, TransactionState txstate, CurrencyType currency)
        {
            Check.Argument.IsNotEmpty(seqNo, "seqNo");

            return this.Context.Sql(getInsideTransferBySequenceNo_Sql.FormatWith(currency.ToString()))
                               .Parameter("@seqNo", seqNo)
                               .Parameter("@state", txstate)
                               .QuerySingle<InsideTransferModel>();
        }
开发者ID:timfun,项目名称:DotPay,代码行数:9,代码来源:InsideTransferQuery.cs


注:本文中的CurrencyType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。