示例#1
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));
 }
示例#2
0
        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());
            }
        }
示例#3
0
 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));
 }