public static void AddTripSummary(Document document, Booking booking) { Table table = document.LastSection.AddTable(); table.Borders.Visible = true; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; table.Rows.Height = 1; Column column = table.AddColumn("5cm"); column.Format.Alignment = ParagraphAlignment.Right; column = table.AddColumn("11cm"); column.Format.Alignment = ParagraphAlignment.Left; table.AddTableHeader("TRIP SUMMARY"); table.AddTableRow("City of service:", booking.City, "Normal"); table.AddTableRow("Type of Journey:", booking.TypeOfJourney, "Normal"); table.AddTableRow("Pick-Up Date/Time:", booking.PickUpTime, "NormalBold"); table.AddTableRow("Type of Vehicle:", booking.Vehicle, "Normal"); table.AddTableRow("Pick-Up:", booking.PickUp, "NormalBold"); table.AddTableRow("Drop-Off:", booking.DropOff, "NormalBold"); if (booking.Stops.Count() > 0) table.AddStopTableRow("Added Stops (" + booking.Stops.Count() + "):", booking.Stops, "Normal"); table.AddTableFooter(""); }
public static void AddLogo(Document document, Booking booking) { HeaderFooter header = document.LastSection.Headers.Primary; var paragraph = header.AddParagraph(string.Format("{0} | {1}\n{2}\n{3}", booking.AssociationName, booking.AssociationHost, booking.AssociationPhone1, booking.AssociationPhone2)); paragraph.Format.Alignment = ParagraphAlignment.Right; paragraph.Style = "Small"; Table table = document.LastSection.AddTable(); table.Borders.Visible = false; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; table.Rows.Height = 5; Column column = table.AddColumn("3cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn("7cm"); column.Format.Alignment = ParagraphAlignment.Left; column = table.AddColumn("6cm"); column.Format.Alignment = ParagraphAlignment.Left; //logo var row = table.AddRow(); row.Cells[0].Format.Alignment = ParagraphAlignment.Center; row.Cells[0].MergeDown = 1; paragraph = row.Cells[0].AddParagraph("Logo"); paragraph.Style = "NormalBold"; paragraph = row.Cells[1].AddParagraph("Your Itinerary, Receipt and Tax Invoice"); row.Cells[1].MergeDown = 1; paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "NormalBoldBlue"; paragraph = row.Cells[1].AddParagraph(booking.PrimaryPassenger); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "NormalBlue"; paragraph = row.Cells[1].AddParagraph(booking.PickUpTime); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "NormalBlue"; // paragraph = row.Cells[2].AddParagraph("Your Booking Reference"); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "NormalBlue"; row = table.AddRow(); paragraph = row.Cells[2].AddParagraph(booking.ReferenceId); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "LargeBlueBold"; paragraph = row.Cells[2].AddParagraph("CONFIRMED"); paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Style = "NormalBoldBlue"; }
public static Document Generate(Booking booking) { Document document = new Document(); document.Info.Title = "Confirmation Voucher"; document.Info.Subject = booking.ReferenceId; document.Info.Author = booking.AssociationName; DefineStyles(document); Section section = document.AddSection(); AddLogo(document, booking); AddTripSummary(document, booking); AddMeetingPoint(document, booking); AddPassengers(document, booking); section.AddParagraph(); AddPayment(document, booking); AddBookedByInfo(document, booking); return document; }
public static void AddMeetingPoint(Document document, Booking booking) { Table table = document.LastSection.AddTable(); table.Borders.Visible = false; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; Column column = table.AddColumn("3cm"); column.Format.Alignment = ParagraphAlignment.Right; column = table.AddColumn("13cm"); column.Format.Alignment = ParagraphAlignment.Left; table.AddTableRow("Meeting Point:", booking.MeetingPoint, "NormalBlue"); table.AddTableRow("", booking.MeetingPointComment, "NormalBlue"); }
public static void AddBookedByInfo(Document document, Booking booking) { Table table = document.LastSection.AddTable(); table.Borders.Visible = false; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; Column column = table.AddColumn("3cm"); column.Format.Alignment = ParagraphAlignment.Right; column = table.AddColumn("13cm"); column.Format.Alignment = ParagraphAlignment.Left; table.AddTableRow("Booked By:", booking.BookedBy, "NormalBlue"); table.AddTableRow("Issued By:", booking.IssuedBy, "NormalBlue"); }
public static void AddPayment(Document document, Booking booking) { Table table = document.LastSection.AddTable(); table.Borders.Visible = true; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; Column column = table.AddColumn("5cm"); column.Format.Alignment = ParagraphAlignment.Right; column = table.AddColumn("11cm"); column.Format.Alignment = ParagraphAlignment.Left; table.AddTableHeader("PAYMENT"); table.AddTableRow("Payment Method:", booking.PaymentMethod, "NormalBold"); table.AddTableRow("Payments:", booking.Payments, "NormalBold"); table.AddPaymentTableRow("Charges:", booking.Charges, "Normal"); table.AddTableFooter(""); }
public static void AddPassengers(Document document, Booking booking) { Table table = document.LastSection.AddTable(); table.Borders.Visible = true; table.TopPadding = TopPadding; table.BottomPadding = BottomPadding; table.Format.Alignment = ParagraphAlignment.Justify; Column column = table.AddColumn("5cm"); column.Format.Alignment = ParagraphAlignment.Right; column = table.AddColumn("11cm"); column.Format.Alignment = ParagraphAlignment.Left; table.AddTableHeader("PASSENGERS"); table.AddTableRow("Primary Passenger:", booking.PrimaryPassenger + booking.PrimaryPassengerPhone, "NormalBold"); table.AddTableRow("Passenger Total :", booking.PassengerTotal.ToString(), "NormalBold"); if (booking.PassengerTotal > 1) table.AddOtherPassengersTableRow("Other Passengers:", booking.PassengerAdults, booking.PassengersChilds, booking.PassengersInfants, "Normal"); table.AddTableRow("Passenger Info:", booking.PassengerInfo, "Normal", false); table.AddTableRow("Pick-Up Sign Name:", booking.SignName, "Normal"); table.AddTableRow("Approved Waiting Time:", booking.ApprovedWaitingTime, "Normal", false); table.AddTableRow("Carry-on Travel Baggage:", booking.CarryOnTravelBaggage, "Normal", false); table.AddTableRow("Total Check-in Baggage:", booking.TotalCheckInBaggage, "Normal", false); table.AddTableRow("Group Event Name:", booking.Event, "Normal", false); table.AddTableFooter(""); }