Пример #1
0
        public XmlDocument Execute(string request)
        {
            var context = RequestContext.Parse(request);

            if (context == null)
            {
                return(Responser.ErrorContextResponse);
            }
            var processor = RequestProcessor.CreateProcessor(context);

            if (processor == null)
            {
                return(Responser.NoneProcessorResponse);
            }
            return(processor.Execute());
        }
Пример #2
0
        /// <summary>
        /// 创建请求处理器
        /// </summary>
        public static RequestProcessor CreateProcessor(RequestContext context)
        {
            RequestProcessor processor = null;

            if (context.Service == "PNRImportWithoutPat")
            {
                processor = new PNRImportWithoutPat();
            }
            else if (context.Service == "PNRImport")
            {
                processor = new PNRImport();
            }
            else if (context.Service == "ProduceOrder")
            {
                processor = new ProduceOrder();
            }
            else if (context.Service == "ProduceOrder2")
            {
                processor = new ProduceOrder2();
            }
            else if (context.Service == "ApplyRefund")
            {
                processor = new ApplyRefund();
            }
            else if (context.Service == "ApplyPostpone")
            {
                processor = new ApplyPostpone();
            }
            else if (context.Service == "OrderPay")
            {
                processor = new PayOrder();
            }
            else if (context.Service == "PayOrderByPayType")
            {
                processor = new PayOrderByPayType();
            }
            else if (context.Service == "PayApplyform")
            {
                processor = new PayApplyform();
            }
            else if (context.Service == "PayApplyformByPayType")
            {
                processor = new PayApplyformByPayType();
            }
            else if (context.Service == "QueryOrder")
            {
                processor = new QueryOrder();
            }
            else if (context.Service == "QueryApplyform")
            {
                processor = new QueryApplyform();
            }
            else if (context.Service == "QueryFlights")
            {
                processor = new QueryFlights();
            }
            else if (context.Service == "QueryFlightStop")
            {
                processor = new QueryFlightStop();
            }
            else if (context.Service == "QueryFlight")
            {
                processor = new QueryFlight();
            }
            else if (context.Service == "AutoPay")
            {
                processor = new AutoPay();
            }
            else if (context.Service == "ManualPay")
            {
                processor = new ManualPay();
            }
            if (processor != null)
            {
                processor.Context = context;
            }
            return(processor);
        }