/// <summary> /// 从配置文件读取策略 /// </summary> /// <returns></returns> public void ReadPolicyConfig() { Policys.Clear(); EnvironmentInfo.BackUpJobConfigs.ForEach(x => { BackUpPolicy policy = ConvertToPolicy(x); policy.Id = x.Id; policy.IsTaskBackUpTables = x.BackUpType == 1 ? true : false; policy.IsTaskBackUpDataBase = x.BackUpType == 0 ? true : false; policy.ItemString = policy.PolicyToString; Policys.Add(policy); }); }
private void Search(int PnrSource = 1) { Policys.Clear(); Action action = () => { IsBusy = true; CommunicateManager.Invoke <IOrderService>(service => { var pnr = Trim(PnrCode); //只有儿童编码和升舱换开时赋值成人(原)订单号 pip.OldOrderId = pip.PnrImportType == Common.Enums.EnumPnrImportType.UpSeatChangePnrImport || pip.PnrImportType == Common.Enums.EnumPnrImportType.CHDPnrImport ? OrderID : string.Empty; pip.PnrAndPnrContent = pnr; pip.IsChangePnrTicket = IsChangePnrTicket; pip.IsLowPrice = IsLowPrice; var result = service.ImportPnrContext(pip);//service.ImportPnrContext(pnr, PnrSource); //只有儿童编码导入时返回儿童订单号 OrderId = pip.PnrImportType == Common.Enums.EnumPnrImportType.CHDPnrImport ? result.ChdOrderId : result.OrderId; //SeatPrice = result.SeatPrice; //PNR导入方式如果是升舱换开直接跳转到支付页面 //if (pip.PnrImportType == Common.Enums.EnumPnrImportType.UpSeatChangePnrImport) //{ // LocalUIManager.ShowPolicy(result.OrderId, null); // return; //} if (result.PolicyList == null || result.PolicyList.Count == 0) { return; } //导入成功,清空pnr PnrCode = null; //foreach (var item in result.PolicyList) //{ // DispatcherHelper.UIDispatcher.Invoke(new Action<PolicyDto>(Policys.Add), item); //} //非白屏预定和手机预定来源的订单政策过滤到动态特价 Policys = (result.OrderSource != EnumOrderSource.WhiteScreenDestine && result.OrderSource != EnumOrderSource.MobileDestine) ? result.PolicyList.Where(p => p.PolicySpecialType != EnumPolicySpecialType.DynamicSpecial).ToList() : result.PolicyList; }, UIManager.ShowErr); }; Task.Factory.StartNew(action).ContinueWith(task => { Action setBusyAction = () => { IsBusy = false; }; DispatcherHelper.UIDispatcher.Invoke(setBusyAction); }); }
public void OnLoaded() { Policys.Clear(); }