예제 #1
0
        private void AddUncomitted(FatDataContext context, StockDividend stockDividend)
        {
            // exists
            var dividend = context.StockDividends.Find(stockDividend.StockCode, stockDividend.ExDate);

            if (dividend == null)
            {
                context.StockDividends.Add(stockDividend);
            }
        }
        //public static void Import()
        //{
        //    var csv = File.ReadAllText(@"D:\Dev\git\FatDividends\_documentation\complete_dividends.csv");
        //}
        public static void Import(StockDividend dividend)
        {
            var dividends = new List<StockDividend> { dividend };

            UpdateClosingPrices(dividends);

            using (var service = new DividendService())
            {
                service.Add(dividends);
            }
        }