private void AddDataToDb()
 {
     if (announcementList.Count > 0)
     {
         Logger.Log("Adding data to database.");
         int rows = KoreaEquityManager.UpdateEquity(announcementList);
         Logger.Log(string.Format("{0} records updated.", rows.ToString()));
     }
 }
        private void GetIpo()
        {
            ipos = new List <KoreaEquityInfo>();

            string currentDate = DateTime.Today.ToString("yyyy-MM-dd", new CultureInfo("en-US"));

            if (!isAfternoonTask)
            {
                currentDate = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd", new CultureInfo("en-US"));
            }

            ipos = KoreaEquityManager.SelectEquityByDate(currentDate);
        }
示例#3
0
        private void GetIpo()
        {
            ipos = new List <KoreaEquityInfo>();

            string currentDate = DateTime.Today.ToString("yyyy-MM-dd", new CultureInfo("en-US"));

            if (!isAfternoonTask)
            {
                currentDate = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd", new CultureInfo("en-US"));
            }

            ipos = KoreaEquityManager.SelectEquityByDate(currentDate);

            //Dictionary<string, KoreaEquityInfo> ipoDic = ipos.ToDictionary(e => e.Ticker, StringComparer.Ordinal);
        }
示例#4
0
        private List <KoreaEquityInfo> FilterTodayAnnounce(IEnumerable <List <string> > records)
        {
            List <KoreaEquityInfo> anns = new List <KoreaEquityInfo>();

            //If code existed in DB. Ignore this announcement.
            foreach (List <string> record in records)
            {
                string code = record[0];
                if (KoreaEquityManager.ExistsFmOneCode(code))
                {
                    Logger.Log(string.Format("Announcement of {0} is already existed in database.", record[1]));
                    continue;
                }
                KoreaEquityInfo ann = new KoreaEquityInfo
                {
                    KoreaName     = record[1],
                    EffectiveDate = record[2],
                    Market        = GetDutyCode(record[3])
                };
                anns.Add(ann);
            }
            return(anns);
        }
示例#5
0
        /// <summary>
        /// Select equities from database and generate GEDA and NDA files.
        /// </summary>
        private void StartNameChangePart()
        {
            Logger.Log("Start Equity Name Change Part:");
            nameChange = KoreaEquityManager.SelectEquityByEffectiveDateChange(effectiveDate);
            if (nameChange == null)
            {
                string msg = string.Format("No equity name change records will effect on {0}.", effectiveDate);
                Logger.Log(msg);
                return;
            }
            else
            {
                string msg = string.Format("{0} equity name change record(s) will effect on {1}.", nameChange.Count, effectiveDate);
                Logger.Log(msg);
            }
            if (!Directory.Exists(outputFolder))
            {
                Directory.CreateDirectory(outputFolder);
            }

            GenerateNameChangeGedaFile();
            GenerateNameChangeNdaQAFile();
            GenerateNameChangeNdaIAFile();
        }