Beispiel #1
0
        /// <summary>
        /// Case 2 : Complex Filter
        /// </summary>
        public static void Case2()
        {
            ICSVReader   reader  = new CSVReader();
            SingleFilter filter1 = new SingleFilter()
            {
                Operator = Operators.GREATERTHAN, PropertyName = "EmployeeID", PropertyValue = 1
            };
            SingleFilter filter2 = new SingleFilter()
            {
                Operator = Operators.CONTAINS, PropertyName = "EmployeeFirstName", PropertyValue = "Su"
            };
            List <IFilter> filterList = new List <IFilter>();

            filterList.Add(filter1);
            filterList.Add(filter2);
            IFilter filter = new ComplexFilter()
            {
                Combiner = Combiners.AND,
                Filter   = filterList
            };

            List <string> reqColumns = new List <string>()
            {
                "EmployeeFirstName", "EmployeeLastName", "EmployeeDOB", "EmployeeID"
            };

            var data = reader.GetNextData(5, 0, filter, reqColumns);

            if (data.Count > 0)
            {
                DisplayRecords(data);
            }
            else
            {
                Console.WriteLine("No Result Found for this filter search");
            }

            data = reader.GetNextData(10, 6, filter, reqColumns);

            if (data.Count > 0)
            {
                DisplayRecords(data);
            }
            else
            {
                Console.WriteLine("No Result Found for this filter search");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Case 1 : Single Filter
        /// </summary>
        public static void Case1()
        {
            ICSVReader reader = new CSVReader();

            IFilter filter = new SingleFilter()
            {
                Operator = Operators.GREATERTHAN, PropertyName = "EmployeeID", PropertyValue = 1
            };

            List <string> reqColumns = new List <string>()
            {
                "EmployeeFirstName", "EmployeeLastName", "EmployeeDOB", "EmployeeID"
            };

            var data = reader.GetNextData(10, 0, filter, reqColumns);

            if (data.Count > 0)
            {
                DisplayRecords(data);
            }
            else
            {
                Console.WriteLine("No Result Found for this filter search");
            }

            data = reader.GetNextData(10, 11, filter, reqColumns);

            if (data.Count > 0)
            {
                DisplayRecords(data);
            }
            else
            {
                Console.WriteLine("No Result Found for this filter search");
            }
        }
Beispiel #3
0
 private bool Check(List <GenericDetail> row, SingleFilter data)
 {
     return(true);
     // return the single check
 }