Inheritance: IPersistableSessionObject
Beispiel #1
0
        public Domain DomainCreate()
        {
            Domain newDomain = new Domain();

            Guid newDomainId;
            Guid newDomainNodeId;

            SqlCommand createDomainCommand = CreateDomainCommand(out newDomainId, out newDomainNodeId);
            createDomainCommand.ExecuteNonQuery();

            newDomain.DomainUid = newDomainId;
            newDomain.DomainOriginalId = newDomainId.ToString();

            return newDomain;
        }
Beispiel #2
0
        public Relationship RelationshipCreate(Domain newDomain, Guid relationshipTypeId, IDictionary<Guid, Guid> nodes)
        {
            Guid newRelationshipId;
            Relationship newRelationship = new Relationship();

            SqlCommand createRelationshipCommand = CreateRelationshipCommand(out newRelationshipId, newDomain.DomainUid, relationshipTypeId, nodes);

            createRelationshipCommand.ExecuteNonQuery();

            newRelationship.RelationshipUid = Guid.Empty;
            newRelationship.RelationshipOriginalId = string.Empty;
            newRelationship.RelationshipTypeUid = relationshipTypeId;
            newRelationship.DomainUid = newDomain.DomainUid;

            return newRelationship;
        }
Beispiel #3
0
        public Node NodeCreate(Domain newDomain, Guid nodeTypeId)
        {
            Guid newNodeId;
            Node newNode = new Node();

            SqlCommand createNodeCommand = CreateNodeCommand(out newNodeId, nodeTypeUid: nodeTypeId, domainUid: newDomain.DomainUid);
            createNodeCommand.Parameters.AddWithValue("@NodeOriginalId", newNodeId.ToString());

            createNodeCommand.ExecuteNonQuery();

            newNode.NodeUid = newNodeId;
            newNode.NodeOriginalId = newNodeId.ToString();
            newNode.NodeTypeUid = nodeTypeId;
            newNode.DomainUid = newDomain.DomainUid;

            return newNode;
        }
Beispiel #4
0
        public Node DomainGetRootNode(Domain domain)
        {
            Node domainNode = new Node();

            SqlCommand selectDomainNodeCommand = SelectDomainNodeCommand(domain.DomainUid);
            SqlDataReader reader = selectDomainNodeCommand.ExecuteReader();

            if (reader.Read())
            {
                domainNode.NodeUid = (Guid)reader["NodeUid"];
                domainNode.NodeOriginalId = (string)reader["NodeOriginalId"];
                domainNode.NodeTypeUid = (Guid)reader["NodeTypeUid"];
                domainNode.DomainUid = (Guid)reader["DomainUid"];
            }

            return domainNode;
        }