Exemplo n.º 1
0
        protected void Session_Start(object sender, EventArgs e)
        {
            if (Session.Count == 0)
            {
                Agency agency = Agency.GetAgencyByDomain("login.motivatedmodels.com"); //TODO:Grab host from URL or subdomain name

                Session.Add("Host", agency.agency_url);
                Session.Add("AgencyID", agency.agency_pk);
                Session.Add("AgencyName", agency.agency_name);
                Session.Add("AgencyTitle", agency.agency_home_title);
                Session.Add("AgencyHomeText", agency.agency_home_text);
                Session.Add("AgencyLocation", agency.agency_location_name);
                Session.Add("AgencyLocationUrl", agency.agency_location_url);
                Session.Add("AgencyLocationLat", agency.agency_location_lat);
                Session.Add("AgencyLocationLong", agency.agency_location_long);
                Session.Add("AgencyYoutube", agency.agency_home_youtube);
                Session.Add("AgencyFacebook", agency.agency_social_facebook);
                Session.Add("AgencyGooglePlus", agency.agency_social_gplus);

                String logoPath = (agency.agency_has_logo) ? String.Format("~/Public/Agency/{0}/Logo/logo_thumb.jpg", agency.agency_pk): null;
                String favicon  = (agency.agency_has_favicon) ? String.Format("~/Public/Agency/{0}/Favicon/favicon.ico", agency.agency_pk): null;

                Session.Add("LogoThumb", logoPath);
                Session.Add("Favicon", favicon);
            }
        }