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 6102)
@@ -18,11 +18,50 @@
         // GET: /Filter/
 
-
         [ChildActionOnly]
         public ActionResult Filters()
         {
+            // Model     
+            FilterModel qm = new FilterModel();
+
+
+            //TODO nicht immer laden
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+            qm.Filters = filterList;
+            qm.SelectedFilters = new List<Filter>();
+
+
             // For ModelViewuUserControl
-            return PartialView("Filters"); // name of usercontrol
+            return PartialView("Filters", qm); // name of usercontrol
         }
+
+        //List<Filter> currentFilters
+
+        [ChildActionOnly]
+        public ActionResult Filters(FilterModel qms)
+        {
+            // Model     
+            FilterModel qm = new FilterModel();
+
+
+            //TODO nicht immer laden
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+            qm.Filters = filterList;
+            qm.SelectedFilters =qms.SelectedFilters;
+            if (qm.SelectedFilters == null)
+            {
+
+                qm.SelectedFilters = new List<Filter>();
+            }
+
+
+
+            // For ModelViewuUserControl
+            return PartialView("Filters", qm); // name of usercontrol
+        }
+
+
+      
 
 
@@ -35,4 +74,6 @@
         public ActionResult AddFilter(FormCollection collection)
         {
+            
+
             // Model     
             FilterModel qm = new FilterModel();
@@ -46,39 +87,56 @@
             // Selected filter (from combobox)
             string filterType = collection.Get("filtersCombobox");
-            Filter filter = filterList.Where(x => x.FilterTypeName.Equals(filterType)).First();
+
+            if (filterType != null)
+            {
+
+                Filter filter = filterList.Where(x => x.FilterTypeName.CompareTo(filterType) == 0).First();
 
 
-            // Get selected filters form session
-            qm.SelectedFilters = (List<Filter>)Session["selectedFilters"];
+                 if (filter != null)
+                {
+                    // Get selected filters form session
+                    qm.SelectedFilters = (List<Filter>)Session["selectedFilters"];
+                    if (qm.SelectedFilters == null)
+                    {
 
-            // Add Filter only if not exists
-            if (qm.SelectedFilters.Where(x => x.FilterTypeName.Equals(filter.FilterTypeName)).Count() == 0)
-            {
+                        qm.SelectedFilters = new List<Filter>();
+                    }
 
-                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);
+                    // Add Filter only if not exists
+                    if (qm.SelectedFilters.Where(x => x.FilterTypeName.Equals(filter.FilterTypeName)).Count() == 0)
+                    {
 
-                    // 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))
+                        qm.SelectedFilters.Add(filter);
+                    }
+
+                    // Set values for the selected filters
+                    foreach (string s in collection.AllKeys)
                     {
-                        ((StringComparisonFilter)f).Value = collection.Get(s);
+                        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);
+                            }
+                            else if ("CombinedFilter".Equals(type))
+                            {
+                                //((CombinedFilter)f).Filters
+                            }
+                            // TODO: add for all filter types and will the values (etc.)
+                        }
                     }
-                    else if ("NameStringComparisonFilter".Equals(type))
-                    {
-                        ((NameStringComparisonFilter)f).Value = collection.Get(s);
-                    }
-                    // TODO: add for all filter types and will the values (etc.)
                 }
             }
-
 
 
