protected void DrawProfilesModule() { bool proxy = false; if (Request.Params["Proxy"] != null) { proxy = Convert.ToBoolean(Request.Params["Proxy"]); } if (proxy) { pnlUserText.Visible = false; pnlProxyText.Visible = true; imgORCIDProxy.Src = Root.Domain + "/Framework/Images/orcid_16x16(1).gif"; string userORCID = Request.Params["UserORCID"]; hlORCIDUrlProxy.Text = Profiles.ORCID.Utilities.config.ORCID_URL + "/" + userORCID; hlORCIDUrlProxy.NavigateUrl = Profiles.ORCID.Utilities.config.ORCID_URL + "/" + userORCID; hlORCIDUrlProxy.Target = "_blank"; } else { pnlUserText.Visible = true; pnlProxyText.Visible = false; imgOrcid.Src = Root.Domain + "/Framework/Images/orcid_16x16(1).gif"; Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); if (person.Exists && !person.ORCIDIsNull && !person.ORCID.Equals(string.Empty)) { hlORCIDUrl.Text = person.ORCIDUrl; hlORCIDUrl.NavigateUrl = person.ORCIDUrl; hlORCIDUrl.Target = "_blank"; spanYourORCID.Visible = true; } } }
private bool AssociateORCIDWithOrganizationID(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person, string orcid) { person.ORCID = orcid; person.PersonStatusTypeID = (int)Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Provided; person.ORCIDRecorded = DateTime.Now; return(PersonBLL.Save(person)); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); LoadPageLabels(person); if (AssociateORCIDWithOrganizationID(person, Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.OAuth.GetORCID(OAuthCode, "ProvideORCIDConfirmation.aspx", LoggedInInternalUsername))) { pSuccess.Visible = true; LoadPageLabels(person); } else { pSuccess.Visible = false; lblErrors.Text = "An error occurred while associating your ORCID with your local identifier"; } Int64 subjectID = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.Profile.Data.Person().GetNodeId(person.InternalUsername); Edit.Utilities.DataIO data = new Edit.Utilities.DataIO(); data.AddLiteral(subjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#orcidId"), data.GetStoreNode(person.ORCID), this.PropertyListXML); pHasProfile.Visible = !subjectID.Equals(0); hlProfile.NavigateUrl = "~/display/" + subjectID.ToString(); hlEdit.NavigateUrl = Root.Domain + "/edit/default.aspx?subject=" + subjectID.ToString() + "&predicateuri=http://vivoweb.org/ontology/core!orcidId&module=DisplayItemToEdit&ObjectType=Literal"; } } catch (Exception ex) { LogException(ex); } }
private void CheckForExistingORCID() { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); if (person.Exists && !person.ORCIDIsNull && !person.ORCID.Equals(string.Empty)) { AddError("You already have an ORCID. Please visit the <a href='" + Profiles.ORCID.Utilities.config.ORCID_URL + "'>ORCID website</a> to make any changes."); this.divEntryForm.Visible = false; } }
private void GetErrorsAndMessages(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person bo) { AddError(bo.Error); this.lblFirstNameErrors.Text = bo.FirstNameErrors; this.lblLastNameErrors.Text = bo.LastNameErrors; this.lblPublishedNameErrors.Text = bo.PublishedNameErrors; this.lblEmailAddressErrors.Text = bo.EmailAddressErrors; this.lblAlternateEmailDecisionIDErrors.Text = bo.AlternateEmailDecisionIDErrors; this.UploadInfoToORCID1.ResearchExpertiseAndProfessionalInterestsErrors = bo.BiographyErrors; }
protected void DrawProfilesModule() { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); if (person.Exists && !person.ORCIDIsNull && !person.ORCID.Equals(string.Empty)) { hlORCIDUrl.Text = person.ORCIDUrl; hlORCIDUrl.NavigateUrl = person.ORCIDUrl; hlORCIDUrl.Target = "_blank"; spanYourORCID.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) //{ Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); divORCIDAlreadyProvided.Visible = person.Exists && !person.ORCIDIsNull; divProvideORCID.Visible = !divORCIDAlreadyProvided.Visible; //lblOrganizationName.Text = Profiles.ORCID.Utilities.config.OrganizationName; //lblOrganizationName2.Text = Profiles.ORCID.Utilities.config.OrganizationName; this.lblButtonLabel.Text = this.btnLoginToORCID.Text; //} }
protected void DrawProfilesModule() { LoadAssets(); Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person orcidPerson = GetPersonWithDBData(Convert.ToInt32(Request.QueryString["subject"])); this.txtEmailAddress.Text = orcidPerson.EmailAddress; this.txtFirstName.Text = orcidPerson.FirstName; this.txtLastName.Text = orcidPerson.LastName; this.hlORCIDAckAndConsent.Text = Profiles.ORCID.Utilities.config.AcknowledgementInfoSiteText; this.hlORCIDAckAndConsent.NavigateUrl = ORCID_WordPress_Agreement; CheckForExistingORCID(); UpdateAcknowledgeVisibility(); UpdateUploadNowVisibility(); this.lblOrgEmailRequired.Text = Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person.EmailRequiredMessage; Session["txtEmailAddress.Text"] = this.txtEmailAddress.Text; Session["txtFirstName.Text"] = this.txtFirstName.Text; Session["txtLastName.Text"] = this.txtLastName.Text; Session["hlORCIDAckAndConsent.Text"] = this.hlORCIDAckAndConsent.Text; Session["hlORCIDAckAndConsent.NavigateUrl"] = this.hlORCIDAckAndConsent.NavigateUrl; }
protected void btnSubmitToORCID_Click(object sender, EventArgs e) { try { if (UploadInfoToORCID1.ResearchExpertiseAndProfessionalInterests.Length > 5000) { UploadInfoToORCID1.ResearchExpertiseAndProfessionalInterestsErrors += "Error! Biography cannot be longer then 5000 characters"; return; } Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = UploadInfoToORCID1.GetPersonWithPageData(); Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.PersonMessage personMessageBLL = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.PersonMessage(); personMessageBLL.CreateUploadMessages(person, LoggedInInternalUsername); } catch (Exception ex) { lblErrorsUpload.Text = ex.Message; LogException(ex); } Response.Redirect("~/ORCID/Default.aspx", true); }
private Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person GetPageControlValues(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person bo) { bo.AlternateEmails = new List <Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail>(); //bo.InternalUsername = LoggedInInternalUsername; bo.PersonStatusTypeID = (int)Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Created; if (!this.txtFirstName.Text.Equals(string.Empty)) { bo.FirstName = this.txtFirstName.Text; } else { bo.FirstNameIsNull = true; } if (!this.txtLastName.Text.Equals(string.Empty)) { bo.LastName = this.txtLastName.Text; } else { bo.LastNameIsNull = true; } if (!this.txtPublishedName.Text.Equals(string.Empty)) { bo.PublishedName = this.txtPublishedName.Text; } foreach (string othername in this.txtOtherNames.Text.Split(Environment.NewLine.ToCharArray())) { if (!othername.Trim().Equals(string.Empty)) { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonOthername otherNameBO = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonOthername(); otherNameBO.OtherName = othername.Trim(); bo.Othernames.Add(otherNameBO); } } if (!this.txtEmailAddress.Text.Equals(string.Empty)) { bo.EmailAddress = this.txtEmailAddress.Text; } else { bo.EmailAddressIsNull = true; } if (!this.ddlEmailDecisionID.Text.Equals(string.Empty)) { bo.EmailDecisionID = int.Parse(this.ddlEmailDecisionID.SelectedValue); } else { bo.EmailDecisionIDIsNull = true; } if (!this.ddlAlternateEmailDecisionID.Text.Equals(string.Empty)) { bo.AlternateEmailDecisionID = int.Parse(this.ddlAlternateEmailDecisionID.SelectedValue); } else { bo.AlternateEmailDecisionIDIsNull = true; } foreach (string email in this.txtAlternateEmail.Text.Split(Environment.NewLine.ToCharArray())) { if (!email.Equals(string.Empty)) { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail emailBO = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.PersonAlternateEmail(); emailBO.EmailAddress = email; bo.AlternateEmails.Add(emailBO); } } return(bo); }
private void LoadPageLabels(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person) { //lblOrganizationName.Text = ProfilesRNSDLL.DevelopmentBase.Common.GetConfig("ORCID.OrganizationName").ToString(); }