コード例 #1
0
        public void Execute(IEnumerable <string> parameters)
        {
            var startDate = DateTime.Now.Date;
            var endDate   = DateTime.Now.Date;

            Logger.Debug($"Synchronizing data from {startDate.ToShortDateString()}");
            _synchronizer.Sync(startDate, endDate);
        }
コード例 #2
0
        public void Execute(IEnumerable <string> parameters)
        {
            var arrayParameters = parameters as string[] ?? parameters.ToArray();
            var startDate       = arrayParameters.Any()
                ? DateTime.ParseExact(arrayParameters[0], Consts.Formats.DateFormat, System.Globalization.CultureInfo.InvariantCulture)
                : DateTime.Parse(Consts.SyncDataParameters.StartDate);
            var endDate = arrayParameters.Length > 1
                ? DateTime.ParseExact(arrayParameters[1], Consts.Formats.DateFormat, System.Globalization.CultureInfo.InvariantCulture)
                : DateTime.Now;
            var companyCodes = arrayParameters.Length > 2 ? arrayParameters.Skip(2) : null;

            _synchronizer.Sync(startDate, endDate, companyCodes);
        }