示例#1
0
        /// <summary>
        /// 根据给出的订座信息和OEM编号,生成订座指令字串。
        /// </summary>
        /// <param name="reservationInfo">订座信息</param>
        /// <param name="oemId">OEM编号</param>
        /// <returns>订座指令字串</returns>
        public static string GetBookingTicketsString(ReservationInfo reservationInfo, Guid oemId)
        {
            const ConfigUseType type = ConfigUseType.Reserve;
            var officeNumber         = GetOfficeNumber(oemId, type);

            return(CommandBuilderService.GetBookInstructionSet(reservationInfo, officeNumber));
        }
示例#2
0
        public ExecuteResult <ReservedPnr> Book(ReservationInfo reservationInfo, string officeNo, string userName)
        {
            var commandString = CommandBuilderService.GetBookInstructionSet(reservationInfo, officeNo);

            var veService = new veSWScnService();

            veService.Url = ReplaceUrl(veService.Url);
            var returnString = veService.Book(commandString, userName, "KMG215");

            var      xdoc         = XDocument.Parse(returnString, LoadOptions.None);
            XElement content      = xdoc.Element("P");
            var      hasSuccessed = content != null && content.Element("R").Value == "1";
            string   rawData      = content.Element("C").Value;

            var executeResult = new ExecuteResult <ReservedPnr>
            {
                Success = hasSuccessed,
                Result  = hasSuccessed ? Domain.Utility.Parser.GetPnrContent(rawData) : null,
                Message = rawData
            };

            return(executeResult);
        }