public void ClearTopoTable() { Log.InfoStart("ClearTopoTable"); Archors.Clear(); DevInfos.Clear(); Maps.Clear(); PhysicalTopologys.Clear(); TransformMs.Clear(); NodeKKSs.Clear(); Points.Clear(); Bounds.Clear(); Log.InfoEnd("ClearTopoTable"); }
private PhysicalTopology AddTopoNode(string name, string kks, PhysicalTopology parent, Types type, TransformM transform = null, string otherName = "") { if (string.IsNullOrEmpty(kks)) { KKSCode kksCode = KKSCodes.DbSet.FirstOrDefault(i => i.Name.Contains(name)); if (kksCode != null) { kks = kksCode.Code; } } if (!string.IsNullOrEmpty(kks)) { PhysicalTopology topoNode = new PhysicalTopology() { Name = name, Parent = parent, Type = type, Transfrom = transform, }; PhysicalTopologys.Add(topoNode); KKSCode kksCode = KKSCodes.DbSet.FirstOrDefault(i => i.Code == kks); NodeKKS kks1 = null; if (kksCode != null) { kks1 = new NodeKKS() { KKS = kks, NodeType = type, NodeId = topoNode.Id, KKSId = kksCode.Id }; NodeKKSs.Add(kks1); } else { kks1 = new NodeKKS() { KKS = kks, NodeType = type, NodeId = topoNode.Id }; NodeKKSs.Add(kks1); } topoNode.Nodekks = kks1; topoNode.NodekksId = kks1.Id; PhysicalTopologys.Edit(topoNode); return(topoNode); } else { PhysicalTopology topoNode = new PhysicalTopology() { Name = name, Parent = parent, Type = type, Transfrom = transform }; PhysicalTopologys.Add(topoNode); return(topoNode); } }