Changeset 6191
- Timestamp:
- 05/14/11 09:29:18 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBQueryPlugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/ComparisonsHelper.cs
r6190 r6191 32 32 public static List<ComparisonItem> stringComparisons = new List<ComparisonItem>() { 33 33 new ComparisonItem((int)OKBQueryService.StringComparison.Equal, STRING_COMPARISONS_EQUAL), 34 new ComparisonItem((int)OKBQueryService.StringComparison.Not Like, STRING_COMPARISONS_NOT_EQUAL),34 new ComparisonItem((int)OKBQueryService.StringComparison.NotEqual, STRING_COMPARISONS_NOT_EQUAL), 35 35 new ComparisonItem((int)OKBQueryService.StringComparison.Contains, STRING_COMPARISONS_CONTAINS), 36 36 new ComparisonItem((int)OKBQueryService.StringComparison.NotContains, STRING_COMPARISONS_NOT_CONTAINS), … … 38 38 new ComparisonItem((int)OKBQueryService.StringComparison.NotLike, STRING_COMPARISONS_NOT_LIKE) 39 39 }; 40 41 42 public static String GetValueForStringComparision(OKBQueryService.StringComparison comparisionValue) 43 { 44 switch (comparisionValue) 45 { 46 case OKBQueryService.StringComparison.Equal: 47 return STRING_COMPARISONS_EQUAL; 48 case OKBQueryService.StringComparison.Contains: 49 return STRING_COMPARISONS_CONTAINS; 50 case OKBQueryService.StringComparison.Like: 51 return STRING_COMPARISONS_LIKE; 52 case OKBQueryService.StringComparison.NotContains: 53 return STRING_COMPARISONS_NOT_CONTAINS; 54 case OKBQueryService.StringComparison.NotEqual: 55 return STRING_COMPARISONS_NOT_EQUAL; 56 case OKBQueryService.StringComparison.NotLike: 57 return STRING_COMPARISONS_NOT_LIKE; 58 default: 59 return STRING_COMPARISONS_EQUAL; //TODO 60 } 61 } 62 40 63 41 64 -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs
r6190 r6191 201 201 if (dict != null) 202 202 { 203 203 204 foreach (KeyValuePair<string, string> kvp in dict) 204 205 { 205 206 if ("StringComparisonFilter".Equals(f.GetType().Name)) 206 207 { 208 209 ((StringComparisonFilter)f).Value = kvp.Value; 210 207 211 if (kvp.Key.Equals(FilterModel.ValueTextbox)) 208 212 { 209 ((StringComparisonFilter)f).Value = kvp.Value + "111"; 213 ((StringComparisonFilter)f).Value = kvp.Value; // +"111"; 214 215 //((StringComparisonFilter)f).Value = ((StringComparisonFilter)f).Value; 216 // ((StringComparisonFilter)f).Comparison = ((StringComparisonFilter)f).Comparison; 217 218 210 219 } 211 220 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList)) 212 221 { 213 ((StringComparisonFilter)f).Value = ((StringComparisonFilter)f).Value + "222";222 // ((StringComparisonFilter)f).Value = ((StringComparisonFilter)f).Value; 214 223 ((StringComparisonFilter)f).Comparison = ComparisonsHelper.GetStringComparisonForValue(kvp.Value); 224 215 225 } 216 226 // To this for alle keys … … 221 231 // To this for all filters 222 232 } 233 234 223 235 } 236 StringComparisonFilter scf = (StringComparisonFilter)f; 237 //throw new Exception("Huhu ich bin doof"); 238 224 239 } 225 240 } -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
r6190 r6191 2 2 <%@ Import Namespace="HLWebOKBQueryPlugin.Models" %> 3 3 <%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %> 4 <%@ Import Namespace="HLWebOKBQueryPlugin.ViewModels" %> 5 4 6 <!-- Put all into a form that calls the "AddFilter" Action--> 5 7 <div><table> … … 40 42 <% StringComparisonFilter filter = ((StringComparisonFilter)f); %> 41 43 <%: Html.Label(filter.Label)%> 42 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value","Text",filter.Comparison))%>44 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%> 43 45 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%> 44 46 <% }
Note: See TracChangeset
for help on using the changeset viewer.