public async void AcceptDialog() { // ダイアログ種別で分岐 switch (DType) { case DialogType.Configure: // 設定を保存 XmlConverter.Serialize(CurrentLogConfig, String.Format(@"{0}\LogConfig.xml", SiteConfig.BASE_DIR)); if (CurrentLoginInfo is null) { CurrentLoginInfo = new LoginInfo(); } CurrentLoginInfo.LoginPass = AesEncrypt.EncryptToBase64(SecureStringConverter.SecureToPlain(CurrentAesPass), AesKeyConf.key, AesKeyConf.iv); XmlConverter.Serialize(CurrentLoginInfo, String.Format(@"{0}\LoginInfo.xml", SiteConfig.BASE_DIR)); // ダイアログを閉じる IsDialogOpen = false; DialogView = null; break; case DialogType.HotelUpdate: // Viewの型で更に分岐 switch (DialogView) { case MaterialDialogOkCancel okCancelDialog: // ダイアログを閉じる IsDialogOpen = false; DialogView = null; // 次のダイアログを表示する Message = "処理中..."; DialogView = new MaterialDialogProcessing() { DataContext = this }; IsDialogOpen = true; // 処理モデル定義 var model = new HotelUpdate(); await Task.Run(() => { // 処理実行 model.Execute(); }); // 処理成功 if (model.Result) { // ダイアログを閉じる IsDialogOpen = false; DialogView = null; // 次のダイアログを表示する Message = "完了しました\r\n"; DialogView = new MaterialDialogOk() { DataContext = this }; IsDialogOpen = true; } break; case MaterialDialogOk okDialog: // ダイアログを閉じる IsDialogOpen = false; DialogView = null; break; } break; case DialogType.License: // ダイアログを閉じる IsDialogOpen = false; DialogView = null; break; } }
static void Main(string[] args) { //艺龙 //var geo = new Mzl.Proxy.Hotel.Elong.StaticData.HotelGeoService().GetAll(); //var result = new HotelListService().Query(new HotelListRequestEntity() { ArrivalDate = DateTime.Today.AddDays(2), DepartureDate = DateTime.Today.AddDays(4), CheckInPersonAmount = 1, CityId="0101" }); //var resultHotel = new Mzl.Proxy.Hotel.Elong.Query.HotelDetail().Query(new HotelDetailRequestEntity() { HotelIds = "50101002", ArrivalDate = DateTime.Today.AddDays(2), DepartureDate = DateTime.Today.AddDays(4) }); //携程酒店列表 //var hil = new Mzl.Proxy.Hotel.CTrip.Query.HotelIdList(); //var test = new HotelIdListRequestEntity(); //test.City = 1; //test.PageIndex = 1; //test.PageSize = 1000; //var ret = hil.QueryStr(test); //酒店详情 //var hdi = new Mzl.Proxy.Hotel.CTrip.Query.HotelDesInfo(); //var hdre = new HotelDesInfoReqEntity //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.SearchCandidate { HotelID = 480728 }, // Settings = new Settings // { // PrimaryLangID = "zh-cn", // ExtendedNodes = new string[]{"HotelStaticInfo.GeoInfo", // "HotelStaticInfo.NearbyPOIs", // "HotelStaticInfo.TransportationInfos", // "HotelStaticInfo.Brand", // "HotelStaticInfo.Group", // "HotelStaticInfo.Ratings", // "HotelStaticInfo.Policies", // "HotelStaticInfo.NormalizedPolicies.ChildAndExtraBedPolicy", // "HotelStaticInfo.AcceptedCreditCards", // "HotelStaticInfo.ImportantNotices", // "HotelStaticInfo.Facilities", // "HotelStaticInfo.Pictures", // "HotelStaticInfo.Descriptions", // "HotelStaticInfo.Themes", // "HotelStaticInfo.ContactInfo", // "HotelStaticInfo.ArrivalTimeLimitInfo", // "HotelStaticInfo.DepartureTimeLimitInfo", // "HotelStaticInfo.HotelTags.IsBookable" // } // } //}; //var ret2 = hdi.Query(hdre); //var str = hdi.QueryStr(hdre); //酒店静态信息2 //var resultObj = HotelApiAccess.QueryObj<HotelDesInfoReqEntity, HotelDesInfoResEntity>(new HotelDesInfoReqEntity //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.SearchCandidate { HotelID = 480728 }, // Settings = new Settings // { // PrimaryLangID = "zh-cn", // ExtendedNodes = new string[]{"HotelStaticInfo.GeoInfo", // "HotelStaticInfo.NearbyPOIs", // "HotelStaticInfo.TransportationInfos", // "HotelStaticInfo.Brand", // "HotelStaticInfo.Group", // "HotelStaticInfo.Ratings", // "HotelStaticInfo.Policies", // "HotelStaticInfo.NormalizedPolicies.ChildAndExtraBedPolicy", // "HotelStaticInfo.AcceptedCreditCards", // "HotelStaticInfo.ImportantNotices", // "HotelStaticInfo.Facilities", // "HotelStaticInfo.Pictures", // "HotelStaticInfo.Descriptions", // "HotelStaticInfo.Themes", // "HotelStaticInfo.ContactInfo", // "HotelStaticInfo.ArrivalTimeLimitInfo", // "HotelStaticInfo.DepartureTimeLimitInfo", // "HotelStaticInfo.HotelTags.IsBookable" // } // } //}); //房型 //var rdi = new Mzl.Proxy.Hotel.CTrip.Query.RoomDesInfo(); //var rdireq = new RoomDesInfoReqEntity() //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.SearchCandidate // { // HotelID = 436187, // RoomIds = new string[] { "18162" } // }, // Settings = new Settings // { // PrimaryLangID = "zh-cn", // ExtendedNodes = new string[]{ "RoomTypeInfo.Facilities", // "RoomTypeInfo.Pictures", // "RoomTypeInfo.Descriptions", // "RoomTypeInfo.Smoking", // "RoomTypeInfo.BroadNet", // "RoomTypeInfo.ChildLimit", // "RoomTypeInfo.RoomBedInfos", // "RoomInfo.ApplicabilityInfo", // "RoomInfo.Smoking", // "RoomInfo.BroadNet", // "RoomInfo.RoomBedInfos", // "RoomInfo.RoomFGToPPInfo", // "RoomInfo.RoomGiftInfos", // "RoomInfo.ChannelLimit", // "RoomInfo.ExpressCheckout", // "RoomInfo.RoomTags", // "RoomInfo.BookingRules", // "RoomInfo.Descriptions" // } // } //}; //var rdires = rdi.Query(rdireq); //var rdiresStr = rdi.QueryStr(rdireq); //酒店和房型增量 //var ci = new GetChangeInfo(); //var cireq = new ChangeInfoReqEntity //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.ChangeInfo.SearchCandidate // { // StartTime = "2017-11-07T21:00:00", // Duration = 0 // }, // Settings = new Settings // { // IsShowChangeDetails = "F" // }, // PagingSettings = new PagingSettings // { // PageSize = 200, // LastRecordID = "0" // } //}; //var cires = ci.Query(cireq); //var ciresStr = ci.QueryStr(cireq); //房型上下线 //var resultStr = HotelApiAccess.QueryStr(new RoomStatusChangeReqEntity //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.RoomStatusChange.SearchCandidate // { // DateTimeRange = new DateTimeRange // { // Start = "2017-11-28T10:34:00", // End = "2017-11-28T11:33:00" // } // } //}, "RoomStatusChange"); //通用接口 //var resultStr = HotelApiAccess.QueryObj<RoomStatusChangeReqEntity, RoomStatusChangeResEntity>(new RoomStatusChangeReqEntity //{ // SearchCandidate = new EntityModel.Proxy.CTripHotel.RoomStatusChange.SearchCandidate // { // DateTimeRange = new DateTimeRange // { // Start = "2017-11-28T10:34:00", // End = "2017-11-28T11:33:00" // } // } //}, "RoomStatusChange"); //solrTest //var tt = new TestSolr //{ // add=new Add // { // doc=new Doc // { // first2="caocaocao", // last="goodluck" // } // } //}; //var str = JsonHelper.SerializeObject(tt); //var strfinal = Index("str"); //upload //var tt = new AddHotelDescription(); //tt.AddHotels(480728); var hd = new HotelUpdate(); hd.UpLoadHotelSimpleInfoToSolr(new int[] { 2 }); //download solr //var ctripHoteldal = new CTripHotelDesDal(); //var hotel=ctripHoteldal.QueryById(480728); }