예제 #1
0
        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();
        }
예제 #2
0
        public static void LoadData(data.tmpDS.stockCodeDataTable stockCodeTbl, data.baseDS.portfolioRow row)
        {
            StringCollection list;

            list = common.MultiValueString.String2List(row.interestedSector);
            if (list.Count > 0)
            {
                LoadStockCode_ByBizSectors(stockCodeTbl, list);
            }

            list = common.MultiValueString.String2List(row.interestedStock);
            if (list.Count > 0)
            {
                data.tmpDS.stockCodeDataTable tmpTbl = new data.tmpDS.stockCodeDataTable();
                LoadStockCode_ByCodeList(tmpTbl, list);
                for (int idx = 0; idx < tmpTbl.Count; idx++)
                {
                    SysLibs.FindAndCache(stockCodeTbl, tmpTbl[idx].code);
                }
            }
        }