Ejemplo n.º 1
0
        /// <summary>
        /// 生成订单
        /// </summary>
        public string ProduceOrder(Guid policyId, PolicyType policyType, Guid publisher, string officeNo, string source, int choise, bool needAUTH, bool HasSubsidized,
                                   bool IsUsePatPrice, bool forbidChnagePNR)
        {
            var           orderView     = Session["OrderView"] as OrderView;
            var           flights       = Session["ReservedFlights"] as IEnumerable <FlightView>;
            MatchedPolicy matchedPolicy = MatchedPolicyCache.FirstOrDefault(p => p.Id == policyId);

            if (matchedPolicy == null)
            {
                throw new CustomException("政策选择超时");
            }
            if (flights.First().BunkType != null && orderView.Source == OrderSource.PlatformOrder &&
                (flights.First().BunkType == BunkType.Free || matchedPolicy.OriginalPolicy is SpecialPolicyInfo && ((SpecialPolicyInfo)matchedPolicy.OriginalPolicy).Type == SpecialProductType.LowToHigh))
            {
                SpecialPolicy policy = PolicyManageService.GetSpecialPolicy(policyId);
                //低打高返和集团票性质一样 不需要去订坐 2013-4-3 wangsl
                //if (policy != null && (policy.SynBlackScreen||policy.Type==SpecialProductType.LowToHigh))
                if (policy != null && policy.SynBlackScreen)
                {
                    PNRPair pnr = PNRHelper.ReserveSeat(flights, orderView.Passengers);
                    orderView.PNR = pnr;
                }
            }
            Order order = OrderProcessService.ProduceOrder(orderView, matchedPolicy, CurrentUser, BasePage.OwnerOEMId, forbidChnagePNR, (AuthenticationChoise)choise);

            FlightQuery.ClearFlightQuerySessions();
            if (order.Source == OrderSource.PlatformOrder && !PNRPair.IsNullOrEmpty(order.ReservationPNR) && !String.IsNullOrWhiteSpace(order.Product.OfficeNo))
            {
                if (needAUTH)
                {
                    authorize(order.ReservationPNR, officeNo, source, BasePage.OwnerOEMId);
                }
            }
            return(order.Id.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 生成申请单
        /// </summary>
        public string ProduceApplyform(Guid policyId, PolicyType policyType, string officeNo, decimal orderId, string source, int choise, bool needAUTH, bool IsUsePatPrice)
        {
            var           applyformView = Session["ApplyformView"] as UpgradeApplyformView;
            MatchedPolicy matchedPolicy = MatchedPolicyCache.FirstOrDefault(p => p.Id == policyId);

            if (matchedPolicy == null)
            {
                throw new CustomException("政策选择超时");
            }
            decimal newOrderId = OrderProcessService.Apply(orderId, applyformView, matchedPolicy, CurrentUser, BasePage.OwnerOEMId);

            FlightQuery.ClearFlightQuerySessions();
            if (needAUTH)
            {
                authorize(applyformView.NewPNR, officeNo, source, BasePage.OwnerOEMId);
            }
            BasePage.ReleaseLock(orderId);
            return(newOrderId.ToString());
        }