public void SetRelationshipType(int p_oid, ChroniGenNHibernate.Enumerated.Chroni.RelationshipEnum p_relationship)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Relationship_setRelationshipType) ENABLED START*/

            // Write here your custom code...

            RelationshipCAD relationshipCAD = new RelationshipCAD();
            RelationshipCEN relationshipCEN = new RelationshipCEN(relationshipCAD);

            if (p_oid > 0)
            {
                RelationshipEN relationship = relationshipCEN.ReadOID(p_oid);

                if (relationship != null)
                {
                    if (p_relationship > 0)
                    {
                        relationship.Relationship = p_relationship;
                        relationshipCAD.Modify(relationship);
                    }
                }
            }

            /*PROTECTED REGION END*/
        }
示例#2
0
        public void SetRelationship(int p_oid, int p_oid_patient, int p_oid_relatedPerson)
        {
            /*PROTECTED REGION ID(ChroniGenNHibernate.CEN.Chroni_Relationship_setRelationship) ENABLED START*/

            // Write here your custom code...

            RelationshipCAD relationshipCAD = new RelationshipCAD();
            RelationshipCEN relationshipCEN = new RelationshipCEN(relationshipCAD);

            PatientCAD patientCAD = new PatientCAD();
            PatientCEN patientCen = new PatientCEN(patientCAD);

            RelatedPersonCAD relatedPersonCAD = new RelatedPersonCAD();
            RelatedPersonCEN relatedPersonCEN = new RelatedPersonCEN(relatedPersonCAD);

            if (p_oid > 0)
            {
                RelationshipEN relationship = relationshipCEN.ReadOID(p_oid);

                if (relationship != null)
                {
                    if (p_oid_patient > 0)
                    {
                        PatientEN patient = patientCen.ReadOID(p_oid_patient);

                        if (patient != null)
                        {
                            if (p_oid_relatedPerson > 0)
                            {
                                RelatedPersonEN relatedPerson = relatedPersonCEN.ReadOID(p_oid_relatedPerson);

                                if (relatedPerson != null)
                                {
                                    relationship.PatientOID       = p_oid_patient;
                                    relationship.RelatedPersonOID = p_oid_relatedPerson;
                                    relationshipCAD.Modify(relationship);
                                }
                            }
                        }
                    }
                }
            }

            /*PROTECTED REGION END*/
        }