Changeset 6226
- Timestamp:
- 05/17/11 15:54:20 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBQueryPlugin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/QueryController.cs
r6076 r6226 41 41 42 42 public ActionResult RunCollectionTable() { 43 return View(); 43 QueryModel qm = new QueryModel(); 44 Session["QueryRuns"] = qm.getTestRuns(); 45 return View(qm); 44 46 } 45 47 } -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj
r6190 r6226 99 99 </Compile> 100 100 <Compile Include="Helpers\HtmlHelpers.cs" /> 101 <Compile Include="Helpers\IParams.cs" /> 102 <Compile Include="Helpers\IResult.cs" /> 101 103 <Compile Include="Helpers\Query.cs" /> 104 <Compile Include="Helpers\RunCollectionData.cs" /> 102 105 <Compile Include="Models\AccountModels.cs" /> 103 106 <Compile Include="Models\ChartModel.cs" /> … … 163 166 <EmbeddedResource Include="Views\Query\Menu.ascx" /> 164 167 <Content Include="Views\Query\Results.aspx" /> 168 <EmbeddedResource Include="Views\Query\RunCollectionTable.ascx" /> 165 169 <Content Include="Views\ServiceTest\Index.aspx" /> 166 170 <Content Include="Web.config"> -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Helpers/Query.cs
r5919 r6226 17 17 try { 18 18 QueryServiceClient client = new QueryServiceClient(); 19 client.ClientCredentials.UserName.UserName = username;20 client.ClientCredentials.UserName.Password = password;19 client.ClientCredentials.UserName.UserName = "okbtester"; 20 client.ClientCredentials.UserName.Password = "okbtester"; 21 21 client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; 22 22 client.GetFilters(); -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Helpers/RunCollectionData.cs
r6076 r6226 10 10 11 11 #region properties 12 // Run 13 public long Id { get; set; } 14 12 15 // Result 13 16 public string ExecutionTime { get; set; } … … 64 67 #region constructor/initialisation 65 68 public RunCollectionData(Run run) { 69 Id = run.Id; 66 70 67 71 // results -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/QueryModel.cs
r6102 r6226 29 29 } 30 30 31 // //just 4 testing32 //public IList<RunCollectionData> getTestRuns() {31 // just 4 testing 32 public IList<RunCollectionData> getTestRuns() { 33 33 34 //QueryServiceClient client = Query.GetClientFactory();34 QueryServiceClient client = Query.GetClientFactory(); 35 35 36 //if (client != null) {37 //IList<RunCollectionData> runs = new List<RunCollectionData>();36 if (client != null) { 37 IList<RunCollectionData> runs = new List<RunCollectionData>(); 38 38 39 ////long[] runIds = client.GetRunIds(new Filter());40 ////if (runIds.Length < cnt) cnt = runIds.Length;39 //long[] runIds = client.GetRunIds(new Filter()); 40 //if (runIds.Length < cnt) cnt = runIds.Length; 41 41 42 // long[] getRuns = new long[2]{1,2};42 long[] getRuns = new long[2] { 1, 2 }; 43 43 44 //IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>();44 IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>(); 45 45 46 // foreach (Run r in runList)47 //runs.Add(new RunCollectionData(r));46 foreach (Run r in runList) 47 runs.Add(new RunCollectionData(r)); 48 48 49 //return runs;50 //}51 //return new List<RunCollectionData>();52 //}49 return runs; 50 } 51 return new List<RunCollectionData>(); 52 } 53 53 } 54 54 } -
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/RunCollectionTable.ascx
r6076 r6226 1 1 <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> 2 <%@ Import Namespace="HLWebOKBQueryPlugin.Helpers" %> 3 <%@ Import Namespace="System.Reflection" %> 2 4 3 5 <div id="RunCollectionTable" style="overflow: auto; width: 100%"> 4 <form id="frmRunCollectionTable" runat="server" method="post"> 6 <table> 7 <thead> 8 <tr> 9 <th> </th> 10 <% foreach (PropertyInfo pi in typeof(RunCollectionData).GetProperties()) { %> 11 <th><%= pi.Name %></th> 12 <% } %> 13 </tr> 14 </thead> 15 <tbody> 16 <% IList<RunCollectionData> data = (IList<RunCollectionData>) Session["QueryRuns"]; 17 foreach (RunCollectionData rcd in data) { 18 RouteValueDictionary rvd = new RouteValueDictionary(); 19 rvd.Add("controller", "Query"); 20 rvd.Add("id", rcd.Id); 21 %> 22 <tr> 23 <td><%: Html.ActionLink("details", "Details", rvd) %></td> 5 24 6 <asp:GridView ID="GridRunCollection" runat="server" DataSourceID="dsQueryRuns">7 <SelectedRowStyle BackColor="Aqua" />8 <Columns>9 <asp:BoundField />10 <asp:CommandField ShowSelectButton="true" SelectText="Details" />11 </Columns>12 </asp:GridView>13 <asp:ObjectDataSource ID="dsQueryRuns" runat="server"14 SelectMethod="getTestRuns"15 TypeName="HLWebPluginHost.Models.QueryModel">16 </asp:ObjectDataSource>25 <% foreach (PropertyInfo pi in typeof(RunCollectionData).GetProperties()) { 26 try { %> 27 <td><%= pi.GetValue(rcd, null).ToString()%></td> 28 <% } catch (Exception e) { %> 29 </td> 30 <% } 31 } %> 32 </tr> 33 <% } %> 34 </tbody> 35 </table> 17 36 18 </form>19 37 </div>
Note: See TracChangeset
for help on using the changeset viewer.