- Timestamp:
- 05/27/11 19:15:16 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBQueryPlugin
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs
r6303 r6318 37 37 // runIds[i] = i; 38 38 //} 39 long[] runIds = client.GetRunIds((CombinedFilter)Session["Content"]); 40 Run[] runs = client.GetRuns(runIds,false); 41 // Run[] runs = Session[""]; 42 cm.Runs = runs; 43 cm.UpdateRunCollection(runs); 44 cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize); 39 long[] runIds = new long[0]; 40 CombinedFilter cf = (CombinedFilter)Session["Content"]; 41 if (cf != null) 42 runIds = client.GetRunIds(cf); 43 44 Run[] runs = client.GetRuns(runIds, false); 45 // Run[] runs = Session[""]; 46 cm.Runs = runs; 47 cm.UpdateRunCollection(runs); 48 cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize); 45 49 46 50 return View("Index",cm); … … 213 217 214 218 // Later, we will get the runs from the session ... 215 QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester"); 216 217 long[] runIds = new long[5]; 218 for (int i = 0; i < 5; i++) { 219 runIds[i] = i; 220 } 219 QueryServiceClient client = Query.GetClientFactory(); 220 221 long[] runIds = new long[0]; 222 CombinedFilter cf = (CombinedFilter)Session["Content"]; 223 if (cf != null) 224 runIds = client.GetRunIds(cf); 225 221 226 Run[] runs = client.GetRuns(runIds, false); 222 223 cm.UpdateRunCollection(runs); 227 cm.Runs = runs; 224 228 225 229 -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
r6311 r6318 33 33 { 34 34 ids = client.GetRunIds(fm.Content); 35 35 36 } 36 37 catch (Exception e) -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/ChartModel.cs
r6242 r6318 9 9 10 10 namespace HLWebOKBQueryPlugin.Models { 11 public class ChartModel { 12 13 14 15 private Color DataPointColor = System.Drawing.Color.Black; 16 //private String xAxisValue; 17 //private String yAxisValue; 18 //private String sizeAxisValue; 19 20 public String xAxisValue { 21 get { return (HttpContext.Current.Session["xAxisValue"] == null) ? null : (String)HttpContext.Current.Session["xAxisValue"]; } 22 set { HttpContext.Current.Session["xAxisValue"] = value; } 11 public class ChartModel { 12 13 14 15 private Color DataPointColor = System.Drawing.Color.Black; 16 //private String xAxisValue; 17 //private String yAxisValue; 18 //private String sizeAxisValue; 19 20 public String xAxisValue { 21 get { return (HttpContext.Current.Session["xAxisValue"] == null) ? null : (String)HttpContext.Current.Session["xAxisValue"]; } 22 set { HttpContext.Current.Session["xAxisValue"] = value; } 23 } 24 public String yAxisValue { 25 get { return (HttpContext.Current.Session["yAxisValue"] == null) ? null : (String)HttpContext.Current.Session["yAxisValue"]; } 26 set { HttpContext.Current.Session["yAxisValue"] = value; } 27 } 28 public String sizeAxisValue { 29 get { return (HttpContext.Current.Session["sizeAxisValue"] == null) ? null : (String)HttpContext.Current.Session["sizeAxisValue"]; } 30 set { HttpContext.Current.Session["sizeAxisValue"] = value; } 31 } 32 33 34 private Dictionary<string, Dictionary<object, double>> CategoricalMap { 35 get; 36 set; 37 } 38 39 //public Run[] Runs { 40 // set; 41 // get; 42 // // { 43 // //UpdateComboBoxValues(value); 44 45 // //} 46 //} 47 48 public Run[] Runs { 49 get { return (HttpContext.Current.Session["runs"] == null) ? null : (Run[])HttpContext.Current.Session["runs"]; } 50 set { HttpContext.Current.Session["runs"] = value; } 51 } 52 53 public Series Series { set; get; } 54 55 public void UpdateRunCollection(Run[] runs) { 56 this.Runs = runs; 57 UpdateComboBoxValues(); 58 // 59 } 60 61 public List<string> valuesAxisY { get; set; } 62 public List<string> valuesAxisX { get; set; } 63 public List<string> bubbleSize { get; set; } 64 65 66 67 // COnstrucotr 68 public ChartModel() { 69 70 CategoricalMap = new Dictionary<string, Dictionary<object, double>>(); 71 72 valuesAxisY = new List<string>(); 73 valuesAxisX = new List<string>(); 74 bubbleSize = new List<string>(); 75 Series = new Series(); 76 this.Series.ChartType = SeriesChartType.Bubble; 77 } 78 79 80 81 private double GetCategoricalValue(string columnName, string value) { 82 if (!this.CategoricalMap.ContainsKey(columnName)) { 83 this.CategoricalMap[columnName] = new Dictionary<object, double>(); 84 } 85 if (!this.CategoricalMap[columnName].ContainsKey(value)) { 86 if (this.CategoricalMap[columnName].Values.Count == 0) { 87 this.CategoricalMap[columnName][value] = 1.0; 88 } 89 else { 90 this.CategoricalMap[columnName][value] = this.CategoricalMap[columnName].Values.Max() + 1.0; 91 } 92 } 93 return this.CategoricalMap[columnName][value]; 94 } 95 96 private double? GetValue(Run run, String columnName) { 97 if ((run == null) || string.IsNullOrEmpty(columnName)) { 98 return null; 99 } 100 Value value = run.ResultValues.FirstOrDefault(x => x.Name == columnName); 101 102 if (value == null) { 103 return null; 104 } 105 106 DoubleValue doubleValue = value as DoubleValue; 107 IntValue intValue = value as IntValue; 108 BoolValue boolValue = value as BoolValue; 109 FloatValue floatValue = value as FloatValue; 110 BinaryValue binaryValue = value as BinaryValue; 111 LongValue longValue = value as LongValue; 112 StringValue stringValue = value as StringValue; 113 114 double? ret = null; 115 if (doubleValue != null) { 116 if (!double.IsNaN(doubleValue.Value) && !double.IsInfinity(doubleValue.Value)) { 117 ret = doubleValue.Value; 118 } 119 } 120 else if (intValue != null) { 121 ret = intValue.Value; 122 } 123 else if (floatValue != null) { 124 ret = floatValue.Value; 125 } 126 else if (longValue != null) { 127 ret = longValue.Value; 128 } 129 else { 130 ret = GetCategoricalValue(columnName, value.ToString()); 131 } 132 return ret; 133 } 134 135 private void AddDataPoint(Run run) {//, int pos) { 136 double? xValue; 137 double? yValue; 138 double? sValue; 139 // Series series = this.BubbleChart.Series[0]; 140 // Series series = new Series(); 141 xValue = GetValue(run, this.xAxisValue); 142 yValue = GetValue(run, this.yAxisValue); 143 sValue = GetValue(run, this.sizeAxisValue); 144 145 if (xValue.HasValue && yValue.HasValue && sValue.HasValue) { 146 xValue = xValue.Value; 147 yValue = yValue.Value; 148 sValue = sValue.Value; 149 double[] yValues = { (double)yValue, (double)sValue }; 150 DataPoint point = new DataPoint(xValue.Value, yValues); 151 point.Tag = run; 152 point.Color = DataPointColor; 153 this.Series.Points.Add(point); 154 } 155 } 156 157 private void UpdateComboBoxValues() { 158 if (Runs == null) { 159 return; 160 } 161 ArrayList comboBoxValues = new ArrayList(); 162 Value[] resultValues = null; 163 foreach (Run run in Runs) { 164 resultValues = run.ResultValues; 165 //comboBoxValues.Add(selectString); 166 foreach (Value v in resultValues) { 167 String resultValueName = v.Name.ToString(); 168 if (!comboBoxValues.Contains(resultValueName)) { 169 comboBoxValues.Add(resultValueName); 170 } 171 } 172 } 173 174 175 this.valuesAxisY.Clear(); 176 this.valuesAxisX.Clear(); 177 this.bubbleSize.Clear(); 178 179 foreach (String s in comboBoxValues) { 180 if (!valuesAxisY.Contains(s)) { 181 this.valuesAxisY.Add(s); 182 this.valuesAxisX.Add(s); 183 this.bubbleSize.Add(s); 184 } 185 } 186 } 187 188 private void UpdateDataPoints() { 189 Run[] runs = this.Runs; 190 Series series = this.Series; 191 series.Points.Clear(); 192 if (runs != null) { 193 foreach (Run run in runs) { 194 this.AddDataPoint(run); 195 } 196 UpdateMarkerSize(); 197 } 198 } 199 200 private void UpdateMarkerSize() { 201 double[] sizeValues = Series.Points.Select(p => p.YValues[1]).ToArray(); 202 double minSizeValue = 0; 203 double maxSizeValue = 0; 204 if (sizeValues.Length > 0) { 205 minSizeValue = sizeValues.Min(); 206 maxSizeValue = sizeValues.Max(); 207 } 208 //int sizeFaktor = int.Parse(bubbleSizeFactor.SelectedItem.Value); 209 210 for (int i = 0; i < sizeValues.Length; i++) { 211 DataPoint dataPoint = this.Series.Points[i]; 212 213 double sizeRange = maxSizeValue - minSizeValue; 214 double relativeSize = dataPoint.YValues[1] - minSizeValue; 215 216 if (sizeRange > double.Epsilon) { 217 relativeSize /= sizeRange; 218 } 219 else { 220 relativeSize = 1; 221 } 222 //int markerSize = (int)Math.Round(bubbleSizeFaktor * relativeSize); 223 //if (markerSize < 1) { 224 // markerSize = 1; 225 //} 226 double[] yValues = dataPoint.YValues; 227 // double minBubbleSizeFactor = double.Parse(bubbleSizeFactor.Items[0].Value); 228 //int markerSize = (int)Math.Round( 229 // (sizeFaktor - minBubbleSizeFactor) * relativeSize + minBubbleSizeFactor); 230 //yValues[1] = markerSize; 231 //dataPoint.MarkerSize = markerSize; 232 dataPoint.YValues = yValues; 233 } 234 } 235 236 public void UpdateBubbleChart(string yAxisValue, string xAxisValue, string sizeAxisValue) { 237 this.yAxisValue = yAxisValue; 238 this.xAxisValue = xAxisValue; 239 this.sizeAxisValue = sizeAxisValue; 240 241 UpdateDataPoints(); 242 } 243 244 //protected void valuesAxisY_SelectedIndexChanged(object sender, EventArgs e) 245 //{ 246 // if (AllAxisSelected()) 247 // { 248 // UpdateBubbleChart(); 249 // } 250 //} 251 252 //protected void valuesAxisX_SelectedIndexChanged(object sender, EventArgs e) 253 //{ 254 // if (AllAxisSelected()) 255 // { 256 // UpdateBubbleChart(); 257 // } 258 //} 259 260 //protected void bubbleSize_SelectedIndexChanged(object sender, EventArgs e) 261 //{ 262 // if (AllAxisSelected()) 263 // { 264 // UpdateBubbleChart(); 265 // } 266 //} 267 268 //protected void bubbleSizeFactor_SelectedIndexChanged(object sender, EventArgs e) 269 //{ 270 // if (AllAxisSelected()) 271 // { 272 // UpdateBubbleChart(); 273 // } 274 //} 275 276 //private bool AllAxisSelected() 277 //{ 278 // return (((valuesAxisY.SelectedValue).CompareTo(selectString) != 0) && 279 // ((valuesAxisX.SelectedValue).CompareTo(selectString) != 0) && 280 // ((bubbleSize.SelectedValue).CompareTo(selectString) != 0)); 281 //} 23 282 } 24 public String yAxisValue {25 get { return (HttpContext.Current.Session["yAxisValue"] == null) ? null : (String)HttpContext.Current.Session["yAxisValue"]; }26 set { HttpContext.Current.Session["yAxisValue"] = value; }27 }28 public String sizeAxisValue {29 get { return (HttpContext.Current.Session["sizeAxisValue"] == null) ? null : (String)HttpContext.Current.Session["sizeAxisValue"]; }30 set { HttpContext.Current.Session["sizeAxisValue"] = value; }31 }32 33 34 private Dictionary<string, Dictionary<object, double>> CategoricalMap {35 get;36 set;37 }38 39 //public Run[] Runs {40 // set;41 // get;42 // // {43 // //UpdateComboBoxValues(value);44 45 // //}46 //}47 48 public Run[] Runs {49 get { return (HttpContext.Current.Session["runs"] == null) ? null : (Run[])HttpContext.Current.Session["runs"]; }50 set { HttpContext.Current.Session["runs"] = value; }51 }52 53 public Series Series { set; get; }54 55 public void UpdateRunCollection(Run[] runs) {56 this.Runs = runs;57 UpdateComboBoxValues();58 //59 }60 61 public List<string> valuesAxisY { get; set; }62 public List<string> valuesAxisX { get; set; }63 public List<string> bubbleSize { get; set; }64 65 66 67 // COnstrucotr68 public ChartModel() {69 70 CategoricalMap = new Dictionary<string, Dictionary<object, double>>();71 72 valuesAxisY = new List<string>();73 valuesAxisX = new List<string>();74 bubbleSize = new List<string>();75 Series = new Series();76 this.Series.ChartType = SeriesChartType.Bubble;77 }78 79 80 81 private double GetCategoricalValue(string columnName, string value) {82 if (!this.CategoricalMap.ContainsKey(columnName)) {83 this.CategoricalMap[columnName] = new Dictionary<object, double>();84 }85 if (!this.CategoricalMap[columnName].ContainsKey(value)) {86 if (this.CategoricalMap[columnName].Values.Count == 0) {87 this.CategoricalMap[columnName][value] = 1.0;88 } else {89 this.CategoricalMap[columnName][value] = this.CategoricalMap[columnName].Values.Max() + 1.0;90 }91 }92 return this.CategoricalMap[columnName][value];93 }94 95 private double? GetValue(Run run, String columnName) {96 if ((run == null) || string.IsNullOrEmpty(columnName)) {97 return null;98 }99 Value value = run.ResultValues.FirstOrDefault(x => x.Name == columnName);100 101 if (value == null) {102 return null;103 }104 105 DoubleValue doubleValue = value as DoubleValue;106 IntValue intValue = value as IntValue;107 BoolValue boolValue = value as BoolValue;108 FloatValue floatValue = value as FloatValue;109 BinaryValue binaryValue = value as BinaryValue;110 LongValue longValue = value as LongValue;111 StringValue stringValue = value as StringValue;112 113 double? ret = null;114 if (doubleValue != null) {115 if (!double.IsNaN(doubleValue.Value) && !double.IsInfinity(doubleValue.Value)) {116 ret = doubleValue.Value;117 }118 } else if (intValue != null) {119 ret = intValue.Value;120 } else if (floatValue != null) {121 ret = floatValue.Value;122 } else if (longValue != null) {123 ret = longValue.Value;124 } else {125 ret = GetCategoricalValue(columnName, value.ToString());126 }127 return ret;128 }129 130 private void AddDataPoint(Run run) {//, int pos) {131 double? xValue;132 double? yValue;133 double? sValue;134 // Series series = this.BubbleChart.Series[0];135 // Series series = new Series();136 xValue = GetValue(run, this.xAxisValue);137 yValue = GetValue(run, this.yAxisValue);138 sValue = GetValue(run, this.sizeAxisValue);139 140 if (xValue.HasValue && yValue.HasValue && sValue.HasValue) {141 xValue = xValue.Value;142 yValue = yValue.Value;143 sValue = sValue.Value;144 double[] yValues = { (double)yValue, (double)sValue };145 DataPoint point = new DataPoint(xValue.Value, yValues);146 point.Tag = run;147 point.Color = DataPointColor;148 this.Series.Points.Add(point);149 }150 }151 152 private void UpdateComboBoxValues() {153 if (Runs == null) {154 return;155 }156 ArrayList comboBoxValues = new ArrayList();157 Value[] resultValues = null;158 foreach (Run run in Runs) {159 resultValues = run.ResultValues;160 //comboBoxValues.Add(selectString);161 foreach (Value v in resultValues) {162 String resultValueName = v.Name.ToString();163 if (!comboBoxValues.Contains(resultValueName)) {164 comboBoxValues.Add(resultValueName);165 }166 }167 }168 169 170 this.valuesAxisY.Clear();171 this.valuesAxisX.Clear();172 this.bubbleSize.Clear();173 174 foreach (String s in comboBoxValues) {175 if (!valuesAxisY.Contains(s)) {176 this.valuesAxisY.Add(s);177 this.valuesAxisX.Add(s);178 this.bubbleSize.Add(s);179 }180 }181 }182 183 private void UpdateDataPoints() {184 Run[] runs = this.Runs;185 Series series = this.Series;186 series.Points.Clear();187 if (runs != null) {188 foreach (Run run in runs) {189 this.AddDataPoint(run);190 }191 UpdateMarkerSize();192 }193 }194 195 private void UpdateMarkerSize() {196 double[] sizeValues = Series.Points.Select(p => p.YValues[1]).ToArray();197 double minSizeValue = sizeValues.Min();198 double maxSizeValue = sizeValues.Max();199 //int sizeFaktor = int.Parse(bubbleSizeFactor.SelectedItem.Value);200 201 for (int i = 0; i < sizeValues.Length; i++) {202 DataPoint dataPoint = this.Series.Points[i];203 204 double sizeRange = maxSizeValue - minSizeValue;205 double relativeSize = dataPoint.YValues[1] - minSizeValue;206 207 if (sizeRange > double.Epsilon) {208 relativeSize /= sizeRange;209 } else {210 relativeSize = 1;211 }212 //int markerSize = (int)Math.Round(bubbleSizeFaktor * relativeSize);213 //if (markerSize < 1) {214 // markerSize = 1;215 //}216 double[] yValues = dataPoint.YValues;217 // double minBubbleSizeFactor = double.Parse(bubbleSizeFactor.Items[0].Value);218 //int markerSize = (int)Math.Round(219 // (sizeFaktor - minBubbleSizeFactor) * relativeSize + minBubbleSizeFactor);220 //yValues[1] = markerSize;221 //dataPoint.MarkerSize = markerSize;222 dataPoint.YValues = yValues;223 }224 }225 226 public void UpdateBubbleChart(string yAxisValue, string xAxisValue, string sizeAxisValue) {227 this.yAxisValue = yAxisValue;228 this.xAxisValue = xAxisValue;229 this.sizeAxisValue = sizeAxisValue;230 231 UpdateDataPoints();232 }233 234 //protected void valuesAxisY_SelectedIndexChanged(object sender, EventArgs e)235 //{236 // if (AllAxisSelected())237 // {238 // UpdateBubbleChart();239 // }240 //}241 242 //protected void valuesAxisX_SelectedIndexChanged(object sender, EventArgs e)243 //{244 // if (AllAxisSelected())245 // {246 // UpdateBubbleChart();247 // }248 //}249 250 //protected void bubbleSize_SelectedIndexChanged(object sender, EventArgs e)251 //{252 // if (AllAxisSelected())253 // {254 // UpdateBubbleChart();255 // }256 //}257 258 //protected void bubbleSizeFactor_SelectedIndexChanged(object sender, EventArgs e)259 //{260 // if (AllAxisSelected())261 // {262 // UpdateBubbleChart();263 // }264 //}265 266 //private bool AllAxisSelected()267 //{268 // return (((valuesAxisY.SelectedValue).CompareTo(selectString) != 0) &&269 // ((valuesAxisX.SelectedValue).CompareTo(selectString) != 0) &&270 // ((bubbleSize.SelectedValue).CompareTo(selectString) != 0));271 //}272 }273 283 } -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Chart/BubbleChart.ascx
r6171 r6318 3 3 <%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %> 4 4 5 5 <div style="background-color: #eeeeee;border-style:solid;border-color:#aaa;border-width:1px;padding:10px;list-style-type:none;"> 6 6 <% using (Html.BeginForm("UpdateBubbleChart","Chart")) %> 7 7 <% { %> 8 8 9 <%: Html.Label(" x axis")%>9 <%: Html.Label("X-Axis")%> 10 10 <%: Html.DropDownList("valuesAxisXCombobox", new SelectList(((ChartModel)Model).valuesAxisX))%> 11 12 <%: Html.Label(" y axis")%>11 <br /> 12 <%: Html.Label("Y-Axis")%> 13 13 <%: Html.DropDownList("valuesAxisYCombobox", new SelectList(((ChartModel)Model).valuesAxisY))%> 14 15 <%: Html.Label(" bubble size")%>14 <br /> 15 <%: Html.Label("Bubble Size")%> 16 16 <%: Html.DropDownList("bubbleSizeCombobox", new SelectList(((ChartModel)Model).bubbleSize))%> 17 17 18 <input type="submit" value="update chart" /> 18 <input type="submit" class="hl-icon-refresh" value="update chart" /> 19 </div> 20 21 19 22 20 23 <% } %> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Chart/Index.aspx
r6118 r6318 1 1 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> 2 3 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent"> 4 <% Html.RenderAction("Menu","Query"); %> 5 </asp:Content> 2 6 3 7 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> … … 7 11 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 8 12 9 <h2> Index (Chart)</h2>13 <h2>Bubble Chart</h2> 10 14 11 15 -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
r6308 r6318 3 3 <%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %> 4 4 <%@ Import Namespace="HLWebOKBQueryPlugin.ViewModels" %> 5 6 7 5 <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script> 8 6 <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> 9 10 7 <script type="text/javascript"> 11 8 function setAction(action, id) { … … 16 13 </script> 17 14 15 <% using (Html.BeginForm("AddFilter", "Filter", FormMethod.Post, new { Name = "filterForm" })) %> 16 <% { %> 17 <!-- Put all into a form that calls the "AddFilter" Action--> 18 <% 19 CombinedFilter topFilter = ((FilterModel)Model).Content; 20 %> 21 <%: Html.Hidden("selectedFilter",null, new { Id = "selectedFilter" })%> 22 <%: Html.Hidden("action", null, new { Id = "action" })%> 23 <div> 24 <% 25 foreach (Filter fNode in topFilter.Filters) { 18 26 19 <% Html.EnableClientValidation(); %> 20 <% using (Html.BeginForm("AddFilter", "Filter", FormMethod.Post, new { Name = "filterForm" })) %> 21 <% { %> 22 <!-- Put all into a form that calls the "AddFilter" Action--> 23 24 <% 25 CombinedFilter topFilter = ((FilterModel)Model).Content; 27 CombinedFilter currentFilter = (CombinedFilter)fNode; 28 string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id; 29 string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id; 26 30 %> 27 <div><table> 28 <tr><td>A<br />N<br />D</td><td> 29 30 <%: Html.Hidden("selectedFilter",null, new { Id = "selectedFilter" })%> 31 <%: Html.Hidden("action", null, new { Id = "action" })%> 32 33 <% 34 foreach (Filter fNode in topFilter.Filters) 35 { 36 37 CombinedFilter currentFilter = (CombinedFilter)fNode; 38 string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id; 39 string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id; 40 %> 41 <table border="0"><tr><td> 42 <%: Html.Hidden(hiddenName, currentFilter.Id.ToString())%> 43 44 <%: Html.DropDownList(comboboxName, new SelectList(((FilterModel)Model).AvailableFilterForCombobox, "FilterTypeName", "Label"))%> 45 46 47 <input type="button" name="submitButton" value="+" class="hl-button-text-plus" onClick="setAction('add','<%: currentFilter.Id%>');" /> 48 <!-- <input type="submit" name="submitButton" value="+.<%:currentFilter.Id%>" />--> 49 </td></tr><tr><td> 50 <!-- Build the selected filters. The filtesr will be stored in the session and the 31 <ul style="background-color: #eeeeee;border-style:solid;border-color:#aaa;border-width:1px;padding:10px;list-style-type:none;"> 32 <li> 33 <%: Html.Hidden(hiddenName, currentFilter.Id.ToString())%> 34 <%: Html.DropDownList(comboboxName, new SelectList(((FilterModel)Model).AvailableFilterForCombobox, "FilterTypeName", "Label"))%> 35 <input type="button" name="submitButton" value="+" class="hl-button-text-plus" onclick="setAction('add','<%: currentFilter.Id%>');" /> 36 <!-- <input type="submit" name="submitButton" value="+.<%:currentFilter.Id%>" />--> 37 </li> 38 <!-- Build the selected filters. The filtesr will be stored in the session and the 51 39 Controller puts the current filters from the session into the model. Selected Filters 52 40 will be iterated. --> 53 <% if (currentFilter.Filters != null) 54 { 41 <% if (currentFilter.Filters != null) { 55 42 56 foreach (Filter f in currentFilter.Filters) 57 { 58 if (f != null) 59 { %> 60 61 <tr><td> 62 <% 43 foreach (Filter f in currentFilter.Filters) { 44 if (f != null) { %> 45 <li style="background-color:#FFF380;padding:5px;margin:5px;"> 46 <% 63 47 64 48 65 if ("StringComparisonFilter".Equals(f.GetType().Name)) 66 { %> 67 <% StringComparisonFilter filter = ((StringComparisonFilter)f); %> 68 <%: Html.Label(filter.Label)%> 69 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 70 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%> 71 <%: Html.TextBoxFor(model => ((FilterModel)Model).IntValue, (filter.Value))%> 72 <%: Html.ValidationMessageFor(model => ((FilterModel)Model).IntValue)%> 73 <% } 74 else if ("NameStringComparisonFilter".Equals(f.GetType().Name)) 75 { %> 76 <% NameStringComparisonFilter filter = ((NameStringComparisonFilter)f); %> 77 <%: Html.Label(filter.Label)%> 78 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 79 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 80 <% } 81 else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) 82 { %> 83 <% StringComparisonAvailableValuesFilter filter = ((StringComparisonAvailableValuesFilter)f); %> 84 <%: Html.Label(filter.Label)%> 85 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 86 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueTextbox, new SelectList(filter.AvailableValues, filter.Value))%> 87 <% } 88 else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name)) 89 { %> 90 <% NameEqualityComparisonByteArrayFilter filter = ((NameEqualityComparisonByteArrayFilter)f); %> 91 <%: Html.Label(filter.Label)%> 92 <%: Html.Label("not supported")%> 93 <% } 94 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name)) 95 { %> 96 <% NameEqualityComparisonBoolFilter filter = ((NameEqualityComparisonBoolFilter)f); %> 97 <%: Html.Label(filter.Label)%> 98 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.BoolComparisons, "Value", "Text", (int)filter.Comparison))%> 99 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(((FilterModel)Model).BoolStates, filter.Value))%> 100 <% } 101 else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name)) 102 { %> 103 <% NameOrdinalComparisonIntFilter filter = ((NameOrdinalComparisonIntFilter)f); %> 104 <%: Html.Label(filter.Label)%> 105 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 106 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 107 <% } 108 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) 109 { %> 110 <% NameStringComparisonAvailableValuesFilter filter = ((NameStringComparisonAvailableValuesFilter)f); %> 111 <%: Html.Label(filter.Label)%> 112 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 113 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(filter.AvailableValues, filter.Value))%> 114 <% } 115 else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name)) 116 { %> 117 <% NameOrdinalComparisonDoubleFilter filter = ((NameOrdinalComparisonDoubleFilter)f); %> 118 <%: Html.Label(filter.Label)%> 119 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 120 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 121 <% } 122 else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name)) 123 { %> 124 <% NameOrdinalComparisonFloatFilter filter = ((NameOrdinalComparisonFloatFilter)f); %> 125 <%: Html.Label(filter.Label)%> 126 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 127 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 128 <% } 129 else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name)) 130 { %> 131 <% NameOrdinalComparisonLongFilter filter = ((NameOrdinalComparisonLongFilter)f); %> 132 <%: Html.Label(filter.Label)%> 133 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 134 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 135 <% } 136 else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name)) 137 { %> 138 <% OrdinalComparisonDateTimeFilter filter = ((OrdinalComparisonDateTimeFilter)f); %> 139 <%: Html.Label(filter.Label)%> 140 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 141 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 142 <% } 49 if ("StringComparisonFilter".Equals(f.GetType().Name)) { 50 %> 51 <% StringComparisonFilter filter = ((StringComparisonFilter)f); %> 52 <%: Html.Label(filter.Label)%> 53 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 54 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%> 55 <% } 56 else if ("NameStringComparisonFilter".Equals(f.GetType().Name)) { %> 57 <% NameStringComparisonFilter filter = ((NameStringComparisonFilter)f); %> 58 <%: Html.Label(filter.Label)%> 59 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 60 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 61 <% } 62 else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) { %> 63 <% StringComparisonAvailableValuesFilter filter = ((StringComparisonAvailableValuesFilter)f); %> 64 <%: Html.Label(filter.Label)%> 65 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 66 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueTextbox, new SelectList(filter.AvailableValues, filter.Value))%> 67 <% } 68 else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name)) { %> 69 <% NameEqualityComparisonByteArrayFilter filter = ((NameEqualityComparisonByteArrayFilter)f); %> 70 <%: Html.Label(filter.Label)%> 71 <%: Html.Label("not supported")%> 72 <% } 73 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name)) { %> 74 <% NameEqualityComparisonBoolFilter filter = ((NameEqualityComparisonBoolFilter)f); %> 75 <%: Html.Label(filter.Label)%> 76 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.BoolComparisons, "Value", "Text", (int)filter.Comparison))%> 77 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(((FilterModel)Model).BoolStates, filter.Value))%> 78 <% } 79 else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name)) { %> 80 <% NameOrdinalComparisonIntFilter filter = ((NameOrdinalComparisonIntFilter)f); %> 81 <%: Html.Label(filter.Label)%> 82 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 83 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 84 <% } 85 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) { %> 86 <% NameStringComparisonAvailableValuesFilter filter = ((NameStringComparisonAvailableValuesFilter)f); %> 87 <%: Html.Label(filter.Label)%> 88 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%> 89 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(filter.AvailableValues, filter.Value))%> 90 <% } 91 else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name)) { %> 92 <% NameOrdinalComparisonDoubleFilter filter = ((NameOrdinalComparisonDoubleFilter)f); %> 93 <%: Html.Label(filter.Label)%> 94 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 95 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 96 <% } 97 else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name)) { %> 98 <% NameOrdinalComparisonFloatFilter filter = ((NameOrdinalComparisonFloatFilter)f); %> 99 <%: Html.Label(filter.Label)%> 100 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 101 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 102 <% } 103 else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name)) { %> 104 <% NameOrdinalComparisonLongFilter filter = ((NameOrdinalComparisonLongFilter)f); %> 105 <%: Html.Label(filter.Label)%> 106 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 107 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 108 <% } 109 else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name)) { %> 110 <% OrdinalComparisonDateTimeFilter filter = ((OrdinalComparisonDateTimeFilter)f); %> 111 <%: Html.Label(filter.Label)%> 112 <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.OrdinalComparisons, "Value", "Text", (int)filter.Comparison))%> 113 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 114 <% } 143 115 116 %> 117 <!-- <input type="submit" name="submitButton" value="-.<%:f.Id%>" class="hl-icon-delete" style="text-indent:-999em;" /> 118 --> 119 <input type="button" name="submitButton" value="-" class="hl-icon-delete" onclick="setAction('delete','<%: f.Id%>');" /> 120 <% } // if%> 121 </li> 122 <% } // inner foreach %> 123 </ul> 124 <% } // if%> 125 <% 126 }// foreach 144 127 %> 145 <!-- <input type="submit" name="submitButton" value="-.<%:f.Id%>" class="hl-icon-delete" style="text-indent:-999em;" /> 146 --> 147 <input type="button" name="submitButton" value="-" class="hl-icon-delete" onClick="setAction('delete','<%: f.Id%>');" /> 148 149 <% }%> 150 </td></tr> 151 <% } %> 152 </table></td></tr> 153 <% }%> 154 <% }%> 155 156 157 158 159 </table> <input type="button" name="submitButton" value="or" onClick="setAction('or','');" /> 160 </br> 161 <input type="button" name="submitButton" value="runs" onClick="setAction('runs','');" /> 162 163 164 <% } 165 %> 166 </div> 128 <a class="hl-button-text-plus" onclick="setAction('or','');" >OR Filter</a> 129 <a class="hl-icon-refresh" onclick="setAction('runs','');" >Refresh</a> 130 <% 131 } // form 132 %> 133 </div> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Results.aspx
r6303 r6318 4 4 <%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %> 5 5 <%@ Import Namespace="HLWebOKBQueryPlugin.Helpers" %> 6 7 <asp:Content ID="Content3" runat="server" ContentPlaceHolderID="SubMenuContent"> 8 <% Html.RenderAction("Menu","Query"); %> 9 </asp:Content> 6 10 7 11 <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/Menu.ascx
r6253 r6318 6 6 </li> 7 7 <li <% if(Session["SelectedSubMenu"] == "Results") {%> class="selected" <%}%>> 8 <%: Html.ActionLink(" Results", "Results", "Query") %>8 <%: Html.ActionLink("Tabular View", "Results", "Query") %> 9 9 </li> 10 10 <% if (Session["QueryRunDetailId"] != null) { %>
Note: See TracChangeset
for help on using the changeset viewer.