- Timestamp:
- 05/27/11 16:58:15 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
r6303 r6305 27 27 FilterModel fm = new FilterModel(); 28 28 fm.Content = (CombinedFilter)Session["Content"]; 29 30 29 QueryServiceClient client = Query.GetClientFactory(); 31 32 30 33 31 long[] ids = client.GetRunIds(fm.Content); 34 32 … … 38 36 return View("Results", qm); // name of usercontrol 39 37 } 40 41 38 42 39 43 40 public ActionResult Filters(CombinedFilter f) … … 66 63 if ("add".Equals(submitAction)) 67 64 { 68 // string stringid = submitButton.Substring(2);69 65 string stringid = collection.Get("selectedFilter"); 70 66 AddNewFilter(collection, fm, stringid); … … 73 69 { 74 70 string stringid= collection.Get("selectedFilter"); 75 // string stringid = submitButton.Substring(2); 76 DeleteFilter(new Guid(stringid)); 71 DeleteFilter(new Guid(stringid)); 77 72 } 78 73 else if ("runs".Equals(submitAction)) … … 87 82 // Set Content 88 83 Session["Content"] = fm.Content; 89 90 84 return View("Index", fm); 91 85 92 86 } 93 87 88 94 89 private void AddNewFilter(FormCollection collection, FilterModel fm, String idKey) 95 { 96 // Add Filter 97 //String idKey = null; 90 { 98 91 String parentIdKey = idKey; 99 100 //foreach (string key in collection.AllKeys)101 //{102 // //if (key.StartsWith(FilterModel.ComboboxName))103 // //{104 // // idKey = key;105 // //}106 // if (key.StartsWith(FilterModel.ParentIdName))107 // {108 // parentIdKey = key;109 // }110 //}111 92 112 93 Guid parentId = new Guid(parentIdKey); 113 94 string filterTypeName = collection.Get(FilterModel.ComboboxName+ "." + idKey); 114 fm.AddFilter(filterTypeName, parentId); 115 116 //UpdateModel(collection, fm); 117 118 //// Set Content 119 //Session["Content"] = fm.Content; 120 121 //return View("Index", fm); 95 fm.AddFilter(filterTypeName, parentId); 122 96 } 123 97 … … 145 119 foreach (string key in collection.AllKeys) 146 120 { 147 148 121 if (!key.StartsWith(FilterModel.ComboboxName) && !key.StartsWith(FilterModel.ParentIdName)) 149 122 { … … 174 147 175 148 176 177 178 149 /// <summary> 179 150 /// Delete a filter with given id. … … 186 157 FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]); 187 158 188 //throw new Exception();189 190 159 // Remove Filter 191 bool filterRemoved = fm.RemoveFilter(id); 192 193 194 //UpdateModel(collection, fm); 195 // TODO Model muss auch beim löschen upgeadatet werden UpdateModel(collection, fm); 196 197 // Set Content 198 //Session["Content"] = fm.Content; 199 200 //return View("Index", fm); 201 } 202 203 204 160 bool filterRemoved = fm.RemoveFilter(id); 161 } 162 205 163 206 164 /// <summary> … … 209 167 /// <returns></returns> 210 168 public void AddFilterOr(FilterModel fm) 211 { 212 169 { 213 170 List<Filter> orFilters = fm.Content.Filters.ToList<Filter>(); ; 214 171 … … 216 173 orFilters.Add(andFilter); 217 174 fm.Content.Filters = orFilters.ToArray<Filter>(); 218 219 // TODO Model muss auch beim löschen upgeadatet werden UpdateModel(collection, fm); 220 221 Session["Content"] = fm.Content; 222 223 //return View("Index", fm); 224 } 225 226 175 176 Session["Content"] = fm.Content; 177 } 227 178 228 179 … … 236 187 public ActionResult Index() 237 188 { 238 239 189 // Set submenu 240 190 Session["SelectedSubMenu"] = "Filter"; 241 191 FilterModel fm = new FilterModel(); 242 243 192 244 193 // Init session variable for selected filters … … 257 206 fm.Content = f; 258 207 259 260 208 return View(fm); 261 209 } 262 263 264 210 } 265 211 }
Note: See TracChangeset
for help on using the changeset viewer.