protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lnkFeatures.Text = Branding.ReBrand(Resources.LocalizedText.AboutViewFeatures); lnkFacebook.Visible = !String.IsNullOrEmpty(lnkFacebook.NavigateUrl = Branding.CurrentBrand.FacebookFeed); lnkTwitter.Visible = !String.IsNullOrEmpty(lnkTwitter.NavigateUrl = Branding.CurrentBrand.TwitterFeed); lblFollowFacebook.Text = Branding.ReBrand(Resources.LocalizedText.FollowOnFacebook); lblFollowTwitter.Text = Branding.ReBrand(Resources.LocalizedText.FollowOnTwitter); FlightStats fs = FlightStats.GetFlightStats(); lblRecentFlightsStats.Text = fs.ToString(); locRecentStats.Text = Branding.ReBrand(Resources.LocalizedText.DefaultPageRecentStats); List <string> lstStats = new List <string>() { String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.DefaultPageRecentStatsFlights, fs.NumFlightsTotal), String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.DefaultPageRecentStatsAircraft, fs.NumAircraft), String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.DefaultPagerecentStatsModels, fs.NumModels) }; rptStats.DataSource = lstStats; rptStats.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Master.SelectedTab = tabID.tabHome; Master.Title = String.Format(CultureInfo.CurrentCulture, Resources.Profile.WelcomeTitleWithDescription, Branding.CurrentBrand.AppName); Master.Layout = MasterPage.LayoutMode.Accordion; string s = util.GetStringParam(Request, "m"); if (s.Length > 0) { this.Master.SetMobile((string.Compare(s, "no", StringComparison.OrdinalIgnoreCase) != 0)); } FlightStats fs = FlightStats.GetFlightStats(); if (!IsPostBack) { List <AppAreaDescriptor> lst = new List <AppAreaDescriptor>() { new AppAreaDescriptor(Resources.Tabs.TabLogbook, "~/Member/LogbookNew.aspx", Branding.ReBrand(Resources.Profile.appDescriptionLogbook), tabID.tabLogbook), new AppAreaDescriptor(Resources.Tabs.TabAircraft, "~/Member/Aircraft.aspx", Branding.ReBrand(Resources.Profile.appDescriptionAircraft), tabID.tabAircraft), new AppAreaDescriptor(Resources.Tabs.TabAirports, "~/Public/MapRoute2.aspx", Branding.ReBrand(Resources.Profile.appDescriptionAirports), tabID.tabMaps), new AppAreaDescriptor(Resources.Tabs.TabInstruction, "~/Member/Training.aspx", Branding.ReBrand(Resources.Profile.appDescriptionTraining), tabID.tabTraining), new AppAreaDescriptor(Resources.Tabs.TabProfile, "~/Member/EditProfile.aspx", Branding.ReBrand(Resources.Profile.appDescriptionProfile), tabID.tabProfile) }; rptFeatures.DataSource = lst; rptFeatures.DataBind(); locRecentFlightsHeader.Text = String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.DefaultPageRecentFlightsHeader, Branding.CurrentBrand.AppName); if (User.Identity.IsAuthenticated) { lblHeader.Text = String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.DefaultPageWelcomeBack, MyFlightbook.Profile.GetUser(User.Identity.Name).UserFirstName); pnlWelcome.Visible = false; } else { lblHeader.Text = String.Format(CultureInfo.CurrentCulture, Resources.Profile.WelcomeTitle, Branding.CurrentBrand.AppName); pnlWelcome.Visible = true; } lblRecentFlightsStats.Text = fs.ToString(); } // redirect to a mobile view if this is from a mobile device UNLESS cookies suggest to do otherwise. if (this.Master.IsMobileSession()) { if ((Request.Cookies[MFBConstants.keyClassic] == null || String.Compare(Request.Cookies[MFBConstants.keyClassic].Value, "yes", StringComparison.OrdinalIgnoreCase) != 0)) { Response.Redirect("DefaultMini.aspx"); } } PopulateRecentImages(fs.RecentPublicFlights); }