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


C# DataAccess.GetAnalogues方法代码示例

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

示例2: loadAnalogues

 private void loadAnalogues(int spareId)
 {
     DataAccess da = new DataAccess();
     List<SpareView> items = da.GetAnalogues(spareId);
     dgAnalogues.DataContext = items;
     dgAnalogues.SelectedIndex = 0;
 }
开发者ID:bashlykevich,项目名称:Bycar,代码行数:7,代码来源:SpareEditView.xaml.cs


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