Esempio n. 1
0
 private void GetPersonURLID(BO.ORCID.PersonURL personURL)
 {
     BO.ORCID.PersonURL personURLExisting = base.GetByPersonIDAndURL(personURL.PersonID, personURL.URL);
     if (personURLExisting.Exists)
     {
         personURL.PersonURLID = personURLExisting.PersonURLID;
     }
 }
Esempio n. 2
0
 private bool Save(BO.ORCID.PersonURL bo, System.Data.Common.DbTransaction trans)
 {
     if (bo.Exists)
     {
         return(base.Edit(bo, trans));
     }
     else
     {
         return(base.Add(bo, trans));
     }
 }
Esempio n. 3
0
 private bool Save(BO.ORCID.PersonURL bo)
 {
     if (bo.Exists)
     {
         return(base.Edit(bo));
     }
     else
     {
         return(base.Add(bo));
     }
 }
Esempio n. 4
0
        public new List <BO.ORCID.PersonURL> GetForORCIDUpdate(BO.ORCID.Person orcidPerson, long subjectID)
        {
            List <ProfilesRNSDLL.BO.ORCID.PersonURL> webSites = new List <ProfilesRNSDLL.BO.ORCID.PersonURL>();

            try
            {
                ProfilesRNSDLL.BO.ORNG.AppData appData = new ProfilesRNSDLL.BLL.ORNG.AppData().GetWebsites(subjectID);
                //value = [{"link_name":"Clinical and Translational Science Institute Leadership","link_url":"http://ctsi.bu.edu/index.php/about-us/leadership/"}, {"link_name":"My Google","link_url":"www.google.com"}]

                string webSitesJSON = appData.value;

                while (webSitesJSON.ToLower().Contains("\"link_name\""))
                {
                    BO.ORCID.PersonURL website = new BO.ORCID.PersonURL();
                    if (webSitesJSON.ToLower().IndexOf("\"link_name\"") < webSitesJSON.ToLower().IndexOf("\"link_url\""))
                    {
                        website.URLName = GetFieldValueFromJsonString(ref webSitesJSON, "link_name");
                        website.URL     = GetFieldValueFromJsonString(ref webSitesJSON, "link_url");
                    }
                    else
                    {
                        website.URL     = GetFieldValueFromJsonString(ref webSitesJSON, "link_url");
                        website.URLName = GetFieldValueFromJsonString(ref webSitesJSON, "link_name");
                    }
                    // Default to Public
                    website.DecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                    webSites.Add(website);
                }
            }
            catch //(Exception ex)
            {
                // unable to get links from the Open Social.
                return(new List <ProfilesRNSDLL.BO.ORCID.PersonURL>());
            }

            // Get the list of processed affiliations
            List <ProfilesRNSDLL.BO.ORCID.PersonURL> processedWebsites = GetSuccessfullyProcessedURLs(orcidPerson.PersonID);

            // Get the affiliations that have not been processed
            return((from w in webSites where !processedWebsites.Any(pw => pw.URL == w.URL) select w).ToList());
        }
        public new List<BO.ORCID.PersonURL> GetForORCIDUpdate(BO.ORCID.Person orcidPerson, long subjectID)
        {
            List<ProfilesRNSDLL.BO.ORCID.PersonURL> webSites = new List<ProfilesRNSDLL.BO.ORCID.PersonURL>();
            try
            {
                ProfilesRNSDLL.BO.ORNG.AppData appData = new ProfilesRNSDLL.BLL.ORNG.AppData().GetWebsites(subjectID);
                //value = [{"link_name":"Clinical and Translational Science Institute Leadership","link_url":"http://ctsi.bu.edu/index.php/about-us/leadership/"}, {"link_name":"My Google","link_url":"www.google.com"}]

                string webSitesJSON = appData.value;

                while (webSitesJSON.ToLower().Contains("\"link_name\""))
                {
                    BO.ORCID.PersonURL website = new BO.ORCID.PersonURL();
                    if (webSitesJSON.ToLower().IndexOf("\"link_name\"") < webSitesJSON.ToLower().IndexOf("\"link_url\""))
                    {
                        website.URLName = GetFieldValueFromJsonString(ref webSitesJSON, "link_name");
                        website.URL = GetFieldValueFromJsonString(ref webSitesJSON, "link_url");
                    }
                    else
                    {
                        website.URL = GetFieldValueFromJsonString(ref webSitesJSON, "link_url");
                        website.URLName = GetFieldValueFromJsonString(ref webSitesJSON, "link_name");
                    }
                    // Default to Public
                    website.DecisionID = (int)BO.ORCID.REFDecision.REFDecisions.Public;
                    webSites.Add(website);
                }
            }
            catch //(Exception ex)
            {
                // unable to get links from the Open Social.
                return new List<ProfilesRNSDLL.BO.ORCID.PersonURL>();
            }

            // Get the list of processed affiliations
            List<ProfilesRNSDLL.BO.ORCID.PersonURL> processedWebsites = GetSuccessfullyProcessedURLs(orcidPerson.PersonID);

            // Get the affiliations that have not been processed
            return (from w in webSites where !processedWebsites.Any(pw => pw.URL == w.URL) select w).ToList();
        }