Exemple #1
0
        public override void CleanBeforeSave()
        {
            base.CleanBeforeSave();

            if ((SelectedReportingStates == null || !SelectedReportingStates.Any()) && StateContext.Any())
            {
                if (SelectedReportingStates == null)
                {
                    SelectedReportingStates = new List <string>();
                }


                StateContext.ForEach(s =>
                {
                    if (SelectedReportingStates.All(rs => !rs.EqualsIgnoreCase(s)))
                    {
                        SelectedReportingStates.Add(s);
                    }
                });
            }

            // Handle Reports null values to force index reordering
            //CleanUpCollectionItems();

            // ****** Status processing for website ******

            // Check status is greater than CompletedDependencyCheck return.
            if ((int?)CurrentStatus >= (int?)WebsiteState.CompletedDependencyCheck)
            {
                return;
            }

            if ((Reports != null && Reports.Any()) && (Measures != null && Measures.Any()) && Datasets.Any())
            {
                CurrentStatus = WebsiteState.Initialized;
            }

            // Check status should be set to HasReports.
            if (CurrentStatus == WebsiteState.HasReports || (Reports != null && Reports.Any()))
            {
                CurrentStatus = WebsiteState.HasReports;
                return;
            }

            // Check status should be set to HasMeasures.
            if (CurrentStatus == WebsiteState.HasMeasures || (Measures != null && Measures.Any()))
            {
                CurrentStatus = WebsiteState.HasMeasures;
                return;
            }

            // Check status should be set to HasDatasources.
            if (CurrentStatus == WebsiteState.HasDatasources || !Datasets.Any())
            {
                return;
            }
            CurrentStatus = WebsiteState.HasDatasources;
        }
Exemple #2
0
        public void LogReport(Report report)
        {
            if (Reports.Any(x => x.Id == report.Id))
            {
                return;
            }

            Reports.Add(report);
            CaseIncrement += 1;
        }
Exemple #3
0
        public bool TryGetReport(ulong id, out Report report)
        {
            report = null;
            if (!Reports.Any(x => x.Id == id))
            {
                return(false);
            }

            report = Reports.FirstOrDefault(x => x.Id == id);
            return(true);
        }
        public ReportsViewModel(
            ISynchronizationReportRepository reportRepository,
            Dictionary <Guid, string> currentProfileNamesById)
        {
            _reportRepository        = reportRepository;
            _currentProfileNamesById = currentProfileNamesById;
            _deleteSelectedCommand   = new DelegateCommand(DeleteSelected, _ => Reports.Any(r => r.IsSelected));
            _saveSelectedCommand     = new DelegateCommand(SaveSelected, _ => Reports.Any(r => r.IsSelected));

            foreach (var reportName in reportRepository.GetAvailableReports())
            {
                AddReportViewModel(reportName);
            }

            // Regarding to race conditions it doesn't matter when the handler is added
            // since everything happens in the ui thread
            _reportRepository.ReportAdded += ReportRepository_ReportAdded;

            if (Reports.Count > 0)
            {
                Reports[0].IsSelected = true;
            }
        }
Exemple #5
0
        public async void CreateNewReport()
        {
            var rule             = new WarcraftLogsUrlValidationRule();
            var validationResult = rule.Validate(NewReportUrl, CultureInfo.CurrentUICulture);

            if (!validationResult.IsValid)
            {
                MessageBox.Show(validationResult.ErrorContent.ToString());
                return;
            }

            if (Reports.Any(d => d.LoaderText.Equals(NewReportUrl)))
            {
                MessageBox.Show("Dieser Bericht existiert bereits.");
                return;
            }

            var newUrl = NewReportUrl;

            NewReportUrl = null;

            await CreateReportViewModelAsync(newUrl);
        }
 public bool IsOrderReport()
 {
     return(Reports.Any(r => r.ReportType.IsOrderReport));
 }