示例#1
0
        public ProfilesRNSDLL.BO.ORCID.Person GetPersonWithDBData(int profilePersonID, string sessionID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person  profilePerson    = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long   profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Person orcidPerson = GetByInternalUsername(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Narrative narrative = new ProfilesRNSDLL.BLL.RDF.Triple().GetNarrative(profileSubjectID);
            if (!string.IsNullOrEmpty(narrative.Overview) && !narrative.Overview.Trim().Equals(string.Empty))
            {
                orcidPerson.Biography = narrative.Overview;
                if (!narrative.Decision.DecisionIDIsNull)
                {
                    orcidPerson.BiographyDecisionID = narrative.Decision.DecisionID;
                }
                else
                {
                    orcidPerson.BiographyDecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                }
            }
            orcidPerson.Affiliations = new ProfilesRNSDLL.BLL.ORCID.PersonAffiliation().GetForORCIDUpdate(orcidPerson, profileSubjectID, profilePersonID);
            orcidPerson.URLs         = new ProfilesRNSDLL.BLL.ORCID.PersonURL().GetForORCIDUpdate(orcidPerson, profileSubjectID);
            orcidPerson.Works        = new ProfilesRNSDLL.BLL.ORCID.PersonWork().GetForORCIDUpdate(orcidPerson, profileSubjectID, sessionID);
            if (BO.ORCID.Config.UseMailinatorEmailAddressForTestingOnStagingEnvironment)
            {
                orcidPerson.EmailAddress = System.Text.RegularExpressions.Regex.Split(profilePerson.EmailAddr, "@")[0] + DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("hhmmss") + "@mailinator.com";
            }
            else
            {
                orcidPerson.EmailAddress = profilePerson.EmailAddr;
            }
            return(orcidPerson);
        }
示例#2
0
        public new ProfilesRNSDLL.BO.ORCID.Person GetByInternalUsername(string internalUsername)
        {
            ProfilesRNSDLL.BO.ORCID.Person person = base.GetByInternalUsername(internalUsername);

            // if no record for the person already exists in the database, we need to set the required fields.
            if (!person.Exists)
            {
                ProfilesRNSDLL.BO.Profile.Data.Person profilePerson = new BLL.Profile.Data.Person().GetByInternalUsername(internalUsername);
                person.InternalUsername = internalUsername;
                if (!profilePerson.FirstNameIsNull)
                {
                    person.FirstName = profilePerson.FirstName;
                }
                if (!profilePerson.LastNameIsNull)
                {
                    person.LastName = profilePerson.LastName;
                }
                if (!profilePerson.EmailAddrIsNull)
                {
                    person.EmailAddress = profilePerson.EmailAddr;
                }
                person.CreateUnlessOptOut = false;
                person.PersonStatusTypeID = (int)ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.Unknown;
                Add(person);
                person.Exists = true;
            }
            return(person);
        }
示例#3
0
        public ProfilesRNSDLL.BO.ORCID.Person GetByPersonID(int profilePersonID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person  profilePerson    = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long   profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            return(GetByInternalUsername(internalUsername));
        }
        public ProfilesRNSDLL.BO.ORCID.Person GetPersonWithDBData(int profilePersonID, string sessionID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person profilePerson = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Person orcidPerson = GetByInternalUsername(internalUsername);

            ProfilesRNSDLL.BO.ORCID.Narrative narrative = new ProfilesRNSDLL.BLL.RDF.Triple().GetNarrative(profileSubjectID);
            if (!string.IsNullOrEmpty(narrative.Overview) && !narrative.Overview.Trim().Equals(string.Empty))
            {
                orcidPerson.Biography = narrative.Overview;
                if (!narrative.Decision.DecisionIDIsNull)
                {
                    orcidPerson.BiographyDecisionID = narrative.Decision.DecisionID;
                }
                else
                {
                    orcidPerson.BiographyDecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                }
            }
            orcidPerson.Affiliations = new ProfilesRNSDLL.BLL.ORCID.PersonAffiliation().GetForORCIDUpdate(orcidPerson, profileSubjectID, profilePersonID);
            orcidPerson.URLs = new ProfilesRNSDLL.BLL.ORCID.PersonURL().GetForORCIDUpdate(orcidPerson, profileSubjectID);
            orcidPerson.Works = new ProfilesRNSDLL.BLL.ORCID.PersonWork().GetForORCIDUpdate(orcidPerson, profileSubjectID, sessionID);
            if (BO.ORCID.Config.UseMailinatorEmailAddressForTestingOnStagingEnvironment)
            {
                orcidPerson.EmailAddress = System.Text.RegularExpressions.Regex.Split(profilePerson.EmailAddr, "@")[0] + DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("hhmmss") + "@mailinator.com";
            }
            else
            {
                orcidPerson.EmailAddress = profilePerson.EmailAddr;
            }
            return orcidPerson;
        }
        public new ProfilesRNSDLL.BO.ORCID.Person GetByInternalUsername(string internalUsername)
        {
            ProfilesRNSDLL.BO.ORCID.Person person = base.GetByInternalUsername(internalUsername);

            // if no record for the person already exists in the database, we need to set the required fields.
            if (!person.Exists)
            {
                ProfilesRNSDLL.BO.Profile.Data.Person profilePerson = new BLL.Profile.Data.Person().GetByInternalUsername(internalUsername);
                person.InternalUsername = internalUsername;
                if (!profilePerson.FirstNameIsNull)
                {
                    person.FirstName = profilePerson.FirstName;
                }
                if (!profilePerson.LastNameIsNull)
                {
                    person.LastName = profilePerson.LastName;
                }
                if (!profilePerson.EmailAddrIsNull)
                {
                    person.EmailAddress = profilePerson.EmailAddr;
                }
                person.CreateUnlessOptOut = false;
                person.PersonStatusTypeID = (int)ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.Unknown;
                Add(person);
                person.Exists = true;
            }
            return person;
        }
示例#6
0
        public ProfilesRNSDLL.BO.ORCID.Person GetByPersonID(int profilePersonID)
        {
            BLL.Profile.Data.Person profilePersonBLL = new BLL.Profile.Data.Person();
            BO.Profile.Data.Person profilePerson = profilePersonBLL.Get(profilePersonID);
            string internalUsername = profilePerson.InternalUsername;
            long profileSubjectID = profilePersonBLL.GetNodeId(internalUsername);

            return GetByInternalUsername(internalUsername);
        }