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 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); } }