public void FilterAgendaByPolicy(string filterValue)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            List<DropdownItem> dds = filterData.GetValidAgendaFilterByPolicy(list, filterValue);
            this.view.ShowFilteredFilter(dds);
        }
        public void FilterApplicationsByProcess(string filterValue)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            List<DropdownItem> dds = filterData.GetValidApplicationFilterByProcess(list, filterValue);
            this.view.ShowFilteredFilter(dds);
        }
 private void InitializeRelatedClasses()
 {
     content = new Strategy2020Content();
     builder = new Strategy2020ContentBuilder();
 }
        private string CreateFilteredContent(Strategy2020Filter filter)
        {
            Strategy2020HtmlContenBuilder htmlBuilder = new Strategy2020HtmlContenBuilder();
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();

            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            list = filter.ApplyFilters();

            if (filter.TypeFilter == 0 &&
                filter.AgendaFilter == 0 &&
                filter.PolicyFilter == 0 &&
                filter.RuleFilter == 0 &&
                filter.ProcessFilter == 0 &&
                filter.SubProcessFilter == 0 &&
                filter.ApplicationFilter == 0 &&
                filter.ModuleFilter == 0
                )
            {
                list = filter.ApplyDefaultFilter(list);
            }

            string content = htmlBuilder.BuildHtml(list);

            return content;
        }
        private List<DropdownItem> CreateFilterObject(FilterType type)
        {
            if (CacheHelper.GetFromCacheWithCheck<List<DropdownItem>>(type.ToString()) != null)
            {
                return CacheHelper.GetFromCacheWithCheck<List<DropdownItem>>(type.ToString());
            }

            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();

            List<Strategy2020DTO> list = new List<Strategy2020DTO>();
            if (CacheHelper.GetFromCacheWithCheck<List<Strategy2020DTO>>("filterbaselist") != null
                && CacheHelper.GetFromCacheWithCheck<List<Strategy2020DTO>>("filterbaselist").Count > 0)
            {
                list = CacheHelper.GetFromCacheWithCheck<List<Strategy2020DTO>>("filterbaselist");
            }
            else
            {
                list = contentBuilder.BuildStrategy2020List();
                CacheHelper.AddToCacheForOneMinute(this.cache, "filterbaselist", list);
            }

            List<DropdownItem> dds = new List<DropdownItem>();
            switch (type)
            {
                case FilterType.Type:
                    dds = filterData.GetValidTypeFilter(list);
                    break;
                case FilterType.Agenda:
                    dds = filterData.GetValidAgendaFilter(list);
                    break;
                case FilterType.Policy:
                    dds = filterData.GetValidPolicyFilter(list);
                    break;
                case FilterType.Rule:
                    dds = filterData.GetValidRuleFilter(list);
                    break;
                case FilterType.Process:
                    dds = filterData.GetValidProcessFilter(list);
                    break;
                case FilterType.SubProcess:
                    dds = filterData.GetValidSubProcessFilter(list);
                    break;
                case FilterType.Application:
                    dds = filterData.GetValidApplicationFilter(list);
                    break;
                case FilterType.Module:
                    dds = filterData.GetValidModuleFilter(list);
                    break;
                default:
                    break;
            }

            CacheHelper.AddToCacheWithCheck(type.ToString(), dds);

            return dds;
            //this.view.ShowContent(html);
        }
        public List<Strategy2020DTO> GetList(Strategy2020Filter filter)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();

            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            list = filter.ApplyFilters();

            if (filter.TypeFilter == 0 &&
                filter.AgendaFilter == 0 &&
                filter.PolicyFilter == 0 &&
                filter.RuleFilter == 0 &&
                filter.ProcessFilter == 0 &&
                filter.SubProcessFilter == 0 &&
                filter.ApplicationFilter == 0 &&
                filter.ModuleFilter == 0
                )
            {
                list = filter.ApplyDefaultFilter(list);
            }

            return list;
        }
        private string CreateFilter(FilterType type)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();
            List<DropdownItem> dds = new List<DropdownItem>();
            switch (type)
            {
                case FilterType.Type:
                    dds = filterData.GetValidTypeFilter(list);
                    break;
                case FilterType.Agenda:
                    dds = filterData.GetValidAgendaFilter(list);
                    break;
                case FilterType.Policy:
                    dds = filterData.GetValidPolicyFilter(list);
                    break;
                case FilterType.Rule:
                    dds = filterData.GetValidRuleFilter(list);
                    break;
                case FilterType.Process:
                    dds = filterData.GetValidProcessFilter(list);
                    break;
                case FilterType.SubProcess:
                    dds = filterData.GetValidSubProcessFilter(list);
                    break;
                case FilterType.Application:
                    dds = filterData.GetValidApplicationFilter(list);
                    break;
                case FilterType.Module:
                    dds = filterData.GetValidModuleFilter(list);
                    break;
                default:
                    break;
            }

            return CreateFilterDropdownMarkup(dds, filterNames[type]);
            //this.view.ShowContent(html);
        }
 public void FilterSubProcessByProcess(string filterValue)
 {
     Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
     List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();
     Dictionary<string, List<DropdownItem>> spAndApps = new Dictionary<string, List<DropdownItem>>();
     List<DropdownItem> dds = filterData.GetValidSubProcessFilterByProcess(list, filterValue);
     spAndApps.Add("sps", dds);
     List<DropdownItem> apps = filterData.GetValidApplicationFilterByProcess(list, filterValue);
     spAndApps.Add("apps", apps);
     this.view.ShowFilteredFilter(spAndApps);
 }
        public void FilterProcessByBusinessRule(string filterValue)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            List<DropdownItem> dds = filterData.GetValidProcessFilterByBusinessRule(list, filterValue);
            this.view.ShowFilteredFilter(dds);
        }
 public void FilterProcessByApplication(string filterValue, string extraFilter)
 {
     Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
     List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();
     //Dictionary instance
     Dictionary<string, List<DropdownItem>> response = new Dictionary<string, List<DropdownItem>>();
     //List of processes
     List<DropdownItem> dds = filterData.GetValidProcessFilterByApplication(list, filterValue);
     //add to the dictionary
     response.Add("process", dds);
     //ids of the processes
     List<int> idList = (from ids in dds
                         select Convert.ToInt32(ids.Value)).ToList();
     //List of sub-processes
     List<DropdownItem> sps = filterData.GetValidSubprocessByProcesses(list, idList, int.Parse(extraFilter));
     //add to the dictionary
     response.Add("sps", sps);
     this.view.ShowFilteredFilter(response);
 }
        public void FilterModuleByApplication(string filterValue, string secondFilterValue)
        {
            Strategy2020ContentBuilder contentBuilder = new Strategy2020ContentBuilder();
            List<Strategy2020DTO> list = contentBuilder.BuildStrategy2020List();

            List<DropdownItem> dds = filterData.GetValidModuleFilterByApplication(list, filterValue, secondFilterValue);
            this.view.ShowFilteredFilter(dds);
        }
예제 #12
0
 private void InitializeRelatedClasses()
 {
     content = new Strategy2020Content();
     builder = new Strategy2020ContentBuilder();
 }