public static void AddTripSummary(Document document, BookingInfo 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 Location:", booking.PickUp, "NormalBold");
            table.AddTableRow("Drop-Off Location:", 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, BookingInfo booking)
        {
            HeaderFooter header = document.LastSection.Headers.Primary;
            var paragraph = header.AddParagraph(string.Format("{0} | {1}\n{2}\n{3}", booking.AssociationName, booking.AssociationHost.ToLower(), booking.AssociationPhone1, booking.AssociationPhone2));
            paragraph.Format.Alignment = ParagraphAlignment.Right;
            paragraph.Style = "NormalBold"; //"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();//row.Cells[0].AddParagraph("Logo"); 
            string path = Path.Combine(ConfigurationSettings.AssociationLogoLocalDirectoryPath, String.Format("{0}.jpg", booking.AssociationId.ToString()));
            Image image = paragraph.AddImage(path);
            image.Width = "2.8cm";
            image.Height = "2.5cm";
            paragraph.Style = "NormalBold";

            paragraph = row.Cells[1].AddParagraph("\n\nYour Itinerary, Receipt and Tax Invoice");
            row.Cells[1].MergeDown = 1;
            paragraph.Format.Alignment = ParagraphAlignment.Center;
            paragraph.Style = "NormalHeading1Black";

            paragraph = row.Cells[1].AddParagraph(booking.PrimaryPassenger);
            paragraph.Format.Alignment = ParagraphAlignment.Center;
            paragraph.Style = "NormalHeading2Black";

            paragraph = row.Cells[1].AddParagraph(booking.PickUpTime);
            paragraph.Format.Alignment = ParagraphAlignment.Center;
            paragraph.Style = "NormalHeading2Black";

            //
            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";
        }
Example #3
0
        public static Document Generate(BookingDispatching dispatch, Association association, AirportMeetingPoint meetingPoint)
        {
            BookingInfo bookingInfo = new BookingInfo(dispatch, association, meetingPoint);

            Document document = new Document();
            document.Info.Title = "Confirmation Voucher";
            document.Info.Subject = dispatch.Booking.ReferenceId;
            document.Info.Author = bookingInfo.AssociationName;

            DefineStyles(document);

            Section section = document.AddSection();

            AddLogo(document, bookingInfo);
            AddTripSummary(document, bookingInfo);
            AddMeetingPoint(document, bookingInfo);
            AddPassengers(document, bookingInfo);
            section.AddParagraph();
            AddPayment(document, bookingInfo);
            AddBookedByInfo(document, bookingInfo);

            return document;
        }
        public static void AddBookedByInfo(Document document, BookingInfo 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("Ordered By:", booking.BookedBy, "NormalBlue");
            table.AddTableRow("Issued By:", booking.IssuedBy, "NormalBlue");
        }
        public static void AddPayment(Document document, BookingInfo 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");
            if (booking.IsBillingAccountPaymentMethod)
            {
                table.AddTableRow("Payment Details:", booking.Payments, "NormalBold");
                if (!string.IsNullOrWhiteSpace(booking.BilingCode))
                    table.AddTableRow("Billing Code:", booking.BilingCode, "Normal");
            }
            else
                table.AddChargeInfoTableRow("Payment Details:", booking.CreditCardTransactions, "Normal");

            table.AddChargeInfoTableRow("Charges:", booking.Charges, "Normal");
            table.AddTableFooter("");
        }
        public static void AddPassengers(Document document, BookingInfo 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("");
        }
        public static void AddMeetingPoint(Document document, BookingInfo 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");
        }