Example #1
0
        public void Test_Deserializer1()
        {
            JetermEntity.Parser.GetPrice getPrice = new JetermEntity.Parser.GetPrice();

            JetermEntity.Request.GetPrice request = new JetermEntity.Request.GetPrice();
            request.PassengerType = JetermEntity.EtermCommand.PassengerType.Adult;
            request.FlightList    = new List <JetermEntity.Flight>();
            JetermEntity.Flight flight = new JetermEntity.Flight();
            flight.FlightNo = "CZ123";

            string cmd = getPrice.ParseCmd(request);

            getPrice.ParseCmdResult(cmd);
        }
Example #2
0
        /// <summary>
        /// 主方法:【获取价格PAT】指令返回结果解析
        /// </summary>
        /// <param name="request">请求对象</param>
        /// <returns>解析结果</returns>
        public override CommandResult <JetermEntity.Response.GetPrice> BusinessDispose(JetermEntity.Request.GetPrice request)
        {
            JetermEntity.Parser.GetPrice getPrice = new JetermEntity.Parser.GetPrice(this.config, this.OfficeNo);

            try
            {
                this.Cmd = getPrice.ParseCmd(request);
                if (string.IsNullOrEmpty(this.Cmd))
                {
                    return(getPrice.Response);
                }

                ExcuteCmd();

                return(getPrice.ParseCmdResult(this.CmdResult));
            }
            catch
            {
                getPrice.Response.error = new Error(EtermCommand.ERROR.PARSE_PRICE_FAIL);
                getPrice.Response.error.CmdResultBag = this.CmdResult;
                return(getPrice.Response);
            }
        }