Esempio n. 1
0
        public static void SyncFinance()
        {
            var list = WYStockBiz.GetFinanceList(DateTime.Now);

            if (!list.IsNullOrEmpty())
            {
                FinanceDAL.InsertFinance(list);
            }
        }
Esempio n. 2
0
        public static void DownloadFinanceFromTHS()
        {
            var stockList = FinanceDAL.GetNoFinanceStock();

            foreach (var stock in stockList)
            {
                var list = THSBiz.DownloadFinance(stock);
                if (!list.IsNullOrEmpty())
                {
                    FinanceDAL.InsertFinance(list);
                }
            }
        }
Esempio n. 3
0
        public static void SyncPlanFinance()
        {
            var date = FinanceDAL.GetMaxPlanIndate();

            if (!date.HasValue)
            {
                date = DateTime.Now.AddYears(-2);
            }
            var list = WYStockBiz.GetPlanFinance(date.Value);

            if (!list.IsNullOrEmpty())
            {
                FinanceDAL.InsertPlan(list);
            }
        }
Esempio n. 4
0
        public static void SyncFinanceFromTHS()
        {
            var reportDate = DateTime.Now;

            reportDate = DateTime.Parse(string.Format("{0}-{1}", reportDate.AddMonths(-6).Year - 2, "09-30"));
            while (reportDate < DateTime.Now)
            {
                var endDate = FinanceDAL.GetMaxIndate(reportDate).GetValueOrDefault(reportDate);
                var list    = THSBiz.GetFinanceList(reportDate, endDate);
                if (!list.IsNullOrEmpty())
                {
                    FinanceDAL.InsertFinance(list);
                }
                reportDate = reportDate.AddDays(1).AddMonths(3).AddDays(-1);
            }
        }