Changeset 6141 for branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views
- Timestamp:
- 05/07/11 10:41:02 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
r6118 r6141 3 3 <%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %> 4 4 <!-- Put all into a form that calls the "AddFilter" Action--> 5 <% using (Html.BeginForm ("AddFilter", "Filter")) %>6 <% { %>7 5 <p> 6 <% 7 CombinedFilter currentFilter = ((FilterModel)Model).Content; 8 %> 9 <% using (Html.BeginForm("AddFilterAnd", "Filter", FormMethod.Post, new { id = currentFilter.Id, name = currentFilter.Id })) %> 10 <% { %> 11 <% 12 13 string comboboxName = "filtersCombobox." + currentFilter.Id; 14 string hiddenName = "parentId." + currentFilter.Id; 15 %> 16 8 17 Select Filter: 9 <%: Html. DropDownList("filtersCombobox", new SelectList(((FilterModel)Model).Filters, "FilterTypeName", "Label"))%>10 < input type="submit" value="add" />11 18 <%: Html.Hidden(hiddenName,currentFilter.Id.ToString()) %> 19 <%: Html.DropDownList(comboboxName, new SelectList(((FilterModel)Model).Filters, "FilterTypeName", "Label"))%> 20 <input type="submit" value="+" /> 12 21 </p> 13 <ul> 14 <!-- Build the selected filters. The filtesr will be stored in the session and the 22 <!-- Build the selected filters. The filtesr will be stored in the session and the 15 23 Controller puts the current filters from the session into the model. Selected Filters 16 24 will be iterated. --> 17 <% if (((FilterModel)Model).SelectedFilters != null) 25 <% if (currentFilter.Filters != null) 26 { 27 28 foreach (Filter f in currentFilter.Filters) 18 29 { 19 20 foreach (Filter f in ((FilterModel)Model).SelectedFilters) 21 { %> 22 <li> 23 <% 24 // If type is StringComparisonFilter build thes controls 25 if ("StringComparisonFilter".Equals(f.GetType().Name)) 26 { %> 27 <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((StringComparisonFilter)f).Value)%> 28 <%: Html.LabelFor(x => f.Label)%> 29 30 <% } 31 // If type is NameStringComparisonFilter build thes controls 32 else if ("NameStringComparisonFilter".Equals(f.GetType().Name)) 33 { %> 34 <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((NameStringComparisonFilter)f).Value) %> 35 36 <% } 37 else if ("CombinedFilter".Equals(f.GetType().Name)) 38 { %> 39 <% CombinedFilter combiFilter = ((CombinedFilter)f); %> 40 <% List<Filter> comtbiFtilterLis = combiFilter.Filters.ToList<Filter>(); 41 FilterModel m = new FilterModel(); 42 m.Filters = ((FilterModel)Model).Filters; 43 m.SelectedFilters = comtbiFtilterLis; 44 %> 45 <% Html.RenderPartial("Filters", m); %> 46 47 <% } 30 if (f != null) 31 { %> 32 <div> 33 <% 34 35 // If type is StringComparisonFilter build thes controls 36 if ("StringComparisonFilter".Equals(f.GetType().Name)) 37 { %> 38 <%: Html.TextBox(f.Id + ".valueTextbox", ((StringComparisonFilter)f).Value)%> 39 <%: Html.Label(f.GetType().Name)%> 40 <% } 41 // If type is NameStringComparisonFilter build thes controls 42 else if ("NameStringComparisonFilter".Equals(f.GetType().Name)) 43 { %> 44 <%: Html.TextBox(f.Id + ".valueTextbox" + f.Id, new{((NameStringComparisonFilter)f).Value})%> 45 <%: Html.Label(f.GetType().Name)%> 46 <% } 48 47 49 48 50 else 51 { %> 52 <!-- type not supported ... --> 53 FilerTypeName = 54 <%: Html.Label(f.GetType().Name)%> 55 <% } 56 %> 57 </li> 49 else 50 { %> 51 <!-- other types ... must be implemented --> 52 <%: Html.Label(f.GetType().Name)%> 58 53 <% } 59 54 %> 55 </div> 56 <% } 60 57 } 61 58 }%> 62 </ul> 59 <% } 60 61 %> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx
r6097 r6141 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 2 3 <%@ Import Namespace="HLWebOKBQueryPlugin.Models" %> 4 <%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %> 3 5 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> 4 6 Index 5 7 </asp:Content> 6 8 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 7 <h2>Filter</h2> 9 <h2> 10 Filter</h2> 8 11 <!-- 9 12 This is the "user control" for the filters. This will call the action "AddFilter" 10 13 in the controller, after the Action "Index" is called (for rendering the page). 14 15 16 ch130 TSP (imported from TSPLIB) 17 18 11 19 --> 12 <% Html.RenderPartial("Filters"); %> 20 <% 21 22 FilterModel model = (FilterModel)Model; 23 24 if (model != null && model.Content != null) 25 { 26 foreach (Filter f in model.Content.Filters) 27 { 28 %> 29 30 <% FilterModel fm = new FilterModel((CombinedFilter)f); 31 32 %> 33 <% Html.RenderPartial("Filters", fm); %> 34 <%} 35 }%> 36 37 38 39 <% using (Html.BeginForm("AddFilterOr", "Filter")) %> 40 <% { %> 41 Or filter <input type="submit" value="+" /> 42 <% } %> 43 44 45 46 <% using (Html.BeginForm("GetRuns", "Filter")) %> 47 <% { %> 48 <input type="submit" value="get runs" /> 49 <% } %> 50 13 51 </asp:Content>
Note: See TracChangeset
for help on using the changeset viewer.