29 lines
739 B
C#
29 lines
739 B
C#
using YLErp.Abstract.DataProviders;
|
|
|
|
namespace YLErp.Helpers
|
|
{
|
|
class InnerExchangeOptionPriceProvider : IPriceProvider
|
|
{
|
|
public double GetPrice(string instrumentCode)
|
|
{
|
|
return TryGetPrice(instrumentCode, out var price) ? price : 0;
|
|
}
|
|
|
|
public bool TryGetPrice(string instrumentCode, out double price)
|
|
{
|
|
switch (instrumentCode)
|
|
{
|
|
case "RB00-C-3400":
|
|
price = 30;
|
|
return true;
|
|
case "RB00-P-3400":
|
|
price = 20;
|
|
return true;
|
|
default:
|
|
price = 0;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|