using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading.Tasks;

namespace Bailun.DC.DailyLogisticSupplierTransaction
{
    class Program
    {
        /// <summary>
        /// 物流供应商往来统计报表
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        //static async Task Main(string[] args)
        //{
        //    Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
        //    var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
        //    {
        //        services.AddHostedService<Services>();
        //    });

        //    await builder.RunConsoleAsync();
        //}

        static void Main(string[] args)
        {
            var _services = new Bailun.DC.Services.LogisticsServices();

            var start = DateTime.Parse("2020-11-01");
            //_services.LogisticsSupplierTransaction(start);

            while (start.AddDays(1) < DateTime.Now)
            {
                Console.WriteLine(start);
                _services.LogisticsSupplierTransaction(start);
                start = start.AddDays(1);
            }
        }
    }
}
