本文整理汇总了C#中bycar.DataAccess.GetIncomes方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.GetIncomes方法的具体用法?C# DataAccess.GetIncomes怎么用?C# DataAccess.GetIncomes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bycar.DataAccess
的用法示例。
在下文中一共展示了DataAccess.GetIncomes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadIncomes
private void LoadIncomes(int SpareID)
{
da = new DataAccess();
List<SpareInSpareIncomeView> items = da.GetIncomes(SpareID);
foreach (SpareInSpareIncomeView i in items)
{
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;
}
dgIncomes.DataContext = items;
}
示例2: LoadHistory
private void LoadHistory(int SpareID)
{
lvHistory.Items.Clear();
da = new DataAccess();
List<SpareInSpareIncomeView> items = da.GetIncomes(SpareID);
items = (from i in items orderby i.SpareIncomeDate.Value descending select i).Take(10).ToList();
foreach (SpareInSpareIncomeView i in items)
{
string hi = "";
string d = i.SpareIncomeDate.Value.ToShortDateString();
string an = i.AccountName;
decimal POutBasic = 0;
if (!i.POutBasic.HasValue)
{
string IncomeCurrencyCode = i.CurrencyCode;
decimal PIn = i.PIn.Value;
POutBasic = CurrencyHelper.GetBasicPrice(IncomeCurrencyCode, PIn);
}
else
{
POutBasic = i.POutBasic.Value;
}
i.DF_PriceInCurrency = CurrencyHelper.GetPrice(currentCurrencyName, POutBasic);
string p = i.DF_PriceInCurrency.ToString();
string cc = i.CurrencyCode;
if (an == null)
an = "НЕ УКАЗАН";
hi = d + " от контрагента [" + an + "] поступило " + i.QIn.ToString() + " единиц товара по цене " + p + cc + ".";
lvHistory.Items.Add(hi);
}
}
示例3: LoadIncomes
private void LoadIncomes(int SpareID)
{
DataAccess da = new DataAccess();
List<SpareInSpareIncomeView> lst = da.GetIncomes(SpareID);
foreach (SpareInSpareIncomeView i in lst)
{
decimal pr1 = CurrencyHelper.GetPrice(CurrentCurrencyCode, i.POutBasic.Value);
if (CurrentCurrencyCode == "BYR")
{
decimal tmpd = Math.Round(pr1 / 50, 0);
pr1 = tmpd * 50;
}
i.DF_PriceInCurrency = pr1;
}
dgIncomes.DataContext = lst;
}
示例4: 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;
}
}
}
示例5: LoadIncomes
private void LoadIncomes(int SpareID)
{
CurrentCurrencyCode = "BYR";
DataAccess da = new DataAccess();
List<SpareInSpareIncomeView> lst = da.GetIncomes(SpareID);
foreach (SpareInSpareIncomeView i in lst)
{
i.DF_PriceInCurrency = CurrencyHelper.GetPrice(CurrentCurrencyCode, i.POutBasic.Value);
}
dgIncomes.DataContext = lst;
}