Esempio n. 1
0
        public ActionResult DoUpdateImgUrl(string hotelId, string imgUrl)
        {
            JsResultObject   re          = new JsResultObject();
            HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId);

            hotelDetail.imgUrl = imgUrl;
            re = BaseZdBiz.Update(hotelDetail, "");
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult SaveHotelDetail(string id)
        {
            HotelDetailModel e = BaseZdBiz.Load <HotelDetailModel>(id);

            e = ObjectUtil.Eval <HotelDetailModel>(e, Request.Params, "", "");
            JsResultObject re = BaseZdBiz.SaveOrUpdate(e, "酒店详细信息");

            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public ActionResult DivMemberCommentEdit(int orderId)
        {
            OrderModel       order = BaseZdBiz.Load <OrderModel>(orderId);
            HotelDetailModel hotel = BaseZdBiz.Load <HotelDetailModel>(order.hotelId);

            ViewData[typeof(OrderModel).Name]       = order;
            ViewData[typeof(HotelDetailModel).Name] = hotel;
            return(View());
        }
Esempio n. 4
0
        public IList <HotelDetailModel> queryHotelList(HotelDetailModel hotel)
        {
            if (!this.login())
            {
                return(new List <HotelDetailModel>());
            }
            GetHotelListRequest req = new GetHotelListRequest();

            req.RequestHead = this.requestHead;
            req.GetHotelCondition.HotelId    = hotel.id;
            req.GetHotelCondition.RoomTypeID = "";

            GetHotelListResponse res = elongService.GetHotelList(req);

            return(null);
        }
Esempio n. 5
0
        public ActionResult SingleDetail(string hotelId)
        {
            HotelDetailModel hotelDetail = null;

            if (string.IsNullOrEmpty(hotelId))
            {
                hotelDetail = new HotelDetailModel();
            }
            else
            {
                hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId);
            }
            if (hotelDetail == null)
            {
                return(View("error"));
            }
            ViewData[typeof(HotelDetailModel).Name] = hotelDetail;
            return(View());
        }
Esempio n. 6
0
        public ActionResult OrderEdit(string hotelId, string roomTypeId, int ratePlanId, DateTime?checkInDate, DateTime?checkOutDate)
        {
            ELongApiBiz         elongBiz            = ELongApiBiz.GetInstant();
            RoomForGetHotelList roomForGetHotelList = elongBiz.getRoomForGetHotelList(hotelId, roomTypeId, checkInDate ?? this.getDefaultCheckInDate(), checkOutDate ?? this.getDefaultCheckOutDate(), ratePlanId);
            HotelDetailModel    hotelDetail         = BaseZdBiz.Load <HotelDetailModel>(hotelId);
            ICriteria           icr = BaseZdBiz.CreateCriteria <HotelRoomModel>();

            icr.Add(Restrictions.And(Restrictions.Eq("hotelFk", hotelId), Restrictions.Eq("roomTypeId", roomTypeId)));
            IList <HotelRoomModel> rooms = icr.List <HotelRoomModel>();

            if (rooms.Count == 1)
            {
                ViewData[typeof(HotelRoomModel).Name] = rooms[0];
            }
            ViewData["checkInDate"]  = (checkInDate ?? this.getDefaultCheckInDate()).ToString(DateTimeUtil.PATTERN_DB_DATE);
            ViewData["checkOutDate"] = (checkOutDate ?? this.getDefaultCheckOutDate()).ToString(DateTimeUtil.PATTERN_DB_DATE);
            ViewData[typeof(RatePlanForGetHotelList).Name] = roomForGetHotelList.RatePlans[0];
            ViewData[typeof(HotelDetailModel).Name]        = hotelDetail;
            return(View());
        }
Esempio n. 7
0
        //
        // GET: /Hotel/

        public ActionResult Detail(string hotelId)
        {
            HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId);

            ViewData[typeof(HotelDetailModel).Name] = hotelDetail;

            HotelFeatrueInfoModel hotelFi = BaseZdBiz.Load <HotelFeatrueInfoModel>(hotelId);

            ViewData[typeof(HotelFeatrueInfoModel).Name] = hotelFi;

            HotelModel hotel = BaseZdBiz.Load <HotelModel>(hotelId);

            ViewData[typeof(HotelModel).Name] = hotel;

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

            icr.Add(Restrictions.Eq("hotelFk", hotelId));
            IList <HotelImageModel> images = icr.List <HotelImageModel>();

            ViewData[typeof(HotelImageModel).Name] = images;

            GeoBiz   geoBiz = GeoBiz.GetInstant();
            GeoModel geo    = geoBiz.GetGeoByCityId(hotelDetail.city);

            this.VdGeoLocation(geo);


            icr = BaseZdBiz.CreateCriteria <HotelLandMarkModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelLandMarkModel> hotelLls = icr.List <HotelLandMarkModel>();

            ViewData[typeof(HotelLandMarkModel).Name] = hotelLls;

            icr = BaseZdBiz.CreateCriteria <HotelSurroundingAttractionModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelSurroundingAttractionModel> hotelSas = icr.List <HotelSurroundingAttractionModel>();

            ViewData[typeof(HotelSurroundingAttractionModel).Name] = hotelSas;

            icr = BaseZdBiz.CreateCriteria <HotelSurroundingCommerceModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelSurroundingCommerceModel> hotelScs = icr.List <HotelSurroundingCommerceModel>();

            ViewData[typeof(HotelSurroundingCommerceModel).Name] = hotelScs;

            icr = BaseZdBiz.CreateCriteria <HotelSurroundingRestaurantModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelSurroundingRestaurantModel> hotelSrs = icr.List <HotelSurroundingRestaurantModel>();

            ViewData[typeof(HotelSurroundingRestaurantModel).Name] = hotelSrs;

            icr = BaseZdBiz.CreateCriteria <HotelSurroundingShopModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelSurroundingShopModel> hotelSss = icr.List <HotelSurroundingShopModel>();

            ViewData[typeof(HotelSurroundingShopModel).Name] = hotelSss;

            icr = BaseZdBiz.CreateCriteria <HotelTrafficInfoModel>();
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            IList <HotelTrafficInfoModel> hotelTrs = icr.List <HotelTrafficInfoModel>();

            ViewData[typeof(HotelTrafficInfoModel).Name] = hotelTrs;


            icr = BaseZdBiz.CreateCriteria <HotelCommentModel>(new PagerObject(1, 5));
            icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id));
            icr.AddOrder(Order.Desc("createDate"));
            IList <HotelCommentModel> hotelComments = icr.List <HotelCommentModel>();

            ViewData[typeof(HotelCommentModel).Name] = hotelComments;
            PageSeoModel seo = PublicBiz.getCurPageSeo();

            this.setPageDesc(string.Format(seo.hotelDetailDesc, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName));
            this.setPageKeyWords(string.Format(seo.hotelDetailKeywords, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName));
            this.VdHotCity(15);
            return(View());
        }
Esempio n. 8
0
        public JsResultObject ImportHotelDetail(string hotelId, bool hasSubInfo)
        {
            JsResultObject re = new JsResultObject();

            ELongHotelDetailAdapter adapter = ELongStaticClient.GetHotelDetail(hotelId);
            HotelDetailModel        hotel   = new HotelDetailModel();

            hotel.from(adapter);
            System.Console.WriteLine(string.Format("{0}:{1}:{2}", hotel.country, hotel.city, hotel.name));
            re = BaseZdBiz.SaveOrUpdate(hotel, "");


            if (!hasSubInfo)
            {
                return(re);
            }

            IList <ELongHotelImageAdapter> images = ELongStaticClient.GetHotelImageList(hotelId);

            foreach (ELongHotelImageAdapter image in images)
            {
                HotelImageModel temp = new HotelImageModel();
                temp.setPk(temp.createPk());
                temp.from(image);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.title, temp.imgUrl));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }



            IList <ELongHotelRoomAdapter> rooms = ELongStaticClient.GetHotelRoomList(hotelId);

            foreach (ELongHotelRoomAdapter room in rooms)
            {
                HotelRoomModel temp = new HotelRoomModel();
                temp.setPk(temp.createPk());
                temp.from(room);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            ELongHotelFeatureInfoAdapter featureInfo           = ELongStaticClient.GetHotelFeatureInfo(hotelId);
            HotelFeatrueInfoModel        hotelFeatrueInfoModel = new HotelFeatrueInfoModel();

            hotelFeatrueInfoModel.from(featureInfo);
            re.rowNum += BaseZdBiz.SaveOrUpdate(hotelFeatrueInfoModel, "").rowNum;


            IList <ELongHotelLandMarkAdapter> landmarks = ELongStaticClient.GetHotelLandMarkList(hotelId);

            foreach (ELongHotelLandMarkAdapter landmark in landmarks)
            {
                HotelLandMarkModel temp = new HotelLandMarkModel();
                temp.setPk(temp.createPk());
                temp.from(landmark);
                temp.id = temp.createPk().ToString();
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingAttractionAdapter> attractions = ELongStaticClient.GetHotelSurroundingAttractionList(hotelId);

            foreach (ElongHotelSurroundingAttractionAdapter attraction in attractions)
            {
                HotelSurroundingAttractionModel temp = new HotelSurroundingAttractionModel();
                temp.setPk(temp.createPk());
                temp.from(attraction);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ELongHotelSurroundingCommerceAdapter> commerces = ELongStaticClient.GetHotelSurroundingCommerceList(hotelId);

            foreach (ELongHotelSurroundingCommerceAdapter commerce in commerces)
            {
                HotelSurroundingCommerceModel temp = new HotelSurroundingCommerceModel();
                temp.setPk(temp.createPk());
                temp.from(commerce);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingRestaurantAdapter> restaurants = ELongStaticClient.GetHotelSurroundingRestaurantList(hotelId);

            foreach (ElongHotelSurroundingRestaurantAdapter restaurant in restaurants)
            {
                HotelSurroundingRestaurantModel temp = new HotelSurroundingRestaurantModel();
                temp.setPk(temp.createPk());
                temp.from(restaurant);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }

            IList <ElongHotelSurroundingShopAdapter> shops = ELongStaticClient.GetHotelSurroundingShopList(hotelId);

            foreach (ElongHotelSurroundingShopAdapter shop in shops)
            {
                HotelSurroundingShopModel temp = new HotelSurroundingShopModel();
                temp.setPk(temp.createPk());
                temp.from(shop);
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }


            IList <ElongHotelTrafficInfoAdapter> traffics = ELongStaticClient.GetHotelTrafficInfoList(hotelId);

            foreach (ElongHotelTrafficInfoAdapter traffic in traffics)
            {
                HotelTrafficInfoModel temp = new HotelTrafficInfoModel();

                temp.from(traffic);
                temp.id = temp.createPk().ToString();
                //System.Console.WriteLine(string.Format("{0}:{1}:{2}", temp.hotelFk, temp.roomName, temp.area));
                re.rowNum += BaseZdBiz.SaveOrUpdate(temp, "").rowNum;
            }


            return(re);
        }