Beispiel #1
0
        public override XmlNode XmlAppend(XmlNode node)
        {
            node.AddAttribute("key", this.Key);
            node.AddAttribute("name", this.Name);
            node.AddAttribute("codeFacade", this.CodeFacade, _def_codefacade);
            node.AddAttribute("description", this.Description, _def_description);
            node.AddAttribute("dataFieldSortOrder", this.SortOrder, _def_sortOrder);
            node.AddAttribute("isPrimaryKey", this.IsPrimaryKey, _def_isPrimaryKey);
            node.AddAttribute("default", this.Default, _def_default);
            node.AddAttribute("length", this.Length, _def_length);
            node.AddAttribute("scale", this.Scale, _def_scale);
            node.AddAttribute("id", this.Id);
            node.AddAttribute("sortOrder", this.SortOrder, _def_sortOrder);
            node.AddAttribute("type", (int)this.DataType);
            node.AddAttribute("allowNull", this.AllowNull, _def_allowNull);

            if (RelationshipRef != null)
            {
                var relationshipRefNode = node.CreateElement("relationshipRef");
                RelationshipRef.XmlAppend(relationshipRefNode);
                node.AppendChild(relationshipRefNode);
            }

            node.AppendChild(ParentViewRef.XmlAppend(node.CreateElement("parentTableRef")));
            return(node);
        }
        public override void XmlAppend(XmlNode node)
        {
            try
            {
                var oDoc = node.OwnerDocument;

                XmlHelper.AddAttribute(node, "key", this.Key);

                XmlHelper.AddAttribute((XmlElement)node, "generated", Generated.ToString());

                XmlHelper.AddAttribute(node, "name", this.Name);

                if (this.CodeFacade != _def_codefacade)
                {
                    XmlHelper.AddAttribute(node, "codeFacade", this.CodeFacade);
                }

                if (this.Description != _def_description)
                {
                    XmlHelper.AddAttribute(node, "description", this.Description);
                }

                if (this.FriendlyName != _def_friendlyName)
                {
                    XmlHelper.AddAttribute(node, "dataFieldFriendlyName", this.FriendlyName);
                }

                if (this.UIVisible != _def_UIVisible)
                {
                    XmlHelper.AddAttribute(node, "dataFieldVisibility", this.UIVisible);
                }

                if (this.SortOrder != _def_sortOrder)
                {
                    XmlHelper.AddAttribute(node, "dataFieldSortOrder", this.SortOrder);
                }

                if (RelationshipRef != null)
                {
                    var relationshipRefNode = oDoc.CreateElement("relationshipRef");
                    RelationshipRef.XmlAppend(relationshipRefNode);
                    node.AppendChild(relationshipRefNode);
                }

                if (this.Default != _def_default)
                {
                    XmlHelper.AddAttribute(node, "default", this.Default);
                }

                if (this.Length != _def_length)
                {
                    XmlHelper.AddAttribute(node, "length", this.Length);
                }

                XmlHelper.AddAttribute(node, "id", this.Id);

                if (this.SortOrder != _def_sortOrder)
                {
                    XmlHelper.AddAttribute(node, "sortOrder", this.SortOrder);
                }

                var parentViewRefNode = oDoc.CreateElement("parentTableRef");
                ParentViewRef.XmlAppend(parentViewRefNode);
                node.AppendChild(parentViewRefNode);

                XmlHelper.AddAttribute(node, "type", (int)this.DataType);

                if (this.AllowNull != _def_allowNull)
                {
                    XmlHelper.AddAttribute(node, "allowNull", this.AllowNull);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }