Exemplo n.º 1
0
        public ActionResult ComboboxRatePlan(string qvHotelId, string qvRoomTypeId, DateTime qvCheckInDate, DateTime qvCheckOutDate)
        {
            ELongApiBiz         elongBiz = ELongApiBiz.GetInstant();
            RoomForGetHotelList room     = elongBiz.getRoomForGetHotelList(qvHotelId, qvRoomTypeId, qvCheckInDate, qvCheckOutDate, 0);

            return(JsonText(room.RatePlans, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult DoSearch()
        {
            ELongApiBiz elongBiz = ELongApiBiz.GetInstant();
            GetHotelConditionForGetHotelList condition = new GetHotelConditionForGetHotelList();

            condition = WebUtil.Eval(condition, "", "");
            PageList <HotelForGetHotelList> hotels = elongBiz.getHotelList(condition);

            return(JsonText(hotels, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult DatagridHotelOrder()
        {
            ELongApiBiz            elongBiz  = ELongApiBiz.GetInstant();
            GetHotelOrderCondition condition = new GetHotelOrderCondition();

            HotelOrderPartialForGetHotelOrderList[] hotelArray = elongBiz.queryHotelOrderList(condition);

            IList <HotelOrderPartialForGetHotelOrderList> hotelList = hotelArray.ToList();

            PageList <HotelOrderPartialForGetHotelOrderList> hotelPageList = new PageList <HotelOrderPartialForGetHotelOrderList>(hotelList, this.getPager());
            DatagridObject datagrid = DatagridObject.ToDatagridObject(hotelPageList);

            return(JsonText(datagrid, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult TableHotelRoomPriceInfo(string hotelId, DateTime checkInDate, DateTime checkOutDate)
        {
            ELongApiBiz elongBiz = ELongApiBiz.GetInstant();

            PriceHotel[] priceInfo = elongBiz.getHotelRoomPrice(hotelId, checkInDate, checkOutDate);
            ICriteria    icr       = BaseZdBiz.CreateCriteria <HotelRoomModel>();

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

            ViewData[typeof(HotelRoomModel).Name] = rooms;
            ViewData[typeof(PriceHotel).Name]     = priceInfo;
            ViewData["checkInDate"]  = checkInDate.ToString(DateTimeUtil.PATTERN_DB_DATE);
            ViewData["checkOutDate"] = checkOutDate.ToString(DateTimeUtil.PATTERN_DB_DATE);
            return(View());
        }
Exemplo n.º 5
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());
        }
Exemplo n.º 6
0
        public ActionResult TableHotelRoomPriceInfo2(string hotelId, DateTime checkInDate, DateTime checkOutDate)
        {
            ELongApiBiz elongBiz = ELongApiBiz.GetInstant();
            //PriceHotel[] priceInfo = elongBiz.getHotelRoomPrice(hotelId, checkInDate, checkOutDate);
            GetHotelConditionForGetHotelList condition = new GetHotelConditionForGetHotelList();

            condition.CheckInDate  = checkInDate;
            condition.CheckOutDate = checkOutDate;
            condition.HotelId      = hotelId;

            HotelForGetHotelList hotel = elongBiz.getHotelList(condition).ElementAt <HotelForGetHotelList>(0);
            ICriteria            icr   = BaseZdBiz.CreateCriteria <HotelRoomModel>();

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

            ViewData[typeof(HotelRoomModel).Name]       = rooms;
            ViewData[typeof(HotelForGetHotelList).Name] = hotel;
            ViewData["checkInDate"]  = checkInDate.ToString(DateTimeUtil.PATTERN_DB_DATE);
            ViewData["checkOutDate"] = checkOutDate.ToString(DateTimeUtil.PATTERN_DB_DATE);
            return(View());
        }
Exemplo n.º 7
0
        public ActionResult DoSubmitOrder()
        {
            OrderModel order = new OrderModel();

            order = ObjectUtil.Eval <OrderModel>(order, Request.Params, "", "");


            DateTime checkInDate      = order.checkInDate;
            DateTime arraivalLateTime = new DateTime(
                checkInDate.Year, checkInDate.Month, checkInDate.Day
                , order.arraivalLateTime.Hour, 0, 0
                );

            order.arraivalLateTime  = arraivalLateTime;
            order.arraivalEarlyTime = arraivalLateTime.AddHours(-3);

            ELongApiBiz    elongBiz = ELongApiBiz.GetInstant();
            JsResultObject re       = elongBiz.submitHotelOrder(ref order);

            BaseZdBiz.SaveOrUpdate(order, "");
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
        public ActionResult DoGetOneRatePlan(string qvHotelId, string qvRoomTypeId, DateTime qvCheckInDate, DateTime qvCheckOutDate, int qvRatePlanId)
        {
            ELongApiBiz             elongBiz = ELongApiBiz.GetInstant();
            RoomForGetHotelList     room     = elongBiz.getRoomForGetHotelList(qvHotelId, qvRoomTypeId, qvCheckInDate, qvCheckOutDate, qvRatePlanId);
            RatePlanForGetHotelList ratePlan = null;
            JsResultObject          re       = new JsResultObject();

            if (room.RatePlans.Length == 1)
            {
                re.code  = JsResultObject.CODE_SUCCESS;
                ratePlan = room.RatePlans[0];
                re.attrs.Add("ratePlan", ratePlan);
            }
            else
            {
                re.code   = JsResultObject.CODE_ERROR;
                re.title  = "查询失败";
                re.msg    = "没有查到符合条件的价格信息";
                re.action = JsResultObject.ACTION_ALERT;
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 9
0
        public ActionResult ViewHotelSearch(string viewName, string cityName, DateTime?checkInDate, DateTime?checkOutDate, string keyword, string hotelId
                                            , string star, string priceRegexp, string geoLlId, string geoClId, string geoDid, string brandName, string orderbyCode, string orderbyType
                                            , decimal?startLng, decimal?endLng, decimal?startLat, decimal?endLat, string geoMode, int?radius
                                            )
        {
            ELongApiBiz elongBiz = ELongApiBiz.GetInstant();
            GeoBiz      geoBiz   = GeoBiz.GetInstant();

            string cityId = geoBiz.GetGeoByCityName(cityName).cityCode;
            ToyzNumberRangeObject            priceRange = null;
            GetHotelConditionForGetHotelList condition  = new GetHotelConditionForGetHotelList();

            condition.CheckInDate  = checkInDate ?? this.getDefaultCheckInDate();
            condition.CheckOutDate = checkOutDate ?? this.getDefaultCheckOutDate();
            condition.CityId       = cityId;
            //condition.HotelName = keyword;
            condition.MaxRows   = this.getPager().size;
            condition.PageIndex = this.getPager().page;

            if (string.IsNullOrEmpty(geoMode) || geoMode == "0")
            {
                if (!string.IsNullOrEmpty(keyword))
                {
                    condition.HotelName = keyword;
                }

                if (!string.IsNullOrEmpty(hotelId))
                {
                    condition.HotelId = hotelId;
                    condition.CityId  = null;
                }

                if (!string.IsNullOrEmpty(brandName))
                {
                    condition.HotelName = brandName;
                }
                if (!string.IsNullOrEmpty(star))
                {
                    condition.StarCode = star;
                }

                if (!string.IsNullOrEmpty(priceRegexp))
                {
                    priceRegexp = HttpUtility.UrlDecode(priceRegexp);
                    IToyzObjcet toyzPrice = NumberUtil.ParseToyz(priceRegexp);
                    priceRange = toyzPrice as ToyzNumberRangeObject;
                    if (priceRange != null)
                    {
                        condition.LowestRate  = priceRange.min;
                        condition.HighestRate = priceRange.max;
                    }
                }

                if (!string.IsNullOrEmpty(geoLlId))
                {
                    condition.LandmarkLocationID = geoLlId;
                }
                else if (!string.IsNullOrEmpty(geoClId))
                {
                    condition.CommercialLocationId = geoClId;
                }
                else if (!string.IsNullOrEmpty(geoDid))
                {
                    condition.DistrictId = geoDid;
                }
            }
            else if (geoMode == "1")
            {
                condition.StartLatitude  = startLat ?? 0;
                condition.StartLongitude = startLng ?? 0;
                condition.EndLatitude    = endLat ?? 0;
                condition.EndLongitude   = endLng ?? 0;

                condition.PositionModeCode = geoMode;
            }
            else if (geoMode == "2")
            {
                condition.StartLatitude    = startLat ?? 0;
                condition.StartLongitude   = startLng ?? 0;
                condition.EndLatitude      = condition.StartLatitude;
                condition.EndLongitude     = condition.StartLongitude;
                condition.PositionModeCode = geoMode;
                condition.Radius           = radius ?? 0;
            }



            if (!string.IsNullOrEmpty(orderbyCode))
            {
                condition.OrderByCode   = orderbyCode;
                condition.OrderTypeCode = orderbyType;
            }
            else
            {
                condition.OrderTypeCode = "desc";
            }



            PageList <HotelForGetHotelList> hotels = elongBiz.getHotelList(condition);

            /*
             * if(priceRegexp!=null){
             *  foreach (HotelForGetHotelList hotel in hotels) {
             *      foreach()
             *      RoomForGetHotelList[] rooms = hotel.Rooms;
             *  }
             */



            IList <string> hotelIds = new List <string>();

            foreach (HotelForGetHotelList hotel in hotels)
            {
                hotelIds.Add(hotel.HotelId);
            }


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

            icr.Add(Restrictions.In("id", hotelIds.ToArray()));

            IList <HotelDetailModel> hotelDetails = icr.List <HotelDetailModel>();

            icr = BaseZdBiz.CreateCriteria <HotelFeatrueInfoModel>();
            icr.Add(Restrictions.In("hotelId", hotelIds.ToArray()));
            IList <HotelFeatrueInfoModel> hotelFeats = icr.List <HotelFeatrueInfoModel>();

            Dictionary <string, HotelDetailModel>      dictHotelDetails = hotelDetails.ToDictionary(p => p.id);
            Dictionary <string, HotelFeatrueInfoModel> dictHotelFeat    = hotelFeats.ToDictionary(p => p.hotelId);

            ViewData[typeof(PageList <HotelForGetHotelList>).Name]       = hotels;
            ViewData[typeof(Dictionary <string, HotelDetailModel>).Name] = dictHotelDetails;
            ViewData[typeof(HotelFeatrueInfoModel).Name] = dictHotelFeat;
            ViewData[typeof(ToyzNumberRangeObject).Name] = priceRange;
            return(View(viewName));
        }