Exemplo n.º 1
0
        public IQueryable <IVersionAgnostic> earHighFilter(IQueryable <IVersionAgnostic> csvTableData
                                                           , LessThanAndGreaterThanStrings lessThanAndGreaterThanStrings)
        {
            if (isValidDataForInts(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                return(csvTableData);
            }

            int earHighToBeGreaterThan;
            int earHighToBelessThan;

            if (onlyDataForGreaterThan(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                earHighToBeGreaterThan = Convert.ToInt32(lessThanAndGreaterThanStrings.greaterThan);
                return(csvTableData.Where(x => x.ear_high > earHighToBeGreaterThan));
            }

            if (onlyDataForLessThan(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                earHighToBelessThan = Convert.ToInt32(lessThanAndGreaterThanStrings.lessThan);
                return(csvTableData.Where(x => x.ear_high < earHighToBelessThan));
            }

            earHighToBeGreaterThan = Convert.ToInt32(lessThanAndGreaterThanStrings.greaterThan);
            earHighToBelessThan    = Convert.ToInt32(lessThanAndGreaterThanStrings.lessThan);
            return(csvTableData.Where(x => x.ear_high < earHighToBelessThan && x.ear_high > earHighToBeGreaterThan));
        }
Exemplo n.º 2
0
        public IQueryable <IVersionAgnostic> tailLowFilter(IQueryable <IVersionAgnostic> csvTableData, LessThanAndGreaterThanStrings lessThanAndGreaterThanStrings)
        {
            if (isValidDataForInts(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                return(csvTableData);
            }

            int TailLowToBeGreaterThan;
            int tailLowToBelessThan;

            if (onlyDataForGreaterThan(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                TailLowToBeGreaterThan = Convert.ToInt32(lessThanAndGreaterThanStrings.greaterThan);
                return(csvTableData.Where(x => x.tail_low > TailLowToBeGreaterThan));
            }

            if (onlyDataForLessThan(lessThanAndGreaterThanStrings.lessThan, lessThanAndGreaterThanStrings.greaterThan))
            {
                tailLowToBelessThan = Convert.ToInt32(lessThanAndGreaterThanStrings.lessThan);
                return(csvTableData.Where(x => x.tail_low < tailLowToBelessThan));
            }

            TailLowToBeGreaterThan = Convert.ToInt32(lessThanAndGreaterThanStrings.greaterThan);
            tailLowToBelessThan    = Convert.ToInt32(lessThanAndGreaterThanStrings.lessThan);
            return(csvTableData.Where(x => x.tail_low < tailLowToBelessThan && x.tail_low > TailLowToBeGreaterThan));
        }