Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/QueryModel.cs @ 6253

Last change on this file since 6253 was 6253, checked in by msammer, 13 years ago

#1520 Added the Run-detail-view which shows the properties and the values of a run. Property-values are shown in a AJAX-based extra view

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.ServiceModel.Security;
6using System.Web.Security;
7using HLWebOKBQueryPlugin.OKBQueryService;
8using HLWebOKBQueryPlugin.Helpers;
9
10namespace HLWebPluginHost.Models {
11    public class QueryModel {
12
13        public String SelectedSubMenu { get; set; }
14
15        public IList<Filter> QueryFilterGetAll() {
16            QueryServiceClient client = Query.GetClientFactory();
17
18            IList<Filter> filterList = new List<Filter>();
19
20            if (client != null) {
21                Filter[] filters = client.GetFilters();
22                foreach (Filter f in filters) {
23                    filterList.Add(f);
24
25                }
26            }
27
28            return filterList;
29        }
30
31        public RunCollectionData getRun(long id) {
32            QueryServiceClient client = Query.GetClientFactory();
33
34            if (client != null) {
35                Run run = client.GetRuns(new long[1] { id }, false).ToList<Run>().First();
36                RunCollectionData rcd = new RunCollectionData(run);
37
38                return rcd;
39            }
40            return null;
41        }
42
43        // just 4 testing
44        public IList<RunCollectionData> getTestRuns() {
45
46            QueryServiceClient client = Query.GetClientFactory();
47
48            if (client != null) {
49                IList<RunCollectionData> runs = new List<RunCollectionData>();
50
51                //long[] runIds = client.GetRunIds(new Filter());
52                //if (runIds.Length < cnt) cnt = runIds.Length;
53
54                long[] getRuns = new long[2] { 1, 2 };
55
56                IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>();
57
58                foreach (Run r in runList)
59                    runs.Add(new RunCollectionData(r));
60
61                return runs;
62            }
63            return new List<RunCollectionData>();
64        }
65
66    }
67}
Note: See TracBrowser for help on using the repository browser.