public static List <Dividend> Get_DividendList_CUSIP(string CUSIP, DividendTable_option table = DividendTable_option.Dividend_Control_Approved) { List <Dividend> dvdList = new List <Dividend>(); if (string.IsNullOrEmpty(CUSIP)) { return(dvdList); } DB_select selt = new DB_select(Dividend.Get_cmdTP()); selt.tableName = table.ToString(); SQL_relation rela = new SQL_relation("CUSIP", RelationalOperator.Equals, CUSIP); selt.SetCondition(rela); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { Dividend dvd = new Dividend(); dvd.Init_from_reader(reader); dvdList.Add(dvd); } reader.Close(); return(dvdList); }
public static Dividend GetDividend_dvdID(string dvdID, DividendTable_option tableOpt) { hssDB hDB = Utility.Get_DRWIN_hDB(); DB_select selt = new DB_select(Dividend.Get_cmdTP()); selt.tableName = tableOpt.ToString(); SQL_relation rela = new SQL_relation("DividendID", RelationalOperator.Equals, dvdID); selt.SetCondition(rela); Dividend dvd = null; DB_reader reader = new DB_reader(selt, hDB); if (reader.Read()) { dvd = new Dividend(); dvd.Init_from_reader(reader); } reader.Close(); return(dvd); }