public void Load(IPreferenceSet prefs, IQueryParametersCollection queryCollection) { _productionView = prefs.Get<HistoryProductionView>(Preference.HistoryProductionType); _showFirstChecked = prefs.Get<bool>(Preference.ShowFirstChecked); _showLastChecked = prefs.Get<bool>(Preference.ShowLastChecked); _showEntriesValue = prefs.Get<int>(Preference.ShowEntriesValue); FormLocation = prefs.Get<Point>(Preference.HistoryFormLocation); FormSize = prefs.Get<Size>(Preference.HistoryFormSize); SortColumnName = prefs.Get<string>(Preference.HistorySortColumnName); SortOrder = prefs.Get<ListSortDirection>(Preference.HistorySortOrder); FormColumns = prefs.Get<StringCollection>(Preference.HistoryFormColumns); _queryList.Clear(); _queryList.Add(new QueryParameters()); foreach (var query in queryCollection) { // don't load Select All twice if (query.Name != QueryParameters.SelectAll.Name) { _queryList.Add(query); } } _queryList.Sort(); ResetBindings(true); }
private IList<HistoryEntry> FetchInternal(QueryParameters parameters, HistoryProductionView productionView) { Debug.Assert(TableExists(SqlTable.WuHistory)); PetaPoco.Sql where = WhereBuilder.Execute(parameters); List<HistoryEntry> query = where != null ? Database.Fetch<HistoryEntry>(where) : Database.Fetch<HistoryEntry>(String.Empty); Debug.Assert(query != null); query.ForEach(x => x.ProductionView = productionView); return query; //if (_proteinDictionary == null) return query; // //var joinQuery = from entry in query // join protein in _proteinDictionary.Values on entry.ProjectID equals protein.ProjectNumber into groupJoin // from entryProtein in groupJoin.DefaultIfEmpty() // select entry.SetProtein(entryProtein); //return FilterProteinParameters(parameters, query); }
private void FetchInternal(int count, QueryParameters parameters, HistoryProductionView productionView) { var entries = _database.Fetch(parameters, productionView); #if DEBUG foreach (var entry in entries) { Debug.WriteLine(entry.ID); } #endif Assert.AreEqual(count, entries.Count); }
public IList<HistoryEntry> Fetch(QueryParameters parameters, HistoryProductionView productionView) { DateTime start = Instrumentation.ExecStart; try { return FetchInternal(parameters, productionView); } finally { _logger.Debug("Database Fetch ({0}) completed in {1}", parameters, Instrumentation.GetExecTime(start)); } }