public override string load(DateTime refDate, string symbol)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(refDate);
            dao.STOCK_ID_ = symbol;

            dao.select_ID_Date(this.conn_);

            return dao.CURR_PRICE_;
        }
        public override string load(DateTime refDate, string symbol)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(refDate);
            dao.STOCK_ID_ = symbol;

            dao.select_ID_Date(this.conn_);

            return(dao.CURR_PRICE_);
        }
        public void selectInterval(DbConnection conn, DateTime startDate, DateTime endDate)
        {
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }
            try
            {
                DataTable tb = new DataTable();

                this.DAOList_ = new List <TD_MRSTOCKFACTOR_Table_DAO>();

                DbCommand dbCommand = conn.CreateCommand();

                string SelectInterValQuery_ = TD_MRSTOCKFACTOR_Table_DAOManager.SelectInterValQuery_;

                SelectInterValQuery_ = SelectInterValQuery_.Replace("@KeyColumnValue@", this.STOCK_ID_);
                SelectInterValQuery_ = SelectInterValQuery_.Replace("@StartDateValue@", startDate.ToString(StringFormat.DbDateFormat_));
                SelectInterValQuery_ = SelectInterValQuery_.Replace("@EndDateValue@", endDate.ToString(StringFormat.DbDateFormat_));

                //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

                dbCommand.CommandText = SelectInterValQuery_;

                //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
                DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

                dataAdapter.Fill(tb);

                DataRow[] dr       = tb.Select();
                int       rowCount = dr.Length;

                foreach (DataRow item in dr)
                {
                    TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

                    dao.STD_DATE_      = item[0].ToString();
                    dao.STOCK_ID_      = item[1].ToString();
                    dao.STOCK_NAME_    = item[2].ToString();
                    dao.CURR_PRICE_    = item[3].ToString();
                    dao.DIVIDEND_RATE_ = item[4].ToString();

                    this.DAOList_.Add(dao);
                }

                conn.Close();
            }
            catch (Exception)
            {
                conn.Close();
                throw;
            }
        }
コード例 #4
0
        public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);

            dao.select_ID_Date(DataBaseConnectManager.ConnectionFactory("MRO"));

            string v = dao.DIVIDEND_RATE_;

            return(v);
        }
        public override string value(DateTime dateTime, Excel_instrumentViewModel excel_instrumentViewModel, Excel_underlyingInfoViewModel excel_uivm)
        {
            TD_MRSTOCKFACTOR_Table_DAO dao = new TD_MRSTOCKFACTOR_Table_DAO();

            dao.STOCK_ID_ = excel_uivm.KrCode_;
            dao.STD_DATE_ = StringConverter.dbDateTimeToDateString(dateTime);

            dao.select_ID_Date(DataBaseConnectManager.ConnectionFactory("MRO"));

            string v = dao.DIVIDEND_RATE_;

            return v;
        }