Exemplo n.º 1
0
        public JsResultObject submitOrder(OrderModel order, bool isElong)
        {
            JsResultObject re = new JsResultObject();

            order.lastModifyDate = DateTime.Now;


            if (isElong)
            {
                ELongApiBiz elongBiz = ELongApiBiz.GetInstant();
                re = elongBiz.submitHotelOrder(ref order);
                if (re.code == JsResultObject.CODE_SUCCESS)
                {
                    order.orderStatus = OrderModel.ORDER_STATUS_ELONG_SUCCESS;
                }
                else
                {
                    order.orderStatus = OrderModel.ORDER_STATUS_FAIL;
                }
            }

            BaseZdBiz.SaveOrUpdate(order, "订单");

            return(re);
        }
Exemplo n.º 2
0
        public void ImportDictList()
        {
            IList <ELongBaseCodeAdapter> basecodes = ELongStaticClient.GetBaseCodeList();

            //this.OpenSession();
            // ITransaction tx = this.session.BeginTransaction();
            foreach (ELongBaseCodeAdapter basecode in basecodes)
            {
                DictModel dict = new DictModel();
                dict.from(basecode);
                System.Console.WriteLine(string.Format("{0}:{1}:{2}", dict.type, dict.text, dict.value));
                BaseZdBiz.SaveOrUpdate(dict, "");
            }
            //tx.Commit();
        }
Exemplo n.º 3
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);
        }