protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var newsBo = new News(web); var settingBo = new SettingsBo(web); SliderBo sliderBo = new SliderBo(web); var companyName = HttpContext.GetGlobalResourceObject("napas.resource", "CompanyName").ToString(); SetPageTitles(companyName); rpNewsHome.DataSource = newsBo.get_NewsHome(web); rpNewsHome.DataBind(); var settingInfo = settingBo.get_SettingInfo(web); var youtube = settingInfo.Youtube; if (!youtube.Contains("rel==")) { youtube = youtube + "?rel=0"; } ltVideoSource.Text = string.Format("<iframe width=\"100%\" height=\"100%\" id=\"ifram\" src=\"{0}\" frameborder=\"0\" allowfullscreen=\"\"></iframe>", settingInfo.Youtube); ltVideoDescription.Text = settingInfo.VideoDescription; var listSlider = sliderBo.get_SliderInfo(web); string style = "<style>{0}</style>"; string styleContent = string.Empty; var s = @"@media screen and (max-width: 4096px) { .home-slider .slider0{0} { background-image: url({1}) !important; } } @media screen and (max-width: 1366px) { .home-slider .slider0{0} { background-image: url({1}) !important; } } @media screen and (max-width: 1024px) { .home-slider .slider0{0} { background-image: url({2}) !important; } } @media (max-width: 480px) { .home-slider .slider0{0} { background-image: url({3}) !important; } }"; foreach (SliderInfo info in listSlider) { styleContent += s.Replace("{0}", info.Index) .Replace("{1}", info.Image1366) .Replace("{2}", info.Image1024) .Replace("{3}", string.IsNullOrEmpty(info.Image480) ? info.Image1024 : info.Image480); //string.Format(s, info.Index, info.Image1366, info.Image1024); } ltStyle.Text = string.Format(style, styleContent); rpSlider.DataSource = listSlider; rpSlider.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { settingsBo = new SettingsBo(SPContext.Current.Web); ltStyle.Text = CacheBanerPage(); var settingInfo = settingsBo.get_SettingInfo(web); ltLogo.Text = string.Format("<img alt=\"NAPAS\" src=\"{0}\" />", settingInfo.Logo); ltMobile.Text = string.Format("<a href=\"tel:{0}\">{0}</a>", settingInfo.Mobile); ltMobile2.Text = string.Format("<a href=\"tel:{0}\">{0}</a>", settingInfo.Mobile); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { settingsBo = new SettingsBo(web); var settingInfo = settingsBo.get_SettingInfo(web); SiteLogoImage92.LogoImageUrl = settingInfo.LogoFooter; lbtEmail.NavigateUrl = string.Format("mailto:{0}", settingInfo.Email); lbtYoutube.NavigateUrl = settingInfo.YoutubeChanel; lbtFaceBook.NavigateUrl = settingInfo.Facebook; ltCompanyName.Text = settingInfo.CompanyName; ltCompanyNationalName.Text = settingInfo.CompanyNameEn; } }
private string GetBanerPage() { SettingsBo settingBo = new SettingsBo(web); string style = @"<style>.intro-banner { background-image: url({-1}); height: 300px; background-repeat: no-repeat; background-size: cover; background-position: center center; } @media screen and (max-width: 991px) { .intro-banner { height: 121px; } } .intro-banner.intro-banner-news { background-image: url({0}); } .intro-banner.intro-banner-service { background-image: url({1}); } .intro-banner.intro-banner-customer { background-image: url({2}); } .intro-banner.intro-banner-ns { background-image: url({3}); } .intro-banner.intro-banner-dk { background-image: url({4}); } .intro-banner-cd {background-image: url({5}); } .intro-banner-tl {background-image: url({6}); } .intro-banner-hotline {background-image: url({7}); } </style>"; var setting = settingBo.get_SettingInfo(web); style = style.Replace("{-1}", setting.BanerAboutUs); style = style.Replace("{0}", setting.BanerNews); style = style.Replace("{1}", setting.BanerProduct); style = style.Replace("{2}", setting.BanerCustomer); style = style.Replace("{3}", setting.BanerCeare); style = style.Replace("{4}", setting.BanerTermCondition); style = style.Replace("{5}", setting.BanerPartner); style = style.Replace("{6}", setting.BanerDocument); style = style.Replace("{7}", setting.BanerHotline); return(style); }