Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the QueryableProxy class.
 /// </summary>
 /// <param name="wrapperScope">The wrapper scope.</param>
 /// <param name="underlyingImplementation">The underlying implementation of the proxy.</param>
 public QueryableProxy(IWrapperScope wrapperScope, System.Linq.IQueryable underlyingImplementation)
 {
     ExceptionUtilities.CheckArgumentNotNull(wrapperScope, "wrapperScope");
     ExceptionUtilities.CheckArgumentNotNull(underlyingImplementation, "underlyingImplementation");
     
     this.Scope = wrapperScope;
     this.underlyingImplementation = underlyingImplementation;
 }
Esempio n. 2
0
 /// <summary>
 /// Disposes the wrapped instance if it implements IDisposable.
 /// </summary>
 /// <param name="disposing">Whether or not to dispose managed resources</param>
 protected virtual void Dispose(bool disposing)
 {
     CallOrderUtilities.TryWrapArbitraryMethodCall(
         () => this.Dispose(),
         () =>
             {
                 var d = this.underlyingImplementation as IDisposable;
                 if (d != null)
                 {
                     d.Dispose();
                     this.underlyingImplementation = null;
                 }
             });
 }
Esempio n. 3
0
 public static TSource?SingleOrDefault <TSource>(this System.Linq.IQueryable <TSource> source)
 {
     throw null;
 }
Esempio n. 4
0
 public static System.Linq.IQueryable <TResult> Select <TSource, TResult>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TResult> > selector)
 {
     throw null;
 }
Esempio n. 5
0
 public static System.Linq.IQueryable <TSource> Reverse <TSource>(this System.Linq.IQueryable <TSource> source)
 {
     throw null;
 }
Esempio n. 6
0
 public static System.Linq.IOrderedQueryable <TSource> OrderBy <TSource, TKey>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector, System.Collections.Generic.IComparer <TKey>?comparer)
 {
     throw null;
 }
Esempio n. 7
0
 public static System.Linq.IQueryable <TResult> OfType <TResult>(this System.Linq.IQueryable source)
 {
     throw null;
 }
Esempio n. 8
0
 public static TSource?Min <TSource>(this System.Linq.IQueryable <TSource> source)
 {
     throw null;
 }
Esempio n. 9
0
 public static System.Linq.IQueryable <System.Linq.IGrouping <TKey, TSource> > GroupBy <TSource, TKey>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector, System.Collections.Generic.IEqualityComparer <TKey>?comparer)
 {
     throw null;
 }
Esempio n. 10
0
 public static System.Linq.IQueryable <TSource> ExceptBy <TSource, TKey>(this System.Linq.IQueryable <TSource> source1, System.Collections.Generic.IEnumerable <TKey> source2, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector)
 {
     throw null;
 }
Esempio n. 11
0
 public static TSource ElementAt <TSource>(this System.Linq.IQueryable <TSource> source, int index)
 {
     throw null;
 }
Esempio n. 12
0
 public static TSource?ElementAtOrDefault <TSource>(this System.Linq.IQueryable <TSource> source, System.Index index)
 {
     throw null;
 }
Esempio n. 13
0
 public static System.Linq.IQueryable <TSource> Distinct <TSource>(this System.Linq.IQueryable <TSource> source, System.Collections.Generic.IEqualityComparer <TSource>?comparer)
 {
     throw null;
 }
Esempio n. 14
0
 public static System.Linq.IQueryable <TSource> Distinct <TSource>(this System.Linq.IQueryable <TSource> source)
 {
     throw null;
 }
Esempio n. 15
0
 public static System.Linq.IQueryable <TSource> DefaultIfEmpty <TSource>(this System.Linq.IQueryable <TSource> source, TSource defaultValue)
 {
     throw null;
 }
 // Refresh Data from Database
 public void ReloadRecords()
 {
     this.records = from rec in db.SurveyRecords
                    select rec;
 }
Esempio n. 17
0
 public static bool Contains <TSource>(this System.Linq.IQueryable <TSource> source, TSource item, System.Collections.Generic.IEqualityComparer <TSource>?comparer)
 {
     throw null;
 }
Esempio n. 18
0
 public static System.Linq.IQueryable <System.Linq.IGrouping <TKey, TElement> > GroupBy <TSource, TKey, TElement>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector, System.Linq.Expressions.Expression <System.Func <TSource, TElement> > elementSelector)
 {
     throw null;
 }
Esempio n. 19
0
 public static TSource?Min <TSource>(this System.Linq.IQueryable <TSource> source, System.Collections.Generic.IComparer <TSource>?comparer)
 {
     throw null;
 }
Esempio n. 20
0
 public static System.Linq.IQueryable <TResult> GroupBy <TSource, TKey, TElement, TResult>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector, System.Linq.Expressions.Expression <System.Func <TSource, TElement> > elementSelector, System.Linq.Expressions.Expression <System.Func <TKey, System.Collections.Generic.IEnumerable <TElement>, TResult> > resultSelector, System.Collections.Generic.IEqualityComparer <TKey>?comparer)
 {
     throw null;
 }
Esempio n. 21
0
 public static System.Linq.IOrderedQueryable <TSource> OrderBy <TSource, TKey>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector)
 {
     throw null;
 }
Esempio n. 22
0
 public static System.Linq.IQueryable <TSource> IntersectBy <TSource, TKey>(this System.Linq.IQueryable <TSource> source1, System.Collections.Generic.IEnumerable <TKey> source2, System.Linq.Expressions.Expression <System.Func <TSource, TKey> > keySelector, System.Collections.Generic.IEqualityComparer <TKey>?comparer)
 {
     throw null;
 }
Esempio n. 23
0
 public static System.Linq.IQueryable <TSource> Prepend <TSource>(this System.Linq.IQueryable <TSource> source, TSource element)
 {
     throw null;
 }
Esempio n. 24
0
 public static System.Linq.IQueryable <TSource> Intersect <TSource>(this System.Linq.IQueryable <TSource> source1, System.Collections.Generic.IEnumerable <TSource> source2)
 {
     throw null;
 }
Esempio n. 25
0
 public static System.Linq.IQueryable <TResult> SelectMany <TSource, TCollection, TResult>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, int, System.Collections.Generic.IEnumerable <TCollection> > > collectionSelector, System.Linq.Expressions.Expression <System.Func <TSource, TCollection, TResult> > resultSelector)
 {
     throw null;
 }
Esempio n. 26
0
 public static System.Linq.IQueryable <TResult> Join <TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable <TOuter> outer, System.Collections.Generic.IEnumerable <TInner> inner, System.Linq.Expressions.Expression <System.Func <TOuter, TKey> > outerKeySelector, System.Linq.Expressions.Expression <System.Func <TInner, TKey> > innerKeySelector, System.Linq.Expressions.Expression <System.Func <TOuter, TInner, TResult> > resultSelector, System.Collections.Generic.IEqualityComparer <TKey>?comparer)
 {
     throw null;
 }
Esempio n. 27
0
 public static bool SequenceEqual <TSource>(this System.Linq.IQueryable <TSource> source1, System.Collections.Generic.IEnumerable <TSource> source2, System.Collections.Generic.IEqualityComparer <TSource>?comparer)
 {
     throw null;
 }
Esempio n. 28
0
 public static TSource?LastOrDefault <TSource>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, bool> > predicate)
 {
     throw null;
 }
Esempio n. 29
0
 public static TSource SingleOrDefault <TSource>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, bool> > predicate, TSource defaultValue)
 {
     throw null;
 }
Esempio n. 30
0
 public static TSource LastOrDefault <TSource>(this System.Linq.IQueryable <TSource> source, TSource defaultValue)
 {
     throw null;
 }
Esempio n. 31
0
 public static long LongCount <TSource>(this System.Linq.IQueryable <TSource> source)
 {
     throw null;
 }
Esempio n. 32
0
 public static long LongCount <TSource>(this System.Linq.IQueryable <TSource> source, System.Linq.Expressions.Expression <System.Func <TSource, bool> > predicate)
 {
     throw null;
 }
        public ActionResult Filter(string sortOrder)
        {
            // Preset Ascendings/Decendings on first open
            if (String.IsNullOrEmpty(sortOrder))
            {
                ViewBag.AgeSortParm = "childAge_asc";
                ViewBag.CountrySortParam = "country_asc";
                ViewBag.StateSortParam = "state_asc";
                ViewBag.CitySortParam = "city_asc";
                ViewBag.ResponseSortParam = "response_asc";
            }

            // Otherwise Update existing sort orders
            ViewBag.AgeSortParm = sortOrder == "childAge_asc" ? "childAge_desc" : ViewBag.AgeSortParm;
            ViewBag.AgeSortParm = sortOrder == "childAge_desc" ? "childAge_asc" : ViewBag.AgeSortParm;
            ViewBag.CountrySortParam = sortOrder == "country_asc" ? "country_desc" : ViewBag.CountrySortParam;
            ViewBag.CountrySortParam = sortOrder == "country_desc" ? "country_asc" : ViewBag.CountrySortParam;
            ViewBag.StateSortParam = sortOrder == "state_asc" ? "state_desc" : ViewBag.StateSortParam;
            ViewBag.StateSortParam = sortOrder == "state_desc" ? "state_asc" : ViewBag.StateSortParam;
            ViewBag.CitySortParam = sortOrder == "city_asc" ? "city_desc" : ViewBag.CitySortParam;
            ViewBag.CitySortParam = sortOrder == "city_desc" ? "city_asc" : ViewBag.CitySortParam;
            ViewBag.ResponseSortParam = sortOrder == "response_asc" ? "response_desc" : ViewBag.ResponseSortParam;
            ViewBag.ResponseSortParam = sortOrder == "response_desc" ? "response_asc" : ViewBag.ResponseSortParam;

            //var records = from rec in db.SurveyRecords
            //                select rec;

            switch (sortOrder)
            {
                case "childAge_desc":
                    records = records.OrderBy(rec => rec.childAge);
                    break;
                case "childAge_asc":
                    records = records.OrderByDescending(rec => rec.childAge);
                    break;
                case "country_desc":
                    records = records.OrderBy(rec => rec.Country);
                    break;
                case "country_asc":
                    records = records.OrderByDescending(rec => rec.Country);
                    break;
                case "state_desc":
                    records = records.OrderBy(rec => rec.State);
                    break;
                case "state_asc":
                    records = records.OrderByDescending(rec => rec.State);
                    break;
                case "city_desc":
                    records = records.OrderBy(rec => rec.City);
                    break;
                case "city_asc":
                    records = records.OrderByDescending(rec => rec.City);
                    break;
                case "response_desc":
                    records = records.OrderBy(rec => rec.SurveyResponses);
                    break;
                case "response_asc":
                    records = records.OrderByDescending(rec => rec.SurveyResponses);
                    break;

                default:
                    records = records.OrderBy(rec => rec.childAge);
                    break;

            }

            // Populate List Select Boxes

            // Note: I KNOW there HAS to be a better way of doing this...
            // This is a ridiculous O(n^2) process, but I can't figure out a better way.
            // It seems like there should be an easy way to build a list box without having to iterate the entire loop each time.

            List<int> ListBoxChildAge = new List<int>();
            List<string> ListBoxCountry = new List<string>();
            List<string> ListBoxState = new List<string>();
            List<string> ListBoxCity = new List<string>();
            List<string> ListBoxResults = new List<string>();

            //foreach (System.Linq.IQueryable<SalesForce_MVCNet.Models.SurveyRecord> SurveyRecord in records)
            foreach (SurveyRecord surveyRecord in records)
            {
                if (!ListBoxChildAge.Contains(surveyRecord.childAge))
                {
                    ListBoxChildAge.Add(surveyRecord.childAge);
                }
                if (!ListBoxCountry.Contains(surveyRecord.Country))
                {
                    ListBoxCountry.Add(surveyRecord.Country);
                }
                if (!ListBoxState.Contains(surveyRecord.State))
                {
                    ListBoxState.Add(surveyRecord.State);
                }
                if (!ListBoxCity.Contains(surveyRecord.City))
                {
                    ListBoxCity.Add(surveyRecord.City);
                }
                if (!ListBoxResults.Contains(surveyRecord.SurveyResponses))
                {
                    ListBoxResults.Add(surveyRecord.SurveyResponses);
                }
            }

            // Sort filter boxes alphabetically
            ListBoxChildAge.Sort();
            ListBoxCountry.Sort();
            ListBoxState.Sort();
            ListBoxCity.Sort();
            ListBoxResults.Sort();

            SelectList SelListChildAge = new SelectList(ListBoxChildAge);
            SelectList SelListBoxCountry = new SelectList(ListBoxCountry);
            SelectList SelListState = new SelectList(ListBoxState);
            SelectList SelListCity = new SelectList(ListBoxCity);
            SelectList SelListResults = new SelectList(ListBoxResults);
            ViewBag.ListBoxChildAge = SelListChildAge;
            ViewBag.ListBoxCountry = SelListBoxCountry;
            ViewBag.ListBoxState = SelListState;
            ViewBag.ListBoxCity = SelListCity;
            ViewBag.ListBoxResults = SelListResults;

            return View(records);
        }
Esempio n. 34
0
 public static bool Contains <TSource>(this System.Linq.IQueryable <TSource> source, TSource item)
 {
     throw null;
 }