Beispiel #1
0
        /// <summary>
        /// 从csv文件中读取交易日信息。
        /// </summary>
        /// <param name="CSVName"></param>
        private void GetDataFromCSV(string CSVName)
        {
            DataTable tradeDaysData = CsvApplication.OpenCSV(CSVName);

            foreach (DataRow r in tradeDaysData.Rows)
            {
                tradeDaysOfDataBase.Add(Convert.ToInt32(r["tradedays"]));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 将交易日信息存入CSV文件。
        /// </summary>
        private void SaveTradeDaysDataByCSV(string CSVName)
        {
            DataTable tradeDaysData = new DataTable();

            tradeDaysData.Columns.Add("tradedays", typeof(int));
            foreach (int date in tradeDaysOfDataBase)
            {
                DataRow r = tradeDaysData.NewRow();
                r["tradedays"] = date;
                tradeDaysData.Rows.Add(r);
            }
            CsvApplication.SaveCSV(tradeDaysData, CSVName);
        }