public string MapToSitecoreInterest(string GUID)
        {
            ParentInterestItem temp = Sitecore.Context.Database.GetItem(new Guid(GUID));

            if (temp != null)
            {
                return(temp.InterestName);
            }

            return("");
        }
示例#2
0
        protected void rptArticleInterests_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                ParentInterestItem item = (ParentInterestItem)e.Item.DataItem;

                Literal litInterest = e.FindControlAs <Literal>("litInterest");

                litInterest.Text = (_parentInterests.Contains(item.ID.ToGuid()))
                    ? HighlightMatch(item.InterestName.Rendered) : item.InterestName.Rendered;
            }
        }
        void rptIssues_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                ParentInterestItem interest    = (ParentInterestItem)e.Item.DataItem;
                Literal            litInterest = e.FindControlAs <Literal>("litInterest");
                HiddenField        hfInterest  = e.FindControlAs <HiddenField>("hfInterest");

                litInterest.Text = interest.InterestName.Raw;
                hfInterest.Value = interest.ID.ToString();
            }
        }
示例#4
0
        protected void rptInterests_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                Interest interest = (Interest)e.Item.DataItem;

                Literal            litInterest = e.FindControlAs <Literal>("litInterest");
                ParentInterestItem pii         = Sitecore.Context.Database.GetItem(interest.Key);
                if (pii != null)
                {
                    litInterest.Text = pii.InterestName.Rendered;
                }
            }
        }
示例#5
0
        protected void rptChildRelatedArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;
                {
                    HyperLink hlArticleImage = e.FindControlAs <HyperLink>("hlArticleImage");
                    HyperLink hlArticleTitle = e.FindControlAs <HyperLink>("hlArticleTitle");

                    hlArticleImage.NavigateUrl = hlArticleTitle.NavigateUrl = item.InnerItem.GetUrl();

                    Image imgThumbnail = e.FindControlAs <Image>("imgThumbnail");
                    imgThumbnail.ImageUrl = item.GetArticleThumbnailUrl(150, 85);

                    // DEBUG - START
                    Literal litDebugTag = e.FindControlAs <Literal>("litDebugTag");

                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine("");
                    sb.AppendLine("Sitecore web db tagging:");
                    sb.AppendLine("Grades:");

                    foreach (var grade in item.ChildGrades.ListItems)
                    {
                        GradeLevelItem gli = grade;
                        sb.AppendLine(HttpUtility.HtmlDecode(gli.Name.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Issues:");

                    foreach (var issue in item.ChildIssues.ListItems)
                    {
                        ChildIssueItem cii = issue;
                        sb.AppendLine(HttpUtility.HtmlDecode(cii.IssueName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Child Diagnoses:");

                    foreach (var diagnosis in item.ChildDiagnoses.ListItems)
                    {
                        ChildDiagnosisItem cdi = diagnosis;
                        sb.AppendLine(HttpUtility.HtmlDecode(cdi.DiagnosisName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Interests:");

                    foreach (var interest in item.ApplicableInterests.ListItems)
                    {
                        ParentInterestItem pii = interest;
                        sb.AppendLine(HttpUtility.HtmlDecode(pii.InterestName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Evaluations:");

                    foreach (var itemEval in item.OtherApplicableEvaluations.ListItems)
                    {
                        sb.AppendLine(itemEval.Name);
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Diagnosed:");

                    foreach (var diag in item.DiagnosedCondition.ListItems)
                    {
                        sb.AppendLine(diag.Name);
                    }

                    sb.AppendLine("");

                    bool excluded = item.OverrideType.ListItems
                                    .Where(x => x.ID == Sitecore.Data.ID.Parse(Constants.ArticleTags.ExcludeFromPersonalization))
                                    .FirstOrDefault() != null;

                    sb.AppendLine(String.Format("Exclude from Personalization: {0}", excluded.ToString().ToLower()));

                    bool mustRead = item.ImportanceLevel.ListItems
                                    .Where(x => x.ID == Sitecore.Data.ID.Parse(Constants.ArticleTags.MustRead))
                                    .FirstOrDefault() != null;

                    sb.AppendLine(String.Format("Must read: {0}", mustRead.ToString().ToLower()));

                    sb.AppendLine(String.Format("Timely: {0}", IsTimely(item.DateStart.DateTime, item.DateEnd.DateTime).ToString()));

                    sb.AppendLine("");



                    Article article = SearchHelper.GetArticle(item.ID);
                    if (article != null)
                    {
                        sb.AppendLine("Solr index:");
                        sb.AppendLine("Grades:");

                        foreach (var grade in article.ChildGrades)
                        {
                            GradeLevelItem gli = Sitecore.Context.Database.GetItem(grade.Guid);
                            if (gli != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(gli.Name.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Issues:");

                        foreach (var issue in article.ChildIssues)
                        {
                            ChildIssueItem cii = Sitecore.Context.Database.GetItem(issue.Guid);
                            if (cii != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(cii.IssueName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Child Diagnoses:");

                        foreach (var diagnosis in article.ChildDiagnoses)
                        {
                            ChildDiagnosisItem cdi = Sitecore.Context.Database.GetItem(diagnosis.Guid);
                            if (cdi != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(cdi.DiagnosisName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Interests:");

                        foreach (var interest in article.ParentInterests)
                        {
                            ParentInterestItem pii = Sitecore.Context.Database.GetItem(interest.Guid);
                            if (pii != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(pii.InterestName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Evaluations:");

                        foreach (var itemEval in article.ApplicableEvaluations)
                        {
                            Item i = Sitecore.Context.Database.GetItem(itemEval);
                            if (i != null)
                            {
                                sb.AppendLine(i.Name);
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Diagnosed:");

                        foreach (var diag in article.DiagnosedConditions)
                        {
                            Item i = Sitecore.Context.Database.GetItem(diag);
                            if (i != null)
                            {
                                sb.AppendLine(i.Name);
                            }
                        }

                        sb.AppendLine("");

                        bool excludedTag = article.OverrideTypes.Contains(Sitecore.Data.ID.Parse(Constants.ArticleTags.ExcludeFromPersonalization));

                        sb.AppendLine(String.Format("Exclude from Personalization: {0}", excludedTag.ToString().ToLower()));

                        bool mustReadTag = article.ImportanceLevels.Contains(Sitecore.Data.ID.Parse(Constants.ArticleTags.MustRead));
                        sb.AppendLine(String.Format("Must read: {0}", mustReadTag.ToString().ToLower()));

                        sb.AppendLine(String.Format("Timely: {0}", IsTimely(article.TimelyStart, article.TimelyEnd)));
                    }

                    litDebugTag.Text = String.Format("<!--{0}-->", sb.ToString());
                    // DEBUG - END
                }
            }
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            mode = Request.QueryString[Constants.QueryStrings.Registration.Mode];

            //string schoolIssueContainer = Constants.SchoolIssueContainer.ToString();
            //string homeLifeContainer = Constants.HomeLifeContainer.ToString();
            //string growingUpContainer = Constants.GrowingUpContainer.ToString();
            //string socialEmotionalContainer = Constants.SocialEmotionalContainer.ToString();
            //string techAppsContainer = Constants.TechAppsContainer.ToString();
            //string waysToHelpContainer = Constants.WaysToHelpContainer.ToString();
            //string parentRolesContainer = "{E5F45505-9153-4AA3-BFCC-04F3808E8AC5}";
            //string parentJourneyContainer = "{40D1F458-746D-4649-A03E-E3729F6C9117}";

            if (!IsPostBack)
            {
                this.registeringUser = CurrentMember;
                //ScreenNameTextField.Text = DictionaryConstants.ScreenNameWatermark;
                ScreenNameTextField.Attributes["placeholder"] = DictionaryConstants.ScreenNameWatermark;
                //ZipCodeTextField.Text = DictionaryConstants.ZipCodeWatermark;
                ZipCodeTextField.Attributes["placeholder"] = DictionaryConstants.ZipCodeWatermark;
                SubmitButton.Text = DictionaryConstants.SubmitButtonText;

                if (mode == Constants.QueryStrings.Registration.ModeEdit)
                {
                    divProgressBar.Visible = false;
                    if (!string.IsNullOrEmpty(registeringUser.ScreenName))
                    {
                        ScreenNameTextField.Text    = this.registeringUser.ScreenName;
                        ScreenNameTextField.Enabled = false;
                    }
                    if (!string.IsNullOrEmpty(registeringUser.ZipCode))
                    {
                        ZipCodeTextField.Text = this.registeringUser.ZipCode;
                    }

                    if (this.registeringUser.Role != null)
                    {
                        if (this.registeringUser.Role == Guid.Parse("{890F06AF-284E-43E1-9647-0EFEEB000526}"))
                        {
                            uxMotherButton.Checked = true;
                        }
                        else
                        {
                            if (this.registeringUser.Role == Guid.Parse("{2BF9D7BE-2E40-432C-ADE7-A25C80B9B9EE}"))
                            {
                                uxFatherButton.Checked = true;
                            }
                            else
                            {
                                if (uxParentList.Items.FindByValue(this.registeringUser.Role.ToString()) != null)
                                {
                                    uxParentList.ClearSelection();
                                    uxParentList.Items.FindByValue(this.registeringUser.Role.ToString()).Selected = true;
                                }
                            }
                        }
                    }

                    if (this.registeringUser.allowConnections)
                    {
                        cbConnections.Checked = true;
                    }

                    if (this.registeringUser.allowNewsletter)
                    {
                        cbNewsLetter.Checked = true;
                    }
                }



                //var schoolIssues = Sitecore.Context.Database.GetItem(schoolIssueContainer).Children.ToList();
                var schoolIssues = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/School Issues/");

                uxSchoolLeft.DataSource = schoolIssues.Take(schoolIssues.Count() / 2);
                uxSchoolLeft.DataBind();

                uxSchoolRight.DataSource = schoolIssues.Skip(schoolIssues.Count() / 2);
                uxSchoolRight.DataBind();

                //var homeLife = Sitecore.Context.Database.GetItem(homeLifeContainer).Children.ToList();
                var homeLife = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/Home Life/");

                uxHomeLife.DataSource = homeLife;
                uxHomeLife.DataBind();

                //var growingUp = Sitecore.Context.Database.GetItem(growingUpContainer).Children.ToList();
                var growingUp = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/Growing Up/");

                uxGrowingUp.DataSource = growingUp;
                uxGrowingUp.DataBind();

                //var socialEmotional = Sitecore.Context.Database.GetItem(socialEmotionalContainer).Children.ToList();
                var socialEmotional = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/Social or Emotional Issues/");

                uxSocialEmotional.DataSource = socialEmotional;
                uxSocialEmotional.DataBind();

                //var techApps = Sitecore.Context.Database.GetItem(techAppsContainer).Children.ToList();
                var techApps = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/Technologies and Apps/");

                //var waysToHelp = Sitecore.Context.Database.GetItem(waysToHelpContainer).Children.ToList();
                var waysToHelp = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Interest/Ways to Help Your Child/");

                uxWaysToHelp.DataSource = waysToHelp;
                uxWaysToHelp.DataBind();

                //var parentJourney = Sitecore.Context.Database.GetItem(parentJourneyContainer).Children.ToList();
                var parentJourney = ParentInterestItem.GetParentInterests("/sitecore/content/Globals/Content Taxonomies/Parent Related/Parent Journey/");

                uxJourney.DataSource = parentJourney;
                uxJourney.DataBind();

                //var parentRoles = Sitecore.Context.Database.GetItem(parentRolesContainer).Children.ToList();
                var parentRoles = ParentRoleItem.GetParentRoles();

                uxFather.Text = parentRoles.ElementAt(0).RoleName.Rendered; // RoleName.Rendered;
                uxMother.Text = parentRoles.ElementAt(1).RoleName.Rendered; // .RoleName.Rendered;

                var otherRoles = new List <ListItem>();

                foreach (var item in parentRoles.Skip(2))
                {
                    otherRoles.Add(new ListItem()
                    {
                        Value = item.ID.Guid.ToString(), Text = item.RoleName.Text
                    });
                }

                uxParentList.DataSource     = otherRoles;
                uxParentList.DataTextField  = "Text";
                uxParentList.DataValueField = "Value";
                uxParentList.DataBind();

                uxParentList.Items.Insert(0, new ListItem()
                {
                    Text = DictionaryConstants.ParentRoleDefault, Value = string.Empty
                });
            }
        }