Exemplo n.º 1
0
        protected override void Execute()
        {
            var report = _reportsViewerController.GetSelectedReports().FirstOrDefault();

            if (report == null)
            {
                return;
            }

            var reportTemplates        = _reportsViewerController.GetCustomReportTemplates();
            var reports                = _reportsViewerController.GetReports();
            var groupNames             = reports.OrderByDescending(b => b.Group).Select(a => a.Group).Distinct().ToList();
            var taskTemplateIdProvider = new TaskTemplateIdProvider();

            var viewModel = new AppendReportViewModel(report.Clone() as Report, _imageService,
                                                      _reportsViewerController.GetSelectedProject(), groupNames, reportTemplates, taskTemplateIdProvider, true);
            var view = new AppendReportWindow(viewModel, null);

            viewModel.Window = view;

            var result = view.ShowDialog();

            if (result != null && (bool)result)
            {
                _reportsViewerController.UpdateReports(new List <Report> {
                    viewModel.Report
                });
            }
        }
Exemplo n.º 2
0
        private void AddNewReport(Report report)
        {
            var selectedProject = _reportsViewerController.GetSelectedProject();

            if (selectedProject == null)
            {
                return;
            }

            var reportTemplates = GetCustomReportTemplates();

            var reports                = _reportsViewerController.GetReports();
            var groupNames             = reports.OrderByDescending(b => b.Group).Select(a => a.Group).Distinct().ToList();
            var taskTemplateIdProvider = new TaskTemplateIdProvider();

            var viewModel = new AppendReportViewModel(report, _imageService, selectedProject, groupNames, reportTemplates, taskTemplateIdProvider);
            var view      = new AppendReportWindow(viewModel, null);

            viewModel.Window = view;

            var result = view.ShowDialog();

            if (result != null && (bool)result)
            {
                _reportsViewerController.AddReports(new List <Report> {
                    viewModel.Report
                });
            }
        }