Пример #1
0
        public override bool Verify()
        {
            //根据别名取featureclass的名字
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            strSrcLayer = LayerReader.GetNameByAliasName(m_pPara.strTargetLayer, standardID);
            strRelLayer = LayerReader.GetNameByAliasName(m_pPara.strRelLayer, standardID);

            if (this.m_BaseWorkspace != null)
            {
                if (!(this.m_BaseWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTFeatureClass, strSrcLayer))
                {
                    string strLog = "当前工作数据库的关系图层" + strSrcLayer + "不存在,无法执行检查!";
                    SendMessage(enumMessageType.RuleError, strLog);
                    return(false);
                }

                if (!(this.m_BaseWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTFeatureClass, strSrcLayer))
                {
                    string strLog = "当前工作数据库的目标图层" + strRelLayer + "不存在,无法执行检查!";
                    SendMessage(enumMessageType.RuleError, strLog);
                    return(false);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        ///通过图层别名获取图层名称
        /// </summary>
        /// <param name="strAliasName">Name of the STR alias.</param>
        /// <returns></returns>
        protected string GetLayerName(string strAliasName)
        {
            if (string.IsNullOrEmpty(strAliasName))
            {
                return(null);
            }
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            return(LayerReader.GetNameByAliasName(strAliasName, standardID));
        }
Пример #3
0
        private string ConstructErrorInfo()
        {
            int            layerid = -1;
            StandardHelper pStand  = new StandardHelper(SysDbHelper.GetSysDbConnection());

            pStand.GetLayerIDByTableName(ref layerid, this.m_SchemaID, m_structPara.strFtName);

            string strSql1 = "Select FieldCode,FieldName From LR_DicField Where LayerID = " + layerid;

            List <FIELDMAP> arrFieldMap = new List <FIELDMAP>();
            DataTable       dt          = new DataTable();

            AdoDbHelper.GetDataTable(SysDbHelper.GetSysDbConnection(), strSql1);
            if (dt.Rows.Count == 0)
            {
                return(null);
            }
            foreach (DataRow dr in dt.Rows)
            {
                string FName  = dr["FieldCode"].ToString(); //字段名
                string FAlias = dr["FieldName"].ToString(); //字段别名

                FIELDMAP fMap = new FIELDMAP();
                fMap.strAlias = FAlias;
                fMap.strName  = FName;
                arrFieldMap.Add(fMap);
            }

            /*string Alias = "", Alias2 = "";
             * pStand.GetAliasByLayerName(ref Alias, m_structPara.strFtName, m_strStdName);
             * pStand.GetAliasByLayerName(ref Alias2, m_structPara.strFtName2, m_strStdName);*/
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            if (!string.IsNullOrEmpty(FtName1))
            {
                FtName1 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            if (!string.IsNullOrEmpty(FtName2))
            {
                FtName2 = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            }
            string strErrInfo = m_structPara.strClause;

            for (int i = 0; i < arrFieldMap.Count; i++)
            {
                string strR = arrFieldMap[i].strAlias;
                string strS = arrFieldMap[i].strName;
                strErrInfo.Replace(strS, strR);
            }
            strErrInfo.Replace(m_structPara.strFtName, FtName1);
            strErrInfo.Replace(m_structPara.strFtName2, FtName2);
            strErrInfo = "字段值符合表达式 (" + strErrInfo + ")";

            return(strErrInfo);
        }
Пример #4
0
        public override bool Verify()
        {
            //根据别名取图层名
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            layerName = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);
            if (string.IsNullOrEmpty(layerName))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("当前标准中不存在图层“{0}”", m_structPara.strFtName));
                return(false);
            }
            return(true);
        }
Пример #5
0
        public override bool Verify()
        {
            //根据别名取featureclass的名字
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);

            layerName = LayerReader.GetNameByAliasName(m_structPara.strFtName, standardID);

            //清除以前结果
            if (this.m_QueryConnection == null)
            {
                return(false);
            }
            return(true);
        }
Пример #6
0
        public override bool Verify()
        {
            m_StandarID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);
            //根据别名取图层名
            m_layerName = LayerReader.GetNameByAliasName(m_structInvalidPara.strFtName, m_StandarID);

            if (m_QueryWorkspace == null)
            {
                return(false);
            }

            if (!(m_QueryWorkspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTTable, m_layerName))
            {
                string strLog = "当前工作数据库中不存在图层" + m_layerName + ",无法执行非法字符检查!";
                SendMessage(enumMessageType.RuleError, strLog);
                return(false);
            }
            return(true);
        }