Пример #1
0
        private void RenameClassObject(IDataset dsCurrent, int standardID)
        {
            if (dsCurrent == null)
            {
                return;
            }

            Hy.Check.Define.StandardLayer standardLayer = LayerReader.GetLayerByName(dsCurrent.Name, standardID);
            //string strAliasName = Hy.Check.Rule.Helper.LayerReader.GetAliasName(dsCurrent.Name, standardID);
            if (standardLayer != null)// dsCurrent.Name != strAliasName)
            {
                ISchemaLock schemaLock = dsCurrent as ISchemaLock;
                schemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock);

                IClassSchemaEdit classSchemaEdit = dsCurrent as IClassSchemaEdit;
                if (classSchemaEdit != null)
                {
                    classSchemaEdit.AlterAliasName(standardLayer.AliasName);

                    ITable tCurrent = dsCurrent as ITable;
                    if (tCurrent != null)
                    {
                        List <Hy.Check.Define.StandardField> fields = FieldReader.GetFieldsByLayer(standardLayer.ID);
                        for (int i = 0; i < fields.Count; i++)
                        {
                            if (tCurrent.Fields.FindField(fields[i].Name) > -1)
                            {
                                classSchemaEdit.AlterFieldAliasName(fields[i].Name, fields[i].AliasName);
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 从DataRow生成Layer对象
        /// </summary>
        /// <param name="rowLayer"></param>
        /// <returns></returns>
        public static StandardLayer GetLayerFromDataRow(DataRow rowLayer)
        {
            if (rowLayer == null)
                return null;

            StandardLayer lyr = new StandardLayer();
            lyr.ID = Convert.ToInt32( rowLayer["LayerID"]);
            lyr.Name = rowLayer["LayerCode"] as string;
            lyr.AliasName = rowLayer["LayerName"]as string;
            lyr.AttributeTableName = rowLayer["AttrTableName"] as string;
            lyr.Description = rowLayer["LayerDesc"] as string;
            lyr.OrderIndex = Convert.ToInt32(rowLayer["SeqID"]);
            lyr.Type = (enumLayerType)Convert.ToInt32(rowLayer["GeometryType"]);

            return lyr;
        }
Пример #3
0
        public override bool Verify()
        {
            int standardID = SysDbHelper.GetStandardIDBySchemaID(this.m_SchemaID);
            lyr = LayerReader.GetLayerByAliasName(m_structFrePara.strFtName, standardID);
            if (lyr == null)
            {
                SendMessage(enumMessageType.VerifyError, "��ǰ�������ڵı�׼���Ҳ�����Ϊ��" + m_structFrePara.strFtName + "����ͼ��");
                return false;
            }

            return true;
        }
Пример #4
0
        public override bool Verify()
        {
            // ��ȡ��׼ID
            int nStdID = SysDbHelper.GetStandardID(this.m_strStdName);
            lyr = LayerReader.GetLayerByAliasName(m_psPara.strFtName, nStdID);
            if (lyr == null)
            {
                SendMessage(enumMessageType.VerifyError, string.Format("��׼�в�����ͼ�㡰{0}��", m_psPara.strFtName));
                return false;
            }

            // ��ȡʵ����ֵ��
            Helper.StandardHelper helper = new Hy.Check.Rule.Helper.StandardHelper(this.m_QueryConnection);
            strFieldCode = FieldReader.GetNameByAliasName(m_psPara.strCodeField, lyr.ID);
            if (string.IsNullOrEmpty(strFieldCode))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("��׼ͼ���в������ֶΡ�{0}��", m_psPara.strCodeField));
                return false;
            }

            strFieldCodeType = helper.GetLayerFieldType(strFieldCode, lyr.AttributeTableName);
            if (string.IsNullOrEmpty(strFieldCodeType))
            {
                SendMessage(enumMessageType.VerifyError, string.Format("����ͼ���в������ֶΡ�{0}��", m_psPara.strCodeField));
                return false;
            }

            if (m_psPara.strNameField != "")
            {
                strFieldName = FieldReader.GetNameByAliasName(m_psPara.strNameField, lyr.ID);
            }
            else
            {
                SendMessage(enumMessageType.VerifyError,"û�������ֶ�");
                return false;
            }

            return true;
        }