/// <summary> /// Builds a list of EForms filtered by disease (if applicable) /// </summary> private void BuildEForms() { // set visibility EformComponentHolder.Visible = false; EformListPanel.Visible = true; // get static eforms var masterEformList = from eform in CaisisConfiguration.GetEformsConfigList() orderby(eform.Disease == "General" ? 0 : 1) ascending, eform.Disease ascending, eform.Name ascending select new { Name = eform.Name, Disease = eform.Disease, FileName = eform.FileName, EFormType = "static", EFormId = string.Empty, Active = eform.Active }; // filter by disease if (!string.IsNullOrEmpty(QueryDiseaseName)) { masterEformList = masterEformList.Where(e => e.Disease.Equals(QueryDiseaseName, StringComparison.CurrentCultureIgnoreCase)); } if (masterEformList.Count() > 0) { // bind list of eforms EformsRptr.DataSource = masterEformList; EformsRptr.DataBind(); NoResultsMsg.Visible = false; } EFormCount.Text = masterEformList.Count().ToString(); }
/// <summary> /// /// </summary> public void BuildEFormDropDownList() { if (ConfigTypeName == typeof(PaperFormConfig).Name) { configName = "Paper Form"; // filter list if needed configList = CaisisConfiguration.GetPaperFormConfigList().OfType <ICaisisConfiguration>(); } else if (ConfigTypeName == typeof(EformConfig).Name) { configName = "Eform"; configList = CaisisConfiguration.GetEformsConfigList().OfType <ICaisisConfiguration>(); DefaultEForm = UserPrefDefaultEForm(); DefaultEForms = UserPrefDefaultEForms(); } // finally, filter out only active nodes configList = configList.Where(c => !string.IsNullOrEmpty(c.DisplayName) && c.Active); // get distinct list of diseases var diseases = configList.SelectMany(c => c.Diseases).Distinct(); // bind outer repeater EformDropDownRptr.DataSource = diseases; EformDropDownRptr.DataBind(); }