Esempio n. 1
0
        /// <summary>
        /// 添加数据,更改G3E_ID
        /// </summary>
        /// <param name="kv"> </param>
        /// <param name="newG3e_id"> </param>
        /// <param name="newG3e_fid"> </param>
        /// <param name="oldG3e_fid"> </param>
        /// <param name="g3e_fno"> </param>
        private static void InsertPointDBEntity(KeyValuePair <ObjectId, DBEntity> kv, long newG3e_id, long newG3e_fid, long oldG3e_fid, long g3e_fno)
        {
            ElectronSymbol newObject_pt = null;
            var            entry        = SimpleDBSymbolsConfig.Instance.DBSymbol.SingleOrDefault(o => o.G3E_FNO == g3e_fno);

            if (entry == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(entry.SymbolPtTable.Trim()))
            {
                newObject_pt = kv.Value.Clone() as ElectronSymbol;
                if (newObject_pt != null)
                {
                    newObject_pt.G3E_ID      = newG3e_id;
                    newObject_pt.G3E_FID     = newG3e_fid;
                    newObject_pt.EntityState = EntityState.Insert;
                    newObject_pt.SetValue("LTT_ID", (decimal)MapConfig.Instance.LTTID);
                    newObject_pt = ConvertGeometry.Instance.UpdateG3E_GEOMETRY(newObject_pt, kv.Key);
                    newObject_pt.ClearSiblings();
                }
            }
            //自身
            if (!string.IsNullOrEmpty(entry.ComponentTable.SelfAttribute))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.SelfAttribute.Trim(), oldG3e_fid, newObject_pt);
            }
            //公共
            if (!string.IsNullOrEmpty(entry.ComponentTable.Common))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.Common.Trim(), oldG3e_fid, newObject_pt);
            }
            //连接
            if (!string.IsNullOrEmpty(entry.ComponentTable.Connectivity))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.Connectivity.Trim(), oldG3e_fid, newObject_pt);
            }
            //功能位置
            if (!string.IsNullOrEmpty(entry.ComponentTable.Gnwz))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.Gnwz.Trim(), oldG3e_fid, newObject_pt);
            }
            //包含
            if (!string.IsNullOrEmpty(entry.ComponentTable.Contain))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.Contain.Trim(), oldG3e_fid, newObject_pt);
            }
            //详表
            if (!string.IsNullOrEmpty(entry.ComponentTable.Detailreference))
            {
                newObject_pt = InsertElectronBase(entry.ComponentTable.Detailreference.Trim(), oldG3e_fid, newObject_pt);
            }
            //其他数据(台架、开关柜)
            newObject_pt = GetOtherDBEntity(oldG3e_fid, newObject_pt);
            DBManager.Instance.Insert(newObject_pt);
            PublicMethod.Instance.UpdateDBSymbolFinder(kv.Key, newObject_pt);
        }
Esempio n. 2
0
        /// <summary>
        /// 添加坐标表数据
        /// </summary>
        /// <param name="newG3e_id"></param>
        /// <param name="newG3e_fid"></param>
        /// <param name="objectId"></param>
        /// <param name="cso"></param>
        /// <returns></returns>
        private ElectronSymbol InsertElectronSymbol(long newG3e_id, long newG3e_fid, ObjectId objectId,
                                                    CopySymbolObject cso)
        {
            ElectronSymbol newObject_pt = null;

            if (cso.pointDBEntity != null)
            {
                newObject_pt = cso.pointDBEntity.Clone() as ElectronSymbol;
                newObject_pt.ClearSiblings();
                newObject_pt.G3E_ID       = newG3e_id;
                newObject_pt.G3E_FID      = newG3e_fid;
                newObject_pt.EntityState  = EntityState.Insert;
                newObject_pt.EntityState2 = EntityState2.Copy;
                newObject_pt.SetValue("LTT_ID", (decimal)MapConfig.Instance.LTTID);
                newObject_pt = ConvertGeometry.Instance.UpdateG3E_GEOMETRY(newObject_pt, objectId);
            }
            return(newObject_pt);
        }