protected void Page_Load(object sender, EventArgs e)
        {
            currentClub = SitecoreHelper.GetCurrentClub(currentItem);

            if (currentClub != null)
            {
                ClubHomeUrl = LinkManager.GetItemUrl(currentClub.InnerItem);
                ClubName = currentClub.Clubname.Raw;

                //Set Book Online Link
                if (currentClub.GetCrmSystem() == ClubCrmSystemTypes.ClubCentric || currentClub.GetCrmSystem() == ClubCrmSystemTypes.Vision)
                {
                    //Show link
                    pnlBookOnline.Visible = true;
                    BookOnlineUrl = SitecoreHelper.GetMembershipLoginUrl(currentClub);
                }
            }

            if (currentItem.InnerItem.HasChildren)
            {
                List<TimetableDownloadModuleItem> moduleList = currentItem.InnerItem.Children.ToList().ConvertAll(X => new TimetableDownloadModuleItem(X));

                DownloadModuleListing.DataSource = moduleList;
                DownloadModuleListing.DataBind();
            }

            //Set club last visited
            User objUser = new User();
            if (Session["sess_User"] != null)
            {
                objUser = (User)Session["sess_User"];
            }
            objUser.ClubLastVisitedID = currentClub.ClubId.Rendered;
            Session["sess_User"] = objUser;

            //Set club last visited cookie
            CookieHelper.AddClubsLastVisitedCookie(CookieKeyNames.ClubLastVisited, currentClub.ClubId.Rendered);

            //Add club name to page title
            string clubNameTitle = String.Format(" - {0}", currentClub.Clubname.Raw);
            clubNameTitle = HtmlRemoval.StripTagsCharArray(clubNameTitle);

            Page.Title = Page.Title + clubNameTitle;
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //get the details of the club
            ClubItem currentClub = new ClubItem(Sitecore.Context.Item.Axes.SelectSingleItem(String.Format(@"ancestor-or-self::*[@@tid=""{0}"" or @@tid=""{1}""]", ClassicClubItem.TemplateId, LifeCentreItem.TemplateId)));

            if (currentClub.GetCrmSystem() == ClubCrmSystemTypes.ClubCentric)
            {
                //Load the download timetable area
                ClubTimetable clubTimetable = Page.LoadControl("~/layouts/virginactive/club/ClubFeedback.ascx") as ClubTimetable;
                PagePh.Controls.Add(clubTimetable);
            }
            else
            {
                //Load rendered time tables
                ClubTimeTableDownload clubTimetableDownload = Page.LoadControl("~/layouts/virginactive/club/ClubKidsFeedback.ascx") as ClubTimeTableDownload;
                PagePh.Controls.Add(clubTimetableDownload);
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            club = SitecoreHelper.GetCurrentClub(Sitecore.Context.Item);
            Club current = new Club(club.InnerItem);
            //Set Esporta Flag or classic club flag
            if (current.IsClassic) //Classic club flag overrides exesporta
            {
                EsportaFlag.Text = String.Format(@"<span class=""prev-esporta""><span class=""prev-by"">{0}</span> {1}</span>", Translate.Text("by"), Translate.Text("VIRGIN ACTIVE CLASSIC"));
            } else if (club.GetCrmSystem() == ClubCrmSystemTypes.ClubCentric)
            {
                if (EsportaFlag != null)
                {
                    EsportaFlag.Text = @"<span class=""prev-esporta""> <span class=""prev-by"">" + Translate.Text("previously") + "</span> " + Translate.Text("ESPORTA") + "</span>";
                }
            }

            //Set club last visited
            User objUser = new User();
            if (Session["sess_User"] != null)
            {
                objUser = (User)Session["sess_User"];
            }
            if (objUser.ShowGallery)
            {
                HtmlGenericControl BodyTag = (HtmlGenericControl)this.Page.FindControl("BodyTag");
                string classNames = BodyTag.Attributes["class"] != null ? BodyTag.Attributes["class"] : "";
                BodyTag.Attributes.Add("class", classNames.Length > 0 ? classNames + " gallery_open" : "gallery_open");
            }
            objUser.ClubLastVisitedID = club.ClubId.Rendered;
            Session["sess_User"] = objUser;

            //Set club last visited cookie
            if (objUser.Preferences != null)
            {
                if (objUser.Preferences.PersonalisedCookies)
                {
                    CookieHelper.AddClubsLastVisitedCookie(CookieKeyNames.ClubLastVisited, club.ClubId.Rendered);
                }
            }

            //Retrieve CSS class
            string rawParameters = Attributes["sc_parameters"];
            NameValueCollection parameters = Sitecore.Web.WebUtil.ParseUrlParameters(rawParameters);
            if (!String.IsNullOrEmpty(parameters["OneColumn"]))
            {
                OneColumn = Convert.ToBoolean(parameters["OneColumn"]);
            }

            if (!String.IsNullOrEmpty(parameters["HasPanels"]))
            {
                Panels = Convert.ToBoolean(parameters["HasPanels"]) ? "-panels" : "";
            }

            //Add club name to page title
            string clubNameTitle = String.Format(" - {0}", club.Clubname.Raw);
            clubNameTitle = HtmlRemoval.StripTagsCharArray(clubNameTitle);

            Page.Title = Page.Title + clubNameTitle;

            this.Page.FindControl("ScriptPh").Controls.Add(new LiteralControl(@"<script>
                $(function(){
                    $('.va-overlay-link').vaOverlay({showMap:true });
                    $(""#carousel"").orbit({directionalNav:true, viewGallery:true });
                    $.va_init.functions.clubsSetup();
                });
                </script>"));
        }
Exemplo n.º 4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                //check if we have a valid club selected
                Boolean blnClubSuccessfullySelected = clubFindSelect.SelectedIndex != 0;

                if (blnClubSuccessfullySelected == true)
                {
                    currentClub = (ClubItem)Sitecore.Context.Database.GetItem(clubFindSelect.SelectedValue);

                    if (currentClub != null)
                    {
                        //get managers info
                        List<ManagerItem> staffMembers = null;
                        if (currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)) != null)
                        {
                            staffMembers = currentClub.InnerItem.Axes.SelectItems(String.Format("descendant-or-self::*[@@tid = '{0}']", ManagerItem.TemplateId)).ToList().ConvertAll(x => new ManagerItem(x));

                            manager = staffMembers.First();
                        }

                        if (currentClub.GetCrmSystem() == ClubCrmSystemTypes.ClubCentric)
                        {
                            //TODO: Log data to database
                            //Data is sent to client via email
                            //SendAdminEmail();
                        }
                        else
                        {
                            //TODO: Log data to database
                            //Data is sent to client via email
                            SendFeedbackDataService();
                        }

                        //Data is sent to client via email
                        SendAdminEmail();

                        //Save feedback to report DB
                        SaveDataToReportDB();

                        //Send confirmation email
                        SendConfirmationEmail();

                        string classNames = formToComplete.Attributes["class"];
                        if (classNames.IndexOf(" hidden") == -1)
                        {
                            formToComplete.Attributes.Add("class", classNames + " hidden submitted");
                        }

                        classNames = formCompleted.Attributes["class"];
                        if (classNames.IndexOf(" hidden") != -1)
                        {
                            formToComplete.Attributes.Add("class", classNames.Replace(" hidden", ""));
                        }

                        //formCompleted.Attributes.Add("style", "display:block;");
                        //formToComplete.Visible = false;
                        formCompleted.Visible = true;

                        pnlForm.Update();
                    }
                }
                else
                {
                    cvClubName.IsValid = false;
                }

            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error sending contact us email confirmation {0}", ex.Message), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }
        }