- User login and signup (using SQL database).
- Browse movies and view movie details.
- Book tickets, specify the type, age, date, and manage the list of booked tickets.
- View and manage ticket details.
- Select seats for a movie.
- Exit the application.
To use Microsoft SQL in Visual Studio, download Microsoft.Data.SqlClient
by right-clicking on the WinFormApp, selecting "Manage NuGet Packages," and installing it. You can then add the Microsoft.Data.SqlClient
using directive in the login and signup forms to implement the database.
The database, loginapp
, was created in Microsoft SQL Server Management Studio and is used for both the Login.cs
and Signup.cs
forms.
- Open Server Explorer from the View menu.
- Connect the device's SQL server in the Data Connection section.
The Login Page allows users to enter their credentials. If the username and password do not match what’s in the database, a "Login Failed!" message is shown.
- Validation: Ensures username and password textboxes are not empty. If they are, a message box appears: "Fill the blank spaces".
- Database Connection: Connects to the
loginapp
SQL database. - Login Query: Executes an SQL query to validate the username and password.
- If no match, "Login Failed!" is displayed.
- If a match is found, the login page hides, and the homepage (
homepage.cs
) opens.
- Error Handling: Displays an error message in case of exceptions.
There is also a Create Account button, which redirects to the Signup Page.
The Signup Page allows new users to create accounts by providing a username and password.
- Validation: Ensures none of the fields (Username, Password, Confirm Password) are empty.
- Password Matching: If the Password and Confirm Password fields do not match, a message box says, "Passwords don’t match."
- Database Insertion: Inserts the new user record into the
loginapp
database.- If
ExecuteNonQuery()
returns 0, it indicates failure; otherwise, the signup is successful.
- If
- Back to Login: A button allows users to go back to the login page.
The Home Page displays movie panels with the following attributes:
- Movie Title
- Time
- Directors
- Writers
- Stars
- Poster Image
Users can navigate to the Booking Page to select and book a movie.
The Booking Movie Page allows users to book movie tickets, manage their booked tickets, and navigate to other forms for ticket details and seat selection.
- Users can specify ticket details (e.g., age, type, and date).
- Buttons to Add, Remove, and Clear the list of booked tickets.
- A Ticket Counter keeps track of the number of tickets.
- Exit button to leave the application.
The Ticket Details Page displays detailed information about a specific ticket, such as:
- Ticket ID
- Movie Title
- Ticket Type
- Age
- Date
- Seat Number
It also generates a random ticket ID using the Ticket
class and its child TypeofTicket
class.
The Booking Seats Page allows users to select seats for a movie, with options for standard and VIP seats.
- 4 instance variables, including lists of front and back seats.
- 8 buttons for different seat arrangements.
- Methods to retrieve seat information (number, type) and book the seat.
Variable | Type |
---|---|
_title | string |
_time | string |
_directors | string |
_writers | string |
_stars | string |
_poster | Image |
- MovieTitle
- Time
- Directors
- Writers
- Stars
- Poster
Variable | Type |
---|---|
Age | int |
Type | string |
Date | DateTime |
SeatNumber | int |
Variable | Type |
---|---|
Title | string |
ID | string |
GenerateID()
: Generates a unique ID for each ticket.
Variable | Type |
---|---|
SeatNumber | int |
IsAvailable | bool |
GetSeatType()
: Returns the type of seat (Standard/VIP).BookSeat()
: Books the seat based on user selection.
Variable | Type |
---|---|
SeatNumber | int |
GetSeatType()
: Returns whether the seat is standard or VIP.
- The user logs in or signs up.
- They navigate to the Home Page.
- The user selects a movie and books a ticket.
- They can view and manage ticket details.
- The user can remove or clear tickets from the list.
- The user selects seats for a movie.
- Detailed seat information is displayed.
- The user exits the application.
Contributors:
- Habiba Ahmed
- Seifeldin Walid