Ejemplo n.º 1
0
        private async Task <bool> GetDataFromMystifly(List <Domain.IssueTicketEntity> list, Models.IssueTickettModel model)
        {
            var supplierAgencyDetails = supplierAgencyServices.GetSupplierRouteBySupplierCodeAndAgencyCode(model.ticketCreateTSTFromPricing.AgencyCode
                                                                                                           , model.ticketCreateTSTFromPricing.SupplierCode, "issueticket");
            //code to add supplier details in to request
            var allSupplierBasicDetails = await supplierAgencyServices.GetSupplierAgencyBasicDetailswithsuppliercode(model.ticketCreateTSTFromPricing.AgencyCode, "T", model.ticketCreateTSTFromPricing.SupplierCode);

            model.SupplierAgencyDetails = allSupplierBasicDetails;

            model.ticketCreateTSTFromPricing.AgencyCode   = "";
            model.ticketCreateTSTFromPricing.SupplierCode = "";


            var result = await partnerClient.GetIssueTicketflight(supplierAgencyDetails.BaseUrl, supplierAgencyDetails.RequestUrl, model);

            string strData = JsonConvert.SerializeObject(result.Data);

            Domain.IssueTicketEntity partnerResponseEntity = JsonConvert.DeserializeObject <Domain.IssueTicketEntity>(strData);
            if (partnerResponseEntity != null)
            {
                if (partnerResponseEntity.TripDetailsResult.ItineraryInformation.Length > 0)
                {
                    //update details here strat
                    await supplierAgencyServices.UpdateTblBooking(partnerResponseEntity.TripDetailsResult.BookingId.ToString(), partnerResponseEntity.TripDetailsResult.ReservationItem[0].AirlinePNR);

                    await supplierAgencyServices.InsertIntotblBookingHistory(partnerResponseEntity.TripDetailsResult.BookingId.ToString(), model.ticketCreateTSTFromPricing.UserID.ToString(), "OK");

                    await supplierAgencyServices.UpdateTblAirpassemgersafterIssuedTicket(partnerResponseEntity.TripDetailsResult.BookingId.ToString(), partnerResponseEntity.TripDetailsResult.ReservationItem[0].AirlinePNR, partnerResponseEntity.TripDetailsResult.ItineraryInformation);

                    //update details here end
                }
                list.Add(partnerResponseEntity);
                return(true);
            }
            return(false);
        }