Free cookie consent management tool by TermsFeed Policy Generator

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

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

#1446 Changed RunCollectionTable for using it in the MVC-pluginhost. Changes for using real Run-objects in the table

File size: 1.5 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        // just 4 testing
32        public IList<RunCollectionData> getTestRuns() {
33
34            QueryServiceClient client = Query.GetClientFactory();
35
36            if (client != null) {
37                IList<RunCollectionData> runs = new List<RunCollectionData>();
38
39                //long[] runIds = client.GetRunIds(new Filter());
40                //if (runIds.Length < cnt) cnt = runIds.Length;
41
42                long[] getRuns = new long[2]{1,2};
43
44                IList<Run> runList = client.GetRuns(getRuns, false).ToList<Run>();
45
46                foreach (Run r in runList)
47                    runs.Add(new RunCollectionData(r));
48
49                return runs;
50            }
51            return new List<RunCollectionData>();
52        }
53    }
54}
Note: See TracBrowser for help on using the repository browser.