Ejemplo n.º 1
0
        public ActionResult Index()
        {
            PublicBiz      publicBiz = PublicBiz.GetInstant();
            FrontPageModel frontPage = publicBiz.getCurFrontPage();


            string[]         cityNames = frontPage.homeHotCityNameArray.Split(',');
            GeoBiz           geoBiz    = GeoBiz.GetInstant();
            IList <GeoModel> geos      = new List <GeoModel>();

            foreach (string cityName in cityNames)
            {
                GeoModel geo = geoBiz.GetGeoByCityName(cityName);
                geo.geoCls = geoBiz.GetGeoCls(geo.id);
                geo.geoDs  = geoBiz.GetGeoDs(geo.id);
                geo.geoLls = geoBiz.GetGeoLls(geo.id);
                geos.Add(geo);
            }
            ViewData[typeof(IList <GeoModel>).Name] = geos;
            this.VdCityTopHotel(20, cityNames);
            this.VdHotBookingHotel(10);
            this.VdHotBrand(12);
            this.VdHotCity(15);

            this.setPageDesc(PublicBiz.getCurPageSeo().hotelIndexDesc);
            this.setPageKeyWords(PublicBiz.getCurPageSeo().hotelIndexKeywords);

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Search(string cityName, string keyWord, string geoClId, string geoDId, DateTime?checkInDate)
        {
            PublicBiz      publicBiz = PublicBiz.GetInstant();
            FrontPageModel frontPage = publicBiz.getCurFrontPage();
            GeoBiz         geoBiz    = GeoBiz.GetInstant();
            GeoModel       geo       = geoBiz.GetGeoByCityName(cityName);

            this.VdGeoLocation(geo);
            GeoLocationModel geoLocation = null;
            PageSeoModel     seo         = PublicBiz.getCurPageSeo();

            this.setPageDesc(string.Format(seo.cityDesc, geo.cityCode, geo.cityName));
            this.setPageKeyWords(string.Format(seo.cityKeywords, geo.cityCode, geo.cityName));
            if (!string.IsNullOrEmpty(geoClId))
            {
                geoLocation = BaseZdBiz.Load <GeoCommercialLocationModel>(Restrictions.Eq("geoFk", geo.id), Restrictions.Eq("locationId", geoClId));
                this.setPageDesc(string.Format(seo.cityClDesc, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name));
                this.setPageKeyWords(string.Format(seo.cityClKeywords, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name));
            }
            else if (!string.IsNullOrEmpty(geoDId))
            {
                geoLocation = BaseZdBiz.Load <GeoDistrictsModel>(Restrictions.Eq("geoFk", geo.id), Restrictions.Eq("locationId", geoDId));
                this.setPageDesc(string.Format(seo.cityDDesc, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name));
                this.setPageKeyWords(string.Format(seo.cityDKeywords, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name));
            }
            else if (!string.IsNullOrEmpty(keyWord))
            {
                this.setPageDesc(string.Format(seo.hotelSearchDesc, cityName, keyWord, (checkInDate ?? DateTime.Now).ToShortDateString()));

                this.setPageKeyWords(string.Format(seo.hotelSearchKeywords, cityName, keyWord, (checkInDate ?? DateTime.Now).ToShortDateString()));
            }
            ViewData[typeof(GeoLocationModel).Name] = geoLocation;

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

            string[] brandNames = frontPage.searchBrandNameArray.Split(',');
            icr.Add(Restrictions.In("brandName", brandNames));
            IList <BrandModel> brands = icr.List <BrandModel>();

            ViewData[typeof(BrandModel).Name] = brands;
            this.VdHotCity(15);
            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            GeoBiz         geoBiz    = GeoBiz.GetInstant();
            PublicBiz      publicBiz = PublicBiz.GetInstant();
            FrontPageModel frontPage = publicBiz.getCurFrontPage();


            // icr=BaseZdBiz.CreateCriteria<HotelCommentModel>(new PagerObject(1,10));
            // IList<HotelCommentModel> listComment = icr.List<HotelCommentModel>();
            // ViewData[typeof(HotelCommentModel).Name] = listComment;

            this.VdHotNews(4);
            this.VdHotBrand(16);
            string[] cityNames = frontPage.homeHotCityNameArray.Split(',');
            this.VdCityTopHotel(10, cityNames);
            this.VdHotBookingHotel(10);
            this.VdHotCommentHotel(10);
            this.VdHotCity(15);

            this.setPageDesc(PublicBiz.getCurPageSeo().homeIndexDesc);
            this.setPageKeyWords(PublicBiz.getCurPageSeo().homeIndexKeywords);
            return(View());
        }