Ejemplo n.º 1
0
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("~/DesktopModules/ATI_Base/controls/ATI_CompetitionAthlete.ascx");

            panel.ContentTemplateContainer.Controls.Add(ctrl);

            //     ASP.desktopmodules_ati_base_controls_ati_c_ascx
            ASP.desktopmodules_ati_base_controls_ati_competitionathlete_ascx details = (ASP.desktopmodules_ati_base_controls_ati_competitionathlete_ascx)ctrl;
            // CompetitionAthleteC
            //ASP.CompetitionAthlet details = (ProductDetailsCS)ctrl;
            //    details.ProductID = elementID;
            long aid = Convert.ToInt64(elementID);

            details.CompetitionAthleteId = aid;
            panel.ContentTemplateContainer.Controls.Add(details);
        }
Ejemplo n.º 2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            try
            {
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(panelAjax, panelAjax, RadAjaxLoadingPanel2);
                atiProfileImage.Settings   = atiProfileLinks.ProfileSettings = base.UserSettings;
                atiProfileLinks.IsOwner    = true;
                atiFindInvite.UserSettings = UserSettings;
                atiFindInvite.TabId        = TabId;

                imgCheck.Src = ResolveUrl("~/DesktopModules/ATI_Base/resources/images/iCheck.png");
                ServiceReference service = new ServiceReference("~/DesktopModules/ATI_Base/resources/services/StreamService.asmx");
                service.InlineScript = true;
                ScriptManager.GetCurrent(Page).Services.Add(service);

                atiGMap.Lat  = UserSettings.LatHome;
                atiGMap.Lng  = UserSettings.LngHome;
                atiGMap.Zoom = 10;
                if (!Page.IsPostBack && !Page.IsCallback)
                {
                    instruction1.Text = "Upload a profile picture, so people know who you are, then click the 'save' button.";
                    if (Request["step"] != null)
                    {
                        instruction1.Text          += ".. or press the skip button in the bottom right.";
                        atiSidePanel.Visible        = false;
                        atiMainPanel.Style["width"] = "100%";
                        atiGMap.Width = Unit.Pixel(605);
                        // check if we may have info on this person from the 2011 crossfit open.
                        aqufitEntities entities = new aqufitEntities();
                        UserFriends    inDotCom = entities.UserFriends.FirstOrDefault(f => f.SrcUserSettingKey == UserSettings.Id && f.DestUserSettingKey == CROSSFIT_COM_ID);
                        if (inDotCom != null)
                        {
                            rbFollowDotCom.SelectedIndex = 0;
                        }
                        CompetitionAthlete[] found = entities.CompetitionAthletes.Where(a => string.Compare(a.AthleteName, UserSettings.UserFirstName + " " + UserSettings.UserLastName, true) == 0 && a.UserSetting == null).ToArray();
                        if (found.Length > 0)
                        {
                            foreach (CompetitionAthlete athlete in found)
                            {
                                Panel p = new Panel();
                                p.CssClass = "compAthleteIsMe";
                                p.Attributes["onclick"] = "Aqufit.Page.Actions.ConnectCompetitionAthlete(" + athlete.Id + ");";
                                Literal me = new Literal();
                                me.Text = "<span class=\"boldButton compAthleteIsMeButton\">This is Me !</span>";
                                p.Controls.Add(me);
                                Control ctrl = Page.LoadControl("~/DesktopModules/ATI_Base/controls/ATI_CompetitionAthlete.ascx");
                                ctrl.ID = "athlete" + athlete.Id;
                                p.Controls.Add(ctrl);
                                ASP.desktopmodules_ati_base_controls_ati_competitionathlete_ascx details = (ASP.desktopmodules_ati_base_controls_ati_competitionathlete_ascx)ctrl;
                                details.CompetitionAthleteId = athlete.Id;
                                p.Controls.Add(details);
                                phCompetitionAthlete.Controls.Add(p);
                            }
                            RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Actions.LoadStep(0); }); ");
                        }
                        else
                        {
                            RadAjaxManager1.ResponseScripts.Add(" $(function(){ Aqufit.Page.Actions.LoadStep(" + Request["step"] + "); }); ");
                        }
                    }
                    else
                    {
                        RadAjaxManager1.ResponseScripts.Add(" $(function(){ $('#step0').hide(); }); ");
                    }
                    this.baseUrl  = ResolveUrl("~/");
                    userPhotoPath = this.baseUrl + @"\Portals\0\Users\" + base.UserSettings.UserName;
                    urlPath       = "/Portals/0/Users/" + base.UserSettings.UserName;
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }