Пример #1
0
 private void GetKeyWordFilter(FilterList filter)
 {
     if (contPage.DescriptionKeyWords != null)
             filter.AddFilterCriteria(FilterList.KEY_DESCRIPTION, contPage.DescriptionKeyWords);
         else
             filter.RemoveCriteria(FilterList.KEY_DESCRIPTION);
 }
Пример #2
0
 private void HasNotesFilter(FilterList filter)
 {
     if (childrenPage.HasNotes)
             filter.AddFilterCriteria(FilterList.KEY_NOTES, childrenPage.HasNotes);
         else
             filter.RemoveCriteria(FilterList.KEY_NOTES);
 }
Пример #3
0
 /// <summary>
 /// Merges QuickFilter 
 /// </summary>
 /// <param name="tbl">
 /// A <see cref="System.Collections.Hashtable"/>
 /// </param>
 /// <param name="condition">
 /// A <see cref="FilterList"/>
 /// </param>
 private static void MergeFilterConditions(System.Collections.Hashtable tbl, FilterList condition)
 {
     foreach(object key in tbl.Keys)
     {
         condition.AddFilterCriteria(key as string, tbl[key]);
     }
 }
Пример #4
0
 private void GetStateFilter(FilterList filter)
 {
     string state = placementPage.Province;
         if (!String.IsNullOrEmpty(state))
             filter.AddFilterCriteria(FilterList.KEY_STATE, placementPage.Province);
 }
Пример #5
0
 private void GetTerrainFilter(FilterList filter)
 {
     if (!String.IsNullOrEmpty (difficultyPage.TerrValue)) {
         filter.AddFilterCriteria (FilterList.KEY_TERRAIN_VAL, difficultyPage.TerrValue);
         filter.AddFilterCriteria (FilterList.KEY_TERRAIN_OP, difficultyPage.TerrOperator);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_TERRAIN_OP);
         filter.RemoveCriteria(FilterList.KEY_TERRAIN_VAL);
     }
 }
Пример #6
0
 private void GetNoChildrenFilter(FilterList filter)
 {
     if (childrenPage.NoChildrenFilter != null)
             filter.AddFilterCriteria(FilterList.KEY_NOCHILDREN, childrenPage.NoChildrenFilter);
         else
             filter.RemoveCriteria(FilterList.KEY_NOCHILDREN);
 }
Пример #7
0
 private void GetPlacedByFilter(FilterList filter)
 {
     String placedby = placementPage.PlacedBy;
         if (null != placedby)
             filter.AddFilterCriteria(FilterList.KEY_PLACEDBY, placedby);
         else
             filter.RemoveCriteria(FilterList.KEY_PLACEDBY);
 }
Пример #8
0
 private void GetDateFilter(FilterList filter)
 {
     if (placementPage.PlaceBefore != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_PLACEBEFORE, placementPage.PlaceBefore);
         else
             filter.RemoveCriteria(FilterList.KEY_PLACEBEFORE);
         if (placementPage.PlaceAfter != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_PLACEAFTER, placementPage.PlaceAfter);
         else
             filter.RemoveCriteria(FilterList.KEY_PLACEAFTER);
         if (updatedPage.InfoBefore != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_INFOBEFORE, updatedPage.InfoBefore);
         else
             filter.RemoveCriteria(FilterList.KEY_INFOBEFORE);
         if (updatedPage.InfoAfter != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_INFOAFTER, updatedPage.InfoAfter);
         else
             filter.RemoveCriteria(FilterList.KEY_INFOAFTER);
 }
Пример #9
0
 private void GetDifficultyFilter(FilterList filter)
 {
     if (!String.IsNullOrEmpty (difficultyPage.DifficultyValue)) {
         filter.AddFilterCriteria (FilterList.KEY_DIFF_VAL, difficultyPage.DifficultyValue);
         filter.AddFilterCriteria (FilterList.KEY_DIFF_OP, difficultyPage.DifficultyOperator);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_DIFF_OP);
         filter.RemoveCriteria(FilterList.KEY_DIFF_VAL);
     }
 }
Пример #10
0
 private void GetCountryFilter(FilterList filter)
 {
     string cntry = placementPage.Country;
         if (!String.IsNullOrEmpty(cntry))
             filter.AddFilterCriteria(FilterList.KEY_COUNTRY, placementPage.Country);
 }
Пример #11
0
 private void GetCTypeFilter(FilterList filter)
 {
     if (null != difficultyPage.SelectedCacheTypes)
         filter.AddFilterCriteria (FilterList.KEY_CACHETYPE, difficultyPage.SelectedCacheTypes);
     else
         filter.RemoveCriteria(FilterList.KEY_CACHETYPE);
 }
Пример #12
0
 private void GetCorrectedCoordsFilter(FilterList filter)
 {
     if (childrenPage.HasCorrectedCoords)
             filter.AddFilterCriteria(FilterList.KEY_CORRECTED, true);
         else
             filter.RemoveCriteria(FilterList.KEY_CORRECTED);
 }
Пример #13
0
 private void GetContainerFilter(FilterList filter)
 {
     if (null != contPage.ContainerTypes)
             filter.AddFilterCriteria(FilterList.KEY_CONTAINER, contPage.ContainerTypes);
         else
             filter.RemoveCriteria(FilterList.KEY_CONTAINER);
 }
Пример #14
0
 public QuickFilter(PREDEF_FILTER mode)
 {
     switch (mode)
     {
         case PREDEF_FILTER.DONE:
             m_advancedFilters = null;
             m_available = true;
             m_unavailable = true;
             m_found = true;
             m_notFound = false;
             m_archived = true;
             m_mine = false;
             m_distFilter = -1;
             m_ComboFilter = null;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("Done");
             break;
         case PREDEF_FILTER.TODO:
             m_advancedFilters = null;
             m_available = true;
             m_unavailable = false;
             m_found = false;
             m_notFound = true;
             m_archived = false;
             m_mine = false;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("To Do");
             break;
         case PREDEF_FILTER.MINE:
             m_advancedFilters = null;
             m_available = false;
             m_unavailable = false;
             m_found = false;
             m_notFound = false;
             m_archived = false;
             m_mine = true;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("Mine");
             break;
         case PREDEF_FILTER.DNF:
             m_advancedFilters = new FilterList();
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_DNF, true);
             m_available = true;
             m_unavailable = false;
             m_found = false;
             m_notFound = true;
             m_archived = false;
             m_mine = false;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("DNF");
             break;
         case PREDEF_FILTER.ALL:
             m_advancedFilters = null;
             m_available = true;
             m_unavailable = true;
             m_found = true;
             m_notFound = true;
             m_archived = true;
             m_mine = true;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("All");
             break;
         case PREDEF_FILTER.STALE:
             m_advancedFilters = new FilterList();
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_INFO_NDAYS, new Config().StaleCacheInterval);
             m_available = true;
             m_unavailable = true;
             m_found = true;
             m_notFound = true;
             m_archived = true;
             m_mine = true;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("Stale");
             break;
         case PREDEF_FILTER.STALEUNSOLVED:
             m_advancedFilters = new FilterList();
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_INFO_NDAYS, new Config().StaleCacheInterval);
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_NOCORRECTED, "true");
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_NOCHILDREN, "Final Location");
             m_available = true;
             m_unavailable = true;
             m_found = true;
             m_notFound = true;
             m_archived = true;
             m_mine = true;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("Stale - Unsolved");
             break;
         case PREDEF_FILTER.NEW:
             m_advancedFilters = new FilterList();
             m_advancedFilters.AddFilterCriteria(FilterList.KEY_PLACEAFTER, DateTime.Today.Subtract(TimeSpan.FromDays(new Config().NewCacheInterval)));
             m_available = true;
             m_unavailable = true;
             m_found = true;
             m_notFound = true;
             m_archived = true;
             m_mine = true;
             m_ComboFilter = null;
             m_distFilter = -1;
             m_nameFilter = String.Empty;
             m_name = Catalog.GetString("Recently Published");
             break;
         default:
             break;
     }
 }
Пример #15
0
 private void GetMarkedFilter(FilterList filter)
 {
     if (contPage.hasDNF)
     {
         filter.AddFilterCriteria(FilterList.KEY_DNF, true);
         filter.RemoveCriteria(FilterList.KEY_FTF);
     }
     else if (contPage.hasNoDNF)
     {
         filter.AddFilterCriteria(FilterList.KEY_DNF, false);
         filter.RemoveCriteria(FilterList.KEY_FTF);
     }
     else if (contPage.hasFTF)
     {
         filter.AddFilterCriteria(FilterList.KEY_FTF, true);
         filter.RemoveCriteria(FilterList.KEY_DNF);
     }
     else if (contPage.hasNoFTF)
     {
         filter.AddFilterCriteria(FilterList.KEY_FTF, false);
         filter.RemoveCriteria(FilterList.KEY_DNF);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_DNF);
         filter.RemoveCriteria(FilterList.KEY_FTF);
     }
 }
Пример #16
0
 private void GetDistanceFilter(FilterList filter)
 {
     if (placementPage.Distance != -1)
         {
             filter.AddFilterCriteria(FilterList.KEY_DIST, placementPage.Distance);
             filter.AddFilterCriteria(FilterList.KEY_DIST_OP, placementPage.DistOp);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_DIST);
             filter.RemoveCriteria(FilterList.KEY_DIST_OP);
         }
 }
Пример #17
0
 private void GetMustNotHaveSetAttributesFilter(FilterList filter)
 {
     if (attributePage.MustNotHaveIncludeAttributes.Count > 0)
             filter.AddFilterCriteria(FilterList.KEY_INCNOATTRS, attributePage.MustNotHaveIncludeAttributes);
         else
             filter.RemoveCriteria(FilterList.KEY_INCNOATTRS);
     if (attributePage.MustNotHaveNegAttributes.Count > 0)
             filter.AddFilterCriteria(FilterList.KEY_EXCNOATTRS, attributePage.MustNotHaveNegAttributes);
         else
             filter.RemoveCriteria(FilterList.KEY_EXCNOATTRS);
 }
Пример #18
0
 private void GetDistanceLoc(FilterList filter)
 {
     if (placementPage.DistLat != -1)
             filter.AddFilterCriteria(FilterList.KEY_DIST_LAT, placementPage.DistLat);
         else
             filter.RemoveCriteria(FilterList.KEY_DIST_LAT);
         if (placementPage.DistLon != -1)
             filter.AddFilterCriteria(FilterList.KEY_DIST_LON, placementPage.DistLon);
         else
             filter.RemoveCriteria(FilterList.KEY_DIST_LON);
 }
Пример #19
0
 private void GetNoCorrectedCoordsFilter(FilterList filter)
 {
     if (childrenPage.DoesNotHaveCorrectedCoords)
             filter.AddFilterCriteria(FilterList.KEY_NOCORRECTED, true);
         else
             filter.RemoveCriteria(FilterList.KEY_NOCORRECTED);
 }
Пример #20
0
 private void GetFoundAfterFilter(FilterList filter)
 {
     if (updatedPage.FoundAfter != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_FOUNDAFTER, updatedPage.FoundAfter);
         else
             filter.RemoveCriteria(FilterList.KEY_FOUNDAFTER);
 }
Пример #21
0
 void GetSourceFilter(FilterList filter)
 {
     if (difficultyPage.CacheSources != null)
         {
             filter.AddFilterCriteria(FilterList.KEY_CACHE_SOURCE, difficultyPage.CacheSources);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_CACHE_SOURCE);
         }
 }
Пример #22
0
 private void GetFoundBeforeFilter(FilterList filter)
 {
     if (updatedPage.FoundBefore != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_FOUNDBEFORE, updatedPage.FoundBefore);
         else
             filter.RemoveCriteria(FilterList.KEY_FOUNDBEFORE);
 }
Пример #23
0
 private void GetStatusFilter(FilterList filter)
 {
     if (contPage.Status != null)
     {
         filter.AddFilterCriteria(FilterList.KEY_STATUS, contPage.Status);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_STATUS);
     }
 }
Пример #24
0
 private void GetFoundOnFilter(FilterList filter)
 {
     if (updatedPage.FoundOn != DateTime.MinValue)
             filter.AddFilterCriteria(FilterList.KEY_FOUNDON, updatedPage.FoundOn);
         else
             filter.RemoveCriteria(FilterList.KEY_FOUNDON);
 }
Пример #25
0
 private void GetUserDataFilters(FilterList filter)
 {
     if (childrenPage.User1 != null)
         {
             filter.AddFilterCriteria(FilterList.KEY_U1, childrenPage.User1);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_U1);
         }
         if (childrenPage.User2 != null)
         {
             filter.AddFilterCriteria(FilterList.KEY_U2, childrenPage.User2);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_U2);
         }
         if (childrenPage.User3 != null)
         {
             filter.AddFilterCriteria(FilterList.KEY_U3, childrenPage.User3);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_U3);
         }
         if (childrenPage.User4 != null)
         {
             filter.AddFilterCriteria(FilterList.KEY_U4, childrenPage.User4);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_U4);
         }
 }
Пример #26
0
 private void GetInfoWithinFilter(FilterList filter)
 {
     if (updatedPage.InfoWithin > 0)
     {
         filter.AddFilterCriteria(FilterList.KEY_INFO_DAYS, updatedPage.InfoWithin);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_INFO_DAYS);
     }
     if (updatedPage.InfoNotWithin > 0)
     {
         filter.AddFilterCriteria(FilterList.KEY_INFO_NDAYS, updatedPage.InfoNotWithin);
     }
     else
     {
         filter.RemoveCriteria(FilterList.KEY_INFO_NDAYS);
     }
 }
Пример #27
0
 private void LastFoundFilter(FilterList filter)
 {
     if (updatedPage.FoundAnyoneBefore != DateTime.MinValue)
         {
             filter.AddFilterCriteria(FilterList.KEY_LFOUND_BEFORE, updatedPage.FoundAnyoneBefore);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_LFOUND_BEFORE);
         }
         if (updatedPage.FoundAnyoneAfter != DateTime.MinValue)
         {
             filter.AddFilterCriteria(FilterList.KEY_LFOUND_AFTER, updatedPage.FoundAnyoneAfter);
         }
         else
         {
             filter.RemoveCriteria(FilterList.KEY_LFOUND_AFTER);
         }
 }
Пример #28
0
 /// <summary>
 /// Adds global critera from an existing quickfilter to the condition
 /// </summary>
 /// <param name="condition">
 /// The condition<see cref="FilterList"/>
 /// </param>
 /// <param name="qf">
 /// The source quick filter <see cref="QuickFilter"/>
 /// </param>
 private static void AddGlobalCriteria(FilterList condition, QuickFilter qf)
 {
     condition.AddFilterCriteria(FilterList.KEY_STATUS,
             new bool[]{qf.Found, qf.NotFound, qf.Mine,
                         qf.Available, qf.Unavailable, qf.Archived});
     if (qf.Distance > 0)
     {
         condition.AddFilterCriteria(FilterList.KEY_DIST, (double) qf.Distance);
         condition.AddFilterCriteria(FilterList.KEY_DIST_OP, "<=");
     }
 }