Free cookie consent management tool by TermsFeed Policy Generator

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

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

#1520 added Styles; fixed bugs

File size: 2.1 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 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.