public void GenerateReport( 
     string agenda, string agendatext,
     string policy, string policytext, 
     string rule, string ruletext, 
     string process, string processtext,
     string subprocess, string subprocesstext,
     string application, string applicationtext,
     string module, string moduletext)
 {
     Strategy2020Filter filter = new Strategy2020Filter(
         agenda, agendatext,
         policy, policytext,
         rule, ruletext,
         process, processtext,
         subprocess, subprocesstext,
         application, applicationtext,
         module, moduletext);
     Strategy2020ReportBuilder reportBuilder = new Strategy2020ReportBuilder(filter);
     byte[] content = reportBuilder.BuildReport();
     this.view.RenderReport(content);
 }
 public Strategy2020ReportBuilder(Strategy2020Filter filter)
 {
     this.content = new Strategy2020Content();
     this.filter = filter;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string agenda = Request.Form["agenda"];
            string policy = Request.Form["policy"];
            string rule = Request.Form["rule"];
            string process = Request.Form["process"];
            string subprocess = Request.Form["subprocess"];
            string application = Request.Form["application"];
            string module = Request.Form["module"];

            var action = Request["action"];

            switch (action)
            {
                case "query":
                    Strategy2020Filter filter =
                        new Strategy2020Filter(agenda, policy, rule, process, subprocess, application, module);
                    presenter.CreateContent(filter);
                    //List<Strategy2020DTO> list = presenter.GetList(filter);
                    //JavaScriptSerializer s = new JavaScriptSerializer();
                    //string js = s.Serialize(list);
                    //Response.Write(js);
                    //Response.End();
                    break;
                case "filter":
                    GetAllFilters();
                    break;
                //case "agendafilter":
                //    presenter.GetFiltersForAgenda();
                //    break;
                //case "policyfilter":
                //    presenter.GetFiltersForPolicy();
                //    break;
                //case "rulefilter":
                //    presenter.GetFiltersForRule();
                //    break;
                //case "processfilter":
                //    presenter.GetFiltersForProcess();
                //    break;
                //case "subprocessfilter":
                //    presenter.GetFiltersForSubProcess();
                //    break;
                //case "modulefilter":
                //    presenter.GetFiltersForModule();
                //    break;
                //case "applicationfilter":
                //    presenter.GetFiltersForApplication();
                //    break;
                //case "report":
                //    Strategy2020Filter filter2 =
                //        new Strategy2020Filter(type, agenda, policy, rule, process, subprocess, application, module);
                //    presenter.CreateReport(filter2);
                //    break;
                case "filterthefilter":
                    FilterTheFilter();
                    break;
                default:
                    break;
            }
        }
 public void CreateContent(Strategy2020Filter filter)
 {
     string content = CreateFilteredContent(filter);
     view.ShowContent(content);
 }
        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;
        }
        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;
        }