Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 13229 was 6315, checked in by msammer, 14 years ago

#1520 added Styles; fixed bugs

File size: 2.1 KB
RevLine 
[5910]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.ServiceModel.Security;
6using System.Web.Security;
7using HLWebOKBQueryPlugin.OKBQueryService;
[5919]8using HLWebOKBQueryPlugin.Helpers;
[5910]9
[6303]10namespace HLWebOKBQueryPlugin.Models
11{
[5910]12    public class QueryModel {
13
[6076]14        public String SelectedSubMenu { get; set; }
[6303]15        private long[] runs;
[5910]16
[6303]17
18
[6076]19        public IList<Filter> QueryFilterGetAll() {
20            QueryServiceClient client = Query.GetClientFactory();
[5919]21
[6076]22            IList<Filter> filterList = new List<Filter>();
[5919]23
[6076]24            if (client != null) {
25                Filter[] filters = client.GetFilters();
26                foreach (Filter f in filters) {
27                    filterList.Add(f);
[5919]28
[6076]29                }
30            }
[5919]31
[6076]32            return filterList;
33        }
[5919]34
[6253]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
[6076]47
[6303]48        public long[] Runs
49        {
50            get
51            {
52                return this.runs;
53            }
54            set
55            {
56                this.runs = value;
57            }
[6076]58
[6303]59        }
[6076]60
61
[6303]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>();
[6076]70
[6303]71                    IList<Run> runList = client.GetRuns(runs, false).ToList<Run>();
[6076]72
[6303]73                    foreach (Run r in runList)
74                        runCollection.Add(new RunCollectionData(r));
[6076]75
[6303]76                    return runCollection;
77                }
78                return new List<RunCollectionData>();
[6226]79            }
80        }
[6253]81
[5910]82    }
83}
Note: See TracBrowser for help on using the repository browser.