Пример #1
0
        private void GetWorksFromThePage(Utilities.ProfilesRNSDLL.BO.ORCID.Person person)
        {
            if (divPublications.Visible)
            {
                int          counter   = 0;
                const string WORK_TYPE = "journal-article";

                foreach (RepeaterItem ri in rptPublications.Items)
                {
                    counter += 1;
                    switch (ri.ItemType)
                    {
                    case ListItemType.Item:
                    case ListItemType.AlternatingItem:
                        // Get the controls for this item.
                        DropDownList ddlPubVis       = (DropDownList)ri.FindControl("ddlPubVis");
                        Label        lblCitation     = (Label)ri.FindControl("lblCitation");
                        Label        lblPubDate      = (Label)ri.FindControl("lblPubDate");
                        Label        lblPubID        = (Label)ri.FindControl("lblPubID");
                        Label        lblPMID         = (Label)ri.FindControl("lblPMID");
                        Label        lblDOI          = (Label)ri.FindControl("lblDOI");
                        Label        lblArticleTitle = (Label)ri.FindControl("lblArticleTitle");

                        // Pubdate is required.
                        if (!Utilities.ProfilesRNSDLL.DevelopmentBase.Helpers.Date.IsDate(lblPubDate.Text))
                        {
                            continue;
                        }
                        Utilities.ProfilesRNSDLL.BO.ORCID.PersonWork work = new Utilities.ProfilesRNSDLL.BO.ORCID.PersonWork();
                        work.DecisionID   = int.Parse(ddlPubVis.SelectedValue.ToString());
                        work.WorkCitation = lblCitation.Text;
                        work.PubDate      = DateTime.Parse(lblPubDate.Text);
                        work.WorkType     = WORK_TYPE;
                        work.PersonID     = person.PersonID;
                        work.PubID        = lblPubID.Text;
                        work.WorkTitle    = lblArticleTitle.Text;

                        // Add the identifiers
                        if (!lblPMID.Text.Trim().Equals(string.Empty))
                        {
                            Utilities.ProfilesRNSDLL.BLL.ORCID.PersonWork.AddIdentifier(work, Utilities.ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.pmid, lblPMID.Text);
                        }
                        if (!lblDOI.Text.Equals(Utilities.ProfilesRNSDLL.BLL.ORCID.DOI.DOI_NOT_FOUND_MESSAGE))
                        {
                            Utilities.ProfilesRNSDLL.BLL.ORCID.PersonWork.AddIdentifier(work, Utilities.ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.doi, lblDOI.Text);
                        }
                        person.Works.Add(work);
                        break;
                    }
                }
            }
        }
        private void GetWorksFromThePage(Utilities.ProfilesRNSDLL.BO.ORCID.Person person)
        {
            if (divPublications.Visible)
            {
                int counter = 0;
                const string WORK_TYPE = "journal-article";

                foreach (RepeaterItem ri in rptPublications.Items)
                {
                    counter += 1;
                    switch (ri.ItemType)
                    {
                        case ListItemType.Item:
                        case ListItemType.AlternatingItem:
                            // Get the controls for this item.
                            DropDownList ddlPubVis = (DropDownList)ri.FindControl("ddlPubVis");
                            Label lblCitation = (Label)ri.FindControl("lblCitation");
                            Label lblPubDate = (Label)ri.FindControl("lblPubDate");
                            Label lblPubID = (Label)ri.FindControl("lblPubID");
                            Label lblPMID = (Label)ri.FindControl("lblPMID");
                            Label lblDOI = (Label)ri.FindControl("lblDOI");
                            Label lblArticleTitle = (Label)ri.FindControl("lblArticleTitle");

                            // Pubdate is required.
                            if (!Utilities.ProfilesRNSDLL.DevelopmentBase.Helpers.Date.IsDate(lblPubDate.Text))
                            {
                                continue;
                            }
                            Utilities.ProfilesRNSDLL.BO.ORCID.PersonWork work = new Utilities.ProfilesRNSDLL.BO.ORCID.PersonWork();
                            work.DecisionID = int.Parse(ddlPubVis.SelectedValue.ToString());
                            work.WorkCitation = lblCitation.Text;
                            work.PubDate = DateTime.Parse(lblPubDate.Text);
                            work.WorkType = WORK_TYPE;
                            work.PersonID = person.PersonID;
                            work.PubID = lblPubID.Text;
                            work.WorkTitle = lblArticleTitle.Text;

                            // Add the identifiers
                            if (!lblPMID.Text.Trim().Equals(string.Empty))
                            {
                                Utilities.ProfilesRNSDLL.BLL.ORCID.PersonWork.AddIdentifier(work, Utilities.ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.pmid, lblPMID.Text);
                            }
                            if (!lblDOI.Text.Equals(Utilities.ProfilesRNSDLL.BLL.ORCID.DOI.DOI_NOT_FOUND_MESSAGE))
                            {
                                Utilities.ProfilesRNSDLL.BLL.ORCID.PersonWork.AddIdentifier(work, Utilities.ProfilesRNSDLL.BO.ORCID.REFWorkExternalType.REFWorkExternalTypes.doi, lblDOI.Text);
                            }
                            person.Works.Add(work);
                            break;
                    }
                }
            }
        }