• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CurrencyType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: PaymentTransactionCreated

 //user id 为兼容恒星币人工充值,以后开通自动就无保留必要了
 public PaymentTransactionCreated(string txid, string address, CurrencyType currency, decimal amount, ReceivePaymentTransaction ptxEntity, int userID = 0)
 {
     this.UserID = userID;
     this.PtxEntity = ptxEntity;
     this.TxID = txid;
     this.Currency = currency;
     this.Address = address;
     this.Amount = amount;
 }
开发者ID:timfun,项目名称:DotPay,代码行数:10,代码来源:PaymentTransactionEvents.cs


示例17: VirtualCoinDepositCompleted

 public VirtualCoinDepositCompleted(int depositID, int depositUserID, int accountID, decimal depositAmount, CurrencyType currency, int byUserID)
 {
     this.DepositID = depositID;
     this.DepositUserID = depositUserID;
     this.Currency = currency;
     this.AccountID = accountID;
     this.DepositAmount = depositAmount;
     this.ByUserID = byUserID;
 }
开发者ID:timfun,项目名称:DotPay,代码行数:9,代码来源:VirtualDepositEvents.cs


示例18: GetGlobleMoneyFrom

 public static decimal GetGlobleMoneyFrom(CurrencyType fromCurrency, decimal money)
 {
     CurrencyType defaultCurrency = AppSetting.Instance.DefaultCurrency;
     if (defaultCurrency == fromCurrency)
     {
         return money;
     }
     return (money * fromCurrency.GetConversionRateTo(defaultCurrency));
 }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:9,代码来源:CurrencyHelper.cs


示例19: GetValueString

		public static string GetValueString(decimal value, CurrencyType currency, CultureInfo cultureInfo)
		{
			if(value == 0)
			{
				return null;
			}

			return value.ToString("### ### ### ###", cultureInfo) + CurrencyName.Names[currency];
		}
开发者ID:UHgEHEP,项目名称:test,代码行数:9,代码来源:LocalizationHelper.cs


示例20: AccountChangedByCancelDeposit

 public AccountChangedByCancelDeposit(int userID, int accountID, decimal depositAmount, int depositID, CurrencyType currency)
 {
     this.UserID = userID;
     this.AccountID = accountID;
     this.DepositID = depositID;
     this.DepositAmount = depositAmount;
     this.Currency = currency;
     this.ModifyType = Convert.ToInt32(AccountModifyType.Deposit.ToString("D") + currency.ToString("D"));
 }
开发者ID:timfun,项目名称:DotPay,代码行数:9,代码来源:AccountEvents.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CurrentUserInfo类代码示例发布时间:2022-05-24
下一篇:
C# CurrencyModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap