Bus Ticket Booking System | Final Year Project | Mini Project



Abstract

  • The Bus Ticket Booking project provides a bus ticket booking platform and thereby leverage the tedious manual ticket booking activity for a customer.
  • We provide some features for the customers to book tickets without hassle and to save favourite bus.
  •  In our System, we provide different types of bus categories like Express, Volvo, AC or Non AC etc.
  • We also manage all types of passenger data & bus data. All details that is related to traveling like fare details, seat availability, booking details, bus details, seat arrangements, inquiry etc.
  • In this link, We provide Final year project for ECE , Final year project in Computer Science along with Coding and training.

Existing System

  • Initially, Customers used to book tickets manually like standing in queue at bus stations.
  • They also used to book tickets by the travel agents. It was actually a tedious process and leading to wastage of time. 
  • It had some issues of incorrect informations.
  • The Another type of system is counter(internal system), which is used to buy tickets manually.
  • These problems like "a customer needed to go counter for buy tickets/ask for bus schedule", which are facing by the company.
  • For Buying bus tickets, Customers have to standing in queue for a longtime and need to pay cash.

Proposed System

  • We can eliminate the drawbacks by an application,which is used to allow the customers for register.
  • A Customer can book tickets, cancel tickets, postpone or prepone the travel dates with feasibility. It can be access from anywhere.
  • This way of buying tickets can avoid the drawbacks of waiting time which is occured in the previous system of Manual Bus Booking.
  • The New System can able to manage the bus details, update the information. It helps to enter data efficiently.
  • It has the capability of managing the Bus fare, source and destination details.
  • This system is also helpful to manage the passenger, charge, booking details separately.

Architecture Diagram

 architecture diagram in bus

Architecture Diagram

Software Requirement

  • ENVIRONMENT :Visual Studio 2019
  • .NET FRAMEWORK :Version 3.5
  • LANGUAGE : C#.NET ( C# Tutorial )
  • BACKEND : SQL SERVER 2019 ( SQL Server )

Hardware Requirement

  • PROCESSOR: PENTIUM i3 and more
  • RAM :1 GB RAM
  • HARD DISK :200 GB

Images for Bus Ticket Booking System

Software Installation

Data-Flow Diagram

  • A data flow diagram (DFD) maps out the flow of information for any process or system.
  • It uses defined symbols like rectangles, circles and arrows, plus short text labels, to show data inputs, outputs, storage points and the routes between each destination.
  • Data flowcharts can range from simple, even hand-drawn process overviews, to in-depth, multi-level DFDs that dig progressively deeper into how the data is handled.
 data flow diagram in bus

Data Flow Diagram

Use Case Diagram

  • In the Unified Modeling Language, a use case diagram can summarize the details of your system's users (also known as actors) and their interactions with the system.
  • To build one, you'll use a set of specialized symbols and connectors.

An effective use case diagram can help your team discuss and represent:

  • Scenarios in which your system or application interacts with people, organizations, or external systems.
  • Goals that it helps those entities (known as actors) achieve.
 use case diagram in bus

Use Case Diagram

Purpose of Use Case Diagram

  • The purpose of use case diagram is to capture the dynamic aspect of a system.
  • However, this definition is too generic to describe the purpose, as other four diagrams (activity, sequence, collaboration, and Statechart) also have the same purpose.
  • We will look into some specific purpose, which will distinguish it from other four diagrams.
  • Use case diagrams are used to gather the requirements of a system including internal and external influences. These requirements are mostly design requirements.
  • Hence, when a system is analyzed to gather its functionalities, use cases are prepared and actors are identified.
  • When the initial task is complete, use case diagrams are modelled to present the outside view.

In brief, the purposes of use case diagrams can be said to be as follows −

  • Used to gather the requirements of a system.
  • Used to get an outside view of a system.
  • Identify the external and internal factors influencing the system.
  • Show the interaction among the requirements are actors.

List Of Modules

  • Login Module
  • Register Module
  • Selection Design module
  • New Booking Module
  • Update Design Module
  • View Booking Module

Login Module

  • This module deals with management of a customer information such as login id and password.
  • This module is used to check whether the user id is valid or invalid.
  • This module can be placed on any module.Tab to allow the users to login.
  • Check the 'create module tabs' to add module.
 login design in bus

Login Module

Sample Code

Login.Designer.cs

namespace BusTicketReservation
{
    partial class Login
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button2 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.button3 = new System.Windows.Forms.Button();
            this.panel4 = new System.Windows.Forms.Panel();
            this.panel3 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.panel1 = new System.Windows.Forms.Panel();
            this.SuspendLayout();
            // 
            // button2
            // 
            this.button2.BackColor = System.Drawing.Color.Linen;
            this.button2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.button2.Location = new System.Drawing.Point(275, 283);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(116, 45);
            this.button2.TabIndex = 16;
            this.button2.Text = "Cancel";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // button1
            // 
            this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
            this.button1.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.button1.Location = new System.Drawing.Point(357, 193);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(116, 45);
            this.button1.TabIndex = 15;
            this.button1.Text = "Login";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // textBox2
            // 
            this.textBox2.Location = new System.Drawing.Point(293, 151);
            this.textBox2.Name = "textBox2";
            this.textBox2.PasswordChar = '*';
            this.textBox2.Size = new System.Drawing.Size(197, 20);
            this.textBox2.TabIndex = 14;
            // 
            // textBox1
            // 
            this.textBox1.Location = new System.Drawing.Point(292, 113);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(197, 20);
            this.textBox1.TabIndex = 13;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.BackColor = System.Drawing.Color.Transparent;
            this.label3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.label3.Location = new System.Drawing.Point(198, 152);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(73, 19);
            this.label3.TabIndex = 12;
            this.label3.Text = "Password";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.BackColor = System.Drawing.Color.Transparent;
            this.label2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.label2.Location = new System.Drawing.Point(197, 112);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(47, 19);
            this.label2.TabIndex = 11;
            this.label2.Text = "Email";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.Transparent;
            this.label1.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.Red;
            this.label1.Location = new System.Drawing.Point(296, 45);
            this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(105, 37);
            this.label1.TabIndex = 10;
            this.label1.Text = " Login";
            // 
            // button3
            // 
            this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
            this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.button3.Location = new System.Drawing.Point(202, 193);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(119, 45);
            this.button3.TabIndex = 18;
            this.button3.Text = "Register";
            this.button3.UseVisualStyleBackColor = false;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            // 
            // panel4
            // 
            this.panel4.BackColor = System.Drawing.Color.Gold;
            this.panel4.Location = new System.Drawing.Point(13, 423);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(758, 10);
            this.panel4.TabIndex = 25;
            // 
            // panel3
            // 
            this.panel3.BackColor = System.Drawing.Color.Gold;
            this.panel3.Location = new System.Drawing.Point(3, 0);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(758, 10);
            this.panel3.TabIndex = 24;
            // 
            // panel2
            // 
            this.panel2.BackColor = System.Drawing.Color.Gold;
            this.panel2.Location = new System.Drawing.Point(761, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(10, 433);
            this.panel2.TabIndex = 23;
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.Gold;
            this.panel1.Location = new System.Drawing.Point(3, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(10, 433);
            this.panel1.TabIndex = 22;
            // 
            // Login
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackgroundImage = global::BusTicketReservation.Properties.Resources.c1;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.ClientSize = new System.Drawing.Size(771, 432);
            this.Controls.Add(this.panel4);
            this.Controls.Add(this.panel3);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.DoubleBuffered = true;
            this.Name = "Login";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Login";
            this.Load += new System.EventHandler(this.Login_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Panel panel4;
        private System.Windows.Forms.Panel panel3;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Panel panel1;
    }
}

Login.cs

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace BusTicketReservation
    {
        public partial class Login : Form
     {
            public Login()
            {
                InitializeComponent();
            }
            private void button1_Click(object sender, EventArgs e)
            {
                SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                conn.Open();
                SqlCommand cmd1 = new SqlCommand(@"select Email,[Password]  from UserData where Email='" + textBox1.Text + "' and [Password]='" +   textBox2.Text  + "'", conn);
                DataTable dt1 = new DataTable();
                SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                da1.Fill(dt1);
                string val = dt1.Rows[0][0].ToString();
                string val1 = dt1.Rows[0][1].ToString();
                conn.Close();
                if (val !=null && val1 != null)
                {
                       MessageBox.Show("Login Successfull");
                        Selection Selection = new Selection();
                        Selection.Show();
                        this.Hide(); 
                }
                else
                {
                  MessageBox.Show("Invalid User");
    }
         }
            private void button2_Click(object sender, EventArgs e)
            {
                this.Close();
            }
            private void button3_Click(object sender, EventArgs e)
            {
                Register Register = new Register();
                Register.Show();
                this.Hide();
            }
            private void Login_Load(object sender, EventArgs e)
            {
    }
           private void label1_Click(object sender, EventArgs e)
            {
    
            }
        }
    }

    Register Module

    • This module is used to register the details of the new customer .
    • Customer id is created to the particular customer.
    • This page will ask user to enter their Details (First name, Last name, Email Id, Age/Gender, Phone Number, Password, Confirm Password).
     register design in bus

    Register Module

    Sample Code

    Register.Designer.cs

    namespace BusTicketReservation
    {
        partial class Register
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.button2 = new System.Windows.Forms.Button();
                this.button1 = new System.Windows.Forms.Button();
                this.textBox7 = new System.Windows.Forms.TextBox();
                this.label8 = new System.Windows.Forms.Label();
                this.linkLabel1 = new System.Windows.Forms.LinkLabel();
                this.textBox6 = new System.Windows.Forms.TextBox();
                this.textBox5 = new System.Windows.Forms.TextBox();
                this.textBox4 = new System.Windows.Forms.TextBox();
                this.textBox3 = new System.Windows.Forms.TextBox();
                this.textBox2 = new System.Windows.Forms.TextBox();
                this.textBox1 = new System.Windows.Forms.TextBox();
                this.label7 = new System.Windows.Forms.Label();
                this.label6 = new System.Windows.Forms.Label();
                this.label5 = new System.Windows.Forms.Label();
                this.label4 = new System.Windows.Forms.Label();
                this.label3 = new System.Windows.Forms.Label();
                this.label2 = new System.Windows.Forms.Label();
                this.panel4 = new System.Windows.Forms.Panel();
                this.panel3 = new System.Windows.Forms.Panel();
                this.panel2 = new System.Windows.Forms.Panel();
                this.panel1 = new System.Windows.Forms.Panel();
                this.button3 = new System.Windows.Forms.Button();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.BackColor = System.Drawing.Color.Transparent;
                this.label1.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label1.ForeColor = System.Drawing.Color.OrangeRed;
                this.label1.Location = new System.Drawing.Point(294, 8);
                this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(137, 37);
                this.label1.TabIndex = 2;
                this.label1.Text = "Register";
                // 
                // button2
                // 
                this.button2.BackColor = System.Drawing.Color.Tomato;
                this.button2.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
                this.button2.Location = new System.Drawing.Point(495, 339);
                this.button2.Name = "button2";
                this.button2.Size = new System.Drawing.Size(89, 34);
                this.button2.TabIndex = 37;
                this.button2.Text = "CANCEL";
                this.button2.UseVisualStyleBackColor = false;
                this.button2.Click += new System.EventHandler(this.button2_Click);
                // 
                // button1
                // 
                this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
                this.button1.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button1.Location = new System.Drawing.Point(361, 339);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(90, 34);
                this.button1.TabIndex = 36;
                this.button1.Text = "REGISTER";
                this.button1.UseVisualStyleBackColor = false;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                // 
                // textBox7
                // 
                this.textBox7.Location = new System.Drawing.Point(345, 301);
                this.textBox7.Name = "textBox7";
                this.textBox7.PasswordChar = '*';
                this.textBox7.Size = new System.Drawing.Size(209, 20);
                this.textBox7.TabIndex = 35;
                // 
                // label8
                // 
                this.label8.AutoSize = true;
                this.label8.BackColor = System.Drawing.Color.Khaki;
                this.label8.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label8.Location = new System.Drawing.Point(202, 306);
                this.label8.Name = "label8";
                this.label8.Size = new System.Drawing.Size(134, 15);
                this.label8.TabIndex = 34;
                this.label8.Text = "CONFORM PASSWORD";
                // 
                // linkLabel1
                // 
                this.linkLabel1.AutoSize = true;
                this.linkLabel1.BackColor = System.Drawing.Color.White;
                this.linkLabel1.Font = new System.Drawing.Font("Cambria", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.linkLabel1.Location = new System.Drawing.Point(285, 376);
                this.linkLabel1.Name = "linkLabel1";
                this.linkLabel1.Size = new System.Drawing.Size(209, 17);
                this.linkLabel1.TabIndex = 33;
                this.linkLabel1.TabStop = true;
                this.linkLabel1.Text = "Already User Goto Login Page ->";
                this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
                // 
                // textBox6
                // 
                this.textBox6.Location = new System.Drawing.Point(345, 268);
                this.textBox6.Name = "textBox6";
                this.textBox6.PasswordChar = '*';
                this.textBox6.Size = new System.Drawing.Size(209, 20);
                this.textBox6.TabIndex = 32;
                // 
                // textBox5
                // 
                this.textBox5.Location = new System.Drawing.Point(345, 226);
                this.textBox5.Name = "textBox5";
                this.textBox5.Size = new System.Drawing.Size(209, 20);
                this.textBox5.TabIndex = 31;
                // 
                // textBox4
                // 
                this.textBox4.Location = new System.Drawing.Point(345, 186);
                this.textBox4.Name = "textBox4";
                this.textBox4.Size = new System.Drawing.Size(209, 20);
                this.textBox4.TabIndex = 30;
                // 
                // textBox3
                // 
                this.textBox3.Location = new System.Drawing.Point(345, 144);
                this.textBox3.Name = "textBox3";
                this.textBox3.Size = new System.Drawing.Size(209, 20);
                this.textBox3.TabIndex = 29;
                // 
                // textBox2
                // 
                this.textBox2.Location = new System.Drawing.Point(345, 108);
                this.textBox2.Name = "textBox2";
                this.textBox2.Size = new System.Drawing.Size(209, 20);
                this.textBox2.TabIndex = 28;
                // 
                // textBox1
                // 
                this.textBox1.Location = new System.Drawing.Point(345, 71);
                this.textBox1.Name = "textBox1";
                this.textBox1.Size = new System.Drawing.Size(209, 20);
                this.textBox1.TabIndex = 27;
                // 
                // label7
                // 
                this.label7.AutoSize = true;
                this.label7.BackColor = System.Drawing.Color.Khaki;
                this.label7.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label7.Location = new System.Drawing.Point(202, 273);
                this.label7.Name = "label7";
                this.label7.Size = new System.Drawing.Size(71, 15);
                this.label7.TabIndex = 26;
                this.label7.Text = "PASSWORD";
                // 
                // label6
                // 
                this.label6.AutoSize = true;
                this.label6.BackColor = System.Drawing.Color.Khaki;
                this.label6.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label6.Location = new System.Drawing.Point(202, 231);
                this.label6.Name = "label6";
                this.label6.Size = new System.Drawing.Size(102, 15);
                this.label6.TabIndex = 25;
                this.label6.Text = "PHONE NUMBER";
                // 
                // label5
                // 
                this.label5.AutoSize = true;
                this.label5.BackColor = System.Drawing.Color.Khaki;
                this.label5.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label5.Location = new System.Drawing.Point(202, 191);
                this.label5.Name = "label5";
                this.label5.Size = new System.Drawing.Size(90, 15);
                this.label5.TabIndex = 24;
                this.label5.Text = "AGE / GENDER";
                // 
                // label4
                // 
                this.label4.AutoSize = true;
                this.label4.BackColor = System.Drawing.Color.Khaki;
                this.label4.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label4.Location = new System.Drawing.Point(202, 149);
                this.label4.Name = "label4";
                this.label4.Size = new System.Drawing.Size(44, 15);
                this.label4.TabIndex = 23;
                this.label4.Text = "EMAIL";
                // 
                // label3
                // 
                this.label3.AutoSize = true;
                this.label3.BackColor = System.Drawing.Color.Khaki;
                this.label3.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label3.Location = new System.Drawing.Point(202, 113);
                this.label3.Name = "label3";
                this.label3.Size = new System.Drawing.Size(71, 15);
                this.label3.TabIndex = 22;
                this.label3.Text = "LASTNAME";
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.BackColor = System.Drawing.Color.Khaki;
                this.label2.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label2.Location = new System.Drawing.Point(202, 76);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(78, 15);
                this.label2.TabIndex = 21;
                this.label2.Text = "FIRST NAME";
                // 
                // panel4
                // 
                this.panel4.BackColor = System.Drawing.Color.Gold;
                this.panel4.Location = new System.Drawing.Point(10, 423);
                this.panel4.Name = "panel4";
                this.panel4.Size = new System.Drawing.Size(758, 10);
                this.panel4.TabIndex = 41;
                // 
                // panel3
                // 
                this.panel3.BackColor = System.Drawing.Color.Gold;
                this.panel3.Location = new System.Drawing.Point(0, 0);
                this.panel3.Name = "panel3";
                this.panel3.Size = new System.Drawing.Size(758, 10);
                this.panel3.TabIndex = 40;
                // 
                // panel2
                // 
                this.panel2.BackColor = System.Drawing.Color.Gold;
                this.panel2.Location = new System.Drawing.Point(758, 0);
                this.panel2.Name = "panel2";
                this.panel2.Size = new System.Drawing.Size(10, 433);
                this.panel2.TabIndex = 39;
                // 
                // panel1
                // 
                this.panel1.BackColor = System.Drawing.Color.Gold;
                this.panel1.Location = new System.Drawing.Point(0, 0);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(10, 433);
                this.panel1.TabIndex = 38;
                // 
                // button3
                // 
                this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
                this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button3.Location = new System.Drawing.Point(218, 338);
                this.button3.Name = "button3";
                this.button3.Size = new System.Drawing.Size(99, 34);
                this.button3.TabIndex = 42;
                this.button3.Text = "Home";
                this.button3.UseVisualStyleBackColor = false;
                this.button3.Click += new System.EventHandler(this.button3_Click);
                // 
                // Register
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.BackgroundImage = global::BusTicketReservation.Properties.Resources.c4;
                this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                this.ClientSize = new System.Drawing.Size(769, 433);
                this.Controls.Add(this.button3);
                this.Controls.Add(this.panel4);
                this.Controls.Add(this.panel3);
                this.Controls.Add(this.panel2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.button2);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.textBox7);
                this.Controls.Add(this.label8);
                this.Controls.Add(this.linkLabel1);
                this.Controls.Add(this.textBox6);
                this.Controls.Add(this.textBox5);
                this.Controls.Add(this.textBox4);
                this.Controls.Add(this.textBox3);
                this.Controls.Add(this.textBox2);
                this.Controls.Add(this.textBox1);
                this.Controls.Add(this.label7);
                this.Controls.Add(this.label6);
                this.Controls.Add(this.label5);
                this.Controls.Add(this.label4);
                this.Controls.Add(this.label3);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.label1);
                this.Name = "Register";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "Register";
                this.Load += new System.EventHandler(this.Register_Load);
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            #endregion
    
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.Button button2;
            private System.Windows.Forms.Button button1;
            private System.Windows.Forms.TextBox textBox7;
            private System.Windows.Forms.Label label8;
            private System.Windows.Forms.LinkLabel linkLabel1;
            private System.Windows.Forms.TextBox textBox6;
            private System.Windows.Forms.TextBox textBox5;
            private System.Windows.Forms.TextBox textBox4;
            private System.Windows.Forms.TextBox textBox3;
            private System.Windows.Forms.TextBox textBox2;
            private System.Windows.Forms.TextBox textBox1;
            private System.Windows.Forms.Label label7;
            private System.Windows.Forms.Label label6;
            private System.Windows.Forms.Label label5;
            private System.Windows.Forms.Label label4;
            private System.Windows.Forms.Label label3;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Panel panel4;
            private System.Windows.Forms.Panel panel3;
            private System.Windows.Forms.Panel panel2;
            private System.Windows.Forms.Panel panel1;
            private System.Windows.Forms.Button button3;
        }
    }
    

    Register.cs

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    
    namespace BusTicketReservation
    {
        public partial class Register : Form
        {
        public Register()
            {
                InitializeComponent();
            }
            private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                Login log = new Login();
                log.Show();
                this.Hide();
            }
            private void button2_Click(object sender, EventArgs e)
            {
                this.Close();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                conn.Open();
                if (textBox1.Text != "" || textBox2.Text != "" || textBox3.Text != "" + "" +
                    "" || textBox4.Text != "" || textBox5.Text != "" || textBox6.Text != "" || textBox7.Text != "")
                {
                    if(textBox5.Text.Length != 10)
                    {
                        MessageBox.Show("Please Fill Valid Phone Number");  
                    }
                    if (textBox6.Text != textBox7.Text)
                    {
                        
                    MessageBox.Show("Please Enter Valid Password");
                    }
                    if(textBox5.Text.Length == 10 && textBox6.Text == textBox7.Text)
                    {
                        SqlCommand cmd = new SqlCommand(@"insert into UserData values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')", conn);
                        if (cmd.ExecuteNonQuery() > 0)
                        {
                            MessageBox.Show("Register Successfull");
                            Login golog = new Login();
                            golog.Show();
                            this.Hide();
                        }
                        else
     {
                           MessageBox.Show("Register Failed");
                        }
                    }
                }         
                else
                {
                    MessageBox.Show("Please Fill All the Information");
                }
                conn.Close();
            }
            private void button3_Click(object sender, EventArgs e)
            {
                Login home = new Login();
                home.Show();
                this.Hide();
    }
            private void Register_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    

    Selection Design Module

    • Selection module consists of following options. These are New, Update, and View. It is an important concept for practicing project.
    • After the runtime environment, the event occurs.It has pass the all input data from the selection screen.
    • The other selection screen events allow programmers to modify the selection screen before it sent and specifically check user input Selection .

    Selection Design

     selection design in bus

    Selection Design Module

    Sample Code

    Selection.Designer.cs

    namespace BusTicketReservation
    {
        partial class Selection
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.button1 = new System.Windows.Forms.Button();
                this.panel4 = new System.Windows.Forms.Panel();
                this.panel3 = new System.Windows.Forms.Panel();
                this.panel2 = new System.Windows.Forms.Panel();
                this.panel1 = new System.Windows.Forms.Panel();
                this.button3 = new System.Windows.Forms.Button();
                this.button2 = new System.Windows.Forms.Button();
                this.button4 = new System.Windows.Forms.Button();
                this.SuspendLayout();
                // 
                // button1
                // 
                this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
                this.button1.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button1.Location = new System.Drawing.Point(94, 104);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(141, 49);
                this.button1.TabIndex = 26;
                this.button1.Text = "View BusTicketReservation";
                this.button1.UseVisualStyleBackColor = false;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                // 
                // panel4
                // 
                this.panel4.BackColor = System.Drawing.Color.Gold;
                this.panel4.Location = new System.Drawing.Point(-1, 469);
                this.panel4.Name = "panel4";
                this.panel4.Size = new System.Drawing.Size(768, 17);
                this.panel4.TabIndex = 34;
                // 
                // panel3
                // 
                this.panel3.BackColor = System.Drawing.Color.Gold;
                this.panel3.Location = new System.Drawing.Point(-1, -2);
                this.panel3.Name = "panel3";
                this.panel3.Size = new System.Drawing.Size(758, 10);
                this.panel3.TabIndex = 33;
                // 
                // panel2
                // 
                this.panel2.BackColor = System.Drawing.Color.Gold;
                this.panel2.Location = new System.Drawing.Point(757, -2);
                this.panel2.Name = "panel2";
                this.panel2.Size = new System.Drawing.Size(10, 472);
                this.panel2.TabIndex = 32;
                // 
                // panel1
                // 
                this.panel1.BackColor = System.Drawing.Color.Gold;
                this.panel1.Location = new System.Drawing.Point(-1, -2);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(10, 473);
                this.panel1.TabIndex = 31;
                // 
                // button3
                // 
                this.button3.BackColor = System.Drawing.Color.LightCoral;
                this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button3.Location = new System.Drawing.Point(197, 33);
                this.button3.Name = "button3";
                this.button3.Size = new System.Drawing.Size(154, 46);
                this.button3.TabIndex = 27;
                this.button3.Text = "Update BusTicketReservation";
                this.button3.UseVisualStyleBackColor = false;
                this.button3.Click += new System.EventHandler(this.button2_Click);
                // 
                // button2
                // 
                this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
                this.button2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button2.Location = new System.Drawing.Point(16, 33);
                this.button2.Name = "button2";
                this.button2.Size = new System.Drawing.Size(139, 46);
                this.button2.TabIndex = 43;
                this.button2.Text = "New BusTicketReservation";
                this.button2.UseVisualStyleBackColor = false;
                this.button2.Click += new System.EventHandler(this.button2_Click_1);
                // 
                // button4
                // 
                this.button4.BackColor = System.Drawing.Color.LightSteelBlue;
                this.button4.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button4.Location = new System.Drawing.Point(281, 104);
                this.button4.Name = "button4";
                this.button4.Size = new System.Drawing.Size(149, 49);
                this.button4.TabIndex = 44;
                this.button4.Text = "Logout";
                this.button4.UseVisualStyleBackColor = false;
                this.button4.Click += new System.EventHandler(this.button4_Click);
                // 
                // Selection
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.BackgroundImage = global::BusTicketReservation.Properties.Resources.c6;
                this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                this.ClientSize = new System.Drawing.Size(765, 476);
                this.Controls.Add(this.button4);
                this.Controls.Add(this.button2);
                this.Controls.Add(this.panel4);
                this.Controls.Add(this.panel3);
                this.Controls.Add(this.panel2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.button3);
                this.Controls.Add(this.button1);
                this.Name = "Selection";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "Selection";
                this.Load += new System.EventHandler(this.Selection_Load);
                this.ResumeLayout(false);
    
            }
    
            #endregion
            private System.Windows.Forms.Button button1;
            private System.Windows.Forms.Panel panel4;
            private System.Windows.Forms.Panel panel3;
            private System.Windows.Forms.Panel panel2;
            private System.Windows.Forms.Panel panel1;
            private System.Windows.Forms.Button button3;
            private System.Windows.Forms.Button button2;
            private System.Windows.Forms.Button button4;
        }
    }
    

    Selection.cs

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    namespace BusTicketReservation
    {
        public partial class Selection : Form
        {
        public Selection()
            {
                InitializeComponent();
            }
            private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                View goDosboard = new View();
                goDosboard.Show();
                this.Hide();
            }
           private void button1_Click(object sender, EventArgs e)
            {
                View View = new View();
                View.Show();
                this.Hide(); 
    }
            private void button2_Click(object sender, EventArgs e)
            {
                Update Update = new Update();
                Update.Show();
                this.Hide();
            }
            private void button2_Click_1(object sender, EventArgs e)
            {
                New new1 = new New();
                new1.Show();
                this.Hide();
            }
            private void button4_Click(object sender, EventArgs e)
    {
                Login golog = new Login();
                golog.Show();
                this.Hide();
            }
            private void Selection_Load(object sender, EventArgs e)
            {
    
            }
        }
    }
    

    New Booking Module

    • This module is used to apply the new booking.
    • New Booking module allows registered users to book the bus ticket.
    • Using this module user can add detail registrations to make booking.
     new design in bus

    New Booking Module

    Sample Code

    New.Designer.cs

    namespace BusTicketReservation
    {
        partial class New
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.label2 = new System.Windows.Forms.Label();
                this.label3 = new System.Windows.Forms.Label();
                this.label5 = new System.Windows.Forms.Label();
                this.label6 = new System.Windows.Forms.Label();
                this.textBox1 = new System.Windows.Forms.TextBox();
                this.button1 = new System.Windows.Forms.Button();
                this.linkLabel1 = new System.Windows.Forms.LinkLabel();
                this.textBox4 = new System.Windows.Forms.TextBox();
                this.textBox5 = new System.Windows.Forms.TextBox();
                this.panel4 = new System.Windows.Forms.Panel();
                this.panel3 = new System.Windows.Forms.Panel();
                this.panel2 = new System.Windows.Forms.Panel();
                this.panel1 = new System.Windows.Forms.Panel();
                this.button3 = new System.Windows.Forms.Button();
                this.button2 = new System.Windows.Forms.Button();
                this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
                this.label4 = new System.Windows.Forms.Label();
                this.comboBox1 = new System.Windows.Forms.ComboBox();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.BackColor = System.Drawing.Color.Transparent;
                this.label1.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label1.ForeColor = System.Drawing.Color.DarkRed;
                this.label1.Location = new System.Drawing.Point(455, 33);
                this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(225, 37);
                this.label1.TabIndex = 13;
                this.label1.Text = "BusTicketReservation Details";
                this.label1.Click += new System.EventHandler(this.label1_Click);
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.BackColor = System.Drawing.Color.IndianRed;
                this.label2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label2.ForeColor = System.Drawing.Color.LawnGreen;
                this.label2.Location = new System.Drawing.Point(375, 167);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(117, 19);
                this.label2.TabIndex = 14;
                this.label2.Text = "Customer Name";
                // 
                // label3
                // 
                this.label3.AutoSize = true;
                this.label3.BackColor = System.Drawing.Color.IndianRed;
                this.label3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label3.ForeColor = System.Drawing.Color.LawnGreen;
                this.label3.Location = new System.Drawing.Point(374, 215);
                this.label3.Name = "label3";
                this.label3.Size = new System.Drawing.Size(44, 19);
                this.label3.TabIndex = 15;
                this.label3.Text = " Date";
                // 
                // label5
                // 
                this.label5.AutoSize = true;
                this.label5.BackColor = System.Drawing.Color.IndianRed;
                this.label5.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label5.ForeColor = System.Drawing.Color.LawnGreen;
                this.label5.Location = new System.Drawing.Point(371, 261);
                this.label5.Name = "label5";
                this.label5.Size = new System.Drawing.Size(55, 19);
                this.label5.TabIndex = 17;
                this.label5.Text = "BusTicketReservation";
                // 
                // label6
                // 
                this.label6.AutoSize = true;
                this.label6.BackColor = System.Drawing.Color.IndianRed;
                this.label6.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label6.ForeColor = System.Drawing.Color.LawnGreen;
                this.label6.Location = new System.Drawing.Point(370, 303);
                this.label6.Name = "label6";
                this.label6.Size = new System.Drawing.Size(44, 19);
                this.label6.TabIndex = 18;
                this.label6.Text = "Place";
                // 
                // textBox1
                // 
                this.textBox1.Location = new System.Drawing.Point(534, 166);
                this.textBox1.Name = "textBox1";
                this.textBox1.Size = new System.Drawing.Size(204, 20);
                this.textBox1.TabIndex = 19;
                // 
                // button1
                // 
                this.button1.BackColor = System.Drawing.Color.Yellow;
                this.button1.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button1.Location = new System.Drawing.Point(501, 350);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(105, 34);
                this.button1.TabIndex = 26;
                this.button1.Text = "Add";
                this.button1.UseVisualStyleBackColor = false;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                // 
                // linkLabel1
                // 
                this.linkLabel1.AutoSize = true;
                this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
                this.linkLabel1.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.linkLabel1.ForeColor = System.Drawing.SystemColors.HotTrack;
                this.linkLabel1.LinkColor = System.Drawing.SystemColors.ActiveCaptionText;
                this.linkLabel1.Location = new System.Drawing.Point(477, 422);
                this.linkLabel1.Name = "linkLabel1";
                this.linkLabel1.Size = new System.Drawing.Size(129, 19);
                this.linkLabel1.TabIndex = 28;
                this.linkLabel1.TabStop = true;
                this.linkLabel1.Text = "Goto Dosboard -->";
                this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
                // 
                // textBox4
                // 
                this.textBox4.Location = new System.Drawing.Point(530, 262);
                this.textBox4.Name = "textBox4";
                this.textBox4.Size = new System.Drawing.Size(204, 20);
                this.textBox4.TabIndex = 30;
                // 
                // textBox5
                // 
                this.textBox5.Location = new System.Drawing.Point(530, 304);
                this.textBox5.Name = "textBox5";
                this.textBox5.Size = new System.Drawing.Size(204, 20);
                this.textBox5.TabIndex = 29;
                // 
                // panel4
                // 
                this.panel4.BackColor = System.Drawing.Color.Gold;
                this.panel4.Location = new System.Drawing.Point(-1, 463);
                this.panel4.Name = "panel4";
                this.panel4.Size = new System.Drawing.Size(768, 17);
                this.panel4.TabIndex = 34;
                // 
                // panel3
                // 
                this.panel3.BackColor = System.Drawing.Color.Gold;
                this.panel3.Location = new System.Drawing.Point(-1, -2);
                this.panel3.Name = "panel3";
                this.panel3.Size = new System.Drawing.Size(758, 10);
                this.panel3.TabIndex = 33;
                // 
                // panel2
                // 
                this.panel2.BackColor = System.Drawing.Color.Gold;
                this.panel2.Location = new System.Drawing.Point(757, -2);
                this.panel2.Name = "panel2";
                this.panel2.Size = new System.Drawing.Size(10, 472);
                this.panel2.TabIndex = 32;
                // 
                // panel1
                // 
                this.panel1.BackColor = System.Drawing.Color.Gold;
                this.panel1.Location = new System.Drawing.Point(-1, -2);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(10, 473);
                this.panel1.TabIndex = 31;
                // 
                // button3
                // 
                this.button3.BackColor = System.Drawing.Color.Olive;
                this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button3.Location = new System.Drawing.Point(633, 350);
                this.button3.Name = "button3";
                this.button3.Size = new System.Drawing.Size(105, 34);
                this.button3.TabIndex = 27;
                this.button3.Text = "Cancel";
                this.button3.UseVisualStyleBackColor = false;
                this.button3.Click += new System.EventHandler(this.button2_Click);
                // 
                // button2
                // 
                this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
                this.button2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button2.Location = new System.Drawing.Point(375, 350);
                this.button2.Name = "button2";
                this.button2.Size = new System.Drawing.Size(99, 34);
                this.button2.TabIndex = 43;
                this.button2.Text = "Back";
                this.button2.UseVisualStyleBackColor = false;
                this.button2.Click += new System.EventHandler(this.button2_Click_1);
                // 
                // dateTimePicker1
                // 
                this.dateTimePicker1.Location = new System.Drawing.Point(534, 213);
                this.dateTimePicker1.Name = "dateTimePicker1";
                this.dateTimePicker1.Size = new System.Drawing.Size(200, 20);
                this.dateTimePicker1.TabIndex = 44;
                // 
                // label4
                // 
                this.label4.AutoSize = true;
                this.label4.BackColor = System.Drawing.Color.IndianRed;
                this.label4.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label4.ForeColor = System.Drawing.Color.Lime;
                this.label4.Location = new System.Drawing.Point(374, 119);
                this.label4.Name = "label4";
                this.label4.Size = new System.Drawing.Size(93, 19);
                this.label4.TabIndex = 45;
                this.label4.Text = "Customer ID";
                // 
                // comboBox1
                // 
                this.comboBox1.FormattingEnabled = true;
                this.comboBox1.Location = new System.Drawing.Point(534, 119);
                this.comboBox1.Name = "comboBox1";
                this.comboBox1.Size = new System.Drawing.Size(204, 21);
                this.comboBox1.TabIndex = 46;
                // 
                // New
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.BackgroundImage = global::BusTicketReservation.Properties.Resources.c5;
                this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                this.ClientSize = new System.Drawing.Size(765, 476);
                this.Controls.Add(this.comboBox1);
                this.Controls.Add(this.label4);
                this.Controls.Add(this.dateTimePicker1);
                this.Controls.Add(this.button2);
                this.Controls.Add(this.panel4);
                this.Controls.Add(this.panel3);
                this.Controls.Add(this.panel2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.textBox4);
                this.Controls.Add(this.textBox5);
                this.Controls.Add(this.linkLabel1);
                this.Controls.Add(this.button3);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.textBox1);
                this.Controls.Add(this.label6);
                this.Controls.Add(this.label5);
                this.Controls.Add(this.label3);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.label1);
                this.Name = "New";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "New";
                this.Load += new System.EventHandler(this.New_Load);
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            #endregion
    
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Label label3;
            private System.Windows.Forms.Label label5;
            private System.Windows.Forms.Label label6;
            private System.Windows.Forms.TextBox textBox1;
            private System.Windows.Forms.Button button1;
            private System.Windows.Forms.LinkLabel linkLabel1;
            private System.Windows.Forms.TextBox textBox4;
            private System.Windows.Forms.TextBox textBox5;
            private System.Windows.Forms.Panel panel4;
            private System.Windows.Forms.Panel panel3;
            private System.Windows.Forms.Panel panel2;
            private System.Windows.Forms.Panel panel1;
            private System.Windows.Forms.Button button3;
            private System.Windows.Forms.Button button2;
            private System.Windows.Forms.DateTimePicker dateTimePicker1;
            private System.Windows.Forms.Label label4;
            private System.Windows.Forms.ComboBox comboBox1;
        }
    }
    

    New.cs

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    namespace  BusTicketReservation
    {
        public partial class New : Form
        {
            public New()
            {
                InitializeComponent();
            }
            private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                Selection sel = new Selection();
                sel.Show();
                this.Hide();
            }
            private void button1_Click(object sender, EventArgs e)
            {
                SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                conn.Open();
                if (textBox1.Text != "" ||   textBox4.Text != "" || textBox5.Text != "")
                {           
                    SqlCommand cmd = new SqlCommand(@"insert into Detail([Id],[Name],[Date],[Type],[Purpose]) values ('" + comboBox1.SelectedItem.ToString() + "','" + textBox1.Text + "','" + dateTimePicker1.Value.ToString("MM/dd/yyyy")  + "','" + textBox4.Text + "','" + textBox5.Text + "')", conn);
                    if (cmd.ExecuteNonQuery() > 0)
                    {
                        MessageBox.Show("Booking Successfull");
                        Selection gosel = new Selection();
                        gosel.Show();
                        this.Hide();
                    }
                    else
                    {
                     MessageBox.Show("Booking Rejected");            
                    }
                }
                else
                {
                    MessageBox.Show("Please Fill All the Information");
                }
                conn.Close();
            }
            private void button2_Click(object sender, EventArgs e)
            {
                //this.Close();
                View view = new View();
                view.Show();
                this.Hide();
            }
            private void New_Load(object sender, EventArgs e)
            {
                SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                conn.Open();
                SqlCommand cmd = new SqlCommand(@"select id from UserData", conn);  
                DataTable dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                foreach (DataRow dr in dt.Rows)
                    comboBox1.Items.Add(dr[0].ToString());
                conn.Close();
            }
            private void button2_Click_1(object sender, EventArgs e)
            {
                Selection sel = new Selection();
                sel.Show();
                this.Hide();
            }
        }
    }

    Update Design Module

    • The module updates the ticket confirmation.
    • The module will check for available updates of customer detail.
    • Fetch details field shows the updated details.
     update design in bus

    Update Design Module

    Sample Code

    Update.Designer.cs

    namespace BusTicketReservation
    {
        partial class Update
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.button1 = new System.Windows.Forms.Button();
                this.label2 = new System.Windows.Forms.Label();
                this.panel4 = new System.Windows.Forms.Panel();
                this.panel3 = new System.Windows.Forms.Panel();
                this.panel2 = new System.Windows.Forms.Panel();
                this.panel1 = new System.Windows.Forms.Panel();
                this.button3 = new System.Windows.Forms.Button();
                this.comboBox1 = new System.Windows.Forms.ComboBox();
                this.dataGridView1 = new System.Windows.Forms.DataGridView();
                this.button4 = new System.Windows.Forms.Button();
                this.label3 = new System.Windows.Forms.Label();
                this.label4 = new System.Windows.Forms.Label();
                this.dataGridView2 = new System.Windows.Forms.DataGridView();
                this.comboBox2 = new System.Windows.Forms.ComboBox();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label1.ForeColor = System.Drawing.Color.OrangeRed;
                this.label1.Location = new System.Drawing.Point(251, 201);
                this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(236, 37);
                this.label1.TabIndex = 2;
                this.label1.Text = "Update Details ";
                // 
                // button1
                // 
                this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
                this.button1.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button1.Location = new System.Drawing.Point(505, 364);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(90, 34);
                this.button1.TabIndex = 36;
                this.button1.Text = "UPDATE";
                this.button1.UseVisualStyleBackColor = false;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label2.Location = new System.Drawing.Point(194, 251);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(76, 15);
                this.label2.TabIndex = 21;
                this.label2.Text = "Customer ID";
                // 
                // panel4
                // 
                this.panel4.BackColor = System.Drawing.Color.Gold;
                this.panel4.Location = new System.Drawing.Point(10, 423);
                this.panel4.Name = "panel4";
                this.panel4.Size = new System.Drawing.Size(758, 10);
                this.panel4.TabIndex = 41;
                // 
                // panel3
                // 
                this.panel3.BackColor = System.Drawing.Color.Gold;
                this.panel3.Location = new System.Drawing.Point(0, 0);
                this.panel3.Name = "panel3";
                this.panel3.Size = new System.Drawing.Size(758, 10);
                this.panel3.TabIndex = 40;
                // 
                // panel2
                // 
                this.panel2.BackColor = System.Drawing.Color.Gold;
                this.panel2.Location = new System.Drawing.Point(758, 0);
                this.panel2.Name = "panel2";
                this.panel2.Size = new System.Drawing.Size(10, 433);
                this.panel2.TabIndex = 39;
                // 
                // panel1
                // 
                this.panel1.BackColor = System.Drawing.Color.Gold;
                this.panel1.Location = new System.Drawing.Point(0, 0);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(10, 433);
                this.panel1.TabIndex = 38;
                // 
                // button3
                // 
                this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
                this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button3.Location = new System.Drawing.Point(653, 16);
                this.button3.Name = "button3";
                this.button3.Size = new System.Drawing.Size(99, 34);
                this.button3.TabIndex = 42;
                this.button3.Text = "Home";
                this.button3.UseVisualStyleBackColor = false;
                this.button3.Click += new System.EventHandler(this.button3_Click_1);
                // 
                // comboBox1
                // 
                this.comboBox1.FormattingEnabled = true;
                this.comboBox1.Location = new System.Drawing.Point(277, 245);
                this.comboBox1.Name = "comboBox1";
                this.comboBox1.Size = new System.Drawing.Size(203, 21);
                this.comboBox1.TabIndex = 43;
                // 
                // dataGridView1
                // 
                this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridView1.Location = new System.Drawing.Point(57, 281);
                this.dataGridView1.Name = "dataGridView1";
                this.dataGridView1.Size = new System.Drawing.Size(667, 77);
                this.dataGridView1.TabIndex = 44;
                // 
                // button4
                // 
                this.button4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
                this.button4.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.button4.Location = new System.Drawing.Point(505, 241);
                this.button4.Name = "button4";
                this.button4.Size = new System.Drawing.Size(90, 34);
                this.button4.TabIndex = 45;
                this.button4.Text = "FETCH DATA ";
                this.button4.UseVisualStyleBackColor = false;
                this.button4.Click += new System.EventHandler(this.button4_Click);
                // 
                // label3
                // 
                this.label3.AutoSize = true;
                this.label3.Font = new System.Drawing.Font("Cambria", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label3.Location = new System.Drawing.Point(194, 374);
                this.label3.Name = "label3";
                this.label3.Size = new System.Drawing.Size(57, 15);
                this.label3.TabIndex = 46;
                this.label3.Text = "PROCESS";
                // 
                // label4
                // 
                this.label4.AutoSize = true;
                this.label4.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.label4.ForeColor = System.Drawing.Color.OrangeRed;
                this.label4.Location = new System.Drawing.Point(270, 39);
                this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
                this.label4.Name = "label4";
                this.label4.Size = new System.Drawing.Size(203, 37);
                this.label4.TabIndex = 48;
                this.label4.Text = "Fetch Details";
                // 
                // dataGridView2
                // 
                this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridView2.Location = new System.Drawing.Point(57, 79);
                this.dataGridView2.Name = "dataGridView2";
                this.dataGridView2.Size = new System.Drawing.Size(667, 100);
                this.dataGridView2.TabIndex = 49;
                // 
                // comboBox2
                // 
                this.comboBox2.FormattingEnabled = true;
                this.comboBox2.Items.AddRange(new object[] {
                "Done",
                "NotDone"});
                this.comboBox2.Location = new System.Drawing.Point(277, 374);
                this.comboBox2.Name = "comboBox2";
                this.comboBox2.Size = new System.Drawing.Size(203, 21);
                this.comboBox2.TabIndex = 50;
                // 
                // Update
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.BackgroundImage = global::BusTicketReservation.Properties.Resources.b5;
                this.ClientSize = new System.Drawing.Size(769, 433);
                this.Controls.Add(this.comboBox2);
                this.Controls.Add(this.dataGridView2);
                this.Controls.Add(this.label4);
                this.Controls.Add(this.label3);
                this.Controls.Add(this.button4);
                this.Controls.Add(this.dataGridView1);
                this.Controls.Add(this.comboBox1);
                this.Controls.Add(this.button3);
                this.Controls.Add(this.panel4);
                this.Controls.Add(this.panel3);
                this.Controls.Add(this.panel2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.label1);
                this.Name = "Update";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "Update";
                this.Load += new System.EventHandler(this.Update_Load);
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            #endregion
    
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.Button button1;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Panel panel4;
            private System.Windows.Forms.Panel panel3;
            private System.Windows.Forms.Panel panel2;
            private System.Windows.Forms.Panel panel1;
            private System.Windows.Forms.Button button3;
            private System.Windows.Forms.ComboBox comboBox1;
            private System.Windows.Forms.DataGridView dataGridView1;
            private System.Windows.Forms.Button button4;
            private System.Windows.Forms.Label label3;
            private System.Windows.Forms.Label label4;
            private System.Windows.Forms.DataGridView dataGridView2;
            private System.Windows.Forms.ComboBox comboBox2;
        }
    }
    

    Update.cs

      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      using System.Data.SqlClient;
      namespace BusTicketReservation
      {
          public partial class Update : Form
          {
           public Update()
              {
                  InitializeComponent();
              }
              private void button2_Click(object sender, EventArgs e)
              {
                  this.Close();
              }
              private void button1_Click(object sender, EventArgs e)
              {
                  SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                  conn.Open();
                  SqlCommand cmd = new SqlCommand(@"update  Detail  set Processed='" + comboBox2.SelectedItem.ToString()   + "' where id = '" + comboBox1.SelectedItem.ToString() + "'", conn);
      
      
              if (cmd.ExecuteNonQuery() > 0)
                  {
                      MessageBox.Show("Data Updated Successfully");
                  }
              }
                     private void button4_Click(object sender, EventArgs e)
              {
                  SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                  conn.Open();
                  SqlCommand cmd1 = new SqlCommand(@"select * from UserData where id = '" + comboBox1.SelectedItem.ToString()+ "'", conn);
                              DataTable dt1 = new DataTable();
                  SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                  da1.Fill(dt1);
                 dataGridView1.DataSource = dt1;
             }
              private void Update_Load(object sender, EventArgs e)
              {
                  SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                  conn.Open();
                  SqlCommand cmd = new SqlCommand(@"select id from Detail", conn);
                  DataTable dt = new DataTable();
                  SqlDataAdapter da = new SqlDataAdapter(cmd);
                  da.Fill(dt);
                  foreach (DataRow dr in dt.Rows)
                  comboBox1.Items.Add(dr[0].ToString());
                  SqlCommand cmd1 = new SqlCommand(@"select * from Detail where Processed is null or processed ='NotDone'", conn);
                  DataTable dt1 = new DataTable();
                  SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                  da1.Fill(dt1);
                  dataGridView2.DataSource = dt1;
                  conn.Close();
              }
              private void button3_Click_1(object sender, EventArgs e)
              {
                  Selection gosel = new Selection();
                  gosel.Show();
                  this.Hide();
              }

      View Booking Module

      • This module is used to view the customer profiles and booking details.
      • The View  Module allows administrators to display customer detail and customer profile.
       view design in bus

      View Booking Module

      Sample Code

      View.Designer.cs

      namespace BusTicketReservation
      {
          partial class View
          {
              /// <summary>
              /// Required designer variable.
              /// </summary>
              private System.ComponentModel.IContainer components = null;
      
              /// <summary>
              /// Clean up any resources being used.
              /// </summary>
              /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
              protected override void Dispose(bool disposing)
              {
                  if (disposing && (components != null))
                  {
                      components.Dispose();
                  }
                  base.Dispose(disposing);
              }
      
              #region Windows Form Designer generated code
      
              /// <summary>
              /// Required method for Designer support - do not modify
              /// the contents of this method with the code editor.
              /// </summary>
              private void InitializeComponent()
              {
                  this.label1 = new System.Windows.Forms.Label();
                  this.button1 = new System.Windows.Forms.Button();
                  this.dataGridView1 = new System.Windows.Forms.DataGridView();
                  this.dataGridView2 = new System.Windows.Forms.DataGridView();
                  this.button2 = new System.Windows.Forms.Button();
                  this.button3 = new System.Windows.Forms.Button();
                  this.panel4 = new System.Windows.Forms.Panel();
                  this.panel3 = new System.Windows.Forms.Panel();
                  this.panel2 = new System.Windows.Forms.Panel();
                  this.panel1 = new System.Windows.Forms.Panel();
                  ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
                  ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
                  this.SuspendLayout();
                  // 
                  // label1
                  // 
                  this.label1.AutoSize = true;
                  this.label1.Font = new System.Drawing.Font("Cambria", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  this.label1.ForeColor = System.Drawing.Color.OrangeRed;
                  this.label1.Location = new System.Drawing.Point(192, 12);
                  this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
                  this.label1.Name = "label1";
                  this.label1.Size = new System.Drawing.Size(421, 37);
                  this.label1.TabIndex = 11;
                  this.label1.Text = "Welcome to Your Dashboard";
                  // 
                  // button1
                  // 
                  this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
                  this.button1.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  this.button1.Location = new System.Drawing.Point(288, 61);
                  this.button1.Name = "button1";
                  this.button1.Size = new System.Drawing.Size(185, 42);
                  this.button1.TabIndex = 12;
                  this.button1.Text = "View  Profile";
                  this.button1.UseVisualStyleBackColor = false;
                  this.button1.Click += new System.EventHandler(this.button1_Click);
                  // 
                  // dataGridView1
                  // 
                  this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                  this.dataGridView1.Location = new System.Drawing.Point(50, 109);
                  this.dataGridView1.Name = "dataGridView1";
                  this.dataGridView1.Size = new System.Drawing.Size(667, 117);
                  this.dataGridView1.TabIndex = 14;
                  // 
                  // dataGridView2
                  // 
                  this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                  this.dataGridView2.Location = new System.Drawing.Point(50, 286);
                  this.dataGridView2.Name = "dataGridView2";
                  this.dataGridView2.Size = new System.Drawing.Size(667, 117);
                  this.dataGridView2.TabIndex = 16;
                  // 
                  // button2
                  // 
                  this.button2.BackColor = System.Drawing.Color.Cyan;
                  this.button2.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  this.button2.Location = new System.Drawing.Point(264, 238);
                  this.button2.Name = "button2";
                  this.button2.Size = new System.Drawing.Size(231, 42);
                  this.button2.TabIndex = 15;
                  this.button2.Text = "View  Detail";
                  this.button2.UseVisualStyleBackColor = false;
                  this.button2.Click += new System.EventHandler(this.button2_Click);
                  // 
                  // button3
                  // 
                  this.button3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
                  this.button3.Font = new System.Drawing.Font("Cambria", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                  this.button3.Location = new System.Drawing.Point(617, 28);
                  this.button3.Name = "button3";
                  this.button3.Size = new System.Drawing.Size(100, 37);
                  this.button3.TabIndex = 17;
                  this.button3.Text = "Back";
                  this.button3.UseVisualStyleBackColor = false;
                  this.button3.Click += new System.EventHandler(this.button3_Click);
                  // 
                  // panel4
                  // 
                  this.panel4.BackColor = System.Drawing.Color.Gold;
                  this.panel4.Location = new System.Drawing.Point(8, 422);
                  this.panel4.Name = "panel4";
                  this.panel4.Size = new System.Drawing.Size(758, 10);
                  this.panel4.TabIndex = 25;
                  // 
                  // panel3
                  // 
                  this.panel3.BackColor = System.Drawing.Color.Gold;
                  this.panel3.Location = new System.Drawing.Point(-2, -1);
                  this.panel3.Name = "panel3";
                  this.panel3.Size = new System.Drawing.Size(758, 10);
                  this.panel3.TabIndex = 24;
                  // 
                  // panel2
                  // 
                  this.panel2.BackColor = System.Drawing.Color.Gold;
                  this.panel2.Location = new System.Drawing.Point(756, -1);
                  this.panel2.Name = "panel2";
                  this.panel2.Size = new System.Drawing.Size(10, 433);
                  this.panel2.TabIndex = 23;
                  // 
                  // panel1
                  // 
                  this.panel1.BackColor = System.Drawing.Color.Gold;
                  this.panel1.Location = new System.Drawing.Point(-2, -1);
                  this.panel1.Name = "panel1";
                  this.panel1.Size = new System.Drawing.Size(10, 433);
                  this.panel1.TabIndex = 22;
                  // 
                  // View
                  // 
                  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                  this.BackColor = System.Drawing.Color.White;
                  this.BackgroundImage = global::BusTicketReservation.Properties.Resources.b4;
                  this.ClientSize = new System.Drawing.Size(764, 430);
                  this.Controls.Add(this.panel4);
                  this.Controls.Add(this.panel3);
                  this.Controls.Add(this.panel2);
                  this.Controls.Add(this.panel1);
                  this.Controls.Add(this.button3);
                  this.Controls.Add(this.dataGridView2);
                  this.Controls.Add(this.button2);
                  this.Controls.Add(this.dataGridView1);
                  this.Controls.Add(this.button1);
                  this.Controls.Add(this.label1);
                  this.Name = "View";
                  this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                  this.Text = "View";
                  this.Load += new System.EventHandler(this.View_Load);
                  ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
                  ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
                  this.ResumeLayout(false);
                  this.PerformLayout();
      
              }
      
              #endregion
      
              private System.Windows.Forms.Label label1;
              private System.Windows.Forms.Button button1;
              private System.Windows.Forms.DataGridView dataGridView1;
              private System.Windows.Forms.DataGridView dataGridView2;
              private System.Windows.Forms.Button button2;
              private System.Windows.Forms.Button button3;
              private System.Windows.Forms.Panel panel4;
              private System.Windows.Forms.Panel panel3;
              private System.Windows.Forms.Panel panel2;
              private System.Windows.Forms.Panel panel1;
          }
      }
      

      View.cs

        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.Data;
        using System.Drawing;
        using System.Linq;
        using System.Text;
        using System.Threading.Tasks;
        using System.Windows.Forms;
        using System.Data.SqlClient;
        namespace BusTicketReservation
        {
            public partial class View : Form
            {
                public View()
                {
                    InitializeComponent();
                }
                private void button1_Click(object sender, EventArgs e)
                {
                    SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                    conn.Open();
                    SqlCommand cmd = new SqlCommand(@"select * from UserData", conn);
                    cmd.ExecuteNonQuery();
                    DataTable dt = new DataTable();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(dt);
                    dataGridView1.DataSource = dt;
                    conn.Close();
                }
                private void button2_Click(object sender, EventArgs e)
                {
                    SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Project\DotNet-Project\BusTicketReservation\Database\Reservation.mdf;Integrated Security=True;Connect Timeout=30");
                    conn.Open();
                    SqlCommand cmd = new SqlCommand(@"select * from Detail", conn);
                    cmd.ExecuteNonQuery();
                    DataTable dt = new DataTable();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(dt);
                    dataGridView2.DataSource = dt;
                    conn.Close();
                }
                private void button3_Click(object sender, EventArgs e)
                {
                    Selection golog = new Selection();
                    golog.Show();
                    this.Hide();
                }
                private void View_Load(object sender, EventArgs e)
                {
                }
            }
        }

        Future Enhancement

        • We provide SMS based alerts and email notifications for bookings.
        • Chat feature can be included in the application to chat with customer care.
        • There is some other features included such as 'save favourite routes and provide discounts'.
        • We introduce coupon management for providing coupons for customers to use the available discount offers.

        Conclusion

        • This Mini project bus reservation system provides an easy way for booking the bus tickets.
        • Our project has succeeded in managing the data and providing the best service to the users.
        • To make reservation reliable, there is a need of advanced system. So the customers can make reservation easier, faster and safer.
        • The system can provide reservation services and information to their customers without the limitation of office hours or manpower.

        References


        Related Searches to Bus Ticket Booking System | Final Year Project | Mini Project