Example #1
0
        /// <summary>
        /// 生成检查数据库(Base库和Query库)
        /// </summary>
        /// <param name="strTaskPath">任务所在路径</param>
        /// <param name="strTaskName"></param>
        /// <param name="baseUseSource"></param>
        /// <param name="queryUseBase"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public static bool CreateCheckDB(string strTaskPath, string strTaskName, bool baseUseSource, bool queryUseBase, ref string errMsg)
        {
            string strPath = strTaskPath + "\\" + strTaskName;

            // Base 库
            if (!baseUseSource)
            {
                if (!AEAccessFactory.CreateFGDB(strPath, COMMONCONST.DB_Name_Base))
                {
                    errMsg = "创建Base库时出错";
                    return(false);
                }
            }

            // Query
            if (!queryUseBase)
            {
                if (!AEAccessFactory.CreatePGDB(strPath, COMMONCONST.DB_Name_Query))
                {
                    errMsg = "创建Query库出错";
                    return(false);
                }
            }

            return(true);
        }
Example #2
0
        private bool PrepareForTable(IDataset dsTarget, out string strBaseName, out string strQueryName)
        {
            strQueryName = strBaseName = "Base.mdb";
            try
            {
                AEAccessFactory.CreateFGDB(TempPath, strBaseName);
                IWorkspace wsBase = AEAccessFactory.OpenWorkspace(enumDataType.FileGDB, string.Format("{0}\\{1}", TempPath, strBaseName));
                GPTool     gpTool = new GPTool();
                DataConverter.ConvertTable(dsTarget.Workspace, wsBase, dsTarget, dsTarget.Name);

                return(true);
            }
            catch
            {
                return(false);
            }
        }