BFM v4.2.0 如何添加DepartureDateTime

BFM v4.2.0 How to add DepartureDateTime

C#请求中如何添加出发日期时间?这是代码的一部分

   refOrgDest = new BFMV430.OTA_AirLowFareSearchRQOriginDestinationInformation
                        {
                            OriginLocation = new BFMV430.OriginDestinationInformationTypeOriginLocation { LocationCode
= refItin.Origin },
                            DestinationLocation = new BFMV430.OriginDestinationInformationTypeDestinationLocation { LocationCode = refItin.Destination },
                            RPH = (i + 1).ToString(),
                            TPA_Extensions = new BFMV430.OTA_AirLowFareSearchRQOriginDestinationInformationTPA_Extensions
                            {
                                CabinPref = new BFMV430.CabinPrefType
                                {
                                    Cabin = (BFMV430.CabinType)Enum.Parse(typeof(BFMV430.CabinType), refResBookType, true),
                                    PreferLevel = BFMV430.PreferLevelType.Preferred,
                                    CabinSpecified = true,
                                }
                            },
                            ItemElementName = BFMV430.ItemChoiceType.DepartureDateTime,
                            Item = new BFMV430.TravelDateTimeType
                            {
                                DepartureWindow = "00002359",
                            },                            
                        };
                        refOrgDestList.Add(refOrgDest);

我也在 运行 时收到此不匹配错误

ItemElementName 的值与 System.String 的类型不匹配;您需要将其设置为 prjWService.BFMV430.ItemChoiceType.@DepartureDateTime.

任何帮助都会很棒。

提前致谢

这是一段可以帮助您的代码,有趣的部分是关于 Sabre 对与搜索相关的所有交易期望的日期格式 flight/availability,这意味着(BMF、ADVShopping、AirLowFare 等是将使用相同的日期格式)。 (2019-04-14T00:00:00)

            __ItemOriginDestination = new AdvacedAirShopping.OTA_AirLowFareSearchRQOriginDestinationInformation
            {
                RPH = "1",
                ItemElementName = AdvacedAirShopping.ItemChoiceType.DepartureDateTime,
                Item = _FlightSearch.DepartureDateTime, //"2019-04-14T00:00:00" Here is the format expected by Sabre

                OriginLocation = new AdvacedAirShopping.OriginDestinationInformationTypeOriginLocation
                {
                    LocationCode = _FlightSearch.Origin
                },
                DestinationLocation = new AdvacedAirShopping.OriginDestinationInformationTypeDestinationLocation
                {
                    LocationCode = _FlightSearch.Destination
                }
            };