Esempio n. 1
0
        public ActionResult ExhiHotel(string exhiId)
        {
            ExhiModel exhi = BaseZdBiz.Load <ExhiModel>(exhiId);
            ICriteria icr  = BaseZdBiz.CreateCriteria <ExhiRefHotelModel>();

            icr.Add(Restrictions.Eq("exhiId", exhiId));
            IList <ExhiRefHotelModel> refHotels = icr.List <ExhiRefHotelModel>();
            IList <string>            ids       = new List <string>();

            if (refHotels.Count > 0)
            {
                ids = ObjectUtil.GetProList(refHotels, "hotelId");
            }
            else
            {
                icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, 10));
                icr.Add(Restrictions.Eq("recInd", BaseModel.IND_Y));
                IList <HotelModel> hotels = icr.List <HotelModel>();
                ids = ObjectUtil.GetProList(hotels, "hotelId");
            }

            exhi.hotelIdArray = StringUtil.UnionArray(ids.ToArray(), ',');
            icr = BaseZdBiz.CreateCriteria <ExhiModel>();
            icr.Add(Restrictions.Eq("geoFk", exhi.geoFk));
            icr.Add(Restrictions.Not(Restrictions.Eq("id", exhi.id)));
            icr.AddOrder(Order.Desc("startDate"));
            IList <ExhiModel> exhis = icr.List <ExhiModel>();

            ViewData["refExhis"]             = exhis;
            ViewData[typeof(ExhiModel).Name] = exhi;
            this.VdHotCity(15);

            PageSeoModel seo = PublicBiz.getCurPageSeo();

            //{0}展会code,{1}:展会名,{2}:展会地址, {3}:展会时间 ,{4}:行业,{5}:内容
            this.setPageDesc(string.Format(seo.exhiHotelDesc, exhi.id, exhi.name, exhi.address, exhi.startDate.ToShortDateString(), exhi.busName, exhi.msg).Substring(0, 228));
            this.setPageKeyWords(string.Format(seo.exhiHotelKeywords, exhi.id, exhi.name, exhi.address, exhi.startDate.ToShortDateString(), exhi.busName, exhi.msg));
            return(View());
        }
Esempio n. 2
0
        public ActionResult NewsHotel(string newsId)
        {
            NewsModel news = BaseZdBiz.Load <NewsModel>(newsId);

            ICriteria icr = BaseZdBiz.CreateCriteria <NewsRefHotelModel>();

            icr.Add(Restrictions.Eq("newsId", newsId));
            IList <NewsRefHotelModel> refHotels = icr.List <NewsRefHotelModel>();
            IList <string>            ids       = new List <string>();

            if (refHotels.Count > 0)
            {
                ids = ObjectUtil.GetProList(refHotels, "hotelId");
            }
            else
            {
                icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, 10));
                icr.Add(Restrictions.Eq("recInd", BaseModel.IND_Y));
                IList <HotelModel> hotels = icr.List <HotelModel>();
                ids = ObjectUtil.GetProList(hotels, "hotelId");
            }
            news.hotelIdArray = StringUtil.UnionArray(ids.ToArray(), ',');

            icr = BaseZdBiz.CreateCriteria <NewsModel>(new PagerObject(1, 5));
            icr.Add(Restrictions.Not(Restrictions.Eq("id", newsId)));
            icr.AddOrder(Order.Desc("deployDate"));
            IList <NewsModel> refNews = icr.List <NewsModel>();

            ViewData["refNews"] = refNews;
            ViewData[typeof(NewsModel).Name] = news;
            this.VdHotCity(15);

            //{0}新闻code,{1}:新闻主题,{2}:新闻日期 ,{3}:新闻内容
            PageSeoModel seo = PublicBiz.getCurPageSeo();

            this.setPageDesc(string.Format(seo.newsHotelDesc, news.id, news.title, news.deployDate.ToShortDateString(), news.context).Substring(0, 228));
            this.setPageKeyWords(string.Format(seo.newsHotelKeywords, news.id, news.title, news.deployDate.ToShortDateString(), news.context));
            return(View());
        }