protected void staffTranSearch_Click(object sender, EventArgs e) { TransViw view = new TransViw(); BookingInfo b = new BookingInfo(); //BOOKING ID if (TBbookingID.Text != "") { int bookingID = Convert.ToInt32(TBbookingID.Text); String err = tran.MyValidate(bookingID); LerrbookingID.Text = err; List<TransViw> TR = tran.findRecord(bookingID); GridView1.DataSource = TR; GridView1.DataBind(); } //MOVIE NAME else if (DDLmovieName.SelectedItem.Text != "") { String movie = DDLmovieName.SelectedItem.Text; List<TransViw> TR = tran.findMovieRecord(movie); GridView1.DataSource = TR; GridView1.DataBind(); } //CINEMA NAME else if (DDLcinemaName.SelectedItem.Text != "") { String cinema = DDLcinemaName.SelectedItem.Text; List<TransViw> TR = tran.findCinemaRecord(cinema); GridView1.DataSource = TR; GridView1.DataBind(); } //CINEMANAME,MOVIE NAME, DATE,TIMESLOT else { if (DDLcinemaName.SelectedItem.Text != "" && DDLmovieName.SelectedItem.Text != "" && DDLtimeSlot.SelectedItem.Text != "" && TBdate.Text != "") { String movie = DDLmovieName.SelectedItem.Text; String cinema = DDLcinemaName.SelectedItem.Text; String date = TBdate.Text; int timeslot = Convert.ToInt32(DDLtimeSlot.SelectedItem.Text); List<TransViw> TR = tran.findRecordall(movie, cinema, date, timeslot); GridView1.DataSource = TR; GridView1.DataBind(); } else if (DDLcinemaName.SelectedItem.Text == "" && DDLmovieName.SelectedItem.Text == "" && DDLtimeSlot.SelectedItem.Text == "" && TBdate.Text == "") LerrbookingID.Text = "Select Movie,Cinema,Date,TImeSlot Option"; else LerrbookingID.Text = "Give BookingID"; } DDLmovieName.ClearSelection(); }
public void OnGetPrice() { // Gets the TempData["Passengers"] to compute bill baggage. var strPassengers = TempData.Peek("Passengers") as string; var passengers = JsonConvert.DeserializeObject <List <Passenger> >(strPassengers); // Gets the TempData["ChosenService"] to compute the total price in PriceInfo. var strChosenService = TempData.Peek("ChosenService") as string; var chosenService = System.Text.Json.JsonSerializer.Deserialize <Model.FlightService>(strChosenService); this.FlightNumber = chosenService.FsId; this.AirlineProvider = this._context.GetAirline(chosenService.AirlineCode).Name; // To display what things are billed. this.CabinBagCount = BookingInfo.GetCabinBagTotal(passengers); this.CheckedBagCount = BookingInfo.GetCheckedBagTotal(passengers); this.PriceInfo = new PriceInfo(); this.PriceInfo.Passengers = this.PriceInfo.CalcPassenger(passengers); this.PriceInfo.CabinBags = BaggagePrice.Calc(BookingInfo.GetCabinBagTotal(passengers)); this.PriceInfo.CheckedBags = BaggagePrice.Calc(BookingInfo.GetCheckedBagTotal(passengers)); this.PriceInfo.TotalPrice = this.PriceInfo.SetTotalPrice(chosenService); // Processes the bill of bags of a respective passenger. var billBaggage = PriceInfo.CalcBaggage(passengers); //TempData["BillBaggage"] = JsonSerializer.Serialize(billBaggage); TempData["BillBaggage"] = JsonConvert.SerializeObject(billBaggage); TempData["PriceInfo"] = System.Text.Json.JsonSerializer.Serialize(this.PriceInfo); }
public Ticket bookSeats(BookingInfo bookingInfo) { return(new Ticket { Id = bookMyShowManager.BookSeats(bookingInfo) }); }
protected override void Execute(CodeActivityContext executionContext) { //Create the tracing service ITracingService tracingService = executionContext.GetExtension <ITracingService>(); //Create the context IWorkflowContext context = executionContext.GetExtension <IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); try { var bookingJson = BookingInfo.Get <string>(executionContext); PayloadBooking payloadBooking = new PayloadBooking(tracingService, service); payloadBooking.BookingInfo = JsonHelper.DeserializeJson(bookingJson, tracingService); ProcessBookingService process = new ProcessBookingService(payloadBooking); Response.Set(executionContext, process.ProcessPayload()); } catch (FaultException <OrganizationServiceFault> ex) { throw new InvalidPluginExecutionException(ex.ToString()); } catch (TimeoutException ex) { throw new InvalidPluginExecutionException(ex.ToString()); } catch (Exception ex) { throw new InvalidPluginExecutionException(ex.ToString()); } }
public async Task <IActionResult> PutBookingInfos(int id, BookingInfo BookingInfo) { if (id != BookingInfo.Id) { return(BadRequest()); } _context.Entry(BookingInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <List <TimeSpan> > GetMyBookingsForDay(DateTime date, int Id) { List <TimeSpan> myBook = new List <TimeSpan>(); var bookings = new BookingInfo[0]; var bookingsQ = new List <BookingInfo>(); try { bookings = await GetBookings(Id); var books = from b in bookings where (b._Date == date.ToString("yyyy-MM-dd")) select b; int[] times = books.AsEnumerable().Select(s => s._Time).ToArray <int>(); foreach (var time in times) { var spots = from t in books where t._Time == time select t; int count = spots.Count(); if (count != 0) { TimeSpan timeTS = new TimeSpan(0, time * 30, 0); if (!myBook.Contains(timeTS)) { myBook.Add(timeTS); } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(ex.InnerException); } return(myBook); }
public async Task <IHttpActionResult> PostBookingInfo(BookingInfo bookingInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.BookingInfoes.Add(bookingInfo); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (BookingInfoExists(bookingInfo.BookingId)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = bookingInfo.BookingId }, bookingInfo)); }
public IActionResult Post(int ScheduleId, [FromBody] BookingInfo bookingInfo) { try { if (ModelState.IsValid) { bookingInfo.ScheduleId = ScheduleId; var bookingConfirmed = _repository.AddBooking(bookingInfo); if (bookingConfirmed > 0) { return(Created(new Uri("/flights/booking", UriKind.Relative), bookingInfo)); } else { return(BadRequest("Booking not confirmed")); } } else { return(BadRequest(ModelState)); } } catch (Exception ex) { return(BadRequest(ExceptionHelper.ProcessError(ex))); } }
public async Task <Dictionary <TimeSpan, int> > GetBookingCountForDay(DateTime date) { Dictionary <TimeSpan, int> dict = new Dictionary <TimeSpan, int>(); var bookings = new BookingInfo[0]; var bookingsQ = new List <BookingInfo>(); try { bookings = await GetBookings(); var books = from b in bookings where (b._Date == date.ToString("yyyy-MM-dd")) select b; int[] times = books.AsEnumerable().Select(s => s._Time).ToArray <int>(); foreach (var time in times) { var spots = from t in books where t._Time == time select t; int count = spots.Count(); if (count != 0) { dict[new TimeSpan(0, time * 30, 0)] = count; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(ex.InnerException); } return(dict); }
private void ReserveReturnBusSeat(BookingInfo info) { var busHandler = new BusReservationHandler(); busHandler.ReserveReturnSeat(info); reservationCompleted(info.ReturnJourney, info.Id); }
private void ReserveTrainSeat(BookingInfo info, bool isOutwardJourney) { var onlineHandler = new TrainReservationHandler(); onlineHandler.ReserveSeat(info, isOutwardJourney); reservationCompleted((isOutwardJourney) ? (IJourney)info : info.ReturnJourney, info.Id); }
private void ReserveBusSeat(BookingInfo info) { var busHandler = new BusReservationHandler(); busHandler.ReserveSeat(info); reservationCompleted(info, info.Id); }
private void ReserveReturnSeat(BookingInfo bookingInfo) { if (bookingInfo.ReturnJourney == null) { return; } ReturnJourney returnJourney = bookingInfo.ReturnJourney; switch (returnJourney.ModeOfTransport) { case ModeOfTransport.Bus: System.Console.WriteLine("Reserve Return Bus Seat for Booking {0}", bookingInfo.Id); bookingInfo.ReturnJourney.IsReservationProcessed = true; ReserveReturnBusSeat(bookingInfo); break; case ModeOfTransport.Train: System.Console.WriteLine("Reserve Return Train Seat for Booking {0}", bookingInfo.Id); bookingInfo.ReturnJourney.IsReservationProcessed = true; ApplyAutomaticTrainUpgrade(bookingInfo.ReturnJourney, bookingInfo.Id); ReserveTrainSeat(bookingInfo, false); break; case ModeOfTransport.Tram: // Nothing to do - assuming user realises tram tickets have open-ended returns break; } }
public void ReserveSeat(BookingInfo bookingInfo) { System.Console.WriteLine("Reserve {0} Seat for Booking {1}", Enum.GetName(typeof(ModeOfTransport), bookingInfo.ModeOfTransport), bookingInfo.Id); bookingInfo.IsReservationProcessed = true; switch (bookingInfo.ModeOfTransport) { case ModeOfTransport.Bus: ReserveBusSeat(bookingInfo); break; case ModeOfTransport.Train: ApplyAutomaticTrainUpgrade(bookingInfo, bookingInfo.Id); ReserveTrainSeat(bookingInfo, true); break; case ModeOfTransport.Tram: ReserveTramSeat(bookingInfo); break; default: break; } ReserveReturnSeat(bookingInfo); if (bookingInfo.ModeOfTransport == ModeOfTransport.Bus) { generateBookingConfirmation(bookingInfo); } System.Console.WriteLine(); }
public async Task <List <BookingInfo> > GetBookingsSelectedWeek(DateTime date, int Id = 0) { var bookings = new BookingInfo[0]; var bookingsQ = new List <BookingInfo>(); int dayOfTheWeek = (int)date.DayOfWeek; DateTime startDate = date.Subtract(new TimeSpan(dayOfTheWeek, 0, 0, 0, 0)); DateTime endDate = startDate.Add(new TimeSpan(8, 0, 0, 0, 0)); System.Diagnostics.Debug.WriteLine(startDate); System.Diagnostics.Debug.WriteLine(date); System.Diagnostics.Debug.WriteLine(endDate); try { bookings = await GetBookings(Id); var books = from b in bookings where (DateTime.Compare(b.Date, startDate) > 0) && (DateTime.Compare(b.Date, endDate) < 0) select b; bookingsQ.AddRange(books); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(ex.InnerException); } return(bookingsQ); }
public static bool SendDraftToCustomer(BookingInfo booking, string specialDescription) { try { string artistEmail = ArtistController.Instance[booking.ArtistID.Value].Email; string artistName = ArtistController.Instance[booking.ArtistID.Value].Name; List <Attachment> attachments = null; if (booking.ImageList.Count > 0) { attachments = new List <Attachment>(); foreach (ImageInfo image in booking.ImageList) { Attachment attachment = new Attachment(image.Path); attachment.ContentId = Path.GetFileName(image.Path); attachments.Add(attachment); } } return(SendEmail(Email.SendOrderToArtistSubject.Replace("[SystemReference]", booking.SystemReference).Replace("[Product]", (booking.ProductCategory != null ? booking.ProductCategory.Name : "Custom image")), Email.SendOrderToArtistBody.Replace("[Artist]", artistName).Replace("[SpecialInstruction]", "<strong>Comments</strong><br />" + specialDescription), artistEmail, string.Empty, string.Empty, attachments, string.Empty)); } catch (Exception ex) { LogHelper.Log(Logger.Application, LogLevel.Error, ex); return(false); } }
private void Autogenerate() { BookingController bookingController = new BookingController(); BookingInfo bookingInfo = bookingController.AutogenerateCode(code); this.txtBookingNo.Text = bookingInfo.AutoCode; }
/// <summary> /// Saves the booking details report. /// </summary> /// <param name="booking">The booking.</param> /// <param name="companyId">The company identifier.</param> /// <param name="userId">The user identifier.</param> /// <param name="bookingPath">The booking path.</param> private Task SaveBookingDetailsReport(BookingInfo booking, int companyId, int userId, string bookingPath) { InventoryBL inventoryBL = new InventoryBL(DataContext); string bookingDetailsFileName = string.Format("{0} {1} details", booking.BookingNumber, Utils.Ellipsize(booking.BookingName, 50)); BookingDetailsReportParameters parametersBookingDetails = new BookingDetailsReportParameters { BookingId = booking.BookingId, BookingName = booking.BookingName, CompanyId = companyId, ContactPerson = null, DisplayMode = "Admin", ItemTypeId = 0, RelatedTable = booking.RelatedTable, SortExpression = string.Empty, UserId = userId }; string fileNameExtension; string encoding; string mimeType; byte[] reportBytes = UserWebReportHandler.GenerateBookingDetailsReport(parametersBookingDetails, ReportTypes.Excel, out fileNameExtension, out encoding, out mimeType, true); return(FileHandler.SaveFileToDisk(reportBytes, string.Format("{0}.{1}", bookingDetailsFileName, fileNameExtension), bookingPath)); }
public JsonResult BookRoom(BookingInfoViewModel bookingInfo) { string result = string.Empty; try { var a = DateTime.Now; var generatedBookingId = Guid.NewGuid(); var toInsert = new BookingInfo { Id = generatedBookingId, EmailAddress = bookingInfo.EmailAddress, PeopleStaying = bookingInfo.PeopleStaying, RoomBookDate = new RoomBookDate { BookingInfoId = generatedBookingId, CreatedDate = DateTime.Now, DateFrom = DateTime.Parse(bookingInfo.DateFrom), DateTo = DateTime.Parse(bookingInfo.DateFrom).AddDays(1), RoomId = bookingInfo.RoomId } }; _bookingService.AddBooking(toInsert); result = "Successfully proccesed your booking. Thankyou very much!"; } catch (Exception ex) { result = "Cannot process your booking as of the moment. Please try again later."; } return(new JsonResult(result)); }
private void btnBooking_Click(object sender, EventArgs e) { BookingInfo frmForm = new BookingInfo(); frmForm.ShowDialog(); //btnStatus(true); }
public bool Insert(BookingInfo bookinginfo) { bool status; try { using (var con = new MySqlConnection(connectionString)) { string query = "INSERT INTO bookingInfo(BookingId,TripId,UserId,BookingDate) " + "VALUES (@bookingId,@tripId,@userId,@bookingDate)"; var sqlCommand = new MySqlCommand(query, con); sqlCommand.Parameters.Add(new MySqlParameter("@bookingId", bookinginfo.BookingId)); sqlCommand.Parameters.Add(new MySqlParameter("@tripId", bookinginfo.TripId)); sqlCommand.Parameters.Add(new MySqlParameter("@userId", bookinginfo.UserId)); sqlCommand.Parameters.Add(new MySqlParameter("@bookingDate", bookinginfo.BookingDate)); sqlCommand.ExecuteNonQuery(); status = true; } } catch (Exception ex) { Logger.LogException(ex); throw new Exception("Error while connecting with database, please contact site admin for more detail."); } finally { } return(status); }
public static string SendOrderText(BookingInfo booking) { return(Email.OrderConfirmation .Replace("[Ref]", (booking != null ? booking.ID.ToString() : "")) .Replace("[Product]", (booking != null ? booking.ProductCategory.Name : "Not defined")) .Replace("[Amount]", "$ " + (booking != null ? booking.ProductCategory.Amount.ToString() : ""))); }
protected void lblOrder_Click(object sender, EventArgs e) { string id = Request.QueryString["idS"].ToString(); var dt1 = new DataTable(); dt1 = ShowTimesService.ShowTimes_GetById(id); lblFilm.Text = dt1.Rows[0]["NameF"].ToString(); double price = Convert.ToDouble(dt1.Rows[0]["Price"].ToString()); double number = Convert.ToDouble(txtNumber.Text); string str = (price * number).ToString(); lblTotal.Text = StringClass.FormatNumber(str); DataTable dt = CustomerService.Customer_GetByTop("", "Username='******'", ""); BookingInfo obj = new BookingInfo(); obj.CusId = dt.Rows[0]["CusId"].ToString(); obj.ShoId = id; obj.Bilmoney = str; obj.Quantity = txtNumber.Text; BookingService.Booking_Insert(obj); var dt2 = new DataTable(); dt2 = BookingService.Booking_GetByTop("", "", "BooId DESC"); string to = dt.Rows[0]["Email"].ToString(); int port = 587; string subject = "Message Admin"; string strContent = "You booking success movie : " + "\n" + dt1.Rows[0]["NameF"].ToString() + "\n" + "Cinema : " + dt1.Rows[0]["NameCi"].ToString() + "\n" + "Date movie: " + dt1.Rows[0]["ShowTime"].ToString() + "\n" + "Time movie: " + dt1.Rows[0]["Time"].ToString() + "\n" + "Quantity ticket : " + dt2.Rows[0]["Quantity"].ToString() + "\n" + "Total amount " + StringClass.FormatNumber(dt2.Rows[0]["Bilmoney"].ToString()) + "\n" + "We will notify you when you pay this ticket. Thank you" + "\n" + "Note : Please, do not reply to email"; string content = strContent; SmtpClient client = new SmtpClient(); client.EnableSsl = true; client.Port = port; client.Host = "smtp.gmail.com"; client.Credentials = new NetworkCredential("*****@*****.**", "Noicomdiento");// mail o day MailAddress from = new MailAddress("*****@*****.**"); MailAddress toAddress = new MailAddress(to); MailMessage message = new MailMessage(from, toAddress); message.Body = content; message.Subject = subject; try { client.Send(message); } catch (Exception ex) { WebMsgBox.Show(ex.Message); } Response.Redirect("BookingSuccess.aspx?idB=" + dt2.Rows[0]["BooId"].ToString()); }
public async Task <IHttpActionResult> PutBookingInfo(int id, BookingInfo bookingInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bookingInfo.BookingId) { return(BadRequest()); } db.Entry(bookingInfo).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingInfoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
/// <summary> /// Handles the CheckedChanged event of the chkArchived control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void chkArchived_CheckedChanged(object sender, EventArgs e) { if (!PageBase.StopProcessing) { if (DisplayMode == ViewMode.InventoryManager && this.CompanyId.HasValue && (!(Utils.IsCompanyInventoryAdmin(this.CompanyId.Value, UserID)) && OnInformCompanyInventoryToShowErrorPopup != null)) { OnInformCompanyInventoryToShowErrorPopup(ErrorCodes.NoEditPermissionForInventory); return; } CheckBox checkbox = sender as CheckBox; Telerik.Web.UI.GridDataItem row = checkbox.NamingContainer as Telerik.Web.UI.GridDataItem; if (row != null) { BookingInfo bookingInfo = row.DataItem as BookingInfo; if (bookingInfo != null) { Booking booking = GetBL <InventoryBL>().GetBooking(bookingInfo.BookingId); if (booking != null) { booking.IsArchived = checkbox.Checked; GetBL <InventoryBL>().SaveChanges(); } } } LoadBookingData(); } }
public async Task <ActionResult <dynamic> > AddBookingInfo(BookingInfo bookingInfo) { TryValidateModel(bookingInfo); if (ModelState.IsValid) { await _busInfoContext.BookingInfos.AddAsync(bookingInfo); await _busInfoContext.SaveChangesAsync(); return(Created("", new { bookingInfo.Id, bookingInfo.Username, bookingInfo.UserMobile, bookingInfo.Email, bookingInfo.BusInfoId, bookingInfo.TravelDate, bookingInfo.SeatNo })); } else { return(BadRequest(ModelState)); } }
public BookingInfo AddBooking(BookingInfo bookingInfo) { LicenseCheck(bookingInfo.LicenseKey); BookingInfo addedBookingInfo = new BookingInfo(bookingMethods.Add(bookingInfo.Booking)); return(addedBookingInfo); }
public static BookingInfo ChangeFromDto(BookingInfo booking, BookingInfo source) { booking.DaysCloseForBooking = source.DaysCloseForBooking; booking.DaysOpenForBooking = source.DaysOpenForBooking; booking.TimeCloseForBooking = source.TimeCloseForBooking; booking.TimeOpenForBooking = source.TimeOpenForBooking; return(booking); }
public static bool SendFailureNotice(BookingInfo booking) { string emailBody = Email.WelcomeMail .Replace("[Name]", booking.ProductCategory.Name) .Replace("[EmailAddress]", booking.Email) .Replace("[Password]", booking.PaymentList[0].PaymentStatus.ToString()); return(SendEmail(Email.WelcomeSubject, emailBody, booking.Email, null, "*****@*****.**", "Welcome")); }
public Checkout WriteBookingInfo(BookingInfo bookingInfo) { nameField.SendKeys(bookingInfo.Name); phoneField.SendKeys(bookingInfo.Phone); cityField.SendKeys(bookingInfo.City); dateFromField.SendKeys(bookingInfo.DateFrom); dateToField.SendKeys(bookingInfo.DateTo); return(this); }
// ********************* // ** Booking methods ** // ********************* public BookingInfo GetBookingAt(BookingRequest request) { LicenseCheck(request.LicenseKey); BookingInfo bookingInfo = new BookingInfo(bookingMethods.GetAt(request.BookingId)); bookingInfo.LicenseKey = request.LicenseKey; return(bookingInfo); }
private void PutOrder(Aspose.Pdf.Generator.Pdf pdf, FlightInfo flightInfo, PassengerInfo passengerInfo, BookingInfo bookingInfo) { //add customer address at the top PutAdress(pdf, passengerInfo); //add order summary PutSummary(pdf, passengerInfo, flightInfo); //create a table and add order details in row(s) Table table = AddTable(pdf); AddRow(pdf, table, flightInfo); PutAmount(pdf, flightInfo.Fare, 0); }
public Aspose.Pdf.Generator.Pdf GetInvoice(FlightInfo flightInfo, PassengerInfo passengerInfo, BookingInfo bookingInfo) { //create a Pdf object Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); pdf.IsTruetypeFontMapCached = false; //bind XML file string xmlFile = path + "\\Invoice.xml"; pdf.BindXML(xmlFile, null); //create header HeaderFooter headerFooter = pdf.Sections[0].OddHeader; Image logoImage = (Image)headerFooter.Paragraphs[0]; logoImage.ImageInfo.File = path + "\\flynowairlinelogoandinvoice.jpg"; logoImage.ImageScale = 0.74F; //call the method to create invoice PutOrder(pdf, flightInfo, passengerInfo, bookingInfo); return pdf; }
private AirPricingSolution AddAirPriceSolution(AirService.AirPricingSolution lowestPrice, AirService.AirItinerary airItinerary) { AirPricingSolution finalPrice = new AirPricingSolution() { Key = lowestPrice.Key, TotalPrice = lowestPrice.TotalPrice, BasePrice = lowestPrice.BasePrice, ApproximateTotalPrice = lowestPrice.ApproximateTotalPrice, ApproximateBasePrice = lowestPrice.ApproximateBasePrice, Taxes = lowestPrice.Taxes, ApproximateTaxes = lowestPrice.ApproximateTaxes, QuoteDate = lowestPrice.QuoteDate }; List<typeBaseAirSegment> finalSegments = new List<typeBaseAirSegment>(); List<AirPricingInfo> finalPriceInfo =new List<AirPricingInfo>(); foreach (var segmentRef in lowestPrice.AirSegmentRef) { foreach (var segment in airItinerary.AirSegment) { if (segmentRef.Key.CompareTo(segment.Key) == 0) { typeBaseAirSegment univSeg = new typeBaseAirSegment() { ArrivalTime = segment.ArrivalTime, AvailabilityDisplayType = segment.AvailabilityDisplayType, AvailabilitySource = segment.AvailabilitySource, Carrier = segment.Carrier, ChangeOfPlane = segment.ChangeOfPlane, ClassOfService = segment.ClassOfService, DepartureTime = segment.DepartureTime, Destination = segment.Destination, Distance = segment.Distance, Equipment = segment.Equipment, FlightNumber = segment.FlightNumber, FlightTime = segment.FlightTime, Group = segment.Group, Key = segment.Key, LinkAvailability = segment.LinkAvailability, OptionalServicesIndicator = segment.OptionalServicesIndicator, Origin = segment.Origin, ParticipantLevel = segment.ParticipantLevel, PolledAvailabilityOption = segment.PolledAvailabilityOption, ProviderCode = segment.ProviderCode, TravelTime = segment.TravelTime, }; finalSegments.Add(univSeg); break; } } } foreach (var priceInfo in lowestPrice.AirPricingInfo) { AirPricingInfo info = new AirPricingInfo() { ApproximateBasePrice = priceInfo.ApproximateBasePrice, ApproximateTotalPrice = priceInfo.ApproximateTotalPrice, BasePrice = priceInfo.BasePrice, ETicketability = (typeEticketability)priceInfo.ETicketability, IncludesVAT = priceInfo.IncludesVAT, Key = priceInfo.Key, LatestTicketingTime = priceInfo.LatestTicketingTime, //PlatingCarrier = priceInfo.PlatingCarrier, Optional but might be required for some carriers PricingMethod = (typePricingMethod)priceInfo.PricingMethod, ProviderCode = priceInfo.ProviderCode, Taxes = priceInfo.Taxes, TotalPrice = priceInfo.TotalPrice, }; List<FareInfo> fareInfoList = new List<FareInfo>(); List<ManualFareAdjustment> fareAdjustmentList = new List<ManualFareAdjustment>(); ManualFareAdjustment adjustment = new ManualFareAdjustment() { AdjustmentType = typeAdjustmentType.Amount, AppliedOn = typeAdjustmentTarget.Base, Value = +40, PassengerRef = "gr8AVWGCR064r57Jt0+8bA==" }; fareAdjustmentList.Add(adjustment); info.AirPricingModifiers = new AirPricingModifiers() { ManualFareAdjustment = fareAdjustmentList.ToArray() }; foreach (var fareInfo in priceInfo.FareInfo) { FareInfo createInfo = new FareInfo() { Amount = fareInfo.Amount, DepartureDate = fareInfo.DepartureDate, Destination = fareInfo.Destination, EffectiveDate = fareInfo.EffectiveDate, FareBasis = fareInfo.FareBasis, Key = fareInfo.Key, NotValidAfter = fareInfo.NotValidAfter, NotValidBefore = fareInfo.NotValidBefore, Origin = fareInfo.Origin, PassengerTypeCode = fareInfo.PassengerTypeCode, PrivateFare = (typePrivateFare)fareInfo.PrivateFare, PseudoCityCode = fareInfo.PseudoCityCode, FareRuleKey = new FareRuleKey() { FareInfoRef = fareInfo.FareRuleKey.FareInfoRef, ProviderCode = fareInfo.FareRuleKey.ProviderCode, Value = fareInfo.FareRuleKey.Value } }; List<Endorsement> endorsementList = new List<Endorsement>(); if (fareInfo.Endorsement != null) { foreach (var endorse in fareInfo.Endorsement) { Endorsement createEndorse = new Endorsement() { Value = endorse.Value }; endorsementList.Add(createEndorse); } createInfo.Endorsement = endorsementList.ToArray(); } fareInfoList.Add(createInfo); } info.FareInfo = fareInfoList.ToArray(); List<BookingInfo> bInfo = new List<BookingInfo>(); foreach (var bookingInfo in priceInfo.BookingInfo) { BookingInfo createBookingInfo = new BookingInfo() { BookingCode = bookingInfo.BookingCode, CabinClass = bookingInfo.CabinClass, FareInfoRef = bookingInfo.FareInfoRef, SegmentRef = bookingInfo.SegmentRef }; bInfo.Add(createBookingInfo); } info.BookingInfo = bInfo.ToArray(); List<typeTaxInfo> taxes = new List<typeTaxInfo>(); foreach (var tax in priceInfo.TaxInfo) { typeTaxInfo createTaxInfo = new typeTaxInfo() { Amount = tax.Amount, Category = tax.Category, Key = tax.Key }; taxes.Add(createTaxInfo); } info.TaxInfo = taxes.ToArray(); info.FareCalc = priceInfo.FareCalc; List<PassengerType> passengers = new List<PassengerType>(); /*foreach (var pass in priceInfo.PassengerType) { PassengerType passType = new PassengerType() { BookingTravelerRef = pass.BookingTravelerRef, Code = pass.BookingTravelerRef }; passengers.Add(passType); }*/ passengers.Add(new PassengerType() { Code = "ADT", BookingTravelerRef = "gr8AVWGCR064r57Jt0+8bA==" }); info.PassengerType = passengers.ToArray(); if (priceInfo.ChangePenalty != null) { info.ChangePenalty = new typeFarePenalty() { Amount = priceInfo.ChangePenalty.Amount }; } List<BaggageAllowanceInfo> baggageInfoList = new List<BaggageAllowanceInfo>(); foreach (var allowanceInfo in priceInfo.BaggageAllowances.BaggageAllowanceInfo) { BaggageAllowanceInfo createBaggageInfo = new BaggageAllowanceInfo() { Carrier = allowanceInfo.Carrier, Destination = allowanceInfo.Destination, Origin = allowanceInfo.Origin, TravelerType = allowanceInfo.TravelerType }; List<URLInfo> urlInfoList = new List<URLInfo>(); foreach (var url in allowanceInfo.URLInfo) { URLInfo urlInfo = new URLInfo() { URL = url.URL }; urlInfoList.Add(urlInfo); } createBaggageInfo.URLInfo = urlInfoList.ToArray(); List<ConsoleApplication1.UniversalService.TextInfo> textInfoList = new List<UniversalService.TextInfo>(); foreach (var textData in allowanceInfo.TextInfo) { ConsoleApplication1.UniversalService.TextInfo textInfo = new UniversalService.TextInfo() { Text = textData.Text }; textInfoList.Add(textInfo); } createBaggageInfo.TextInfo = textInfoList.ToArray(); List<BagDetails> bagDetailsList = new List<BagDetails>(); foreach (var bagDetails in allowanceInfo.BagDetails) { BagDetails bag = new BagDetails() { ApplicableBags = bagDetails.ApplicableBags, ApproximateBasePrice = bagDetails.ApproximateBasePrice, ApproximateTotalPrice = bagDetails.ApproximateTotalPrice, BasePrice = bagDetails.BasePrice, TotalPrice = bagDetails.TotalPrice, }; List<BaggageRestriction> bagRestictionList = new List<BaggageRestriction>(); foreach (var restriction in bagDetails.BaggageRestriction) { List<ConsoleApplication1.UniversalService.TextInfo> restrictionTextList = new List<UniversalService.TextInfo>(); foreach (var bagResTextInfo in restriction.TextInfo) { ConsoleApplication1.UniversalService.TextInfo resText = new UniversalService.TextInfo() { Text = bagResTextInfo.Text }; restrictionTextList.Add(resText); } BaggageRestriction bagRes = new BaggageRestriction() { TextInfo = restrictionTextList.ToArray() }; bagRestictionList.Add(bagRes); } bag.BaggageRestriction = bagRestictionList.ToArray(); bagDetailsList.Add(bag); } createBaggageInfo.BagDetails = bagDetailsList.ToArray(); baggageInfoList.Add(createBaggageInfo); } List<CarryOnAllowanceInfo> carryOnAllowanceList = new List<CarryOnAllowanceInfo>(); foreach (var carryOnBag in priceInfo.BaggageAllowances.CarryOnAllowanceInfo) { CarryOnAllowanceInfo carryOn = new CarryOnAllowanceInfo() { Carrier = carryOnBag.Carrier, Destination = carryOnBag.Destination, Origin = carryOnBag.Origin }; carryOnAllowanceList.Add(carryOn); } List<BaseBaggageAllowanceInfo> embargoInfoList = new List<BaseBaggageAllowanceInfo>(); if(priceInfo.BaggageAllowances.EmbargoInfo != null) { foreach(AirService.BaseBaggageAllowanceInfo embargoInfo in priceInfo.BaggageAllowances.EmbargoInfo) { BaseBaggageAllowanceInfo embargo = new BaseBaggageAllowanceInfo() { Carrier = embargoInfo.Carrier, Destination = embargoInfo.Destination, Origin = embargoInfo.Origin }; List<URLInfo> embargoURLList = new List<URLInfo>(); foreach(var embargoUrl in embargoInfo.URLInfo){ URLInfo url = new URLInfo() { URL = embargoUrl.URL, Text = embargoUrl.Text }; embargoURLList.Add(url); } embargo.URLInfo = embargoURLList.ToArray(); List<ConsoleApplication1.UniversalService.TextInfo> embargoTextList = new List<UniversalService.TextInfo>(); foreach(var embargoText in embargoInfo.TextInfo){ ConsoleApplication1.UniversalService.TextInfo text = new UniversalService.TextInfo() { Text = embargoText.Text }; embargoTextList.Add(text); } embargo.TextInfo = embargoTextList.ToArray(); embargoInfoList.Add(embargo); } } info.BaggageAllowances = new BaggageAllowances() { BaggageAllowanceInfo = baggageInfoList.ToArray(), CarryOnAllowanceInfo = carryOnAllowanceList.ToArray(), EmbargoInfo = embargoInfoList.ToArray() }; finalPriceInfo.Add(info); break; } finalPrice.AirPricingInfo = finalPriceInfo.ToArray(); finalPrice.AirSegment = finalSegments.ToArray(); return finalPrice; }