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)); }
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()); } }
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)); }