public static void SyncFinance() { var list = WYStockBiz.GetFinanceList(DateTime.Now); if (!list.IsNullOrEmpty()) { FinanceDAL.InsertFinance(list); } }
public static void DownloadFinanceFromTHS() { var stockList = FinanceDAL.GetNoFinanceStock(); foreach (var stock in stockList) { var list = THSBiz.DownloadFinance(stock); if (!list.IsNullOrEmpty()) { FinanceDAL.InsertFinance(list); } } }
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); } }
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); } }