当前位置: 首页>>代码示例>>C#>>正文


C# DataAccess.GetIncomes方法代码示例

本文整理汇总了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;
        }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:44,代码来源:UCSpares.xaml.cs

示例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);
            }
        }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:32,代码来源:UCSpares.xaml.cs

示例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;
 }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:16,代码来源:SpareInOutgoSelectView.xaml.cs

示例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;
                }
            }
        }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:83,代码来源:UCSpares.xaml.cs

示例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;
 }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:11,代码来源:SpareInInvoiceSelectView2.xaml.cs


注:本文中的bycar.DataAccess.GetIncomes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。