예제 #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 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;
        }
예제 #4
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);
        }