Exemple #1
0
 public BookingInfo(BookingDispatching dispatch, Association association, AirportMeetingPoint meetingPoint)
 {
     _dispatch = dispatch;
     _booking = dispatch.Booking;
     _association = association;
     _airportMeetingPoint = meetingPoint;
 }
Exemple #2
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;
        }
Exemple #3
0
 static SettingViewModel()
 {
     ApplySettingDefault();
     DummyCity = new City() { Id = -1, Name = "-select-" };
     DummyAssociation = new Association() { Id = -1, Name = "-ALL ASSOCIATIONS-" };
     DummyCountry = new Country() { Id = -1, Name = "-ALL COUNTRIES-", HasStates = true, DisplayStates = true };
     DummyState = new State() { Id = -1, Name = "-select-" };
 }
        public MemoryStream GeneratePDFVoucher(BookingDispatching dispatch, Association association, AirportMeetingPoint meetingPoint)
        {
            var document = BookingVoucher.Generate(dispatch, association, meetingPoint);
            PdfDocumentRenderer renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
            renderer.Document = document;
            renderer.RenderDocument();

            MemoryStream pdfStream = new MemoryStream();
            renderer.PdfDocument.Save(pdfStream, false);
            return pdfStream;
        }
Exemple #5
0
     public bool Equals(Association other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }