public PublicResultForm(QueryResult resultSet, MainForm owner)
 {
     InitializeComponent();
     FormsConn fc = new FormsConn(resultSet);
     imainForm = (IMainForm)fc;
     m_mainForm = owner;
 }
 /// <summary>
 /// 显示结果信息
 /// </summary>
 /// <param name="resultsetValue">数据信息</param>
 public void ShowResultSet(QueryResult resultsetValue)
 {
     m_listRecordSet = new List<QueryResult>();
     this.TreeFrame.ImageList = imageList;
     if (resultsetValue != null && resultsetValue.Recordsets != null && resultsetValue.Recordsets != null)
     {
         for (int i = 0; i < resultsetValue.Recordsets.Length; i++)
         {
             this.TreeFrame.Nodes.Add(resultsetValue.Recordsets[i].DatasetName);
             //this.TreeFrame.Nodes[i].ImageIndex = GetLayerTypeImage(ds.Type);
             this.TreeFrame.Nodes[i].SelectedImageIndex = 0;
             m_listRecordSet.Add(resultsetValue);
         }
     }
     this.Show();
 }
 /// <summary>
 /// 显示子信息
 /// </summary>
 /// <param name="strNodeTag">子标示</param>
 /// <param name="index">索引号</param>
 /// <param name="parantIndex">父索引号</param>
 /// <param name="layerName">数据集名称</param>
 private void ShowNodeMessage(int index)
 {
     this.TreeFrame.SelectedNode = this.TreeFrame.Nodes[index];
     m_recordSet = new Recordset();
     m_resultSet = new QueryResult();
     m_resultSet = m_listRecordSet[index];
     if (m_resultSet != null && m_resultSet.Recordsets != null)
     {
         if (m_resultSet.Recordsets != null)
         {
             m_recordSet = m_resultSet.Recordsets[index];
             DataFrame.DataSource = m_recordSet.ToDataTable();
             DataFrame.AllowUserToAddRows = false;
             DataFrame.ClearSelection();
         }
     }
 }
 public FormsConn(QueryResult rs)
 {
     resultSet = rs;
 }
 /// <summary>
 /// 查询。
 /// </summary>
 /// <param name="mapName">地图名。</param>
 /// <param name="queryResource">查询参数。</param>
 /// <returns>查询结果。</returns>
 internal QueryResult QueryInternal(string mapName, QueryResource queryResource)
 {
     string uri = string.Format("{0}/maps/{1}/queryResults.json?returnContent={2}&returnCustomResult={3}", this._serviceUrl,
         HttpUtility.UrlEncode(mapName), queryResource.QueryParameters.ReturnContent, queryResource.QueryParameters.ReturnCustomResult);
     string connect = JsonConvert.SerializeObject(queryResource);
     string requestResultJson = SynchHttpRequest.GetRequestString(uri, connect);
     QueryResult queryResult = null;
     if (queryResource.QueryParameters.ReturnContent)
     {
         queryResult = JsonConvert.DeserializeObject<QueryResult>(requestResultJson);
     }
     else
     {
         queryResult = new QueryResult();
         queryResult.ResourceInfo = JsonConvert.DeserializeObject<ResourceInfo>(requestResultJson);
     }
     return queryResult;
 }
 public PublicResultForm(QueryResult resultSet, MainForm owner)
 {
     InitializeComponent();
 }
示例#7
0
 /// <summary>
 /// 构造函数。
 /// </summary>
 /// <param name="queryResult">查询结果对象。</param>
 public QueryEventArgs(QueryResult queryResult)
 {
     _queryResult = queryResult;
 }
 private void ShowResultSet(QueryResult resultsetValue)
 {
     _recordsets.Clear();
     this.TreeFrame.Nodes.Clear();
     if (resultsetValue != null && resultsetValue.Recordsets != null && resultsetValue.Recordsets.Length > 0)
     {
         for (int i = 0; i < resultsetValue.Recordsets.Length; i++)
         {
             if (resultsetValue.Recordsets[i].Features.Length > 0)
             {
                 this.TreeFrame.Nodes.Add(resultsetValue.Recordsets[i].DatasetName);
                 _recordsets.Add(resultsetValue.Recordsets[i].DatasetName, resultsetValue.Recordsets[i]);
             }
         }
     }
 }
        public static void NormalResult(GraphicsLayer graLayer, QueryResult result)
        {
            if (result != null && result.Recordsets != null && result.Recordsets.Length > 0)
            {
                foreach (var v in result.Recordsets)
                {
                    if (v != null && v.Features != null && v.Features.Length > 0)
                    {
                        UGCLayer layer = QuerySetting.Layers.Cast<UGCLayer>().FirstOrDefault(c => c.Name == v.DatasetName);
                        if (layer == null)
                        {
                            continue;
                        }

                        foreach (var w in v.Features)
                        {
                            if (w == null || w.Geometry == null)
                            {
                                continue;
                            }
                            if (w.Geometry.Type == GeometryType.POINT || w.Geometry.Type == GeometryType.TEXT)
                            {
                                HelpGeometry.CreateMarker(graLayer, w, layer, v, MarkerType.Red_Pushpin);
                            }
                            else if (w.Geometry.Type == GeometryType.LINE)
                            {
                                HelpGeometry.CreateLine(graLayer, w, layer, v, Draw.Color.Blue);
                            }
                            else if (w.Geometry.Type == GeometryType.REGION || w.Geometry.Type == GeometryType.RECTANGLE)
                            {
                                HelpGeometry.CreatePolygon(graLayer, w, layer, v, Draw.Color.FromArgb(100, 0, 122, 122), Draw.Color.FromArgb(255, 0, 122, 122));

                            }
                        }
                    }
                }
            }
        }