private TravellerReferenceInformationType AddPaxReference(TravellerReferenceInformationType paxDefinition, int paxCount, string personType, int referenceStartNumber) { if (paxCount < 1) { return(paxDefinition); } if (paxDefinition == null) { paxDefinition = new TravellerReferenceInformationType { ptc = new string[] { personType }, traveller = new TravellerDetailsType[paxCount] }; } for (var i = 0; i < paxCount; i++) { var traveller = new TravellerDetailsType(); paxDefinition.traveller[i] = traveller; if (personType == "INF") { traveller.infantIndicator = "1"; traveller.@ref = (i + 1).ToString(CultureInfo.InvariantCulture); } else { traveller.@ref = ((i + 1) + referenceStartNumber).ToString(CultureInfo.InvariantCulture); //globalny numer referencyjny paxa } } return(paxDefinition); }
private TravellerReferenceInformationType AddPaxReference(TravellerReferenceInformationType paxDefinition, int paxCount, string personType, int referenceStartNumber) { if (paxCount < 1) return paxDefinition; if (paxDefinition == null) { paxDefinition = new TravellerReferenceInformationType { ptc = new string[] {personType}, traveller = new TravellerDetailsType[paxCount] }; } for (var i = 0; i < paxCount; i++) { var traveller = new TravellerDetailsType(); paxDefinition.traveller[i] = traveller; if (personType == "INF") { traveller.infantIndicator = "1"; traveller.@ref = (i + 1).ToString(CultureInfo.InvariantCulture); } else { traveller.@ref = ((i + 1) + referenceStartNumber).ToString(CultureInfo.InvariantCulture); //globalny numer referencyjny paxa } } return paxDefinition; }