Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using System.ServiceModel.Security;
|
---|
6 | using System.Web.Security;
|
---|
7 | using HLWebOKBQueryPlugin.OKBQueryService;
|
---|
8 | using HLWebOKBQueryPlugin.Helpers;
|
---|
9 |
|
---|
10 | namespace HLWebOKBQueryPlugin.Models
|
---|
11 | {
|
---|
12 | public class QueryModel {
|
---|
13 |
|
---|
14 | public String SelectedSubMenu { get; set; }
|
---|
15 | private long[] runs;
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 | public IList<Filter> QueryFilterGetAll() {
|
---|
20 | QueryServiceClient client = Query.GetClientFactory();
|
---|
21 |
|
---|
22 | IList<Filter> filterList = new List<Filter>();
|
---|
23 |
|
---|
24 | if (client != null) {
|
---|
25 | Filter[] filters = client.GetFilters();
|
---|
26 | foreach (Filter f in filters) {
|
---|
27 | filterList.Add(f);
|
---|
28 |
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | return filterList;
|
---|
33 | }
|
---|
34 |
|
---|
35 | public RunCollectionData getRun(long id) {
|
---|
36 | QueryServiceClient client = Query.GetClientFactory();
|
---|
37 |
|
---|
38 | if (client != null) {
|
---|
39 | Run run = client.GetRuns(new long[1] { id }, false).ToList<Run>().First();
|
---|
40 | RunCollectionData rcd = new RunCollectionData(run);
|
---|
41 |
|
---|
42 | return rcd;
|
---|
43 | }
|
---|
44 | return null;
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | public long[] Runs
|
---|
49 | {
|
---|
50 | get
|
---|
51 | {
|
---|
52 | return this.runs;
|
---|
53 | }
|
---|
54 | set
|
---|
55 | {
|
---|
56 | this.runs = value;
|
---|
57 | }
|
---|
58 |
|
---|
59 | }
|
---|
60 |
|
---|
61 |
|
---|
62 | public IList<RunCollectionData> RunCollection
|
---|
63 | {
|
---|
64 | get
|
---|
65 | {
|
---|
66 | QueryServiceClient client = Query.GetClientFactory();
|
---|
67 | if (client != null)
|
---|
68 | {
|
---|
69 | IList<RunCollectionData> runCollection = new List<RunCollectionData>();
|
---|
70 |
|
---|
71 | IList<Run> runList = client.GetRuns(runs, false).ToList<Run>();
|
---|
72 |
|
---|
73 | foreach (Run r in runList)
|
---|
74 | runCollection.Add(new RunCollectionData(r));
|
---|
75 |
|
---|
76 | return runCollection;
|
---|
77 | }
|
---|
78 | return new List<RunCollectionData>();
|
---|
79 | }
|
---|
80 | }
|
---|
81 |
|
---|
82 | }
|
---|
83 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.