Exemplo n.º 1
0
    private static void BuildQuery(layerObj layer, string qstring)
    {
        if (layer != null && layer.map != null)
        {
            /*layer.open();
             * string qs = "";
             * string att = "";
             * for (int i=0; i < layer.numitems; i++)
             * {
             *  if (qs == "")
             *  {
             *      qs = "(";
             *      att = layer.getItem(i);
             *  }
             *  else
             *  {
             *      qs += " OR ";
             *  }
             *  qs += "'[" + layer.getItem(i) + "]'='" + qstring + "'";
             * }
             * qs += ")";
             * layer.close();*/
            string qs  = qstring;
            string att = null;

            Console.WriteLine("Query string: " + qs);

            try
            {
                layer.queryByAttributes(layer.map, att, qs, 1);
            }
            catch (Exception e)
            {
                Console.WriteLine("BuildQuery: " + e.Message);
            }
        }
    }
Exemplo n.º 2
0
    private static void BuildQuery(layerObj layer, string qstring)
    {
        if (layer != null && layer.map != null)
        {
            /*layer.open();
            string qs = "";
            string att = "";
            for (int i=0; i < layer.numitems; i++)
            {
                if (qs == "")
                {
                    qs = "(";
                    att = layer.getItem(i);
                }
                else
                {
                    qs += " OR ";
                }
                qs += "'[" + layer.getItem(i) + "]'='" + qstring + "'";
            }
            qs += ")";
            layer.close();*/
            string qs = qstring;
            string att = null;

            Console.WriteLine("Query string: " + qs);
            
            try
            {
                layer.queryByAttributes(layer.map, att, qs, 1);
            }
            catch (Exception e)
            {
                Console.WriteLine("BuildQuery: " + e.Message);
            }
        }
    }