Ejemplo n.º 1
0
    private void ShowSearchCriteria()
    {
        //ListItem li = new ListItem(((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Name.FirstName.Text,
        List <string> searchRequestList = (List <string>)Session["ProfileSearchRequestCriteriaList"];

        if (searchRequestList.Count > 0)
        {
            lstSearchCriteriaDisplay.DataSource = (List <string>)Session["ProfileSearchRequestCriteriaList"];
            lstSearchCriteriaDisplay.DataBind();
        }

        string keyWords = Convert.ToString(((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Keywords.KeywordString.Text);

        if (keyWords != null)
        {
            Profiles         searchReq  = (Profiles)Session["ProfileSearchRequest"];
            string           keyword    = searchReq.QueryDefinition.Keywords.KeywordString.Text;
            string           queryId    = searchReq.QueryDefinition.QueryID;
            KeywordMatchType matchType  = searchReq.QueryDefinition.Keywords.KeywordString.MatchType;
            bool             matchExact = (matchType == KeywordMatchType.exact) ? true : false;

            MatchingKeywordList keywordList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetMatchingKeywords(keyword, queryId, matchExact);

            if (keywordList.Count > 0)
            {
                lstSearchKeywordDisplay.DataSource = keywordList;
                lstSearchKeywordDisplay.DataBind();
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                hypBack.Attributes.Add("onclick", "Backward('" + hdnBack.ClientID + "')");

                if (Request["Person"] != null) //Check for Null values
                {
                    _userID = GetPersonFromQueryString();
                    ProfileRightSide1.ProfileId = _userID;

                    hypLnkViewProfile.Visible     = true;
                    hypLnkViewProfile.NavigateUrl = "~/ProfileDetails.aspx?Person=" + Server.UrlEncode(_userID.ToString());

                    PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(_userID);
                    ltProfileName.Text = pList.Person[0].Name.FullName;
                    Page.Title         = "Co-Authors of " + pList.Person[0].Name.FullName;

                    rptCoAuthor.DataSource = pList.Person[0].PassiveNetworks.CoAuthorList.CoAuthor;
                    rptCoAuthor.DataBind();

                    lblSubTitle.Text = String.Format("Co-Authors ({0})", rptCoAuthor.Items.Count.ToString());
                }
            }

            catch (Exception Ex)
            {
                throw (Ex);
            }

            Page.Title = (string)Session["Fname"] + " " + (string)Session["Lname"] + " | " + Page.Title;
        }
    }
Ejemplo n.º 3
0
    private void InitalizePage()
    {
        string profileId = Convert.ToString(Request.QueryString["Person"]);

        // Get a copy of the last search
        Profiles personQuery = new Profiles();

        personQuery.QueryDefinition           = new QueryDefinition();
        personQuery.OutputOptions             = new OutputOptions();
        personQuery.OutputOptions.StartRecord = "0";

        personQuery.QueryDefinition.Keywords = ((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Keywords;

        // Set the selection input parameter to the session variable holding the search request
        personQuery.QueryDefinition.PersonID = profileId;

        PublicationMatchDetailList pmdl = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetProfilePublicationMatchSummary(personQuery);

        personQuery.Version = 2;
        PersonList thisPerson = new Connects.Profiles.Service.ServiceImplementation.ProfileService().ProfileSearch(personQuery);

        lstViewHeader.DataSource = thisPerson.Person;
        lstViewHeader.DataBind();

        rptMatchingPubs.DataSource = thisPerson.Person[0].PublicationList;
        rptMatchingPubs.DataBind();

        lblSubTitle.Text            = String.Format("Search Results to {0} {1}", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
        lblSubTitleCaptionText.Text = String.Format("This is a \"connection\" page, showing why {0} {1} matched the keywords from your search.", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
    }
Ejemplo n.º 4
0
 public string GetDisplayName()
 {
     if (_displayname == string.Empty)
     {
         PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(GetUserId());
         _displayname = pList.Person[0].Name.FullName;
     }
     return(_displayname);
 }
 public string GetDisplayName()
 {
     if (_displayname == string.Empty)
     {
         PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(GetUserId());
         _displayname = pList.Person[0].Name.FullName;
     }
     return _displayname;
 }
 public string GetDisplayName()
 {
     if (_displayname == string.Empty)
     {
         PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(GetUserid());
         lblSubTitle.Text = String.Format("Co-Authors ({0})", pList.Person[0].PassiveNetworks.CoAuthorList.TotalCoAuthorCount.ToString());
         _displayname = pList.Person[0].Name.FullName;
     }
     return _displayname;
 }
Ejemplo n.º 7
0
 public string GetDisplayName()
 {
     if (_displayname == string.Empty)
     {
         PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(GetUserid());
         lblSubTitle.Text = String.Format("Co-Authors ({0})", pList.Person[0].PassiveNetworks.CoAuthorList.TotalCoAuthorCount.ToString());
         _displayname     = pList.Person[0].Name.FullName;
     }
     return(_displayname);
 }
Ejemplo n.º 8
0
    protected void dlPeopleList_OnItemDataBound(Object sender, DataListItemEventArgs e)
    {
        DataRowView drv = (DataRowView)e.Item.DataItem;
        HyperLink   hypLnk;
        Label       lbl;

        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {                                                                                 //To check if the BirthDate has null values
            if (drv.Row["PersonId"].ToString() != DBNull.Value.ToString())
            {
                hypLnk = (HyperLink)(e.Item.FindControl("hypLnkPeopleList"));
                //
                hypLnk.NavigateUrl = "~\\ProfileDetails.aspx?From=SE&Person=" + drv["PersonId"].ToString();
            }
        }
        if (e.Item.ItemType != ListItemType.Footer)
        {
            lbl      = (Label)(e.Item.FindControl("LblRowNo"));
            lbl.Text = Convert.ToString(e.Item.ItemIndex + 1);
            lbl.Style.Add("Color", "#333");
            lbl.Visible = true;

            if (drv.Row["CoAuthor"] != null)
            {
                if (drv.Row["CoAuthor"].ToString().Length > 0)
                {
                    _showSimilarCoauthors = true;
                }
            }
        }
        else
        {
            PlaceHolder phSimilarCoauthors = (PlaceHolder)(e.Item.FindControl("phSimilarCoauthors"));
            phSimilarCoauthors.Visible = _showSimilarCoauthors;

            int personId = GetPersonFromQueryString();

            PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);

            //if (pList.Person[0].Address.Latitude > 0)
            //{
            //    HyperLink hypLnkMap = (HyperLink)(e.Item.FindControl("hypNeighborMap"));
            //    hypLnkMap.NavigateUrl = "~/gpeople.aspx?person=" + personId.ToString();
            //}
            //else
            //{
            //    PlaceHolder ph = (PlaceHolder)(e.Item.FindControl("phGoogleMap"));
            //    ph.Visible = false;
            //}
        }
    }
Ejemplo n.º 9
0
    protected int GetPersonFromQueryString()
    {
        int personId = 0;

        if (Request["Person"] != null)
        {
            if (!int.TryParse(Request["Person"], out personId))
            {
                personId = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonIdFromInternalId("EcommonsUsername", Request["Person"]);
            }
        }

        return(personId);
    }
Ejemplo n.º 10
0
    protected int GetPersonFromQueryString()
    {
        int personId = 0;

        if (Request["Person"] != null)
        {
            if (!int.TryParse(Request["Person"], out personId))
            {
                personId = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonIdFromInternalId("EcommonsUsername", Request["Person"]);
            }
        }

        return personId;
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                hypBack.Attributes.Add("onclick", "Backward('" + hdnBack.ClientID + "')");

                if (Request["Person"] != null) //Check for Null values
                {
                    // Read the userId from the querystring
                    userId = GetPersonFromQueryString();

                    // Set the UserId on the user controls
                    ProfileRightSide1.ProfileId = userId;
                    SimilarPeopleMap.ProfileId  = userId;

                    hypLnkViewProfile.Visible     = true;
                    hypLnkViewProfile.NavigateUrl = "~/ProfileDetails.aspx?Person=" + userId.ToString();

                    //DataRow dro = _userBL.GetUserInformation(userId).Rows[0];
                    PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(userId);

                    //Session["PersonIsMy"] = (string)dro["Lastname"] + ", " + ((string)dro["Firstname"]).Substring(0, 1);
                    ltProfileName.Text = String.Format("{0} {1}", pList.Person[0].Name.FirstName, pList.Person[0].Name.LastName);

                    // PRG: Refactor needed
                    //Persist names into viewstate
                    Session["Lname"] = pList.Person[0].Name.LastName;
                    Session["Fname"] = pList.Person[0].Name.FirstName;

                    // if (pList.Person[0].Address.Latitude == 0)
                    //   SimilarPeopleMap.HideMapTab();
                }
            }

            catch (Exception Ex)
            {
                throw (Ex);
            }

            Page.Title = (string)Session["Fname"] + " " + (string)Session["Lname"] + " | " + Page.Title;
        }
    }
Ejemplo n.º 12
0
    private void ShowSearchCriteria()
    {
        List <string> searchRequestList = (List <string>)Session["ProfileSearchRequestCriteriaList"];

        if (searchRequestList.Count > 0)
        {
            lstSearchCriteriaDisplay.DataSource = (List <string>)Session["ProfileSearchRequestCriteriaList"];
            lstSearchCriteriaDisplay.DataBind();
        }

        string keyword = "";

        if (this.txtKeyword.Text.Length > 0)
        {
            keyword = this.txtKeyword.Text;
        }
        else if (Session["ProfileSearchRequestKeywordList"] != null)
        {
            if (((List <string>)Session["ProfileSearchRequestKeywordList"]).Count > 0)
            {
                keyword = ((List <string>)Session["ProfileSearchRequestKeywordList"])[0];
            }
        }

        if (keyword.Length > 0)
        {
            Profiles         searchReq     = (Profiles)Session["ProfileSearchRequest"];
            string           searchKeyword = searchReq.QueryDefinition.Keywords.KeywordString.Text;
            string           queryId       = searchReq.QueryDefinition.QueryID;
            KeywordMatchType matchType     = searchReq.QueryDefinition.Keywords.KeywordString.MatchType;
            bool             matchExact    = (matchType == KeywordMatchType.exact) ? true : false;

            MatchingKeywordList keywordList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetMatchingKeywords(searchKeyword, queryId, matchExact);

            if (keywordList.Count > 0)
            {
                lstSearchKeywordDisplay.DataSource = keywordList;
                lstSearchKeywordDisplay.DataBind();
            }
        }
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                hypBack.Attributes.Add("onclick", "Backward('" + hdnBack.ClientID + "')");

                if (Request["Person"] != null) //Check for Null values
                {
                    _userID = GetPersonFromQueryString();

                    ProfileRightSide1.ProfileId = _userID;

                    hypLnkViewProfile.Visible = true;
                    hypLnkViewProfile.NavigateUrl = "~/ProfileDetails.aspx?Person=" + Server.UrlEncode(_userID.ToString());

                    PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(_userID);
                    ltProfileName.Text = pList.Person[0].Name.FullName;

                    lblSubTitle.Text = String.Format("Co-Authors ({0})", pList.Person[0].PassiveNetworks.CoAuthorList.TotalCoAuthorCount.ToString());

                    if (pList.Person[0].Address != null)
                    {
                        if (pList.Person[0].Address.Latitude == 0)
                            divMapView.Attributes.Add("style", "display:none");
                    }
                }
            }

            catch (Exception Ex)
            {
                throw (Ex);
            }

            Page.Title = (string)Session["Fname"] + " " + (string)Session["Lname"] + " | " + Page.Title;
        }
    }
Ejemplo n.º 14
0
    protected int GetPersonFromQueryString()
    {
        int personId = 0;

        if (Request.QueryString["Person"] != null)
        {
            if (!int.TryParse(Request.QueryString["Person"], out personId))
            {
                // get the internal personId from the profile search
                personId = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonIdFromInternalId("EcommonsUsername", Request.QueryString["Person"]);

                string sourceQuery = Request.Url.Query;
                string personQuery = sourceQuery.Substring(sourceQuery.IndexOf("Person="), 11);

                // replace the original URL with person modified for the integer
                string newUrl = Request.Url.OriginalString.Replace(personQuery, "Person=" + personId.ToString());

                // redirect to the new URL
                Response.Redirect(newUrl);
            }
        }

        return(personId);
    }
Ejemplo n.º 15
0
    private string GetJSONProfiles(int personId, bool showPublications, bool mobile)
    {
        Dictionary <string, Object>         personData     = new Dictionary <string, Object>();
        List <Dictionary <string, Object> > personDataList = new List <Dictionary <string, object> >();
        Dictionary <string, Object>         profileData    = new Dictionary <string, Object>();

        // lookup personid from FNO
        try
        {
            PersonList personProfileList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);
            if (personProfileList.Person.Count == 1)
            {
                Person          person         = personProfileList.Person[0];
                UserPreferences userPreference = _userBL.GetUserPreferences(personId);

                personData.Add("Name", person.Name.FullName);
                personData.Add("ProfilesURL", ConfigUtil.GetConfigItem("URLBase") + "ProfileDetails.aspx?Person=" + personId);

                /*personData.Add("SampleHTML", "<a href=\"" + ConfigUtil.GetConfigItem("URLBase") + "ProfileDetails.aspx?Person=" + personId +
                 *  "\" title=\"Go to UCSF Profiles, powered by CTSI\" rel=\"me\">View " + person.Name.FirstName + " " +
                 *  (person.Name.MiddleName != null && person.Name.MiddleName.Length > 0 ? person.Name.MiddleName + " " : "") + person.Name.LastName + "'s research profile</a>"); */

                if (person.EmailImageUrl.Visible)
                {
                    personData.Add("Email", person.EmailImageUrl.Text);
                }

                personData.Add("Address", person.Address);
                List <String> titles = new List <string>();
                foreach (AffiliationPerson aff in person.AffiliationList.Affiliation)
                {
                    if (aff.Primary)
                    {
                        personData.Add("Department", aff.DepartmentName);
                        personData.Add("School", aff.InstitutionName);
                    }
                    titles.Add(aff.JobTitle);
                }
                personData.Add("Titles", titles);

                if (userPreference.Narrative.Equals("Y"))
                {
                    personData.Add("Narrative", person.Narrative.Text);
                }

                if (userPreference.Photo.Equals("Y") && person.PhotoUrl.Visible)
                {
                    personData.Add("PhotoURL", ConfigUtil.GetConfigItem("URLBase") + "Thumbnail.ashx?id=" + personId);
                }

                if (userPreference.Publications.Equals("Y"))
                {
                    if (showPublications)
                    {
                        List <Object> pubList = new List <object>();
                        foreach (Publication pub in person.PublicationList)
                        {
                            Dictionary <string, Object> pubData = new Dictionary <string, Object>();
                            pubData.Add("PublicationID", pub.PublicationID);
                            pubData.Add("PublicationTitle", pub.PublicationReference);
                            //pubData.Add("PublicationAbstract", pub.PublicationDetails);

                            List <Object> pubSourceList = new List <object>();
                            foreach (PublicationSource pubSource in pub.PublicationSourceList)
                            {
                                Dictionary <string, Object> pubSourceData = new Dictionary <string, Object>();
                                pubSourceData.Add("PublicationSourceName", pubSource.Name);
                                pubSourceData.Add("PublicationSourceURL", (mobile ? pubSource.URL.Replace("/pubmed", "/m/pubmed") : pubSource.URL));
                                pubSourceData.Add("PublicationAddedBy", GetPublicationInclusionSource(personId, pubSource.ID));
                                pubSourceList.Add(pubSourceData);
                            }
                            pubData.Add("PublicationSource", pubSourceList);
                            pubList.Add(pubData);
                        }
                        personData.Add("Publications", pubList);
                    }
                    else
                    {
                        personData.Add("PublicationCount", person.PublicationList.Count());
                    }
                }

                // Co-authors
                List <int> coAuthors = new List <int>();
                foreach (CoAuthor ca in person.PassiveNetworks.CoAuthorList.CoAuthor)
                {
                    coAuthors.Add(Int32.Parse(ca.PersonID));
                }
                if (coAuthors.Count > 0)
                {
                    personData.Add("CoAuthors", coAuthors);
                }

                // Similiar People
                int        Count         = 0;
                List <int> similarPeople = new List <int>();
                foreach (DataRow row in _userBL.GetUserSimilarPeople(personId, "False", ref Count).Rows)
                {
                    similarPeople.Add((int)row.ItemArray[0]);
                }
                if (similarPeople.Count > 0)
                {
                    personData.Add("SimilarPeople", similarPeople);
                }

                // Keywords
                Count = 0;
                List <string> keywords = new List <string>();
                foreach (DataRow row in _userBL.GetUserMESHkeywords(personId, "True", ref Count).Rows)
                {
                    keywords.Add((string)row.ItemArray[0]);
                }
                if (keywords.Count > 0)
                {
                    personData.Add("Keywords", keywords);
                }

                // add person
                personDataList.Add(personData);
                profileData.Add("Profiles", personDataList);
            }
        }
        catch (Exception ex)
        {
            // do nothing
        }
        JavaScriptSerializer serializer = new JavaScriptSerializer();

        return(serializer.Serialize(profileData));
    }
Ejemplo n.º 16
0
    private string GetXMLProfiles(int personId)
    {
        PersonList personProfileList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);

        return(XmlUtilities.SerializeObject(personProfileList));
    }
Ejemplo n.º 17
0
    private void InitalizePage()
    {
        string profileId = Convert.ToString(Request.QueryString["Person"]);

        // Get a copy of the last search
        Profiles personQuery = new Profiles();
        personQuery.QueryDefinition = new QueryDefinition();
        personQuery.OutputOptions = new OutputOptions();
        personQuery.OutputOptions.StartRecord = "0";

        personQuery.QueryDefinition.Keywords = ((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Keywords;

        // Set the selection input parameter to the session variable holding the search request
        personQuery.QueryDefinition.PersonID = profileId;

        PublicationMatchDetailList pmdl = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetProfilePublicationMatchSummary(personQuery);

        personQuery.Version = 2;
        PersonList thisPerson = new Connects.Profiles.Service.ServiceImplementation.ProfileService().ProfileSearch(personQuery);
        lstViewHeader.DataSource = thisPerson.Person;
        lstViewHeader.DataBind();

        rptMatchingPubs.DataSource = thisPerson.Person[0].PublicationList;
        rptMatchingPubs.DataBind();

        lblSubTitle.Text = String.Format("Search Results to {0} {1}", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
        lblSubTitleCaptionText.Text = String.Format("This is a \"connection\" page, showing why {0} {1} matched the keywords from your search.", thisPerson.Person[0].Name.FirstName, thisPerson.Person[0].Name.LastName);
    }
    private void ShowSearchCriteria()
    {
        List<string> searchRequestList = (List<string>)Session["ProfileSearchRequestCriteriaList"];
        if (searchRequestList.Count > 0)
        {
            lstSearchCriteriaDisplay.DataSource = (List<string>)Session["ProfileSearchRequestCriteriaList"];
            lstSearchCriteriaDisplay.DataBind();
        }

        string keyword = "";

        if (this.txtKeyword.Text.Length > 0)
            keyword = this.txtKeyword.Text;
        else if (Session["ProfileSearchRequestKeywordList"] != null)
        {
            if (((List<string>)Session["ProfileSearchRequestKeywordList"]).Count > 0)
                keyword = ((List<string>)Session["ProfileSearchRequestKeywordList"])[0];
        }

        if (keyword.Length > 0)
        {
            Profiles searchReq = (Profiles)Session["ProfileSearchRequest"];
            string searchKeyword = searchReq.QueryDefinition.Keywords.KeywordString.Text;
            string queryId = searchReq.QueryDefinition.QueryID;
            KeywordMatchType matchType = searchReq.QueryDefinition.Keywords.KeywordString.MatchType;
            bool matchExact = (matchType == KeywordMatchType.exact) ? true : false;

            MatchingKeywordList keywordList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetMatchingKeywords(searchKeyword, queryId, matchExact);

            if (keywordList.Count > 0)
            {
                lstSearchKeywordDisplay.DataSource = keywordList;
                lstSearchKeywordDisplay.DataBind();
            }
        }
    }
    protected int GetPersonFromQueryString()
    {
        int personId = 0;

        if (Request.QueryString["Person"] != null)
        {
            if (!int.TryParse(Request.QueryString["Person"], out personId))
            {
                // get the internal personId from the profile search
                personId = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonIdFromInternalId("EcommonsUsername", Request.QueryString["Person"]);

                string sourceQuery = Request.Url.Query;
                string personQuery = sourceQuery.Substring(sourceQuery.IndexOf("Person="), 11);

                // replace the original URL with person modified for the integer
                string newUrl = Request.Url.OriginalString.Replace(personQuery, "Person=" + personId.ToString());

                // redirect to the new URL
                Response.Redirect(newUrl);
            }
        }

        return personId;
    }
 private string GetXMLProfiles(int personId)
 {
     PersonList personProfileList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);
     return XmlUtilities.SerializeObject(personProfileList);
 }
    private string GetJSONProfiles(int personId, bool showPublications, bool mobile)
    {
        Dictionary<string, Object> personData = new Dictionary<string, Object>();
        List<Dictionary<string, Object>> personDataList = new List<Dictionary<string, object>>();
        Dictionary<string, Object> profileData = new Dictionary<string, Object>();

        // lookup personid from FNO
        try
        {
            PersonList personProfileList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);
            if (personProfileList.Person.Count == 1)
            {
                Person person = personProfileList.Person[0];
                UserPreferences userPreference = _userBL.GetUserPreferences(personId);

                personData.Add("Name", person.Name.FullName);
                personData.Add("ProfilesURL", ConfigUtil.GetConfigItem("URLBase") + "ProfileDetails.aspx?Person=" + personId);
                /*personData.Add("SampleHTML", "<a href=\"" + ConfigUtil.GetConfigItem("URLBase") + "ProfileDetails.aspx?Person=" + personId +
                    "\" title=\"Go to UCSF Profiles, powered by CTSI\" rel=\"me\">View " + person.Name.FirstName + " " +
                    (person.Name.MiddleName != null && person.Name.MiddleName.Length > 0 ? person.Name.MiddleName + " " : "") + person.Name.LastName + "'s research profile</a>"); */

                if (person.EmailImageUrl.Visible)
                {
                    personData.Add("Email", person.EmailImageUrl.Text);
                }

                personData.Add("Address", person.Address);
                List<String> titles = new List<string>();
                foreach (AffiliationPerson aff in person.AffiliationList.Affiliation)
                {
                    if (aff.Primary)
                    {
                        personData.Add("Department", aff.DepartmentName);
                        personData.Add("School", aff.InstitutionName);
                    }
                    titles.Add(aff.JobTitle);
                }
                personData.Add("Titles", titles);

                if (userPreference.Narrative.Equals("Y"))
                {
                    personData.Add("Narrative", person.Narrative.Text);
                }

                if (userPreference.Photo.Equals("Y") && person.PhotoUrl.Visible)
                {
                    personData.Add("PhotoURL", ConfigUtil.GetConfigItem("URLBase") + "Thumbnail.ashx?id=" + personId);
                }

                if (userPreference.Publications.Equals("Y"))
                {
                    if (showPublications)
                    {
                        List<Object> pubList = new List<object>();
                        foreach (Publication pub in person.PublicationList)
                        {
                            Dictionary<string, Object> pubData = new Dictionary<string, Object>();
                            pubData.Add("PublicationID", pub.PublicationID);
                            pubData.Add("PublicationTitle", pub.PublicationReference);
                            //pubData.Add("PublicationAbstract", pub.PublicationDetails);

                            List<Object> pubSourceList = new List<object>();
                            foreach (PublicationSource pubSource in pub.PublicationSourceList)
                            {
                                Dictionary<string, Object> pubSourceData = new Dictionary<string, Object>();
                                pubSourceData.Add("PublicationSourceName", pubSource.Name);
                                pubSourceData.Add("PublicationSourceURL", (mobile ? pubSource.URL.Replace("/pubmed", "/m/pubmed") : pubSource.URL) );
                                pubSourceData.Add("PublicationAddedBy", GetPublicationInclusionSource(personId, pubSource.ID));
                                pubSourceList.Add(pubSourceData);
                            }
                            pubData.Add("PublicationSource", pubSourceList);
                            pubList.Add(pubData);
                        }
                        personData.Add("Publications", pubList);
                    }
                    else
                    {
                        personData.Add("PublicationCount", person.PublicationList.Count());
                    }
                }

                // Co-authors
                List<int> coAuthors = new List<int>();
                foreach (CoAuthor ca in person.PassiveNetworks.CoAuthorList.CoAuthor)
                {
                    coAuthors.Add(Int32.Parse(ca.PersonID));
                }
                if (coAuthors.Count > 0)
                {
                    personData.Add("CoAuthors", coAuthors);
                }

                // Similiar People
                int Count = 0;
                List<int> similarPeople = new List<int>();
                foreach (DataRow row in _userBL.GetUserSimilarPeople(personId, "False", ref Count).Rows)
                {
                    similarPeople.Add((int)row.ItemArray[0]);
                }
                if (similarPeople.Count > 0)
                {
                    personData.Add("SimilarPeople", similarPeople);
                }

                // Keywords
                Count = 0;
                List<string> keywords = new List<string>();
                foreach (DataRow row in _userBL.GetUserMESHkeywords(personId, "True", ref Count).Rows)
                {
                    keywords.Add((string)row.ItemArray[0]);
                }
                if (keywords.Count > 0)
                {
                    personData.Add("Keywords", keywords);
                }

                // add person
                personDataList.Add(personData);
                profileData.Add("Profiles", personDataList);
            }

        }
        catch (Exception ex)
        {
            // do nothing
        }
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        return serializer.Serialize(profileData);
    }
    protected void dlPeopleList_OnItemDataBound(Object sender, DataListItemEventArgs e)
    {
        DataRowView drv = (DataRowView)e.Item.DataItem;
        HyperLink hypLnk;
        Label lbl;
        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {                                                                                 //To check if the BirthDate has null values
            if (drv.Row["PersonId"].ToString() != DBNull.Value.ToString())
            {

                hypLnk = (HyperLink)(e.Item.FindControl("hypLnkPeopleList"));
                //
                hypLnk.NavigateUrl = "~\\ProfileDetails.aspx?From=SE&Person=" + drv["PersonId"].ToString();
            }
        }
        if (e.Item.ItemType != ListItemType.Footer)
        {
            lbl = (Label)(e.Item.FindControl("LblRowNo"));
            lbl.Text = Convert.ToString(e.Item.ItemIndex + 1);
            lbl.Style.Add("Color", "#333");
            lbl.Visible = true;

            if (drv.Row["CoAuthor"] != null)
            {
                if (drv.Row["CoAuthor"].ToString().Length > 0)
                {
                    _showSimilarCoauthors = true;
                }
            }
        }
        else
        {
            PlaceHolder phSimilarCoauthors = (PlaceHolder)(e.Item.FindControl("phSimilarCoauthors"));
            phSimilarCoauthors.Visible = _showSimilarCoauthors;

            int personId = GetPersonFromQueryString();

            PersonList pList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(personId);

            //if (pList.Person[0].Address.Latitude > 0)
            //{
            //    HyperLink hypLnkMap = (HyperLink)(e.Item.FindControl("hypNeighborMap"));
            //    hypLnkMap.NavigateUrl = "~/gpeople.aspx?person=" + personId.ToString();
            //}
            //else
            //{
            //    PlaceHolder ph = (PlaceHolder)(e.Item.FindControl("phGoogleMap"));
            //    ph.Visible = false;
            //}
        }
    }
Ejemplo n.º 23
0
    private void ShowSearchCriteria()
    {
        //ListItem li = new ListItem(((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Name.FirstName.Text,
        List<string> searchRequestList = (List<string>)Session["ProfileSearchRequestCriteriaList"];
        if (searchRequestList.Count > 0)
        {
            lstSearchCriteriaDisplay.DataSource = (List<string>)Session["ProfileSearchRequestCriteriaList"];
            lstSearchCriteriaDisplay.DataBind();
        }

        string keyWords = Convert.ToString(((Profiles)Session["ProfileSearchRequest"]).QueryDefinition.Keywords.KeywordString.Text);

        if (keyWords != null)
        {
            Profiles searchReq = (Profiles)Session["ProfileSearchRequest"];
            string keyword = searchReq.QueryDefinition.Keywords.KeywordString.Text;
            string queryId = searchReq.QueryDefinition.QueryID;
            KeywordMatchType matchType = searchReq.QueryDefinition.Keywords.KeywordString.MatchType;
            bool matchExact = (matchType == KeywordMatchType.exact) ? true : false;

            MatchingKeywordList keywordList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetMatchingKeywords(keyword, queryId, matchExact);

            if (keywordList.Count > 0)
            {
                lstSearchKeywordDisplay.DataSource = keywordList;
                lstSearchKeywordDisplay.DataBind();
            }
        }
    }