public void GenerateQuotationHtml(uAPIClassLib.AirReference.AirSearchRsp objresp, string Key, string retkey, string OptionText, string FlightTotalPrice, string ServiceFee, string Status, string strFlightRequestId, string strTravellerId) { string TotalPrice = "0"; string KeyConfig = string.Empty; string strBothKeys = string.Empty; string FareInfoRef = string.Empty; List <uAPIClassLib.AirReference.typeBaseAirSegment> segments = new List <uAPIClassLib.AirReference.typeBaseAirSegment>(); List <uAPIClassLib.AirReference.SearchPassenger> passengers = new List <uAPIClassLib.AirReference.SearchPassenger>(); List <uAPIClassLib.AirReference.Connection> Connections = new List <uAPIClassLib.AirReference.Connection>(); int StopCount = 0; foreach (uAPIClassLib.AirReference.AirPricePointList Itemsin in objresp.Items) { if (StopCount == 0) { foreach (var AirPricePointin in Itemsin.AirPricePoint) { TotalPrice = AirPricePointin.TotalPrice; decimal FlightPrice = Convert.ToDecimal(objBOUtiltiy.RemovecurrencyCode(TotalPrice)); foreach (var AirPricingInfoin in AirPricePointin.AirPricingInfo) { uAPIClassLib.AirReference.FlightOption[] objFlightOption = AirPricingInfoin.FlightOptionsList.Where(fol => fol.LegRef == Key).ToArray(); uAPIClassLib.AirReference.FlightOption[] objFlightOptionReturnCal = AirPricingInfoin.FlightOptionsList.Where(fol => fol.LegRef == retkey).ToArray(); int RetrunStopsPriceCal = 0; int OnwayTotalStops = 0; string strCabinClass = string.Empty; string strBookingcode = string.Empty; foreach (var returnoptioninCal in objFlightOptionReturnCal) { foreach (var retOptioninCal in returnoptioninCal.Option) { RetrunStopsPriceCal = retOptioninCal.BookingInfo.Length; } } foreach (var optioninCal in objFlightOption) { foreach (var OptioninCal in optioninCal.Option) { OnwayTotalStops = OptioninCal.BookingInfo.Length; } } foreach (var FlightOptionsListin in AirPricingInfoin.FlightOptionsList) { #region ForwardFlightConfirm List <uAPIClassLib.AirReference.Option> objOptins = FlightOptionsListin.Option.Where(opt => opt.Key == Key).ToList(); if (objOptins != null) { for (int opt = 0; opt < objOptins.Count; opt++) { int BookingInfoFirstElement = 0; string CalculatedTotalPrice = "0"; string strclass = "border_bottom1"; uAPIClassLib.AirReference.BookingInfo[] objBookingInfo = objOptins[opt].BookingInfo; foreach (var objBookingInfoin in objBookingInfo) { strCabinClass = objBookingInfoin.CabinClass; strBookingcode = objBookingInfoin.BookingCode; uAPIClassLib.AirReference.typeBaseAirSegment[] objAirSegment = objresp.AirSegmentList.Where(seg => seg.Key == objBookingInfoin.SegmentRef).ToArray(); if (objAirSegment != null) { foreach (var inAirSegment in objAirSegment) { uAPIClassLib.AirReference.typeBaseAirSegment segment = new uAPIClassLib.AirReference.typeBaseAirSegment(); if (BookingInfoFirstElement == 0) { CalculatedTotalPrice = FlightTotalPrice; strclass = "border_bottom"; if (retkey != "") { KeyConfig = "?optkey=" + Key + "&optkeyret=" + retkey; strBothKeys = Key + "~" + retkey; } else { KeyConfig = "?optkey=" + Key; strBothKeys = Key + "~"; } } else { OptionText = ""; CalculatedTotalPrice = ""; strclass = "border_bottom1"; } BookingInfoFirstElement = 1; DataRow Segment1 = dtQuotation.NewRow(); Segment1["OptionText"] = OptionText; Segment1["FlightNo"] = inAirSegment.FlightNumber; Segment1["FlightRequestId"] = strFlightRequestId; Segment1["TrvellerId"] = strTravellerId; string strAirLineName = string.Empty; DataRow[] drAirLineList = objDsAirlinecode.Tables[2].Select("airline_code='" + inAirSegment.Carrier + "'"); if (drAirLineList.Length > 0) { strAirLineName = drAirLineList[0]["airline_name"].ToString(); } else { strAirLineName = segment.Carrier; } Segment1["AirLineCode"] = strAirLineName; Segment1["airlineimgsrc"] = objBOUtiltiy.LogoUrl() + "DinoSales/airline_logo/" + inAirSegment.Carrier + ".gif"; string OriginDesc = string.Empty; string DestinationDesc = string.Empty; DataRow[] drOrgGdsCodes; drOrgGdsCodes = objDsAirlinecode.Tables[3].Select("GdsCode='" + inAirSegment.Origin + "'"); if (drOrgGdsCodes.Length > 0) { OriginDesc = drOrgGdsCodes[0]["GdsCodeDescription"].ToString(); } else { OriginDesc = inAirSegment.Origin; } Segment1["FromCode"] = OriginDesc; DataRow[] drDestGdsCodes; drDestGdsCodes = objDsAirlinecode.Tables[3].Select("GdsCode='" + inAirSegment.Destination + "'"); if (drDestGdsCodes.Length > 0) { DestinationDesc = drDestGdsCodes[0]["GdsCodeDescription"].ToString(); } else { DestinationDesc = inAirSegment.Destination; } Segment1["ToCode"] = DestinationDesc; Segment1["DeptDateAndTime"] = objBOUtiltiy.ConvertDateString(inAirSegment.DepartureTime); Segment1["ArrivalDateAndtime"] = objBOUtiltiy.ConvertDateString(inAirSegment.ArrivalTime); Segment1["TotalPrice"] = CalculatedTotalPrice; Segment1["ServiceFee"] = ServiceFee; Segment1["Status"] = Status; Segment1["TrClass"] = strclass; Segment1["CabinClass"] = strCabinClass; Segment1["OptionKeys"] = KeyConfig; Segment1["Quotationkeys"] = strBothKeys; Segment1["CurrencyCode"] = CalculatedTotalPrice != "" ? strCurrencyCode : ""; dtQuotation.Rows.Add(Segment1); } } } } } #endregion ForwardFlightConfirm if (retkey != "") { #region ReturnFlightConfirm if (retkey != "") { List <uAPIClassLib.AirReference.Option> objReturnOptins = FlightOptionsListin.Option.Where(opt => opt.Key == retkey).ToList(); if (objOptins != null) { for (int opt = 0; opt < objReturnOptins.Count; opt++) { uAPIClassLib.AirReference.BookingInfo[] objBookingInfo = objReturnOptins[opt].BookingInfo; foreach (var objBookingInfoin in objBookingInfo) { strCabinClass = objBookingInfoin.CabinClass; strBookingcode = objBookingInfoin.BookingCode; uAPIClassLib.AirReference.typeBaseAirSegment[] objAirSegment = objresp.AirSegmentList.Where(seg => seg.Key == objBookingInfoin.SegmentRef).ToArray(); if (objAirSegment != null) { foreach (var inAirSegment in objAirSegment) { DataRow Segment1 = dtQuotation.NewRow(); Segment1["OptionText"] = ""; Segment1["FlightNo"] = inAirSegment.FlightNumber; string strAirLineName = string.Empty; DataRow[] drAirLineList = objDsAirlinecode.Tables[2].Select("airline_code='" + inAirSegment.Carrier + "'"); if (drAirLineList.Length > 0) { strAirLineName = drAirLineList[0]["airline_name"].ToString(); } else { strAirLineName = inAirSegment.Carrier; } Segment1["AirLineCode"] = strAirLineName; Segment1["airlineimgsrc"] = objBOUtiltiy.LogoUrl() + "DinoSales/airline_logo/" + inAirSegment.Carrier + ".gif"; string OriginDesc = string.Empty; string DestinationDesc = string.Empty; DataRow[] drOrgGdsCodes; drOrgGdsCodes = objDsAirlinecode.Tables[3].Select("GdsCode='" + inAirSegment.Origin + "'"); if (drOrgGdsCodes.Length > 0) { OriginDesc = drOrgGdsCodes[0]["GdsCodeDescription"].ToString(); } else { OriginDesc = inAirSegment.Origin; } Segment1["FromCode"] = OriginDesc; DataRow[] drDestGdsCodes; drDestGdsCodes = objDsAirlinecode.Tables[3].Select("GdsCode='" + inAirSegment.Destination + "'"); if (drDestGdsCodes.Length > 0) { DestinationDesc = drDestGdsCodes[0]["GdsCodeDescription"].ToString(); } else { DestinationDesc = inAirSegment.Destination; } Segment1["ToCode"] = DestinationDesc; Segment1["DeptDateAndTime"] = objBOUtiltiy.ConvertDateString(inAirSegment.DepartureTime); Segment1["ArrivalDateAndtime"] = objBOUtiltiy.ConvertDateString(inAirSegment.ArrivalTime); Segment1["TotalPrice"] = ""; Segment1["TrClass"] = "border_bottom1"; Segment1["CabinClass"] = strCabinClass; Segment1["OptionKeys"] = ""; Segment1["Quotationkeys"] = ""; Segment1["CurrencyCode"] = ""; dtQuotation.Rows.Add(Segment1); } } } } } } #endregion ReturnFlightConfirm } } } } } StopCount = 1; } }