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


C# data.FindBycode方法代码示例

本文整理汇总了C#中data.FindBycode方法的典型用法代码示例。如果您正苦于以下问题:C# data.FindBycode方法的具体用法?C# data.FindBycode怎么用?C# data.FindBycode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data的用法示例。


在下文中一共展示了data.FindBycode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadStockCode_ByWatchList

        public static void LoadStockCode_ByWatchList(data.tmpDS.stockCodeDataTable stockCodeTbl, StringCollection codes)
        {
            StringCollection retList = new StringCollection();
            StringCollection list;

            data.tmpDS.stockCodeDataTable tmpTbl = new data.tmpDS.stockCodeDataTable();
            data.baseDS.portfolioDataTable portfolioTbl = new data.baseDS.portfolioDataTable();
            data.baseDS.portfolioRow portfolioRow;
            for (int idx1 = 0; idx1 < codes.Count; idx1++)
            {
                portfolioRow = SysLibs.FindAndCache(portfolioTbl, codes[idx1]);
                if (portfolioRow == null) continue;
                list = common.MultiValueString.String2List(portfolioRow.interestedStock);
                if (list.Count <= 0) continue;
                tmpTbl.Clear();
                LoadStockCode_ByCodeList(tmpTbl, list);
                for (int idx2 = 0; idx2 < tmpTbl.Count; idx2++)
                {
                    if (stockCodeTbl.FindBycode(tmpTbl[idx2].code)==null) stockCodeTbl.ImportRow(tmpTbl[idx2]);
                }
            }
            portfolioTbl.Dispose();
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:23,代码来源:DbAccess.cs

示例2: FindAndCache

 public static data.baseDS.stockCodeRow FindAndCache(data.baseDS.stockCodeDataTable tbl, string code)
 {
     data.baseDS.stockCodeRow row = tbl.FindBycode(code);
     if (row != null) return row;
     data.baseDSTableAdapters.stockCodeTA dataTA = new data.baseDSTableAdapters.stockCodeTA();
     dataTA.ClearBeforeFill = false;
     dataTA.FillByCode(tbl, code);
     row = tbl.FindBycode(code);
     if (row != null) return row;
     return null;
 }
开发者ID:oghenez,项目名称:trade-software,代码行数:11,代码来源:lib.cs

示例3: LoadStockList

        protected void LoadStockList(data.tmpDS.stockCodeDataTable toTbl, string[] watchCodes)
        {
            //Load stocks in portfolio
            data.tmpDS.stockCodeDataTable myStockCodeTbl = null;
            switch (this.watchType)
            { 
                case AppTypes.PortfolioTypes.Portfolio:
                     myStockCodeTbl = DataAccess.Libs.GetStock_InPortfolio(common.system.List2Collection(watchCodes));
                     break;
                case AppTypes.PortfolioTypes.WatchList:
                     myStockCodeTbl = DataAccess.Libs.GetStock_ByWatchList(common.system.List2Collection(watchCodes));
                     break;
                default:
                     common.system.ThrowException("Invalid WatchType"); 
                     break;
            }

            DataView myStockView = new DataView(myStockCodeTbl);
            data.baseDS.stockCodeRow stockRow;
            myStockView.Sort = myStockCodeTbl.codeColumn.ColumnName + "," + myStockCodeTbl.stockExchangeColumn.ColumnName;
            data.tmpDS.stockCodeRow reportRow;
            for (int idx1 = 0; idx1 < myStockView.Count; idx1++)
            {
                stockRow = (data.baseDS.stockCodeRow)myStockView[idx1].Row;
                //Ignore duplicate stocks
                reportRow = toTbl.FindBycode(stockRow.code);
                if (reportRow != null) continue;
                reportRow = toTbl.NewstockCodeRow();
                commonClass.AppLibs.InitData(reportRow);
                reportRow.code = stockRow.code;
                reportRow.stockExchange = stockRow.stockExchange;
                toTbl.AddstockCodeRow(reportRow);
            }
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:34,代码来源:basePortfolioWatch.cs

示例4: DoRefreshPrice

        private void DoRefreshPrice(data.tmpDS.stockCodeDataTable dataTbl)
        {
            //Open price is the same all day.
            if (openPriceTbl == null || openPriceDate != DateTime.Today)
            {
                openPriceTbl = DataAccess.Libs.GetLastPrice(commonClass.PriceDataType.Open);
                openPriceDate = DateTime.Today;
            }

            data.baseDS.lastPriceDataDataTable priceTbl = DataAccess.Libs.GetLastPrice(commonClass.PriceDataType.Close);
            if (priceTbl == null) return;

            data.tmpDS.stockCodeRow stockCodeRow;
            data.baseDS.lastPriceDataRow openPriceRow, closePriceRow;
            dataTbl.priceColumn.ReadOnly = false;
            dataTbl.priceVariantColumn.ReadOnly = false;
            for (int idx = 0; idx < stockGV.RowCount; idx++)
            {
                stockCodeRow = dataTbl.FindBycode(stockGV.Rows[idx].Cells[codeColumn.Name].Value.ToString() );
                if (stockCodeRow == null) continue;
                closePriceRow = priceTbl.FindBystockCode(stockGV.Rows[idx].Cells[codeColumn.Name].Value.ToString());
                if (stockCodeRow.price != closePriceRow.value)
                {
                    stockCodeRow.price = closePriceRow.value;
                    openPriceRow = openPriceTbl.FindBystockCode(stockGV.Rows[idx].Cells[codeColumn.Name].Value.ToString());
                    if (openPriceRow!=null)
                        stockCodeRow.priceVariant = closePriceRow.value - openPriceRow.value;
                    else stockCodeRow.priceVariant = 0;
                }
            }
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:31,代码来源:stockCodeSelectByWatchList.cs


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