public DlgEqptMaintain(LayerInfo layerInfo,int smId,EqptMaintain eqptMaintain) { InitializeComponent(); _eqptMaintain = eqptMaintain; _layerInfo = layerInfo; _smId = smId; InitForm(); }
private static DataTable CreateDataTableByLayerInfo(LayerInfo layerInfo) { var dt= new DataTable(); foreach (var fieldInfo in layerInfo.FieldInfos) { dt.Columns.Add(new DataColumn() {Caption = fieldInfo.FieldCaption, ColumnName = fieldInfo.FieldName}); } return dt; }
public DlgEqptInfo(int smId, LayerInfo layerInfo,ref DataRow row) { _eqptValues = row; _layerInfo = layerInfo; _smId = smId; InitializeComponent(); InitEqptInfo(); InitImageGrid(); InitMaintainGrid(); InitAttachmentGrid(); Text = layerInfo.LayerCaption + "属性信息"; if (_layerInfo.LayerName.Contains("遥控站")) { xtraTabControl1.TabPages.Remove(tabPage_Maintain); } }
public static DataTable RecordsetToDataTable(Recordset rs,LayerInfo layerInfo) { var dt = CreateDataTableByLayerInfo(layerInfo); if (rs.IsEmpty) return dt; while (!rs.IsEOF) { var row = dt.NewRow(); foreach (var fieldInfo in layerInfo.FieldInfos) { var value = rs.GetFieldValue(fieldInfo.FieldName); row[fieldInfo.FieldName] = value; } dt.Rows.Add(row); rs.MoveNext(); } return dt; }
public void CreateQueryResultGrid(DataTable dt,LayerInfo layerInfo) { var gc = new GridControl(); var gv = new GridView(); gc.Dock = DockStyle.Fill; gc.MainView = gv; gv.OptionsView.ShowGroupPanel = false; gv.OptionsBehavior.Editable = false; gc.ViewCollection.Add(gv); gv.GridControl = gc; gc.DataSource = dt; gv.RowClick += new RowClickEventHandler(gv_RowClick); gv.DoubleClick += new EventHandler(gv_DoubleClick); gv.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(gv_CustomDrawRowIndicator); gv.IndicatorWidth = 50; gv.Tag = layerInfo; var tab = new XtraTabPage() { Text = layerInfo.LayerCaption }; tab.Controls.Add(gc); xtraTabCtl_QueryResult.TabPages.Add(tab); }
private List<LayerInfo> ParaseLayerInfo(string layerInfoXml) { var layerInfos = new List<LayerInfo>(); var xDoc = XDocument.Parse(layerInfoXml); var layerEls = xDoc.Root.Elements("layer"); foreach (var layerEl in layerEls) { var layerInfo = new LayerInfo { LayerCaption = layerEl.Attribute("caption").Value, LayerName = layerEl.Attribute("name").Value, Queryable = Convert.ToBoolean(layerEl.Attribute("queryable").Value) }; var fieldEls = layerEl.Descendants("field"); layerInfo.FieldInfos=new List<FieldInfo>(); foreach (var fieldEl in fieldEls) { var fieldInfo = new FieldInfo(); var attribute = fieldEl.Attribute("caption"); if (attribute != null) fieldInfo.FieldCaption = attribute.Value; var xAttribute = fieldEl.Attribute("name"); if (xAttribute != null) fieldInfo.FieldName = xAttribute.Value; layerInfo.FieldInfos.Add(fieldInfo); } layerInfos.Add(layerInfo); } return layerInfos; }
private void treeList_StationLayer_MouseDown(object sender, MouseEventArgs e) { if(e.Button == MouseButtons.Left) { var hInfo = treeList_StationLayer.CalcHitInfo(new Point(e.X, e.Y)); if(hInfo.HitInfoType==HitInfoType.StateImage) { var checkState = GetCheckState(hInfo.Node.Tag); if(checkState == CheckState.Indeterminate||checkState == CheckState.Unchecked) { checkState = CheckState.Checked; } else { checkState = CheckState.Unchecked; } var stationLayerInfos = LayerService.INSTANCE.GetStationLayerInfos(); SetCheckedNode(treeList_StationLayer, mapCtl_Station.Map, _stationLayers,stationLayerInfos, hInfo.Node, checkState); } }else if(e.Button==MouseButtons.Right) { var hInfo = treeList_StationLayer.CalcHitInfo(new Point(e.X, e.Y)); if(hInfo.Node!=null) { if(hInfo.Node["Type"].ToString()=="layer") { _blinkLayerName = hInfo.Node["Name"].ToString(); var selectedLayer = LayerService.INSTANCE.GetStationLayerInfos().First(l => l.LayerName == _blinkLayerName); if (selectedLayer.Queryable) { _blinkLayerInfo = selectedLayer; popupMenu_StationTree.ShowPopup(MousePosition); } } } } }