예제 #1
0
        protected void NextStep()
        {
            //if (!err)//no errors. Move the progression forward.
            //{
            if (mode == Constants.QueryStrings.Registration.ModeEdit)
            {
                Response.Redirect(MyProfileItem.GetMyProfilePage().GetUrl());
            }

            Response.Redirect(MyProfileStepFiveItem.GetCompleteMyProfileStepFive().GetUrl());
            //}
        }
예제 #2
0
        protected void DoNextStep()
        {
            string redirect = "/";

            //if here via edit OR add
            if (status == Constants.QueryStrings.Registration.ModeAdd || status == Constants.QueryStrings.Registration.ModeEdit)
            {
                redirect = MyProfileItem.GetMyProfilePage().GetUrl();
            }
            else if (this.registeringUser.Children.Where(x => x.Issues.Count == 0).Count() > 0)
            {
                redirect = MyProfileStepTwoItem.GetCompleteMyProfileStepTwo().GetUrl();
            }
            else
            {
                redirect = MyProfileStepFourItem.GetCompleteMyProfileStepFour().GetUrl();
            }

            //move onto next step
            Response.Redirect(redirect);
        }
        protected void DoNextStep()
        {
            string redirect = "/";

            if (singleChild.EvaluationStatus == Guid.Parse(Constants.ChildEvaluation.StatusEvaluationYes))
            {
                //eval = yes, always show page 3
                redirect = MyProfileStepThreeItem.GetCompleteMyProfileStepThree().GetUrl();

                //add current status to query string if present
                if (!string.IsNullOrEmpty(status))
                {
                    redirect += "?" + Constants.QueryStrings.Registration.Mode + "=" + status;
                }
            }
            else if (status == Constants.QueryStrings.Registration.ModeEdit || status == Constants.QueryStrings.Registration.ModeAdd)
            {
                //go back to my profile
                redirect = MyProfileItem.GetMyProfilePage().GetUrl();
            }
            else
            {
                //CMP process
                if (this.registeringUser.Children.Where(x => x.Issues.Count == 0).Count() > 0)
                {
                    //more children, go to step 2
                    redirect = MyProfileStepTwoItem.GetCompleteMyProfileStepTwo().GetUrl();
                }
                else
                {
                    //no more children to deal with, go to step 4
                    redirect = MyProfileStepFourItem.GetCompleteMyProfileStepFour().GetUrl();
                }
            }

            Response.Redirect(redirect);
        }
        private void Page_Load(object sender, EventArgs e)
        {
            if (this.CurrentMember == null && this.CurrentUser == null)
            {
                if (!string.IsNullOrEmpty(CurrentPage.SignInPage.Url))
                {
                    Response.Redirect(CurrentPage.SignInPage.Url);
                }
                else
                {
                    Response.Redirect("/");
                }
            }

            if (!IsPostBack)
            {
                //update member
                MembershipManager membershipManager = new MembershipManager();
                this.CurrentMember = membershipManager.GetMember(this.CurrentMember.MemberId);
                this.CurrentUser   = membershipManager.GetUser(this.CurrentMember.MemberId, true);

                MyProfileItem context = (MyProfileItem)Sitecore.Context.Item;
                HyperLink     myHL    = (HyperLink)this.FindControl("uxAddChild");
                myHL.Text = context.AddChildText;

                SetLabels();
                SetRole();

                uxChildList.DataSource = this.CurrentMember.Children;
                uxChildList.DataBind();

                //disable new children if you already have 6 or more
                if (this.CurrentMember.Children.Count >= 6)
                {
                    uxAddChild.Visible = false;
                }

                SetInterests();

                uxEmailAddress.Text = txtEmail.Text = this.CurrentUser.UserName;


                SetJourney();

                uxPassword.Text = replacePassword("digitalpulp!");

                string phoneNumber = string.Empty;

                if (!string.IsNullOrEmpty(this.CurrentMember.MobilePhoneNumber))
                {
                    phoneNumber = this.CurrentMember.MobilePhoneNumber.Replace("-", string.Empty).Trim();

                    //if (phoneNumber.Length == 10 && !phoneNumber.Contains("-"))
                    //{
                    phoneNumber = phoneNumber.Insert(3, "-");
                    phoneNumber = phoneNumber.Insert(7, "-");
                    //}
                }
                else
                {
                    //10 points to Gryffindor if you know where this phone number comes from
                    txtPhoneNumber.Attributes["placeholder"] = "212-555-2368";
                }

                uxPhoneNumber.Text  = phoneNumber;
                txtPhoneNumber.Text = phoneNumber;

                uxPrivacyLevel.Text = this.CurrentMember.allowConnections ? DictionaryConstants.OpenToConnect : DictionaryConstants.NotOpenToConnect;

                uxScreenname.Text = this.CurrentMember.ScreenName;

                uxZipcode.Text = this.CurrentMember.ZipCode.Trim();

                uxAddChild.Text        = string.Format(uxAddChild.Text, ((ChildCount)this.CurrentMember.Children.Count).ToString());
                uxAddChild.NavigateUrl = MyProfileStepTwoItem.GetCompleteMyProfileStepTwo().GetUrl() + "?" + Constants.QueryStrings.Registration.Mode + "=" + Constants.QueryStrings.Registration.ModeAdd;

                if (Session["PostReloadScript"] != null)
                {
                    string reloadScript = Session["PostReloadScript"].ToString();

                    if (reloadScript != "")
                    {
                        ltlJS.Text = string.Format("<script type=\"text/javascript\">{0}</script>", reloadScript);
                        Session["PostReloadScript"] = null;
                    }
                }

                //top of edit interests
                hypEditCommunityAboutMe.NavigateUrl = String.Format(MyProfileStepFourItem.GetCompleteMyProfileStepFour().GetUrl() + "?{0}={1}", Constants.QueryStrings.Registration.Mode, Constants.QueryStrings.Registration.ModeEdit);

                //jump to edit community
                hypEditCommunity.NavigateUrl = hypCompleteYourProfile.NavigateUrl = String.Format(MyProfileStepFourItem.GetCompleteMyProfileStepFour().GetUrl() + "?{0}={1}#community", Constants.QueryStrings.Registration.Mode, Constants.QueryStrings.Registration.ModeEdit);

                if (!string.IsNullOrEmpty(this.CurrentMember.ScreenName))
                {
                    hypViewAsVisitors.NavigateUrl = MembershipHelper.GetPublicProfileAsVisitorUrl(CurrentMember.ScreenName);
                    hypViewAsMembers.NavigateUrl  = MembershipHelper.GetPublicProfileAsMemberUrl(CurrentMember.ScreenName);
                    hypViewAsFriends.NavigateUrl  = MembershipHelper.GetPublicProfileUrl(CurrentMember.ScreenName);
                }
                else
                {
                    uxNoProfile.Visible  = true;
                    uxPublicView.Visible = false;
                }
            }
        }
예제 #5
0
        protected void NextButton_Click(object sender, EventArgs e)
        {
            var child = new Child();

            if ((uxBoy1.Checked || uxGirl1.Checked) && uxSelectGrade1.SelectedValue != string.Empty)
            {
                child.Grades.Add(new Grade()
                {
                    Key = Constants.GradesByValue[uxSelectGrade1.SelectedValue]
                });
                child.Gender = uxBoy1.Checked ? "boy" : "girl";
                //CurrentMember.Children.Add(child);
            }

            var issues = new List <Issue>();

            if (q1a1.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(0).Key, Value = Constants.Issues.ElementAt(0).Value
                });
            }
            if (q1a2.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(1).Key, Value = Constants.Issues.ElementAt(1).Value
                });
            }
            if (q1a3.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(2).Key, Value = Constants.Issues.ElementAt(2).Value
                });
            }
            if (q1a4.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(3).Key, Value = Constants.Issues.ElementAt(3).Value
                });
            }
            if (q1a5.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(4).Key, Value = Constants.Issues.ElementAt(4).Value
                });
            }
            if (q1a6.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(5).Key, Value = Constants.Issues.ElementAt(5).Value
                });
            }
            if (q1a7.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(6).Key, Value = Constants.Issues.ElementAt(6).Value
                });
            }
            if (q1a8.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(7).Key, Value = Constants.Issues.ElementAt(7).Value
                });
            }
            if (q1a9.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(8).Key, Value = Constants.Issues.ElementAt(8).Value
                });
            }
            if (q1a10.Checked)
            {
                issues.Add(new Issue()
                {
                    Key = Constants.Issues.ElementAt(9).Key, Value = Constants.Issues.ElementAt(9).Value
                });
            }

            child.Issues   = issues;
            child.Nickname = ScreenNameTextBox.Text;
            // handle redirects
            if (!q2a1.Checked) // Has (child) been formally evauluated for ...
            {
                //BG: Set alternative child evaulation status
                if (q2a2.Checked)//BG: Child has not been evaluated
                {
                    child.EvaluationStatus = new Guid(Constants.ChildEvaluation.StatusEvaluationNo);
                }
                else if (q2a3.Checked)//BG: Child evaluation is in progress
                {
                    child.EvaluationStatus = new Guid(Constants.ChildEvaluation.StatusEvaluationInProgress);
                }
            }
            else
            {
                child.EvaluationStatus = new Guid(Constants.ChildEvaluation.StatusEvaluationYes);

                if (uxIEPStatus.SelectedValue != string.Empty)
                {
                    child.IEPStatus = Guid.Parse(uxIEPStatus.SelectedValue);
                }

                if (ux504Status.SelectedValue != string.Empty)
                {
                    child.Section504Status = Guid.Parse(ux504Status.SelectedValue);
                }

                foreach (var item in uxLeftList.Items)
                {
                    var check = item.FindControl("diagnosis") as CheckBox;
                    if (check != null && check.Checked)
                    {
                        child.Diagnoses.Add(new Domain.Membership.Diagnosis()
                        {
                            Key = Guid.Parse(check.Attributes["guid"])
                        });
                    }
                }

                foreach (var item in uxRightList.Items)
                {
                    var check = item.FindControl("diagnosis") as CheckBox;
                    if (check != null && check.Checked)
                    {
                        child.Diagnoses.Add(new Domain.Membership.Diagnosis()
                        {
                            Key = Guid.Parse(check.Attributes["guid"])
                        });
                    }
                }
            }

            CurrentMember.Children.Add(child);

            var membershipManager = new MembershipManager();

            membershipManager.UpdateMember(CurrentMember);

            Response.Redirect(MyProfileItem.GetMyProfilePage().InnerItem.GetUrl());
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            litNotificationsLabel.Text = DictionaryConstants.NotificationsButtonLabel;
            if (IsUserLoggedIn)
            {
                MyProfilePage = MyProfileItem.GetMyProfilePage();
                MyAccountPage = MyAccountItem.GetMyAccountPage();

                btnUpload.Text = MyAccountPage.AvatarUploadButtonText.Rendered;

                var accountPages = MyAccountPage.GetAccountPages();
                rptrAccountNav.DataSource = accountPages;
                rptrAccountNav.DataBind();

                hlSectionTitle.NavigateUrl = MainsectionItem.GetHomePageItem().GetUrl();
                frSectionTitle.Item        = MainsectionItem.GetHomePageItem();

                if (CurrentMember.ZipCode != null)
                {
                    if (!string.IsNullOrEmpty(CurrentMember.ScreenName))
                    {
                        litLocation.Text = Services.CommunityServices.GeoTargeting.GetStateByZip(CurrentMember.ZipCode);
                    }
                }

                if (!String.IsNullOrEmpty(CurrentMember.ScreenName))
                {
                    List <INotification> notifs      = new  List <INotification>();
                    List <Conversation>  checkConvos = new List <Conversation>();
                    if (Notifications == null)
                    {
                        notifs = TelligentService.GetNotifications(CurrentMember.ScreenName);
                        if (notifs != null && notifs.Count() > 0)
                        {
                            //spnCount.Visible = true;
                            //litNotifCount.Text = notifs.Count().ToString();
                            Notifications = notifs;
                        }
                        else
                        {
                            notifs        = new List <INotification>();
                            Notifications = notifs;
                        }
                    }
                    else
                    {
                        notifs = Notifications;
                    }

                    if (Conversations == null)
                    {
                        checkConvos = TelligentService.GetConversations(CurrentMember.ScreenName, Constants.TelligentConversationStatus.Unread);
                        if (checkConvos != null && checkConvos.Count() > 0)
                        {
                            Conversations = checkConvos;
                        }
                        else
                        {
                            checkConvos   = new List <Conversation>();
                            Conversations = checkConvos;
                        }
                    }
                    else
                    {
                        checkConvos = Conversations;
                    }
                    int totalNotifs = notifs.Count() + checkConvos.Count();
                    if (totalNotifs > 0)
                    {
                        spnCount.Visible   = true;
                        litNotifCount.Text = totalNotifs.ToString();
                    }
                    else
                    {
                        spnCount.Visible = false;
                    }
                }
            }
            else
            {
                Response.Redirect(MainsectionItem.GetHomePageItem().GetUrl());
            }

            if (CurrentMember != null && !string.IsNullOrEmpty(CurrentMember.ScreenName))
            {
                try
                {
                    User user = TelligentService.GetUser(this.CurrentMember.ScreenName);
                    if (user != null)
                    {
                        userAvatar.Src = user.AvatarUrl;
                    }
                }
                catch { }
            }

            //if (!IsPostBack)
            //{
            //    try
            //    {
            //        if (CurrentMember.ScreenName != null)
            //        {
            //            userAvatar.Src = TelligentService.GetUser(this.CurrentMember.ScreenName).AvatarUrl;
            //        }
            //    }
            //    catch { }
            //}
        }