private void RunCommitServices(List <ValidationResult> repairList)
        {
            SettingsCollection _options = new SettingsCollection();

            foreach (ValidationResult itemToFix in repairList)
            {
                DateTimeRange _dateTimeRange    = new DateTimeRange();
                string        TargetPeriodStart = String.Empty;
                string        TargetPeriodEnd   = String.Empty;

                _dateTimeRange.Start = DateTimeSpecification.Parse(itemToFix.TargetPeriodStart.ToString());
                _dateTimeRange.End   = DateTimeSpecification.Parse(itemToFix.TargetPeriodEnd.ToString());

                string serviceName = Const.AdMetricsConst.WorkflowServices.CommitServiceName;
                ServiceClient <IScheduleManager> scheduleManager = new ServiceClient <IScheduleManager>();

                _options.Add("ConflictBehavior", "Ignore");
                _options.Add("DeliveryID", itemToFix.DeliveryID.ToString());

                //Run Service
                _options.Add(PipelineService.ConfigurationOptionNames.TimePeriod, _dateTimeRange.ToAbsolute().ToString());

                //bool result = _listner.FormAddToSchedule(serviceName, -1, DateTime.Now, _options, ServicePriority.Normal);
                //if (!result)
                //{
                //    MessageBox.Show(string.Format("Service {0} for account {1} did not run", serviceName, -1));
                //}
            }
        }
Exemple #2
0
        private bool TryGetDeliveryTargetPeriod(string deliveryId, out DateTimeRange TargetPeriodDefinition)
        {
            TargetPeriodDefinition = new DateTimeRange();
            string TargetPeriodStart = String.Empty;
            string TargetPeriodEnd   = String.Empty;

            GetDeliveryTargetPeriodFromDB(deliveryId, out TargetPeriodStart, out TargetPeriodEnd);

            if (!string.IsNullOrEmpty(TargetPeriodStart) && !string.IsNullOrEmpty(TargetPeriodEnd))
            {
                TargetPeriodDefinition.Start = DateTimeSpecification.Parse(TargetPeriodStart);
                TargetPeriodDefinition.End   = DateTimeSpecification.Parse(TargetPeriodEnd);
                return(true);
            }
            return(false);
        }