Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6097)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6097)
@@ -0,0 +1,126 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using HLWebOKBQueryPlugin.Models;
+using HLWebOKBQueryPlugin.Helpers;
+using HLWebOKBQueryPlugin.OKBQueryService;
+
+namespace HLWebOKBQueryPlugin.Controllers
+{
+    /// <summary>
+    /// Controller for the filter subpage.
+    /// </summary>
+    public class FilterController : Controller
+    {
+        //
+        // GET: /Filter/
+
+
+        [ChildActionOnly]
+        public ActionResult Filters()
+        {
+            // For ModelViewuUserControl
+            return PartialView("Filters"); // name of usercontrol
+        }
+
+
+        /// <summary>
+        /// This action will be called from the Filters.ascx
+        /// when submitting the form.
+        /// </summary>
+        /// <param name="collection"></param>
+        /// <returns></returns>
+        public ActionResult AddFilter(FormCollection collection)
+        {
+            // Model     
+            FilterModel qm = new FilterModel();
+
+            // Get filters from service and set the model
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+            qm.Filters = filterList;
+
+
+            // Selected filter (from combobox)
+            string filterType = collection.Get("filtersCombobox");
+            Filter filter = filterList.Where(x => x.FilterTypeName.Equals(filterType)).First();
+
+
+            // Get selected filters form session
+            qm.SelectedFilters = (List<Filter>)Session["selectedFilters"];
+
+            // Add Filter only if not exists
+            if (qm.SelectedFilters.Where(x => x.FilterTypeName.Equals(filter.FilterTypeName)).Count() == 0)
+            {
+
+                qm.SelectedFilters.Add(filter);
+            }
+
+            // Set values for the selected filters
+            foreach (string s in collection.AllKeys)
+            {
+                if (s.StartsWith("valueTextbox"))
+                {
+                    // Get the type of the textbox
+                    string type = s.Substring(s.IndexOf(".") + 1);
+
+                    // Get the filter from the selected filters to set the value(s)
+                    Filter f = qm.SelectedFilters.Where(x => x.GetType().Name.Equals(type)).First();
+                    if ("StringComparisonFilter".Equals(type))
+                    {
+                        ((StringComparisonFilter)f).Value = collection.Get(s);
+                    }
+                    else if ("NameStringComparisonFilter".Equals(type))
+                    {
+                        ((NameStringComparisonFilter)f).Value = collection.Get(s);
+                    }
+                    // TODO: add for all filter types and will the values (etc.)
+                }
+            }
+
+
+
+            // Set session variable with actual selected filters
+            Session["selectedFilters"] = qm.SelectedFilters;
+
+            // "Index" ist the view name. We use here the Index view
+            // because the index view renders the Filters() action 
+            // that will return to the "Filters.ascx" partial view.
+            return View("Index", qm);
+        }
+
+
+        /// <summary>
+        /// This action will be called when rendering
+        /// the index.aspx. This will hapen the first
+        /// time, so the available Filters in the Model
+        /// will be set.
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult Index()
+        {
+            // Set submenu
+            Session["SelectedSubMenu"] = "Filter";
+
+            // Init session variable for selected filters
+            if (Session["selectedFilters"] == null)
+            {
+                Session["selectedFilters"] = new List<Filter>();
+            }
+
+            // Get available filters from service
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+
+            // Set model
+            FilterModel qm = new FilterModel();
+            qm.Filters = filterList;
+
+            return View(qm);
+        }
+
+
+    }
+}
