Ejemplo 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();
        }
Ejemplo n.º 2
0
 public static void LoadStockOwnedByAll(tmpDS.investorStockDataTable tbl)
 {
     sumInvestorStockTA.ClearBeforeFill = false;
     sumInvestorStockTA.Fill(tbl);
 }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
 public static void LoadStockCode_ByStockExchange(tmpDS.stockCodeDataTable tbl, string stockExchange, AppTypes.CommonStatus status)
 {
     shortStockCodeTA.FillByStockExchange(tbl, stockExchange,((byte)status).ToString());
 }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Return the stocks prefered by an investor
 /// </summary>
 /// <param name="tbl"></param>
 /// <param name="investorCode"></param>
 public static void LoadData(tmpDS.interestedCodeDataTable tbl,string investorCode)
 {
     interestedCodeTA.ClearBeforeFill = false;
     interestedCodeTA.FillByInvestor(tbl, investorCode);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Load investor data with investorCode
 /// </summary>
 /// <param name="tbl"></param>
 /// <param name="investorCode"></param>
 public static void LoadData(tmpDS.investorStockDataTable tbl,string investorCode)
 {
     sumInvestorStockTA.ClearBeforeFill = false;
     sumInvestorStockTA.FillByInvestor(tbl, investorCode);
 }
Ejemplo n.º 9
0
 public static void LoadData(tmpDS.investorDataTable tbl)
 {
     tmpDSTableAdapters.investorTA investorTA = new tmpDSTableAdapters.investorTA();
     investorTA.ClearBeforeFill = false;
     investorTA.Fill(tbl);
 }
Ejemplo n.º 10
0
 public static void LoadData(tmpDS.stockCodeDataTable tbl, AppTypes.CommonStatus status)
 {
     shortStockCodeTA.ClearBeforeFill = false;
     shortStockCodeTA.FillByStatusMask(tbl, ((byte)status).ToString());
 }
Ejemplo n.º 11
0
 public static void LoadData(tmpDS.stockCodeDataTable tbl, string code)
 {
     shortStockCodeTA.ClearBeforeFill = false;
     shortStockCodeTA.FillByCode(tbl, code);
 }