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 ConfigFrontPage()
        {
            FrontPageModel frontPage = PublicBiz.GetInstant().getCurFrontPage();

            ViewData[typeof(FrontPageModel).Name] = frontPage;
            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult DoLogin(string key, string t, string uid)
        {
            MemberModel    member    = WebUtil.Eval(new MemberModel(), "", "");
            PublicBiz      publicBiz = PublicBiz.GetInstant();
            JsResultObject re        = publicBiz.login(member, key);

            if (re.code == JsResultObject.CODE_SUCCESS)
            {
                member = re.attrs[typeof(MemberModel).Name] as MemberModel;

                Session[typeof(MemberModel).Name] = member;
                OrderModel order = WebUtil.GetSessionAttr <OrderModel>(typeof(OrderModel).Name);
                if (order != null)
                {
                    order          = BaseZdBiz.Load <OrderModel>(order.id);
                    order.memberFk = member.id;
                    BaseZdBiz.Update(order, "");
                    WebUtil.SetSessionAttr(typeof(OrderModel).Name, null);
                }
                if (!string.IsNullOrEmpty(t) && !string.IsNullOrEmpty(uid))
                {
                    MemberModel m     = BaseZdBiz.Load <MemberModel>(member.id);
                    string      tName = "";
                    if (t == "weibo")
                    {
                        tName      = "新浪微博";
                        m.weiboUid = uid;
                    }
                    else if (t == "renren")
                    {
                        tName       = "人人网";
                        m.renrenUid = uid;
                    }
                    else if (t == "kaixin")
                    {
                        tName       = "开心网";
                        m.kaixinUid = uid;
                    }
                    re    = BaseZdBiz.Update(m, "");
                    m.pwd = "";
                    if (re.code == JsResultObject.CODE_SUCCESS)
                    {
                        this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的{1}帐号:{0}已绑定成功,以后可以直接使用新浪微博进行登录", uid, tName), true);
                        WebUtil.SetSessionAttr(typeof(MemberModel).Name, m);
                    }
                    else
                    {
                        this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的{1}帐号:{0}已绑定失败,可能已有相同的微博帐号与其他帐号绑定了", uid, tName), true);
                    }
                    return(RedirectToAction("Edit", "Account"));
                }
                return(Redirect(this.getPreUrl()));
            }
            else
            {
                this.SetResult(re.code, re.msg, false);
                return(RedirectToAction("Login", "Home"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult DoSaveFrontPage()
        {
            FrontPageModel frontPage = PublicBiz.GetInstant().getCurFrontPage();

            frontPage = WebUtil.Eval <FrontPageModel>(frontPage, "", "");
            JsResultObject re = BaseZdBiz.Update(frontPage, "首页配置");

            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
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.º 6
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());
        }