Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6247)
@@ -20,5 +20,5 @@
         /// </summary>
         /// <returns></returns>
-        public ActionResult GetRuns()
+        public void GetRuns()
         {
             FilterModel qm = new FilterModel();
@@ -32,5 +32,5 @@
             Response.Write("Found <" + ids.Count() + "> Runs.");
 
-            return View("Index", qm); // name of usercontrol
+          //  return View("Index", qm); // name of usercontrol
         }
 
@@ -51,35 +51,67 @@
         /// <param name="collection"></param>
         /// <returns></returns>
-        public ActionResult AddFilterAnd(FormCollection collection)
+        public ActionResult AddFilterAnd(string submitButton, FormCollection collection)
         {
             FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]);
 
-
-            // Add Filter
-            String idKey = null;
-            String parentIdKey = null;
-
-            foreach (string key in collection.AllKeys)
-            {
-                if (key.StartsWith(FilterModel.ComboboxName))
-                {
-                    idKey = key;
-                }
-                if (key.StartsWith(FilterModel.ParentIdName))
-                {
-                    parentIdKey = key;
-                }
-            }
-
-            Guid parentId = new Guid(collection.Get(parentIdKey));
-            string filterTypeName = collection.Get(idKey);
-            fm.AddFilter(filterTypeName, parentId);
-
+            Response.Write("Submit:" + submitButton);
+            
+            //update model with form data
             UpdateModel(collection, fm);
 
+            if (submitButton.StartsWith("+"))
+            {
+                string stringid = submitButton.Substring(2);
+                AddNewFilter(collection, fm, stringid);
+            }
+            else if (submitButton.StartsWith("-"))
+            {
+                string stringid = submitButton.Substring(2);
+                DeleteFilter(new Guid(stringid));
+            }
+            else if (submitButton.Equals("runs"))
+            {
+                GetRuns();
+            }
+            else if (submitButton.Equals("or"))
+            {
+                AddFilterOr( fm);
+            }
+            
             // Set Content
             Session["Content"] = fm.Content;
 
             return View("Index", fm);
+                        
+        }
+
+        private void AddNewFilter(FormCollection collection, FilterModel fm, String idKey)
+        {
+            // Add Filter
+            //String idKey = null;
+            String parentIdKey = idKey;
+
+            //foreach (string key in collection.AllKeys)
+            //{
+            //    //if (key.StartsWith(FilterModel.ComboboxName))
+            //    //{
+            //    //    idKey = key;
+            //    //}
+            //    if (key.StartsWith(FilterModel.ParentIdName))
+            //    {
+            //        parentIdKey = key;
+            //    }
+            //}
+
+            Guid parentId = new Guid(parentIdKey);
+            string filterTypeName = collection.Get(FilterModel.ComboboxName+ "." + idKey);
+            fm.AddFilter(filterTypeName, parentId);
+
+            //UpdateModel(collection, fm);
+
+            //// Set Content
+            //Session["Content"] = fm.Content;
+
+            //return View("Index", fm);
         }
 
@@ -111,19 +143,22 @@
                 {
                     int idx = key.IndexOf(".");
-                    string id = key.Substring(0, idx);
-                    string type = key.Substring(idx + 1);
-
-                    Guid fid = new Guid(id);
-
-                    if (postValues.ContainsKey(fid))
+                    if (idx != -1)
                     {
-                        Dictionary<string, string> d = postValues[fid];
-                        d.Add(type, collection.Get(key));
-                    }
-                    else
-                    {
-                        Dictionary<string, string> d = new Dictionary<string, string>();
-                        d.Add(type, collection.Get(key));
-                        postValues.Add(fid, d);
+                        string id = key.Substring(0, idx);
+                        string type = key.Substring(idx + 1);
+
+                        Guid fid = new Guid(id);
+
+                        if (postValues.ContainsKey(fid))
+                        {
+                            Dictionary<string, string> d = postValues[fid];
+                            d.Add(type, collection.Get(key));
+                        }
+                        else
+                        {
+                            Dictionary<string, string> d = new Dictionary<string, string>();
+                            d.Add(type, collection.Get(key));
+                            postValues.Add(fid, d);
+                        }
                     }
                 }
@@ -140,18 +175,22 @@
         /// <param name="id"></param>
         /// <returns></returns>
-        public ActionResult DeleteFilter(Guid id)
+        public void DeleteFilter(Guid id) 
         {
             // Get Content from Session
             FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]);
 
+            //throw new Exception();
+
             // Remove Filter
             bool filterRemoved = fm.RemoveFilter(id);
 
+
+            //UpdateModel(collection, fm);
             // TODO Model muss auch beim löschen upgeadatet werden UpdateModel(collection, fm);
 
             // Set Content
-            Session["Content"] = fm.Content;
-
-            return View("Index", fm);
+            //Session["Content"] = fm.Content;
+
+            //return View("Index", fm);
         }
 
@@ -163,8 +202,7 @@
         /// </summary>
         /// <returns></returns>
-        public ActionResult AddFilterOr()
-        {
-            FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]);
-
+        public void AddFilterOr(FilterModel fm)
+        {
+           
             List<Filter> orFilters = fm.Content.Filters.ToList<Filter>(); ;
 
@@ -177,5 +215,5 @@
             Session["Content"] = fm.Content;
 
-            return View("Index", fm);
+            //return View("Index", fm);
         }
 
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs	(revision 6247)
@@ -16,5 +16,5 @@
     public class FilterModel
     {
-        
+
 
 
@@ -61,5 +61,5 @@
         }
 
-        public static List<ComparisonItem> OrdinalComparisons 
+        public static List<ComparisonItem> OrdinalComparisons
         {
             get { return ComparisonsHelper.ordinalComparisons; }
@@ -70,7 +70,7 @@
             get { return ComparisonsHelper.stringComparisons; }
         }
-        
-
-        
+
+
+
 
         /// <summary>
@@ -192,9 +192,9 @@
                     if (dict != null)
                     {
-                      
+
                         foreach (KeyValuePair<string, string> kvp in dict)
                         {
                             if ("StringComparisonFilter".Equals(f.GetType().Name))
-                            { 
+                            {
                                 if (kvp.Key.Equals(FilterModel.ValueTextbox))
                                 {
@@ -202,7 +202,7 @@
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
-                                {                                  
-                                    ((StringComparisonFilter)f).Comparison = ComparisonsHelper.GetStringComparisonForValue(kvp.Value);                                  
-                                } 
+                                {
+                                    ((StringComparisonFilter)f).Comparison = ComparisonsHelper.GetStringComparisonForValue(kvp.Value);
+                                }
                             }
                             else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
@@ -238,14 +238,14 @@
                                     ((NameStringComparisonAvailableValuesFilter)f).Comparison = ComparisonsHelper.GetStringComparisonForValue(kvp.Value);
                                 }
-                            }  
-                             else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name))
-                            {
-                               //TODO not supported
-                            }
-                              else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name))
+                            }
+                            else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name))
+                            {
+                                //TODO not supported
+                            }
+                            else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name))
                             {
                                 if (kvp.Key.Equals(FilterModel.ValueDropDownList))
                                 {
-                                    ((NameEqualityComparisonBoolFilter)f).Value = Boolean.Parse( kvp.Value);                                  
+                                    ((NameEqualityComparisonBoolFilter)f).Value = Boolean.Parse(kvp.Value);
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
@@ -268,6 +268,6 @@
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
-                                {                                    
-                                    ((NameOrdinalComparisonIntFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);                                  
+                                {
+                                    ((NameOrdinalComparisonIntFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);
                                 }
                             }
@@ -286,9 +286,8 @@
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
-                                {                                   
-                                    ((NameOrdinalComparisonLongFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);                                  
-                                }                            
-                            }
-
+                                {
+                                    ((NameOrdinalComparisonLongFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);
+                                }
+                            }
                             else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name))
                             {
@@ -305,8 +304,26 @@
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
-                                {                                   
+                                {
                                     ((NameOrdinalComparisonFloatFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);
                                 }
                             }
+                            else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name))
+                            {
+                                if (kvp.Key.Equals(FilterModel.ValueTextbox))
+                                {
+                                    try
+                                    {
+                                        ((OrdinalComparisonDateTimeFilter)f).Value = DateTime.Parse(kvp.Value);
+                                    }
+                                    catch (Exception)
+                                    {
+                                        //TOOD Fehler ausgeben
+                                    }
+                                }
+                                else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
+                                {
+                                    ((OrdinalComparisonDateTimeFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);
+                                }
+                            }
                             else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name))
                             {
@@ -323,9 +340,9 @@
                                 }
                                 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
-                                {                                    
+                                {
                                     ((NameOrdinalComparisonDoubleFilter)f).Comparison = ComparisonsHelper.GetOrdinalComparisonForValue(kvp.Value);
                                 }
                             }
-                                
+
 
                             else
@@ -334,8 +351,8 @@
                             }
 
-                            
+
                         }
-                       
-                        
+
+
                     }
                 }
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx	(revision 6247)
@@ -9,17 +9,19 @@
 <p>
     <%
-        CombinedFilter currentFilter = ((FilterModel)Model).Content;
+        CombinedFilter topFilter = ((FilterModel)Model).Content;
     %>
-    <% using (Html.BeginForm("AddFilterAnd", "Filter", FormMethod.Post, new { id = currentFilter.Id, name = currentFilter.Id })) %>
-    <% {     %>
-    <%
-  
-        string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id;
-        string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id;
+    <% using (Html.BeginForm("AddFilterAnd", "Filter", FormMethod.Post, new { id = topFilter.Id, name = topFilter.Id })) %>
+    <% {    
+           
+            foreach (Filter fNode in topFilter.Filters)
+            {
+
+                CombinedFilter currentFilter = (CombinedFilter)fNode;
+                string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id;
+                string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id;
     %>
- 
     <%: Html.Hidden(hiddenName,currentFilter.Id.ToString()) %>
     <%: Html.DropDownList( comboboxName, new SelectList(((FilterModel)Model).AvailableFilterForCombobox, "FilterTypeName", "Label"))%>
-    <input type="submit" value="+" />
+    <input type="submit" name="submitButton" value="+.<%:currentFilter.Id%>" />
 </p>
 <!-- Build the selected filters. The filtesr will be stored in the session and the
@@ -106,13 +108,28 @@
     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%>
     <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
+    <% }
+else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name))
+{ %>
+    <% OrdinalComparisonDateTimeFilter filter = ((OrdinalComparisonDateTimeFilter)f);   %>
+    <%: Html.Label(filter.Label)%>
+    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%>
+    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
     <% }                 
                   
     %>
-    <%: Html.ActionLink("remove", "DeleteFilter", new { f.Id })%>
 
+    <input type="submit" name="submitButton" value="-.<%:f.Id%>"    />
+   
 <% }%>
     </td></tr></table>
     <% } %>
  <%  }%>
+   <% }%>
+ <input type="submit" name="submitButton"  value="or" />
+ </br>
+ <input type="submit" name="submitButton" value="runs" />
+
+  
+
 <% }
       
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx	(revision 6246)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx	(revision 6247)
@@ -26,28 +26,19 @@
         if (model != null && model.Content != null)
         {
-            foreach (Filter f in model.Content.Filters)
-            {
+            
+                FilterModel fm = new FilterModel((CombinedFilter)model.Content);
     %>
- 
-    <% FilterModel fm = new FilterModel((CombinedFilter)f);
-             
+                 <% Html.RenderPartial("Filters", fm); %>
+    <%    
+        }
     %>
-    <% Html.RenderPartial("Filters", fm); %>
-    <%}
-         }%>
 
          
      
-  <% using (Html.BeginForm("AddFilterOr", "Filter")) %>
-  <% {     %>
- Or filter <input type="submit" value="+" />
-  <% }     %>
+
 
 
   
-  <% using (Html.BeginForm("GetRuns", "Filter")) %>
-  <% {     %>
- <input type="submit" value="get runs" />
-  <% }     %>
+
 
 </asp:Content>
