// sql queries filters
        public static List <String> filterProvincia(Dictionary <string, object> dic)
        {
            List <string> result     = new List <string>();
            List <string> parameters = (List <string>)dic["parameters"];
            //Console.WriteLine("\n**** Parametros ****\n");
            //Utilities.printCollection(parameters);
            List <int> columns_position_infile = new List <int>();
            string     file = "temp_Provincia.txt";

            if (!File.Exists(file))
            {
                Utilities.Client("Provincia");
            }
            result = Utilities.readFileByList(Utilities.provincia_dir);
            if (parameters[0] == "*")
            {
                return(result);
            }
            else
            {
                if (parameters.Contains("idprovincia"))
                {
                    columns_position_infile.Add(0);
                }
                if (parameters.Contains("nombre"))
                {
                    columns_position_infile.Add(1);
                }
                if (parameters.Contains("location"))
                {
                    columns_position_infile.Add(2);
                }
                if (parameters.Contains("area"))
                {
                    columns_position_infile.Add(3);
                }
                if (parameters.Contains("punto_cardinal"))
                {
                    columns_position_infile.Add(4);
                }
                //Console.WriteLine("\n**** Elementos ****\n\n");
                //Utilities.printCollection(columns_position_infile);
                //Console.WriteLine("\n**** Find elementos ****\n\n");

                if (!File.Exists(file))
                {
                    Utilities.Client("Provincia");
                }
                result = Utilities.readFileByListSpecified(Utilities.provincia_dir, columns_position_infile);
            }
            return(result);
        }
        public static List <String> filterBarrioDM(Dictionary <string, object> dic)
        {
            string        columns    = "";
            List <string> result     = new List <string>();
            List <string> parameters = (List <string>)dic["parameters"];
            //Console.WriteLine("\n**** Parametros ****\n");
            //Utilities.printCollection(parameters);
            List <int> columns_position_infile = new List <int>();

            result = Utilities.readFileByList(Utilities.barrio_dm_dir);
            if (parameters[0] == "*")
            {
                return(result);
            }
            else
            {
                if (parameters.Contains("idbarrio_dm"))
                {
                    columns_position_infile.Add(0);
                }
                if (parameters.Contains("iddistrito"))
                {
                    columns_position_infile.Add(1);
                }
                if (parameters.Contains("nombre"))
                {
                    columns_position_infile.Add(2);
                }
                if (parameters.Contains("location"))
                {
                    columns_position_infile.Add(3);
                }
                if (parameters.Contains("area"))
                {
                    columns_position_infile.Add(4);
                }
                if (parameters.Contains("punto_cardinal"))
                {
                    columns_position_infile.Add(5);
                }
                //Console.WriteLine("\n**** Elementos ****\n\n");
                //Utilities.printCollection(columns_position_infile);
                //Console.WriteLine("\n**** Find elementos ****\n\n");
                result = Utilities.readFileByListSpecified(Utilities.barrio_dm_dir, columns_position_infile);
            }
            return(result);
        }
 public static List<String> filterPersona(Dictionary<string, object> dic)
 {
     string columns = "";
     List<string> result = new List<string>();
     List<string> parameters = (List<string>)dic["parameters"];
     //Console.WriteLine("\n**** Parametros ****\n");
     //Utilities.printCollection(parameters);
     List<int> columns_position_infile = new List<int>();
     result = Utilities.readFileByList(Utilities.persona_dir);
     if (parameters[0] == "*")
     {
         return result;
     }
     else
     {
         if (parameters.Contains("idpersona"))
         {
             columns_position_infile.Add(0);
         }
         if (parameters.Contains("nombre"))
         {
             columns_position_infile.Add(1);
         }
         if (parameters.Contains("apellido"))
         {
             columns_position_infile.Add(2);
         }
         if (parameters.Contains("sexo"))
         {
             columns_position_infile.Add(3);
         }
         if (parameters.Contains("fecha_nacimiento"))
         {
             columns_position_infile.Add(4);
         }
         if (parameters.Contains("estado_civil"))
         {
             columns_position_infile.Add(5);
         }
         if (parameters.Contains("ocupacion"))
         {
             columns_position_infile.Add(6);
         }
         if (parameters.Contains("idbarrio"))
         {
             columns_position_infile.Add(7);
         }
         if (parameters.Contains("idurbanizacion"))
         {
             columns_position_infile.Add(8);
         }
         if (parameters.Contains("idseccion_dm"))
         {
             columns_position_infile.Add(9);
         }
         if (parameters.Contains("idbarrio_dm"))
         {
             columns_position_infile.Add(10);
         }
         if (parameters.Contains("idurbanizacion_dm"))
         {
             columns_position_infile.Add(11);
         }
         if (parameters.Contains("idistrito_municipal"))
         {
             columns_position_infile.Add(12);
         }
         if (parameters.Contains("isvivo"))
         {
             columns_position_infile.Add(13);
         }
         //Console.WriteLine("\n**** Elementos ****\n\n");
         //Utilities.printCollection(columns_position_infile);
         //Console.WriteLine("\n**** Find elementos ****\n\n");
         result = Utilities.readFileByListSpecified(Utilities.persona_dir, columns_position_infile);
     }
     return result;
 }