Example #1
0
        /// <summary>
        /// 创建(描述当前用户自定义dbtune配置的)XML文件
        /// </summary>
        private static void CreateXml(IDBHelper dbHelper, string filePath)
        {
            XDocument xml = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement(ROOT_NAME));

            xml.Save(string.Format("{0}\\{1}.xml", Environment.CurrentDirectory, UtilityConst.XML_NAME));

            DbtuneHelper dbtuneHelper = new DbtuneHelper(filePath, dbHelper.DBServiceName.Split('/')[0], dbHelper.DBPort, dbHelper.DBUser, dbHelper.DBPwd);

            List <string> keywordSet = dbtuneHelper.ListConfig();

            List <string> keywordScreenedSet = new List <string>();

            for (int i = 0; i < keywordSet.Count; i++)
            {
                if (!RegexCheck.IsExist(ScreenTemplate.ScreenDbtuneReservedKeyWord, keywordSet[i]))
                {
                    keywordScreenedSet.Add(keywordSet[i]);
                }
            }

            for (int i = 0; i < keywordScreenedSet.Count; i++)
            {
                InsertKeyWord(new DbtuneInfo()
                {
                    KeyWord    = keywordScreenedSet[i],
                    ParamName  = PartitionKeyWordInfo.DBTUNE_PARAM_NAME,
                    ParamValue = dbtuneHelper.ListConfig(keywordScreenedSet[i], PartitionKeyWordInfo.DBTUNE_PARAM_NAME)
                });
            }
        }
Example #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="param"></param>
        /// <param name="filePath">dbtune导出文件的复制路径</param>
        public DbtuneConfigHelper(DbtuneConfigParam param, string filePath)
        {
            this._dbHelper       = param.DBHelper;
            this._featureClass   = param.FeatureClass;
            this._basicField     = param.BasicField;
            this._partitionWay   = param.PartitionWay;
            this._partitionCount = param.PartitionCount;
            this._tablespaceSet  = param.TablespaceSet;
            this._dbtuneKeyWord  = param.DbtuneKeyWord;
            this._sdeCopyPath    = filePath;

            this._dbtuneHelper = new DbtuneHelper(filePath, this._dbHelper.DBServiceName.Split('/')[0], this._dbHelper.DBPort, this._dbHelper.DBUser, this._dbHelper.DBPwd);
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dbHelper"></param>
 /// <param name="filePath">dbtune导出文件的复制路径</param>
 public DbtuneManageHelper(IDBHelper dbHelper, string filePath)
 {
     this._dbtuneHelper = new DbtuneHelper(filePath, dbHelper.DBServiceName.Split('/')[0], dbHelper.DBPort, dbHelper.DBUser, dbHelper.DBPwd);
 }