Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/11 15:54:20 (14 years ago)
Author:
msammer
Message:

#1446 rebuild the shown table. Now it is possible to make a right 'details'-call via an action within the MVC

Location:
branches/WebApplication/MVC2/HLWebOKBQueryPlugin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/QueryController.cs

    r6076 r6226  
    4141
    4242        public ActionResult RunCollectionTable() {
    43             return View();
     43            QueryModel qm = new QueryModel();
     44            Session["QueryRuns"] = qm.getTestRuns();
     45            return View(qm);
    4446        }
    4547    }
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj

    r6190 r6226  
    9999    </Compile>
    100100    <Compile Include="Helpers\HtmlHelpers.cs" />
     101    <Compile Include="Helpers\IParams.cs" />
     102    <Compile Include="Helpers\IResult.cs" />
    101103    <Compile Include="Helpers\Query.cs" />
     104    <Compile Include="Helpers\RunCollectionData.cs" />
    102105    <Compile Include="Models\AccountModels.cs" />
    103106    <Compile Include="Models\ChartModel.cs" />
     
    163166    <EmbeddedResource Include="Views\Query\Menu.ascx" />
    164167    <Content Include="Views\Query\Results.aspx" />
     168    <EmbeddedResource Include="Views\Query\RunCollectionTable.ascx" />
    165169    <Content Include="Views\ServiceTest\Index.aspx" />
    166170    <Content Include="Web.config">
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Helpers/Query.cs

    r5919 r6226  
    1717            try {
    1818                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";
    2121                client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
    2222                client.GetFilters();
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Helpers/RunCollectionData.cs

    r6076 r6226  
    1010
    1111        #region properties
     12        // Run
     13        public long Id { get; set; }
     14
    1215        // Result
    1316        public string ExecutionTime { get; set; }
     
    6467        #region constructor/initialisation
    6568        public RunCollectionData(Run run) {
     69            Id = run.Id;
    6670
    6771            // results
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/QueryModel.cs

    r6102 r6226  
    2929        }
    3030
    31         //// just 4 testing
    32         //public IList<RunCollectionData> getTestRuns() {
     31        // just 4 testing
     32        public IList<RunCollectionData> getTestRuns() {
    3333
    34         //    QueryServiceClient client = Query.GetClientFactory();
     34            QueryServiceClient client = Query.GetClientFactory();
    3535
    36         //    if (client != null) {
    37         //        IList<RunCollectionData> runs = new List<RunCollectionData>();
     36            if (client != null) {
     37                IList<RunCollectionData> runs = new List<RunCollectionData>();
    3838
    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;
    4141
    42         //        long[] getRuns = new long[2]{1,2};
     42                long[] getRuns = new long[2] { 1, 2 };
    4343
    44         //        IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>();
     44                IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>();
    4545
    46         //        foreach (Run r in runList)
    47         //            runs.Add(new RunCollectionData(r));
     46                foreach (Run r in runList)
     47                    runs.Add(new RunCollectionData(r));
    4848
    49         //        return runs;
    50         //    }
    51         //    return new List<RunCollectionData>();
    52         //}
     49                return runs;
     50            }
     51            return new List<RunCollectionData>();
     52        }
    5353    }
    5454}
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/RunCollectionTable.ascx

    r6076 r6226  
    11<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
     2<%@ Import Namespace="HLWebOKBQueryPlugin.Helpers" %>
     3<%@ Import Namespace="System.Reflection" %>
    24
    35<div id="RunCollectionTable" style="overflow: auto; width: 100%">
    4     <form id="frmRunCollectionTable" runat="server" method="post">
     6    <table>
     7        <thead>
     8            <tr>
     9                <th>&nbsp;</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>
    524
    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                        &nbsp;</td>
     30                    <%     }
     31                       } %>
     32                </tr>
     33               <% } %>
     34        </tbody>
     35    </table>
    1736
    18     </form>
    1937</div>
Note: See TracChangeset for help on using the changeset viewer.