Changeset 6190 for branches/WebApplication/MVC2
- Timestamp:
- 05/12/11 20:08:00 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBQueryPlugin
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
r6170 r6190 26 26 27 27 QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester"); 28 29 30 long[] ids =client.GetRunIds(qm.Content);28 29 30 long[] ids = client.GetRunIds(qm.Content); 31 31 32 32 Response.Write("Found <" + ids.Count() + "> Runs."); … … 52 52 /// <returns></returns> 53 53 public ActionResult AddFilterAnd(FormCollection collection) 54 { 54 { 55 55 FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]); 56 56 57 57 58 58 // Add Filter 59 59 60 60 String idKey = null; 61 61 String parentIdKey = null; … … 135 135 { 136 136 // Get Content from Session 137 FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]); 138 137 FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]); 138 139 139 // Remove Filter 140 bool filterRemoved =fm.RemoveFilter(id);141 140 bool filterRemoved = fm.RemoveFilter(id); 141 142 142 // Set Content 143 143 Session["Content"] = fm.Content; 144 144 145 145 return View("Index", fm); 146 146 } … … 181 181 public ActionResult Index() 182 182 { 183 183 184 184 // Set submenu 185 185 Session["SelectedSubMenu"] = "Filter"; … … 201 201 CombinedFilter f = (CombinedFilter)Session["Content"]; 202 202 fm.Content = f; 203 204 203 204 205 205 return View(fm); 206 206 } -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj
r6141 r6190 103 103 <Compile Include="Models\ChartModel.cs" /> 104 104 <Compile Include="Models\Filter.cs" /> 105 <Compile Include="ViewModels\ComparisonItem.cs" /> 106 <Compile Include="ViewModels\ComparisonsHelper.cs" /> 105 107 <Compile Include="ViewModels\FilterModel.cs" /> 106 108 <Compile Include="Models\QueryModel.cs" /> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs
r6170 r6190 5 5 using HLWebOKBQueryPlugin.OKBQueryService; 6 6 using HLWebOKBQueryPlugin.Helpers; 7 using HLWebOKBQueryPlugin.ViewModels; 7 8 8 9 namespace HLWebOKBQueryPlugin.Models … … 15 16 public class FilterModel 16 17 { 18 19 17 20 18 21 public static string ComboboxName { get { return "filtersCombobox"; } } … … 20 23 public static string ValueTextbox { get { return "valueTextbox"; } } 21 24 public static string ValueDropDownList { get { return "valueDropDownList"; } } 22 25 public static string ComparisonDropDownList { get { return "comparisonDropDownList"; } } 23 26 24 27 /// <summary> … … 53 56 54 57 58 public static List<ComparisonItem> OrdinalComparisons 59 { 60 get { return ComparisonsHelper.ordinalComparisons; } 61 } 62 63 public static List<ComparisonItem> StringComparisons 64 { 65 get { return ComparisonsHelper.stringComparisons; } 66 } 67 68 69 //"<"; 70 //else if (Content.Comparison == OrdinalComparison.LessOrEqual) 71 // comparisonComboBox.SelectedItem = "<="; 72 //else if (Content.Comparison == OrdinalComparison.Equal) 73 // comparisonComboBox.SelectedItem = "="; 74 //else if (Content.Comparison == OrdinalComparison.GreaterOrEqual) 75 // comparisonComboBox.SelectedItem = ">="; 76 //else if (Content.Comparison == OrdinalComparison.Greater) 77 // comparisonComboBox.SelectedItem = ">"; 78 //else if (Content.Comparison == OrdinalComparison.NotEqual) 79 // comparisonComboBox.SelectedItem = "<>" 80 81 82 83 84 55 85 /// <summary> 56 86 /// Available Filters … … 61 91 { 62 92 QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester"); 63 return client.GetFilters().ToList<Filter>(); 93 Filter[] filters = client.GetFilters(); 94 95 if (filters == null) 96 { 97 return new List<Filter>(); 98 } 99 return filters.ToList<Filter>(); 64 100 } 65 101 } … … 87 123 public CombinedFilter Content { get; set; } 88 124 89 125 90 126 91 127 /// <summary> … … 171 207 if (kvp.Key.Equals(FilterModel.ValueTextbox)) 172 208 { 173 ((StringComparisonFilter)f).Value = kvp.Value; 209 ((StringComparisonFilter)f).Value = kvp.Value + "111"; 210 } 211 else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList)) 212 { 213 ((StringComparisonFilter)f).Value = ((StringComparisonFilter)f).Value + "222"; 214 ((StringComparisonFilter)f).Comparison = ComparisonsHelper.GetStringComparisonForValue(kvp.Value); 174 215 } 175 216 // To this for alle keys -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
r6170 r6190 40 40 <% StringComparisonFilter filter = ((StringComparisonFilter)f); %> 41 41 <%: Html.Label(filter.Label)%> 42 <%: Html. Label("=")%>42 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons,"Value","Text", filter.Comparison))%> 43 43 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%> 44 44 <% } … … 47 47 <% NameStringComparisonFilter filter = ((NameStringComparisonFilter)f); %> 48 48 <%: Html.Label(filter.Label)%> 49 <%: Html.Label("=" + f.Id)%>49 <%: Html.Label("=")%> 50 50 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 51 51 <% } … … 61 61 <% NameEqualityComparisonByteArrayFilter filter = ((NameEqualityComparisonByteArrayFilter)f); %> 62 62 <%: Html.Label(filter.Label)%> 63 <%: Html.Label("teby")%> 63 64 <% } 64 65 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name)) … … 67 68 %> 68 69 <%: Html.Label(filter.Label)%> 69 <%: Html.Label("is") %>70 <%: Html.Label("is") %> 70 71 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(((FilterModel)Model).BoolStates, filter.Value))%> 71 72 <% } … … 74 75 <% NameOrdinalComparisonIntFilter filter = ((NameOrdinalComparisonIntFilter)f); %> 75 76 <%: Html.Label(filter.Label)%> 76 <%: Html.Label("is")%> 77 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(FilterModel.OrdinalComparisons,"Value","Text", filter.Comparison))%> 78 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 77 79 <% } 78 80 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) … … 87 89 <% NameOrdinalComparisonDoubleFilter filter = ((NameOrdinalComparisonDoubleFilter)f); %> 88 90 <%: Html.Label(filter.Label)%> 89 <%: Html.Label(" =")%>91 <%: Html.Label("<")%> 90 92 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 91 93 <% } … … 94 96 <% NameOrdinalComparisonFloatFilter filter = ((NameOrdinalComparisonFloatFilter)f); %> 95 97 <%: Html.Label(filter.Label)%> 96 <%: Html.Label(" =")%>98 <%: Html.Label("<")%> 97 99 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 98 100 <% } … … 101 103 <% NameOrdinalComparisonLongFilter filter = ((NameOrdinalComparisonLongFilter)f); %> 102 104 <%: Html.Label(filter.Label)%> 103 <%: Html.Label(" =")%>105 <%: Html.Label("<")%> 104 106 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 105 107 <% }
Note: See TracChangeset
for help on using the changeset viewer.