public void onFlightInfoQueryCallback(FlightInfo[] flights) { flightInfo = flights; MessageBox.Show("Loaded Flight Information..."); _flightService.LoadFlightInformation(); }
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 void PutSummary(Aspose.Pdf.Generator.Pdf pdf, PassengerInfo passengerInfo, FlightInfo flightInfo) { //create a table to hold summary of the order Table summaryTable = new Table(); Aspose.Pdf.Generator.Color color = new Aspose.Pdf.Generator.Color(111, 146, 188); summaryTable.Margin.Top = 20; summaryTable.ColumnWidths = "60 80 80 80 80 80"; summaryTable.DefaultCellTextInfo.FontSize = 10; summaryTable.DefaultCellBorder = new BorderInfo((int)BorderSide.All, color); summaryTable.DefaultCellPadding.Bottom = summaryTable.DefaultCellPadding.Top = 3; //add table to the first section/page Section section = pdf.Sections[0]; section.Paragraphs.Add(summaryTable); //create row and add cells and contents Row row1SummaryTable = summaryTable.Rows.Add(); Aspose.Pdf.Generator.TextInfo tf1 = new Aspose.Pdf.Generator.TextInfo(); tf1.FontSize = 10; tf1.Color = new Aspose.Pdf.Generator.Color("White"); tf1.FontName = "Helvetica-Bold"; tf1.Alignment = AlignmentType.Center; Cell cell1Row1SummaryTable = row1SummaryTable.Cells.Add("Order ID", tf1); cell1Row1SummaryTable.BackgroundColor = color; Cell cell2Row1SummaryTable = row1SummaryTable.Cells.Add("Customer ID", tf1); cell2Row1SummaryTable.BackgroundColor = color; Cell cell3Row1SummaryTable = row1SummaryTable.Cells.Add("Agent ID", tf1); cell3Row1SummaryTable.BackgroundColor = color; Cell cell4Row1SummaryTable = row1SummaryTable.Cells.Add("Sales Person", tf1); cell4Row1SummaryTable.BackgroundColor = color; Cell cell5Row1SummaryTable = row1SummaryTable.Cells.Add("Required Date", tf1); cell5Row1SummaryTable.BackgroundColor = color; Cell cell6Row1SummaryTable = row1SummaryTable.Cells.Add("Shipped Date", tf1); cell6Row1SummaryTable.BackgroundColor = color; Row row2SummaryTable = summaryTable.Rows.Add(); tf1 = new Aspose.Pdf.Generator.TextInfo(); tf1.FontSize = 9; tf1.Color = new Aspose.Pdf.Generator.Color("Black"); tf1.FontName = "Times-Roman"; tf1.Alignment = AlignmentType.Center; row2SummaryTable.Cells.Add("90234", tf1); row2SummaryTable.Cells.Add("3762", tf1); row2SummaryTable.Cells.Add("AU89", tf1); row2SummaryTable.Cells.Add("James Smith", tf1); row2SummaryTable.Cells.Add(DateTime.Now.Date.ToString(), tf1); row2SummaryTable.Cells.Add(DateTime.Now.Date.ToString(), tf1); }
private void AddRow(Aspose.Pdf.Generator.Pdf pdf, Aspose.Pdf.Generator.Table tabel, FlightInfo flightInfo) { //add a new row in order detail. Section section = pdf.Sections[0]; Aspose.Pdf.Generator.TextInfo tf1 = new Aspose.Pdf.Generator.TextInfo(); tf1.FontSize = 10; tf1.Alignment = AlignmentType.Center; Row row1DetailTable = tabel.Rows.Add(); row1DetailTable.Cells.Add("1", tf1); tf1.Alignment = AlignmentType.Left; row1DetailTable.Cells.Add("Ticket: " + flightInfo.DepartureLocation + " to " + flightInfo.Destination, tf1); tf1.Alignment = AlignmentType.Center; row1DetailTable.Cells.Add("1", tf1); row1DetailTable.Cells.Add(flightInfo.Fare.ToString("c", locale), tf1); row1DetailTable.Cells.Add("0" + "%", tf1); row1DetailTable.Cells.Add(flightInfo.Fare.ToString("c", locale), tf1); }