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 HLWebOKBQueryPlugin.Models { public class QueryModel { public String SelectedSubMenu { get; set; } private long[] runs; 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; } public long[] Runs { get { return this.runs; } set { this.runs = value; } } public IList RunCollection { get { QueryServiceClient client = Query.GetClientFactory(); if (client != null) { IList runCollection = new List(); IList runList = client.GetRuns(runs, false).ToList(); foreach (Run r in runList) runCollection.Add(new RunCollectionData(r)); return runCollection; } return new List(); } } } }