Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Online movie ticket booking project In Asp Net with c# (or) free download online cinema movie ticket booking c# asp .net

Online movie ticket booking project In Asp Net with c#

This project is basically aimed to provide the customers facility to book the movie tickets online. The pain of standing in queue at cinema hall window will be gone with help of this facility of online movie tickets booking. It is an automatic system. The customers will get the extra benefit of selecting the seats of their choice from seats layout. The customers will be able to make a choice of their own by riding through the website. User friendliness of website will help attract more customers to multiplex. Extra features of website like discounts, offers, advertises , movie details etc will help people to know about different movies and they will be attracted to the multiplex by seeing such facilities. Along with customers the employees at window booking of the multiplex will get very user friendly and smooth ride for booking process.

Code : asp.net and c# 
 Datebase : SQL

List of pages :


Admin panel pages differs from the normal web page. 
Admin panels are for managing the entire site whcih consist of following modules
 
1. Users
2. Contents
3. Permission of various pages.
4. Transactions (If website is performing any transaction)
5. Sending Newsletter ( If website has the provision for users to subscribe news letter).
So basically admin panels are for managing the website. So build/arrange your modules based on your actual website/webapplication.

Admin Pages :

AdminHome.aspx
AdminLogin.aspx
Create ddHallLayout.aspx
CreateTheatre.aspx
creatycity.aspx
InsertMovieInformation.aspx
ListOfBookedTickets.aspx
ListOfCancelledTicketd.aspx
DeleteUser.aspx
ListOfRegCandidates.aspx
ModifyRegUsers.aspx

UserLoginPages :

Index.aspx
Provided Login.aspx
Registration
.aspx
Forgot password
.aspx
Contactus.aspx
Change password
.aspx
Update User Details..aspx
List of Posted Jobs
.aspx
PrintTicket.aspx
SearchMovies
.aspx
SelectedMovie.aspx
ListofBookedTickets.aspx
CancelTickets.aspx
Gateway.aspx
ConfirmationShow.aspx
Selected  Movie :
In this page user has to choose movie , city , theatre, date and submit to next page.


Hall Layout Screen
using System;
usingSystem.Collections;
usingSystem.Configuration;
usingSystem.Data;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Web.UI.HtmlControls;
usingSystem.Xml.Linq;
usingSystem.Data.SqlClient;
usingSystem.Globalization;

namespaceBookFilmTickets
{
    public partial class Index : System.Web.UI.Page
    {
        SqlConnectioncon = new SqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);
        protectedvoid Page_Load(objectsender, EventArgs e)
        {
            if(!IsPostBack)
            {
                stringstr = "select distinct  city from moviedata";
                SqlDataAdapteradp = new SqlDataAdapter(str, con);
                DataSetds = new DataSet();
                adp.Fill(ds);
                Ddlcity.DataSource = ds;
                Ddlcity.DataBind();
                Ddlcity.Items.Insert(0, new ListItem("--Select city--","0"));
                Ddlmovie.Items.Insert(0, new ListItem("--Select movie--", "0"));
                Ddltheatre.Items.Insert(0, new ListItem("--Select theatre--", "0"));
            }
        }

        protectedvoid Ddlcity_SelectedIndexChanged(object sender, EventArgse)
        {
            Ddlmovie.Items.Clear();
            stringct = Ddlcity.SelectedValue.ToString();
            stringstr = "select movie from moviedata where city= '" + ct + "' ";
            SqlDataAdapteradp = new SqlDataAdapter(str, con);
            DataSetds = new DataSet();
            adp.Fill(ds);
            Ddlmovie.DataSource = ds;
            Ddlmovie.DataBind();
            Ddlmovie.Items.Insert(0, new ListItem("--Select movie--", "0"));
        }

        protectedvoid Ddlmovie_SelectedIndexChanged(object sender, EventArgse)
        {
            Ddltheatre.Items.Clear();
            stringmv = Ddlmovie.SelectedValue.ToString();
            stringstr = "select theatre from moviedata where movie= '" + mv + "' ";
            SqlDataAdapteradp = new SqlDataAdapter(str, con);
            DataSetds = new DataSet();
            adp.Fill(ds);
            Ddltheatre.DataSource = ds;
            Ddltheatre.DataBind();
            Ddltheatre.Items.Insert(0, new ListItem("--Select Theatre--", "0"));
            DdlDATE.Items.Clear();
            ListItemlt = new ListItem();
            lt.Text = "--Select Date--";
            lt.Value = "0";
            DdlDATE.Items.Add(lt);          
            StringsDate = DateTime.UtcNow.ToString();
            DateTimedatevalue = (Convert.ToDateTime(sDate.ToString()));  
            stringpattern = CultureInfo.CurrentCulture.DateTimeFormat.MonthDayPattern;
            pattern = pattern.Replace("MMMM", "MMM");
            stringformatted = "Today, " + datevalue.ToString(pattern);
            stringformatted1 = "Tomorrow, " + datevalue.AddDays(1).ToString(pattern);
            stringformatted2 = datevalue.AddDays(2).ToString(pattern);
            DdlDATE.Items.Add(formatted);
            DdlDATE.Items.Add(formatted1);
            DdlDATE.Items.Add(formatted2);
        }

        protectedvoid Button1_Click(objectsender, EventArgs e)
        {
            stringcty = Ddlcity.SelectedValue.ToString();
            stringmve = Ddlmovie.SelectedValue.ToString();
            stringthr = Ddltheatre.SelectedValue.ToString();
            stringdte = DdlDATE.SelectedValue.ToString();
            Response.Redirect("~/UserSelectedMovie.aspx?city=" + cty + "&movie=" + mve + " &thetre=" + thr + " &date=" + dte);

        }


    }
}

After  selecting  movie, you can see the hall lay out  of your selected hall. Here you can select the seats and user can selet 6 tickets only.
We use business o bjects and data access layers in this projects.

BOL.cs  and DAL.cs

BOL.cs   code :

using System;
usingSystem.Data;
usingSystem.Configuration;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.HtmlControls;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Xml.Linq;
usingSystem.Data.Sql;
usingSystem.Data.SqlClient;

/// <summary>
/// Summary description for BOL
/// </summary>
public class BOL
{
    SqlConnectioncon = new SqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);
      public BOL()
      {
            //
            // TODO: Add constructor logic here
            //
      }
    public int AddScreen(stringscreenName)
    {
        try
        {
            SqlParameter[] p = new SqlParameter[1];
            p[0] = newSqlParameter("@ScreenName", screenName);
            returnDAL.ExecuteNonQuery(DAL.GetConnectionString(), CommandType.StoredProcedure, "sp_AddScreen", p);
        }
        catch (ArgumentException ex)
        {
            thrownew ArgumentException(ex.Message);
        }
    }
    public DataSet GetScreens()
    {
        try
        {
            SqlParameter[] p = new SqlParameter[0];
            returnDAL.ExecuteDataSet(DAL.GetConnectionString(), CommandType.StoredProcedure, "sp_GetScreens", p);
        }
        catch (Exception)
        {       
            throw;
        }
    }
    public DataSet GetScreenLayout(intscreenId)
    {
        try
        {
            SqlParameter[] p = new SqlParameter[1];
            p[0] = newSqlParameter("@ScreenId", screenId);
            returnDAL.ExecuteDataSet(DAL.GetConnectionString(), CommandType.StoredProcedure, "sp_GetScreenLayout", p);
        }
        catch (ArgumentException ex)
        {
            thrownew ArgumentException(ex.Message);
        }
    }
    public string AddScreenLayout(stringrowName, int screenId,  string one, string two, stringthree, string four, stringfive, string six, stringseven, string eight, stringnine, string ten, stringeleven, string twelve, stringthirteen, string fourteen, string fifteen, stringsixteen, string seventeen, string eighteen, stringnineteen, string twenty, string twentyone, stringtwentytwo, string twentythree, string twentyfour, stringtwentyfive, string twentysix, string twentyseven, stringtwentyeight, string twentynine, string thirty)
    {
        try
        {
            SqlParameter[] p = new SqlParameter[33];
            p[0] = newSqlParameter("@RowName", rowName);
            p[1] = newSqlParameter("@ScreenId", screenId);
            p[3] = newSqlParameter("@1", one);
            p[4] = newSqlParameter("@2", two);
            p[5] = newSqlParameter("@3", three);
            p[6] = newSqlParameter("@4", four);
            p[7] = new SqlParameter("@5", five);
            p[8] = newSqlParameter("@6", six);
            p[9] = newSqlParameter("@7", seven);
            p[10] = newSqlParameter("@8", eight);
            p[11] = newSqlParameter("@9", nine);
            p[12] = newSqlParameter("@10", ten);
            p[13] = newSqlParameter("@11", eleven);
            p[14] = newSqlParameter("@12", twelve);
            p[15] = newSqlParameter("@13", thirteen);
            p[16] = newSqlParameter("@14", fourteen);
            p[17] = newSqlParameter("@15", fifteen);
            p[18] = newSqlParameter("@16", sixteen);
            p[19] = newSqlParameter("@17", seventeen);
            p[20] = newSqlParameter("@18", eighteen);
            p[21] = newSqlParameter("@19", nineteen);
            p[22] = newSqlParameter("@20", twenty);
            p[23] = newSqlParameter("@21", twentyone);
            p[24] = newSqlParameter("@22", twentytwo);
            p[25] = newSqlParameter("@23", twentythree);
            p[26] = newSqlParameter("@24", twentyfour);
            p[27] = newSqlParameter("@25", twentyfive);
            p[28] = newSqlParameter("@26", twentysix);
            p[29] = newSqlParameter("@27", twentyseven);
            p[30] = newSqlParameter("@28", twentyeight);
            p[31] = newSqlParameter("@29", twentynine);
            p[32] = newSqlParameter("@30", thirty);
            p[2] = newSqlParameter("@Message", SqlDbType.VarChar, 150);
            p[2].Direction = ParameterDirection.Output;
            DAL.ExecuteDataSet(DAL.GetConnectionString(), CommandType.StoredProcedure, "sp_AddScreenLayout", p);
            returnConvert.ToString(p[2].Value);
        }
        catch (ArgumentException ex)
        {
            throw new ArgumentException(ex.Message);
        }
    }
}

 ============================================================================================

DAL.cs code :

using System;
usingSystem.Data;
usingSystem.Configuration;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.HtmlControls;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Xml.Linq;
usingSystem.Data.SqlClient;

/// <summary>
/// Summary description for DAL
/// </summary>
public class DAL
{
      public DAL()
      {
            //
            // TODO: Add constructor logic here
            //
      }
    static SqlConnection con;
    static SqlCommand cmd;
    static DataSet ds;
    static SqlDataAdapter da;
    public static stringGetConnectionString()
    {
        SqlConnectioncon = new SqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);
        stringconstr = con.ToString();
        returnconstr;
    }
    public static intExecuteNonQuery(string connectionString, CommandType commandType, stringcommandText, SqlParameter[] parameters)
    {
        try
        {
            SqlConnectioncon = new SqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);
            cmd = newSqlCommand(commandText, con);
            cmd.CommandType = commandType;
            foreach(SqlParameter p inparameters)
            {
                if(p.Value == null)
                {
                }
                cmd.Parameters.Add(p);
            }
            con.Open();
            returncmd.ExecuteNonQuery();
        }
        catch (SqlException ex)
        {
            thrownew ArgumentException(ex.Message);
        }
        finally{ con.Close(); }
    }
    public static DataSetExecuteDataSet(string connectionString, CommandType commandType, stringcommandText, SqlParameter[] parameters)
    {
        try
        {
            SqlConnectioncon = new SqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);
            cmd = newSqlCommand();
            cmd.Connection = con;
            cmd.CommandText = commandText;
            cmd.CommandType = commandType;
            if(parameters == null)
            {
                da = newSqlDataAdapter(cmd);
                ds = newDataSet();
                da.Fill(ds);
                returnds;
            }
            else
            {
                foreach(SqlParameter p inparameters)
                {
                    if((p.Direction == ParameterDirection.InputOutput) && (p.Value == null))
                    {
                    }
                    //if (p.Value != null)
                    //{
                    cmd.Parameters.Add(p);
                    //}
                }
                da = newSqlDataAdapter(cmd);
                ds = newDataSet();
                da.Fill(ds);
                returnds;
            }
        }
        catch (SqlException ex)
        {
            thrownew ArgumentException(ex.Message);
        }
    }  
}

============================================================================================
AdminAddHallLayout.aspx


Admin can create different hall layouts,  these layouts are used to any number of halls.

using System;
usingSystem.Collections;
usingSystem.Configuration;
usingSystem.Data;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Web.UI.HtmlControls;
usingSystem.Xml.Linq;

namespaceBookFilmTickets.Admin
{
    public partial class AddHallLayout1 : System.Web.UI.Page
    {
         intval;
        BOLobj;  //Business Object Layer class

        //Default Constructor
        publicAddHallLayout1()
        {
         obj = newBOL();
        }
        protectedvoid Page_Load(objectsender, EventArgs e)
        {
            if(Session["Admin"].ToString() == "")
            {
                Response.Redirect("AdminIndex.aspx");
            }
            if(!IsPostBack)
            {
                BindScreens();
            }
        }
        voidBindScreens()
        {
            try
            {
                ddlScreens.Items.Clear();
                ddlScreens.DataSource = obj.GetScreens();
                ddlScreens.DataTextField = "ScreenName";
                ddlScreens.DataValueField = "ScreenId";
                ddlScreens.DataBind();
                ddlScreens.Items.Insert(0, "Select");
            }
            catch(Exception)
            {
                throw;
            }
        }

        protectedvoid btnSubmit_Click(objectsender, EventArgs e)
        {
         
                intval = obj.AddScreen(Convert.ToString(txtScreenName.Text));
                if(val >= 0)
                {
                    Response.Write("Screen addeed successfully.");
                    BindScreens();
                }
                else
                    Response.Write("Screen you added is already existed.");
         
          
        }
        protectedvoid chkSelectAll_CheckedChanged(object sender, EventArgse)
        {
            if(chkSelectAll.Checked)
            {
                foreach(ListItem lt inchkbSeats.Items)
                {
                    lt.Selected = true;
                    val += 1;
                    lt.Text = Convert.ToString(val);
                }
            }
            else
            {
                foreach(ListItem lt inchkbSeats.Items)
                {
                    lt.Selected = false;
                    lt.Text = "";
                }
                chkSelectAll.Checked = false;
            }
        }

        protectedvoid chkbSeats_SelectedIndexChanged(object sender, EventArgse)
        {
            foreach(ListItem lt inchkbSeats.Items)
            {
                if(lt.Selected)
                {
                    val += 1;
                    lt.Text = Convert.ToString(val);
                }
                else{ lt.Text = ""; }
            }
        }

        /// <summary>
        /// This is for adding screen layout
        /// </summary>
        protectedvoid btnSubmitScreenLayout_Click(object sender, EventArgse)
        {
            //try
            //{
                stringone = chkbSeats.Items.FindByValue("1").Text.ToString();
                stringtwo = chkbSeats.Items.FindByValue("2").Text.ToString();
                stringthree = chkbSeats.Items.FindByValue("3").Text.ToString();
                stringfour = chkbSeats.Items.FindByValue("4").Text.ToString();
                stringfive = chkbSeats.Items.FindByValue("5").Text.ToString();
                stringsix = chkbSeats.Items.FindByValue("6").Text.ToString();
                stringseven = chkbSeats.Items.FindByValue("7").Text.ToString();
                stringeight = chkbSeats.Items.FindByValue("8").Text.ToString();
                stringnine = chkbSeats.Items.FindByValue("9").Text.ToString();
                stringten = chkbSeats.Items.FindByValue("10").Text.ToString();
                stringeleven = chkbSeats.Items.FindByValue("11").Text.ToString();
                stringtwelve = chkbSeats.Items.FindByValue("12").Text.ToString();
                stringthirteen = chkbSeats.Items.FindByValue("13").Text.ToString();
                stringfourteen = chkbSeats.Items.FindByValue("14").Text.ToString();
                stringfifteen = chkbSeats.Items.FindByValue("15").Text.ToString();
                stringsixteen = chkbSeats.Items.FindByValue("16").Text.ToString();
                stringseventeen = chkbSeats.Items.FindByValue("17").Text.ToString();
                stringeighteen = chkbSeats.Items.FindByValue("18").Text.ToString();
                stringnineteen = chkbSeats.Items.FindByValue("19").Text.ToString();
                stringtwenty = chkbSeats.Items.FindByValue("20").Text.ToString();
                stringtwentyone = chkbSeats.Items.FindByValue("21").Text.ToString();
                stringtwentytwo = chkbSeats.Items.FindByValue("22").Text.ToString();
                stringtwentythree = chkbSeats.Items.FindByValue("23").Text.ToString();
                stringtwentyfour = chkbSeats.Items.FindByValue("24").Text.ToString();
                stringtwentyfive = chkbSeats.Items.FindByValue("25").Text.ToString();
                stringtwentysix = chkbSeats.Items.FindByValue("26").Text.ToString();
                stringtwentyseven = chkbSeats.Items.FindByValue("27").Text.ToString();
                stringtwentyeight = chkbSeats.Items.FindByValue("28").Text.ToString();
                stringtwentynine = chkbSeats.Items.FindByValue("29").Text.ToString();
                stringthirty = chkbSeats.Items.FindByValue("30").Text.ToString();
                lblMsg.Text = obj.AddScreenLayout(Convert.ToString(txtRowName.Text), Convert.ToInt32(ddlScreens.SelectedValue), one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, twentyone, twentytwo, twentythree, twentyfour, twentyfive, twentysix, twentyseven, twentyeight, twentynine, thirty);
                if(lblMsg.Text == "Added Successfully.")
                {
                    GetScreenLayout(Convert.ToInt32(ddlScreens.SelectedValue));
                }
            //}
            //catch (Exception)
            //{ throw; }
        }

        /// <summary>
        /// Binds the Screen Layout to gvScreenLayout GridView which is present in Panel3(GroupingText="Screen Layout";)
        /// </summary>
        /// <param name="screenId"></param>
        voidGetScreenLayout(int screenId)
        {
            try
            {
                gvScreenLayout.DataSource = obj.GetScreenLayout(screenId);
                gvScreenLayout.DataBind();
            }
            catch(ArgumentException ex)


This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

Online movie ticket booking project In Asp Net with c# (or) free download online cinema movie ticket booking c# asp .net

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×