本文整理汇总了C#中bycar.DataAccess.getCurrencyRateValue方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.getCurrencyRateValue方法的具体用法?C# DataAccess.getCurrencyRateValue怎么用?C# DataAccess.getCurrencyRateValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.getCurrencyRateValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBasicPrice
public static decimal GetBasicPrice(string CurrencyCode, decimal Price)
{
decimal BasicPrice = 0;
DataAccess da = new DataAccess();
string BasicCurrencyCode = da.getBasicCurrencyCode();
decimal RateUsd = da.getCurrencyRateValue("USD");
decimal RateEur = da.getCurrencyRateValue("EUR");
decimal RateRur = da.getCurrencyRateValue("RUR");
if (BasicCurrencyCode.Equals(CurrencyCode))
{
BasicPrice = Price;
}
else
{
if (BasicCurrencyCode.Contains("USD"))
{
if (CurrencyCode.Contains("BYR"))
{
BasicPrice = Price / RateUsd;
}
if (CurrencyCode.Contains("EUR"))
{
BasicPrice = Price * RateEur / RateUsd;
}
if (CurrencyCode.Contains("RUR"))
{
BasicPrice = Price * RateRur / RateUsd;
}
}
if (BasicCurrencyCode.Contains("EUR"))
{
if (CurrencyCode.Contains("BYR"))
{
BasicPrice = Price / RateEur;
}
if (CurrencyCode.Contains("USD"))
{
BasicPrice = Price * RateUsd / RateEur;
}
if (CurrencyCode.Contains("RUR"))
{
BasicPrice = Price * RateRur / RateEur;
}
}
if (BasicCurrencyCode.Contains("RUR"))
{
if (CurrencyCode.Contains("BYR"))
{
BasicPrice = Price / RateRur;
}
if (CurrencyCode.Contains("EUR"))
{
BasicPrice = Price * RateEur / RateRur;
}
if (CurrencyCode.Contains("USD"))
{
BasicPrice = Price * RateUsd / RateRur;
}
}
if (BasicCurrencyCode.Contains("BYR"))
{
if (CurrencyCode.Contains("USD"))
{
BasicPrice = Price * RateUsd;
}
if (CurrencyCode.Contains("EUR"))
{
BasicPrice = Price * RateEur;
}
if (CurrencyCode.Contains("RUR"))
{
BasicPrice = Price * RateRur;
}
}
}
return BasicPrice;
}