Aspose.Total icon

Aspose.Total for .NET can be used in a variety of scenarios and with many different technologies and applications. In this series, we’re looking into the airline reservation scenario. We’re building a small application based on WCF, Windows Forms, and a few Aspose components for file manipulation. This is the second part of the series. You may have a look into the first part at the following URL: Part 1: Aspose File Components for .NET and WCF – Airline Reservation Example Scenario.

In this second part of the series, we’ll have a look into the application architecture and the different parts of the application. We’ll see how these parts come together to build a service for creating the airline ticket and sending it to the customer via email.

Airline Reservation Service

We’ll build a simple WCF service that will allow the booking agents to get the flight information, using a client application, based upon the customer’s reservation criteria, and then reserve the seats.

In the following class diagram, you can see a service contract named “IBookingService”. We have created a class named “BookingService” based on the above service contract. This class provides two methods: GetFlightInfo and BookFlight. We have also defined a couple of data contracts: FlightInfo, PassengerInfo, and BookingInfo to pass the data back and forth between the service and the client.

As we also need to add the features to create the ticket in PDF format and then send it to the customer via email, we’re going to use Aspose file format components to handle file manipulation and email related tasks. Aspose file manipulation components work perfectly in a WCF service, so we can use them in this application.

We have created a separate class named “AsposeFileManager” to work with files. This class will contain all the Aspose related code like creating bar codes using Aspose.BarCode for .NET, generating ticket in PDF format using Aspose.Pdf for .NET, saving flight and passenger information in Excel format using Aspose.Cells for .NET, and sending ticket to the customer via email using Aspose.Email for .NET.

Airline Reservation Service

**Airline Reservation Service - Class Diagram

Airline Reservation Client

On the client end, we’ll use Windows Forms to build the application which will consume the above reservation service. The booking agent will be able to find the flight information and book the seat for the customer. In addition to that, the agent will be able to print an invoice for the customer. We’ll use Aspose.PDF for .NET to create the invoice in the PDF format and then send it to the printer.

What’s Next?

In the next post, I’ll share the actual code with you so you could see what’s going on inside the service and how we’re manipulating the files in this WCF based service. You’ll also be able to download the sample application, so you could run and test it at your end.