using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ServiceModel.Security; using System.Web.Security; using HLWebOKBQueryPlugin.OKBQueryService; using HLWebOKBQueryPlugin.Helpers; namespace HLWebPluginHost.Models { public class QueryModel { public String SelectedSubMenu { get; set; } public IList QueryFilterGetAll() { QueryServiceClient client = Query.GetClientFactory(); IList filterList = new List(); if (client != null) { Filter[] filters = client.GetFilters(); foreach (Filter f in filters) { filterList.Add(f); } } return filterList; } public RunCollectionData getRun(long id) { QueryServiceClient client = Query.GetClientFactory(); if (client != null) { Run run = client.GetRuns(new long[1] { id }, false).ToList().First(); RunCollectionData rcd = new RunCollectionData(run); return rcd; } return null; } // just 4 testing public IList getTestRuns() { QueryServiceClient client = Query.GetClientFactory(); if (client != null) { IList runs = new List(); //long[] runIds = client.GetRunIds(new Filter()); //if (runIds.Length < cnt) cnt = runIds.Length; long[] getRuns = new long[2] { 1, 2 }; IList runList = client.GetRuns(getRuns, false).ToList(); foreach (Run r in runList) runs.Add(new RunCollectionData(r)); return runs; } return new List(); } } }