public ColumnInfo(TableInfo ownerTable)
 {
     OwnerTable = ownerTable;
 }
        private ColumnInfo GetColumn(XmlNode xnColumn, TableInfo ownerTable)
        {
            ColumnInfo mColumn = new ColumnInfo(ownerTable);
            XmlElement xe = (XmlElement)xnColumn;
            mColumn.ColumnId = xe.GetAttribute("Id");
            XmlNodeList xnCProperty = xe.ChildNodes;
            foreach (XmlNode xnP in xnCProperty)
            {
                switch (xnP.Name)
                {
                    case "a:ObjectID":
                        mColumn.ObjectId = xnP.InnerText;
                        break;

                    case "a:Name":
                        mColumn.Name = xnP.InnerText;
                        break;

                    case "a:Code":
                        mColumn.Code = xnP.InnerText;
                        break;

                    case "a:CreationDate":
                        mColumn.CreationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Creator":
                        mColumn.Creator = xnP.InnerText;
                        break;

                    case "a:ModificationDate":
                        mColumn.ModificationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Modifier":
                        mColumn.Modifier = xnP.InnerText;
                        break;

                    case "a:Comment":
                        mColumn.Comment = xnP.InnerText;
                        break;

                    case "a:DataType":
                        mColumn.DataType = xnP.InnerText;
                        break;

                    case "a:Length":
                        mColumn.Length = xnP.InnerText;
                        break;

                    case "a:Identity":
                        mColumn.Identity = ConvertToBooleanPg(xnP.InnerText);
                        break;

                    case "a:Mandatory":
                        mColumn.Mandatory = ConvertToBooleanPg(xnP.InnerText);
                        break;

                    case "a:PhysicalOptions":
                        mColumn.PhysicalOptions = xnP.InnerText;
                        break;

                    case "a:ExtendedAttributesText":
                        mColumn.ExtendedAttributesText = xnP.InnerText;
                        break;

                    case "a:Precision":
                        mColumn.Precision = xnP.InnerText;
                        break;
                }
            }
            return mColumn;
        }
Exemplo n.º 3
0
 public PdmKey(TableInfo table)
 {
     OwnerTable = table;
 }
 //初始化c:PrimaryKey"的节点
 private void InitPrimaryKey(XmlNode xnPrimaryKey, TableInfo pTable)
 {
     pTable.PrimaryKeyRefCode = GetPrimaryKey(xnPrimaryKey);
 }
 //初始化c:Keys"的节点
 private void InitKeys(XmlNode xnKeys, TableInfo pTable)
 {
     foreach (XmlNode xnKey in xnKeys)
     {
         pTable.AddKey(GetKey(xnKey, pTable));
     }
 }
 //初始化"c:Columns"的节点
 private void InitColumns(XmlNode xnColumns, TableInfo pTable)
 {
     foreach (XmlNode xnColumn in xnColumns)
     {
         pTable.AddColumn(GetColumn(xnColumn, pTable));
     }
 }
        //初始化"o:Table"的节点
        private TableInfo GetTable(XmlNode xnTable)
        {
            TableInfo mTable = new TableInfo();
            XmlElement xe = (XmlElement)xnTable;
            mTable.TableId = xe.GetAttribute("Id");
            XmlNodeList xnTProperty = xe.ChildNodes;
            foreach (XmlNode xnP in xnTProperty)
            {
                switch (xnP.Name)
                {
                    case "a:ObjectID":
                        mTable.ObjectId = xnP.InnerText;
                        break;

                    case "a:Name":
                        mTable.Name = xnP.InnerText;
                        break;

                    case "a:Code":
                        mTable.Code = xnP.InnerText;
                        break;

                    case "a:CreationDate":
                        mTable.CreationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Creator":
                        mTable.Creator = xnP.InnerText;
                        break;

                    case "a:ModificationDate":
                        mTable.ModificationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Modifier":
                        mTable.Modifier = xnP.InnerText;
                        break;

                    case "a:Comment":
                        mTable.Comment = xnP.InnerText;
                        break;

                    case "a:PhysicalOptions":
                        mTable.PhysicalOptions = xnP.InnerText;
                        break;

                    case "c:Columns":
                        InitColumns(xnP, mTable);
                        break;

                    case "c:Keys":
                        InitKeys(xnP, mTable);
                        break;

                    case "c:PrimaryKey":
                        InitPrimaryKey(xnP, mTable);
                        break;

                    case "a:Description":
                        mTable.Description = xnP.InnerText;
                        break;
                }
            }
            return mTable;
        }
        private PdmKey GetKey(XmlNode xnKey, TableInfo ownerTable)
        {
            PdmKey mKey = new PdmKey(ownerTable);
            XmlElement xe = (XmlElement)xnKey;
            mKey.KeyId = xe.GetAttribute("Id");
            XmlNodeList xnKProperty = xe.ChildNodes;
            foreach (XmlNode xnP in xnKProperty)
            {
                switch (xnP.Name)
                {
                    case "a:ObjectID":
                        mKey.ObjectId = xnP.InnerText;
                        break;

                    case "a:Name":
                        mKey.Name = xnP.InnerText;
                        break;

                    case "a:Code":
                        mKey.Code = xnP.InnerText;
                        break;

                    case "a:CreationDate":
                        mKey.CreationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Creator":
                        mKey.Creator = xnP.InnerText;
                        break;

                    case "a:ModificationDate":
                        mKey.ModificationDate = String2DateTime(xnP.InnerText);
                        break;

                    case "a:Modifier":
                        mKey.Modifier = xnP.InnerText;
                        break;

                    case "c:Key.Columns":
                        InitKeyColumns(xnP, mKey);
                        break;
                }
            }
            return mKey;
        }