本文整理汇总了C#中bycar.DataAccess.GetAnalogues方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.GetAnalogues方法的具体用法?C# DataAccess.GetAnalogues怎么用?C# DataAccess.GetAnalogues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.GetAnalogues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BackgroundShowDetails_DoWork
private void BackgroundShowDetails_DoWork(object sender, DoWorkEventArgs e)
{
// DETAILED INFO
IList selectedItems = e.Argument as IList;
if (selectedItems.Count == 0)
{
DetailSpareInfo_Brand = "";
DetailSpareInfo_Group = "";
DetailSpareInfo_Name = "";
Detail_Incomes = null;
Detail_Analogues = null;
}
else
{
SpareView selected = selectedItems[0] as SpareView;
DetailSpareInfo_Brand = selected.BrandName;
DetailSpareInfo_Name = selected.name;
// построим путь по группам к запчасти
// текущая группа
DataAccess db = new DataAccess();
spare s = db.GetSpare(selected.id);
string gp = s.spare_group.name;
// родительская
if (s.spare_group1 != null)
gp = s.spare_group1.name + "/" + gp;
// дедушка
if (s.spare_group2 != null)
gp = s.spare_group2.name + "/" + gp;
// прадедушка
if (s.spare_group3 != null)
gp = s.spare_group3.name + "/" + gp;
DetailSpareInfo_Group = gp;
// INCOMES & ANALOGS WINDOWS
// anlogues
Detail_Analogues = db.GetAnalogues(selected.id);
// incomes
Detail_Incomes = db.GetIncomes(selected.id);
foreach (SpareInSpareIncomeView i in Detail_Incomes)
{
decimal POutBasic = 0;
decimal PInBasic = 0;
if (!i.POutBasic.HasValue)
{
string IncomeCurrencyCode = i.CurrencyCode;
decimal PIn = i.PIn.Value;
POutBasic = CurrencyHelper.GetBasicPrice(IncomeCurrencyCode, PIn);
}
else
{
POutBasic = i.POutBasic.Value;
}
if (i.PInBasic.HasValue)
{
PInBasic = i.PInBasic.Value;
}
else
{
string IncomeCurrencyCode = i.CurrencyCode;
decimal PIn = i.PIn.Value;
PInBasic = CurrencyHelper.GetBasicPrice(IncomeCurrencyCode, PIn);
}
i.DF_PriceInCurrency = CurrencyHelper.GetPrice(currentCurrencyName, POutBasic);
i.DF_PriceInCurrencyIn = CurrencyHelper.GetPrice(currentCurrencyName, PInBasic);
string strDate = "";
if (i.SpareIncomeDate.Value.Day < 10)
strDate += "0";
strDate += i.SpareIncomeDate.Value.Day + ".";
if (i.SpareIncomeDate.Value.Month < 10)
strDate += "0";
strDate += i.SpareIncomeDate.Value.Month + ".";
strDate += i.SpareIncomeDate.Value.Year;
i.DF_Date = strDate;
}
}
}
示例2: loadAnalogues
private void loadAnalogues(int spareId)
{
DataAccess da = new DataAccess();
List<SpareView> items = da.GetAnalogues(spareId);
dgAnalogues.DataContext = items;
dgAnalogues.SelectedIndex = 0;
}