- Timestamp:
- 05/21/11 16:13:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
r6190 r6245 57 57 58 58 // Add Filter 59 60 59 String idKey = null; 61 60 String parentIdKey = null; … … 77 76 fm.AddFilter(filterTypeName, parentId); 78 77 79 80 81 82 78 UpdateModel(collection, fm); 79 80 // Set Content 81 Session["Content"] = fm.Content; 82 83 return View("Index", fm); 84 } 85 86 private void UpdateModel(FormCollection collection, FilterModel fm) 87 { 83 88 // Iterate "posted" values and build up a dictionary for 84 89 // each filter (id). 85 90 // <id> => <key> => <value> 86 91 // => <key> => <value> 92 Dictionary<Guid, Dictionary<string, string>> postValues = CreatePostValueMap(collection); 93 94 // Update filters with posted data 95 fm.UpdateWithPostValues(postValues); 96 } 97 98 99 // Iterate "posted" values and build up a dictionary for 100 // each filter (id). 101 // <id> => <key> => <value> 102 // => <key> => <value> 103 private Dictionary<Guid, Dictionary<string, string>> CreatePostValueMap(FormCollection collection) 104 { 87 105 Dictionary<Guid, Dictionary<string, string>> postValues = new Dictionary<Guid, Dictionary<string, string>>(); 88 106 … … 111 129 } 112 130 } 113 114 // Update filters with posted data 115 fm.UpdateWithPostValues(postValues); 116 117 118 // Set Content 119 Session["Content"] = fm.Content; 120 121 122 123 return View("Index", fm); 131 return postValues; 124 132 } 125 133 … … 139 147 // Remove Filter 140 148 bool filterRemoved = fm.RemoveFilter(id); 149 150 // TODO Model muss auch beim löschen upgeadatet werden UpdateModel(collection, fm); 141 151 142 152 // Set Content … … 163 173 fm.Content.Filters = orFilters.ToArray<Filter>(); 164 174 175 // TODO Model muss auch beim löschen upgeadatet werden UpdateModel(collection, fm); 165 176 166 177 Session["Content"] = fm.Content;
Note: See TracChangeset
for help on using the changeset viewer.