protected string noticeHtml = string.Empty; //网站公告 protected void Page_Load(object sender, EventArgs e) { PageMenu1.HeadMenuIndex = 1; this.Page.Title = string.Format(PageTitle.Home_Title, CityModel.CityName); //首页Page Title初始化 AddMetaTag("description", string.Format(PageTitle.Home_Des, CityModel.CityName)); //添加 Description Meta 标记 AddMetaTag("keywords", string.Format(PageTitle.Home_Keywords, CityModel.CityName)); //添加 Keywords Meta 标记 //添加头部样式脚本 Utils.AddStylesheetInclude(CssManage.GetCssFilePath("index2011")); Utils.AddStylesheetInclude(CssManage.GetCssFilePath("517autocomplete")); //绑定供求 BindSupply(); //创建广告类Bll advBll = EyouSoft.BLL.AdvStructure.Adv.CreateInstance(); //绑定焦点轮轮换广告 isExtendSite = EyouSoft.BLL.AdvStructure.SiteExtend.CreateInstance().IsExtendSite(CityId); //如果是重点分站显示散拼中心,否则显示旅行社 if (!isExtendSite) { if (IsLogin) { guest1.isLogin = true; } routeArea1.IsShow = true; goldc1.IsShow = true; RecomP1.IsShow = true; RecomP1.CityId = CityId; goldc1.CityId = CityId; routeArea1.CityId = CityId; Comp1.IsShow = false; } else { Comp1.IsShow = true; Comp1.CityName = CityModel.CityName; Comp1.CityId = CityId; } BindPartnerLinks();//友情链接 newBll = EyouSoft.BLL.NewsStructure.NewsBll.CreateInstance(); GetLoginMessage(); GetAdvImg(); GetDataCount(); BindNotice(); BindTurnPic(); }
private void PageMsgInit() { EyouSoft.IBLL.NewsStructure.INewsBll newsBll = EyouSoft.BLL.NewsStructure.NewsBll.CreateInstance(); EyouSoft.Model.NewsStructure.NewsCategory? cate = EyouSoft.Model.NewsStructure.NewsCategory.用户后台公告; IList <EyouSoft.Model.NewsStructure.WebSiteNews> newsList = newsBll.GetList(6, cate, null, null, null); if (newsList != null && newsList.Count > 0) { this.rptGG.DataSource = newsList; this.rptGG.DataBind(); } else { Label lb = new Label(); lb.Text = "暂无公告"; this.rptGG.Controls.Add(lb); } }
//初始化页面信息 public void Initialize() { //获取热点资讯排行 EyouSoft.IBLL.NewsStructure.INewsBll bll_News = EyouSoft.BLL.NewsStructure.NewsBll.CreateInstance(); IList <EyouSoft.Model.NewsStructure.WebSiteNews> HotList = bll_News.GetHotNews(10); StringBuilder strHot = new StringBuilder(); if (HotList != null && HotList.Count > 0) { foreach (EyouSoft.Model.NewsStructure.WebSiteNews item in HotList) { if (item.GotoUrl.Length > 0) {//含有跳转的 strHot.AppendFormat("<li><a href='{0}' title='{3}' target=\"_blank\" style='{2}'>{1}</a></li>", item.GotoUrl, EyouSoft.Common.Utils.GetText2(item.AfficheTitle, 16, true), "color:" + item.TitleColor, item.AfficheTitle); } else {//不含跳转 strHot.AppendFormat("<li><a href='{0}' title='{3}' target=\"_blank\" style='{2}'>{1}</a></li>", EyouSoft.Common.URLREWRITE.Infomation.GetNewsDetailUrl(item.AfficheClass, item.Id), EyouSoft.Common.Utils.GetText2(item.AfficheTitle, 16, true), "color:" + item.TitleColor, item.AfficheTitle); } } } else { strHot.Append("<li>暂无资讯排行信息</li>"); } HotLists = strHot.ToString(); //获取资讯信息类别 EyouSoft.IBLL.NewsStructure.INewsType BLL_NewsType = EyouSoft.BLL.NewsStructure.NewsType.CreateInstance(); IList <EyouSoft.Model.NewsStructure.NewsType> InfoTypeList = BLL_NewsType.GetInformationType(); EyouSoft.Model.NewsStructure.NewsType only = InfoTypeList.Where(p => p.ClassName == "行业新闻").FirstOrDefault(); //获取最新行业新闻 IList <EyouSoft.Model.NewsStructure.WebSiteNews> Trades = bll_News.GetListByNewType(6, only.Id); this.news.DataSource = Trades; this.news.DataBind(); bll_News = null; //获取供求信息 EyouSoft.IBLL.CommunityStructure.IExchangeList Bchange = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance(); IList <EyouSoft.Model.CommunityStructure.ExchangeList> excList = Bchange.GetTopList(6); this.star.DataSource = excList; this.DataBind(); //获取最新线路 EyouSoft.IBLL.NewTourStructure.IRoute Btour = EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance(); IList <EyouSoft.Model.NewTourStructure.MRoute> TourList = Btour.GetNewRouteList(6); StringBuilder NewRoute = new StringBuilder(); if (TourList != null) { foreach (EyouSoft.Model.NewTourStructure.MRoute item in TourList) { NewRoute.Append(string.Format("<li><a title='{0}' target='_blank' href='{1}'>{2}</a></li>", item.RouteName, EyouSoft.Common.URLREWRITE.Tour.GetTourToUrl(item.Id, CityId), Utils.GetText2(item.RouteName, 16, true))); } } RouteList = NewRoute.ToString(); Btour = null; //获取旅游企业 EyouSoft.IBLL.CompanyStructure.ICompanyInfo Bcompany = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.MLatestRegCompanyInfo> ComList = Bcompany.GetTopNumNewCompanys(9, true); this.company.DataSource = ComList; this.company.DataBind(); Bcompany = null; }