コード例 #1
0
 public override ReportResult Run(SavedReport report)
 {
     repo = new ReportRepository();
     ReportResult result = new ReportResult();
     result.DataTableResults = repo.RunRedistrictingReport();
     result.ChartData = null;
     return result;
 }
コード例 #2
0
ファイル: StepCategory.cs プロジェクト: ericjohnolson/NadaNtd
 private void lnkDistro_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     report.ReportOptions.ShowDiseasesOption = false;
     report.ReportOptions.EntityType = Model.IndicatorEntityType.DiseaseDistribution;
     report.ReportOptions.CategoryName = Translations.DiseaseDistribution;
     report.ReportOptions.ReportGenerator = new DistributionReportGenerator();
     report.ReportOptions.AvailableIndicators = repo.GetDiseaseDistroIndicators();
     OnSwitchStep(new StepIndicators(report));
 }
コード例 #3
0
ファイル: StepCategory.cs プロジェクト: ericjohnolson/NadaNtd
 private void lnkIntv_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     report.ReportOptions.ShowDiseasesOption = true;
     report.ReportOptions.EntityType = Model.IndicatorEntityType.Intervention;
     report.ReportOptions.CategoryName = Translations.Interventions;
     report.ReportOptions.ReportGenerator = new IntvReportGenerator();
     report.ReportOptions.AvailableIndicators = repo.GetIntvIndicators();
     OnSwitchStep(new StepIndicators(report));
 }
コード例 #4
0
ファイル: StepCategory.cs プロジェクト: ericjohnolson/NadaNtd
 private void lnkSaes_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     report.ReportOptions.ShowDiseasesOption = false;
     report.ReportOptions.EntityType = Model.IndicatorEntityType.Sae;
     report.ReportOptions.CategoryName = Translations.SAEs;
     report.ReportOptions.ReportGenerator = null; //new SurveyReportGenerator();
     report.ReportOptions.AvailableIndicators = null; // repo.GetSurveyIndicators();
     OnSwitchStep(new StepIndicators(report));
 }
コード例 #5
0
 private void lnkIntv_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     opts.EntityType = Model.IndicatorEntityType.Intervention;
     opts.AvailableIndicators = repo.GetIntvIndicators();
     IntvRepository intv = new IntvRepository();
     var types = intv.GetAllTypes();
     opts.FormTypes = types.Select(t => t.IntvTypeName).OrderBy(t => t).ToList();
     OnSwitchStep(new IndStepIndicators(opts));
 }
コード例 #6
0
 private void lnkSurvey_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     opts.EntityType = Model.IndicatorEntityType.Survey;
     opts.AvailableIndicators = repo.GetSurveyIndicators(false);
     SurveyRepository typeRepo = new SurveyRepository();
     var types = typeRepo.GetSurveyTypes();
     opts.FormTypes = types.Select(t => t.SurveyTypeName).OrderBy(t => t).ToList();
     OnSwitchStep(new IndStepIndicators(opts));
 }
コード例 #7
0
 private void lnkDistro_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     opts.EntityType = Model.IndicatorEntityType.DiseaseDistribution;
     opts.AvailableIndicators = repo.GetDiseaseDistroIndicators();
     DiseaseRepository typeRepo = new DiseaseRepository();
     var types = typeRepo.GetSelectedDiseases();
     opts.FormTypes = types.Select(t => t.DisplayName).OrderBy(t => t).ToList();
     OnSwitchStep(new IndStepIndicators(opts));
 }
コード例 #8
0
 private void lnkProcess_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     opts.EntityType = Model.IndicatorEntityType.Process;
     opts.AvailableIndicators = repo.GetProcessIndicators();
     ProcessRepository typeRepo = new ProcessRepository();
     var types = typeRepo.GetProcessTypes().Select(t => t.TypeName).ToList();
     ProcessBase saes = typeRepo.Create(9);
     types.Add(saes.ProcessType.TypeName);
     opts.FormTypes = types.OrderBy(t => t).ToList();
     OnSwitchStep(new IndStepIndicators(opts));
 }
コード例 #9
0
ファイル: SaveReport.cs プロジェクト: ericjohnolson/NadaNtd
        private void btnSave_Click_1(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(model.DisplayName))
            {
                MessageBox.Show(Translations.PleaseEnterRequiredFields, Translations.ValidationErrorTitle);
                return;
            }
            bindingSource1.EndEdit();
            int userid = ApplicationData.Instance.GetUserId();
            ReportRepository repo = new ReportRepository();
            repo.Save(model, userid);
            OnSave();
            this.Close();

        }
コード例 #10
0
ファイル: DevUtilUi.cs プロジェクト: ericjohnolson/NadaNtd
        public void CreateIndicatorOptionUpdateForm()
        {
            string path = ConfigurationManager.AppSettings["AutomatedListsSavePath"];

            DataTable table = new DataTable();
            table.Columns.Add(new DataColumn("Indicator Id"));
            table.Columns.Add(new DataColumn("Type Id"));
            table.Columns.Add(new DataColumn("Type Name"));
            table.Columns.Add(new DataColumn("Form Name"));
            table.Columns.Add(new DataColumn("Indicator Name"));
            table.Columns.Add(new DataColumn("Indicator Option ID"));
            table.Columns.Add(new DataColumn("Indicator Option"));
            table.Columns.Add(new DataColumn("Weighted Ranking"));
            ReportRepository repo = new ReportRepository();
            List<ReportIndicator> indicators = repo.GetDiseaseDistroIndicators();
            foreach (var cmpc in indicators)
                foreach (var cat in cmpc.Children)
                    AddOptions(table, cat.Children.Where(x => x.DataTypeId == (int)IndicatorDataType.Dropdown), cat.Name, IndicatorEntityType.DiseaseDistribution);
            indicators = repo.GetSurveyIndicators();
            foreach (var cmpc in indicators)
                foreach (var cat in cmpc.Children)
                    AddOptions(table, cat.Children.Where(x => x.DataTypeId == (int)IndicatorDataType.Dropdown), cat.Name, IndicatorEntityType.Survey);
            indicators = repo.GetIntvIndicators();
            foreach (var cmpc in indicators)
                foreach (var cat in cmpc.Children)
                    AddOptions(table, cat.Children.Where(x => x.DataTypeId == (int)IndicatorDataType.Dropdown), cat.Name, IndicatorEntityType.Intervention);
            indicators = repo.GetProcessIndicators();
            foreach (var cmpc in indicators)
                foreach (var cat in cmpc.Children)
                    AddOptions(table, cat.Children.Where(x => x.DataTypeId == (int)IndicatorDataType.Dropdown), cat.Name, IndicatorEntityType.Process);

            ProcessRepository prepo = new ProcessRepository();
            ProcessBase saes = prepo.Create(9);
            foreach (var i in saes.ProcessType.Indicators)
                indicators.Add(ReportRepository.CreateReportIndicator(saes.ProcessType.Id, i));
            AddOptions(table, indicators.Where(x => x.DataTypeId == (int)IndicatorDataType.Dropdown), saes.ProcessType.TypeName, IndicatorEntityType.Process);

            using (ExcelPackage pck = new ExcelPackage())
            {
                ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Sheet1");
                ws.Cells["A1"].LoadFromDataTable(table, true);
                File.WriteAllBytes(path + string.Format("IndicatorDropdownWeightedRules_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")), pck.GetAsByteArray());
            }
        }
コード例 #11
0
        private void LoadSavedReports()
        {
            ReportRepository repo = new ReportRepository();
            var reports = repo.GetCustomReports();
            tblReportBuilder.Visible = false;
            this.SuspendLayout();
            tblReportBuilder.Controls.Clear();
            int rowIndex = tblReportBuilder.RowStyles.Add(new RowStyle { SizeType = SizeType.AutoSize });
            var tblNew = new TableLayoutPanel { AutoSize = true, AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink };
            tblNew.RowStyles.Clear();
            tblNew.ColumnStyles.Clear();
            tblNew.ColumnStyles.Add(new ColumnStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
            tblNew.ColumnStyles.Add(new ColumnStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
            tblNew.RowStyles.Add(new RowStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
            var name2 = new H3bLabel { Text = Translations.CustomReport, Name = "rpt_cr", AutoSize = true, };
            name2.SetMaxWidth(400);
            var edit2 = new H3Link { Text = Translations.NewLink, Margin = new Padding(0, 2, 0, 0) };
            edit2.ClickOverride += () =>
            {
                WizardForm wiz = new WizardForm(new StepCategory(), Translations.CustomReportBuilder);
                wiz.Height = 695;
                wiz.OnRunReport = RunCustomReport;
                wiz.Show();
            };
            tblNew.Controls.Add(name2, 0, 0);
            tblNew.Controls.Add(edit2, 1, 0);
            tblReportBuilder.Controls.Add(tblNew, 0, rowIndex);

            foreach (var report in reports)
            {
                rowIndex = tblReportBuilder.RowStyles.Add(new RowStyle { SizeType = SizeType.AutoSize });
                var tbl = new TableLayoutPanel { AutoSize = true, AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink };
                tbl.RowStyles.Clear();
                tbl.ColumnStyles.Clear();
                tbl.ColumnStyles.Add(new ColumnStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
                tbl.ColumnStyles.Add(new ColumnStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
                tbl.ColumnStyles.Add(new ColumnStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
                tbl.RowStyles.Add(new RowStyle { SizeType = System.Windows.Forms.SizeType.AutoSize });
                var name = new H3bLabel { Text = report.DisplayName, Name = "rpt_" + report.DisplayName, AutoSize = true, };
                name.SetMaxWidth(400);
                var edit = new H3Link { Text = Translations.Edit + "...", Margin = new Padding(0, 2, 0, 0) };
                edit.ClickOverride += () =>
                {
                    WizardForm wiz = new WizardForm(new StepIndicators(report), Translations.CustomReportBuilder);
                    wiz.Height = 695;
                    wiz.OnRunReport = RunCustomReport;
                    wiz.Show();
                };
                var delete = new H3Link { Text = Translations.Delete + "...", Margin = new Padding(0, 2, 0, 0) };
                delete.ClickOverride += () => 
                {
                    DeleteConfirm confirm = new DeleteConfirm(Translations.Delete, Translations.DeleteConfirmMessage);
                    if (confirm.ShowDialog() == DialogResult.OK)
                    {
                        repo.DeleteCustomReport(report, ApplicationData.Instance.GetUserId());
                        LoadSavedReports();
                    }
                };
                tbl.Controls.Add(name, 0, 0);
                tbl.Controls.Add(edit, 1, 0);
                tbl.Controls.Add(delete, 2, 0);
                tblReportBuilder.Controls.Add(tbl, 0, rowIndex);
            }
            this.ResumeLayout();
            tblReportBuilder.Visible = true;
        }
コード例 #12
0
ファイル: StepCategory.cs プロジェクト: ericjohnolson/NadaNtd
 private void lnkProcess_ClickOverride()
 {
     ReportRepository repo = new ReportRepository();
     report.ReportOptions.ShowDiseasesOption = false;
     report.ReportOptions.EntityType = Model.IndicatorEntityType.Process;
     report.ReportOptions.CategoryName = Translations.ProcessIndicators;
     report.ReportOptions.ReportGenerator = new ProcessReportGenerator();
     report.ReportOptions.AvailableIndicators = repo.GetProcessIndicators();
     OnSwitchStep(new StepIndicators(report));
 }