本文整理汇总了C#中bycar.DataAccess.GetCurrency方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.GetCurrency方法的具体用法?C# DataAccess.GetCurrency怎么用?C# DataAccess.GetCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.GetCurrency方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRates
private void AddRates()
{
DataAccess da = new DataAccess();
List<currency_rate> rates = new List<currency_rate>();
// USD
currency c1 = da.GetCurrency("USD");
currency_rate r1 = new currency_rate();
r1.currency = c1;
r1.rate = decimal.Parse(edtUSD.Text);
r1.rate_date = DateTime.Now;
// EURO
currency c2 = da.GetCurrency("EUR");
currency_rate r2 = new currency_rate();
r2.currency = c2;
r2.rate = decimal.Parse(edtEURO.Text);
r2.rate_date = DateTime.Now;
// RUR
currency c3 = da.GetCurrency("RUR");
currency_rate r3 = new currency_rate();
r3.currency = c3;
r3.rate = decimal.Parse(edtRUR.Text)/100;
r3.rate_date = DateTime.Now;
rates.Add(r1);
rates.Add(r2);
rates.Add(r3);
da.CurrencyRatesCreate(rates);
}
示例2: EditRates
private void EditRates()
{
DataAccess da = new DataAccess();
List<currency_rate> rates = new List<currency_rate>();
// USD
currency c1 = da.GetCurrency("USD");
currency_rate r1 = new currency_rate();
r1.currency = c1;
r1.rate = decimal.Parse(edtUSD.Text);
r1.rate_date = edtDate.SelectedDate.Value;
// EURO
currency c2 = da.GetCurrency("EUR");
currency_rate r2 = new currency_rate();
r2.currency = c2;
r2.rate = decimal.Parse(edtEURO.Text);
r2.rate_date = edtDate.SelectedDate.Value;
// RUR
currency c3 = da.GetCurrency("RUR");
currency_rate r3 = new currency_rate();
r3.currency = c3;
r3.rate = decimal.Parse(edtRUR.Text)/100;
r3.rate_date = edtDate.SelectedDate.Value;
rates.Add(r1);
rates.Add(r2);
rates.Add(r3);
da.CurrencyRatesEdit(rates);
}
示例3: ReloadList
private void ReloadList()
{
DataAccess da = new DataAccess();
this.DataContext = da.GetCurrency();
}
示例4: LoadComboboxCurrencies
// CUSTOM FUNCTIONS
private void LoadComboboxCurrencies()
{
DataAccess da = new DataAccess();
List<currency> x = da.GetCurrency();
edtCurrency.Items.Clear();
foreach (currency c in x)
edtCurrency.Items.Add(c.code);
edtCurrency.SelectedItem = da.getBasicCurrencyCode();
}
示例5: LoadCurrencies
private void LoadCurrencies()
{
DataAccess da = new DataAccess();
List<currency> lst = da.GetCurrency();
edtCurrentCurrency.Items.Clear();
foreach (currency i in lst)
{
edtCurrentCurrency.Items.Add(i.code);
if (i.is_basic == 1)
edtCurrentCurrency.SelectedValue = i.code;
}
}