Exemplo n.º 1
0
        public static void LoadStockCode_ByWatchList(tmpDS.stockCodeDataTable stockCodeTbl, StringCollection codes)
        {
            StringCollection retList = new StringCollection();
            StringCollection list;

            tmpDS.stockCodeDataTable  tmpTbl       = new tmpDS.stockCodeDataTable();
            baseDS.portfolioDataTable portfolioTbl = new baseDS.portfolioDataTable();
            baseDS.portfolioRow       portfolioRow;
            for (int idx1 = 0; idx1 < codes.Count; idx1++)
            {
                portfolioRow = AppLibs.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();
        }
Exemplo n.º 2
0
        public static void LoadStockCode_ByCodeList(tmpDS.stockCodeDataTable tbl, StringCollection stockCode)
        {
            string cond   = common.system.MakeConditionStr(stockCode, "" + tbl.codeColumn.ColumnName + "=N'", "'", "OR");
            string sqlCmd = "SELECT code, stockExchange, tickerCode, name,nameEn FROM stockCode WHERE " + cond;

            LoadFromSQL(tbl, sqlCmd);
        }
Exemplo n.º 3
0
        public static void LoadStockCode_ByBizSectors(tmpDS.stockCodeDataTable tbl, StringCollection bizSectors)
        {
            baseDS.stockCodeDataTable comTbl = new baseDS.stockCodeDataTable();
            string cond = common.system.MakeConditionStr(bizSectors,
                                                         comTbl.bizSectorsColumn.ColumnName + " LIKE N'" +
                                                         common.Consts.SQL_CMD_ALL_MARKER + common.Settings.sysListSeparatorPrefix,
                                                         common.Settings.sysListSeparatorPostfix + common.Consts.SQL_CMD_ALL_MARKER + "'",
                                                         "OR");
            string sqlCmd = "SELECT code, stockExchange, tickerCode, name,nameEn,0 AS price,0 AS priceVariant FROM stockCode WHERE " + cond;

            LoadFromSQL(tbl, sqlCmd);
        }
Exemplo n.º 4
0
        public static void LoadStockCode_ByPortfolios(tmpDS.stockCodeDataTable tbl, StringCollection portfolios)
        {
            baseDS.investorStockDataTable tmpTbl = new baseDS.investorStockDataTable();
            string cond = common.system.MakeConditionStr(portfolios, "b." + tmpTbl.portfolioColumn.ColumnName + "=N'", "'", "OR");

            if (cond.Trim() == "")
            {
                return;
            }

            tmpTbl.Dispose();

            string sqlCmd = "SELECT DISTINCT a.code, a.stockExchange, a.tickerCode, a.name,nameEn" +
                            " FROM stockCode a INNER JOIN investorStock b ON a.code = b.stockCode" +
                            " WHERE " + cond;

            LoadFromSQL(tbl, sqlCmd);
        }
Exemplo n.º 5
0
 public static void LoadStockCode_ByStockExchange(tmpDS.stockCodeDataTable tbl, string stockExchange, AppTypes.CommonStatus status)
 {
     shortStockCodeTA.FillByStockExchange(tbl, stockExchange, ((byte)status).ToString());
 }
Exemplo n.º 6
0
 public static void LoadData(tmpDS.stockCodeDataTable tbl, AppTypes.CommonStatus status)
 {
     shortStockCodeTA.ClearBeforeFill = false;
     shortStockCodeTA.FillByStatusMask(tbl, ((byte)status).ToString());
 }
Exemplo n.º 7
0
 public static void LoadData(tmpDS.stockCodeDataTable tbl, string code)
 {
     shortStockCodeTA.ClearBeforeFill = false;
     shortStockCodeTA.FillByCode(tbl, code);
 }
Exemplo n.º 8
0
        public static void LoadStockCode_ByWatchList(tmpDS.stockCodeDataTable stockCodeTbl, StringCollection codes)
        {
            StringCollection retList = new StringCollection();
            StringCollection list;

            tmpDS.stockCodeDataTable tmpTbl = new tmpDS.stockCodeDataTable();
            baseDS.portfolioDataTable portfolioTbl = new baseDS.portfolioDataTable();
            baseDS.portfolioRow portfolioRow;
            for (int idx1 = 0; idx1 < codes.Count; idx1++)
            {
                portfolioRow = AppLibs.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();
        }