Esempio n. 1
0
        public override void XmlLoad(XmlNode node)
        {
            _key         = XmlHelper.GetAttributeValue(node, "key", string.Empty);
            _enforce     = XmlHelper.GetAttributeValue(node, "enforce", _def_enforce);
            _description = XmlHelper.GetAttributeValue(node, "description", _def_description);

            var columnRelationshipsNode = node.SelectSingleNode("columnRelationships"); //deprecated, use "crl"

            if (columnRelationshipsNode == null)
            {
                columnRelationshipsNode = node.SelectSingleNode("crl");
            }
            ColumnRelationships.XmlLoad(columnRelationshipsNode);

            var childTableRefNode = node.SelectSingleNode("childTableRef"); //deprecated, use "ct"

            if (childTableRefNode == null)
            {
                childTableRefNode = node.SelectSingleNode("ct");
            }
            if (this.ChildTableRef == null)
            {
                _childTableRef = new Reference(this.Root);
            }
            this.ChildTableRef.XmlLoad(childTableRefNode);

            var parentTableRefNode = node.SelectSingleNode("parentTableRef"); //deprecated, use "pt"

            if (parentTableRefNode == null)
            {
                parentTableRefNode = node.SelectSingleNode("pt");
            }
            if (this.ParentTableRef == null)
            {
                _parentTableRef = new Reference(this.Root);
            }
            this.ParentTableRef.XmlLoad(parentTableRefNode);

            this.ResetId(XmlHelper.GetAttributeValue(node, "id", _id));

            var roleName = XmlHelper.GetAttributeValue(node, "roleName", _def_roleName);

            if (roleName == "fk")
            {
                roleName = string.Empty;                   //Error correct from earlier versions
            }
            this.RoleName = roleName;

            this.ConstraintName = XmlHelper.GetAttributeValue(node, "constraintName", _def_constraintname);
            //_createdDate = DateTime.ParseExact(XmlHelper.GetAttributeValue(node, "createdDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)), "yyyy-MM-dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);

            this.Dirty = false;
        }
Esempio n. 2
0
        public override void XmlLoad(XmlNode node)
        {
            this.Key     = XmlHelper.GetAttributeValue(node, "key", string.Empty);
            _enforce     = XmlHelper.GetAttributeValue(node, "enforce", _def_enforce);
            _description = XmlHelper.GetAttributeValue(node, "description", _def_description);

            _deleteAction = (DeleteActionConstants)Enum.Parse(typeof(DeleteActionConstants), XmlHelper.GetAttributeValue(node, "deleteAction", _def_deleteAction.ToString()));

            var columnRelationshipsNode = node.SelectSingleNode("columnRelationships"); //deprecated, use "crl"

            if (columnRelationshipsNode == null)
            {
                columnRelationshipsNode = node.SelectSingleNode("crl");
            }
            ColumnRelationships.XmlLoad(columnRelationshipsNode);

            var childTableRefNode = node.SelectSingleNode("childTableRef"); //deprecated, use "ct"

            if (childTableRefNode == null)
            {
                childTableRefNode = node.SelectSingleNode("ct");
            }
            if (this.ChildTableRef == null)
            {
                _childTableRef = new Reference(this.Root);
            }
            this.ChildTableRef.XmlLoad(childTableRefNode);

            var parentTableRefNode = node.SelectSingleNode("parentTableRef"); //deprecated, use "pt"

            if (parentTableRefNode == null)
            {
                parentTableRefNode = node.SelectSingleNode("pt");
            }
            if (this.ParentTableRef == null)
            {
                _parentTableRef = new Reference(this.Root);
            }
            this.ParentTableRef.XmlLoad(parentTableRefNode);

            this.ResetId(XmlHelper.GetAttributeValue(node, "id", this.Id));

            var roleName = XmlHelper.GetAttributeValue(node, "roleName", _def_roleName);

            if (roleName == "fk")
            {
                roleName = string.Empty;                   //Error correct from earlier versions
            }
            this.RoleName = roleName;

            this.ConstraintName = XmlHelper.GetAttributeValue(node, "constraintName", _def_constraintname);
        }