Online Movie Ticket Booking Project in ASP Net With c

download Online Movie Ticket Booking Project in ASP Net With c

of 61

description

online film booking

Transcript of Online Movie Ticket Booking Project in ASP Net With c

Online movie ticket booking project In Asp Net with c# (or) free download online cinema movie ticket booking c# asp .netOnline 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 modules1. Users2. Contents3. 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.aspxAdminLogin.aspxCreate ddHallLayout.aspxCreateTheatre.aspxcreatycity.aspxInsertMovieInformation.aspxListOfBookedTickets.aspxListOfCancelledTicketd.aspxDeleteUser.aspxListOfRegCandidates.aspxModifyRegUsers.aspx

UserLoginPages :

Index.aspxProvided Login.aspxRegistration.aspxForgot password.aspxContactus.aspxChange password.aspxUpdate User Details..aspxList of Posted Jobs.aspxPrintTicket.aspxSearchMovies.aspxSelectedMovie.aspxListofBookedTickets.aspxCancelTickets.aspxGateway.aspxConfirmationShow.aspxSelected Movie :In this page user has to choose movie , city , theatre, date and submit to next page.

Hall Layout Screen

usingSystem;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{publicpartialclassIndex: System.Web.UI.Page {SqlConnectioncon =newSqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);protectedvoidPage_Load(objectsender,EventArgse) {if(!IsPostBack) {stringstr ="select distinct city from moviedata";SqlDataAdapteradp =newSqlDataAdapter(str, con);DataSetds =newDataSet(); adp.Fill(ds); Ddlcity.DataSource = ds; Ddlcity.DataBind(); Ddlcity.Items.Insert(0,newListItem("--Select city--","0")); Ddlmovie.Items.Insert(0,newListItem("--Select movie--","0")); Ddltheatre.Items.Insert(0,newListItem("--Select theatre--","0")); } }

protectedvoidDdlcity_SelectedIndexChanged(objectsender,EventArgse) { Ddlmovie.Items.Clear();stringct = Ddlcity.SelectedValue.ToString();stringstr ="select movie from moviedata where city= '"+ ct +"' ";SqlDataAdapteradp =newSqlDataAdapter(str, con);DataSetds =newDataSet(); adp.Fill(ds); Ddlmovie.DataSource = ds; Ddlmovie.DataBind(); Ddlmovie.Items.Insert(0,newListItem("--Select movie--","0")); }

protectedvoidDdlmovie_SelectedIndexChanged(objectsender,EventArgse) { Ddltheatre.Items.Clear();stringmv = Ddlmovie.SelectedValue.ToString();stringstr ="select theatre from moviedata where movie= '"+ mv +"' "; SqlDataAdapteradp =newSqlDataAdapter(str, con);DataSetds =newDataSet(); adp.Fill(ds); Ddltheatre.DataSource = ds; Ddltheatre.DataBind(); Ddltheatre.Items.Insert(0,newListItem("--Select Theatre--","0")); DdlDATE.Items.Clear();ListItemlt =newListItem(); 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); }

protectedvoidButton1_Click(objectsender,EventArgse) {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 :

usingSystem;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 description for BOL///publicclassBOL{SqlConnectioncon =newSqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);publicBOL() {//// TODO: Add constructor logic here// }publicintAddScreen(stringscreenName) {try {SqlParameter[] p =newSqlParameter[1]; p[0] =newSqlParameter("@ScreenName", screenName);returnDAL.ExecuteNonQuery(DAL.GetConnectionString(),CommandType.StoredProcedure,"sp_AddScreen", p); }catch(ArgumentExceptionex) {thrownewArgumentException(ex.Message); } }publicDataSetGetScreens() {try {SqlParameter[] p =newSqlParameter[0];returnDAL.ExecuteDataSet(DAL.GetConnectionString(),CommandType.StoredProcedure,"sp_GetScreens", p); }catch(Exception) {throw; } }publicDataSetGetScreenLayout(intscreenId) {try {SqlParameter[] p =newSqlParameter[1]; p[0] =newSqlParameter("@ScreenId", screenId);returnDAL.ExecuteDataSet(DAL.GetConnectionString(),CommandType.StoredProcedure,"sp_GetScreenLayout", p); }catch(ArgumentExceptionex) {thrownewArgumentException(ex.Message); } }publicstringAddScreenLayout(stringrowName,intscreenId,stringone,stringtwo,stringthree,stringfour,stringfive,stringsix,stringseven,stringeight,stringnine,stringten,stringeleven,stringtwelve,stringthirteen,stringfourteen,stringfifteen,stringsixteen,stringseventeen,stringeighteen,stringnineteen,stringtwenty,stringtwentyone,stringtwentytwo,stringtwentythree,stringtwentyfour,stringtwentyfive,stringtwentysix,stringtwentyseven,stringtwentyeight,stringtwentynine,stringthirty) {try {SqlParameter[] p =newSqlParameter[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] =newSqlParameter("@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(ArgumentExceptionex) { thrownewArgumentException(ex.Message); } }}============================================================================================DAL.cs code :

usingSystem;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 description for DAL///publicclassDAL{publicDAL() {//// TODO: Add constructor logic here// }staticSqlConnectioncon;staticSqlCommandcmd;staticDataSetds;staticSqlDataAdapterda;publicstaticstringGetConnectionString() {SqlConnectioncon =newSqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);stringconstr = con.ToString();returnconstr; }publicstaticintExecuteNonQuery(stringconnectionString,CommandTypecommandType,stringcommandText,SqlParameter[] parameters) {try {SqlConnectioncon =newSqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString); cmd =newSqlCommand(commandText, con); cmd.CommandType = commandType;foreach(SqlParameterpinparameters) {if(p.Value ==null) { } cmd.Parameters.Add(p); } con.Open();returncmd.ExecuteNonQuery(); }catch(SqlExceptionex) {thrownewArgumentException(ex.Message); }finally{ con.Close(); } }publicstaticDataSetExecuteDataSet(stringconnectionString,CommandTypecommandType,stringcommandText,SqlParameter[] parameters) {try {SqlConnectioncon =newSqlConnection(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(SqlParameterpinparameters) {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(SqlExceptionex) {thrownewArgumentException(ex.Message); } }}

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

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

usingSystem;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{publicpartialclassAddHallLayout1: System.Web.UI.Page {intval;BOLobj;//Business Object Layer class

//Default ConstructorpublicAddHallLayout1() { obj =newBOL(); }protectedvoidPage_Load(objectsender,EventArgse) {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; } }

protectedvoidbtnSubmit_Click(objectsender,EventArgse) {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."); }protectedvoidchkSelectAll_CheckedChanged(objectsender,EventArgse) {if(chkSelectAll.Checked) {foreach(ListItemltinchkbSeats.Items) { lt.Selected =true; val += 1; lt.Text =Convert.ToString(val); } }else {foreach(ListItemltinchkbSeats.Items) { lt.Selected =false; lt.Text =""; } chkSelectAll.Checked =false; } }

protectedvoidchkbSeats_SelectedIndexChanged(objectsender,EventArgse) {foreach(ListItemltinchkbSeats.Items) {if(lt.Selected) { val += 1; lt.Text =Convert.ToString(val); }else{ lt.Text =""; } } }

//////This is for adding screen layout///protectedvoidbtnSubmitScreenLayout_Click(objectsender,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; } }

//////Binds the Screen Layout to gvScreenLayout GridView which is present in Panel3(GroupingText="Screen Layout";)//////voidGetScreenLayout(intscreenId) {try { gvScreenLayout.DataSource = obj.GetScreenLayout(screenId); gvScreenLayout.DataBind(); }catch(ArgumentExceptionex) { Response.Write(ex.Message); } }

protectedvoidddlScreens_SelectedIndexChanged1(objectsender,EventArgse) { lblMsg.Text ="";if(ddlScreens.SelectedIndex != 0) { gvScreenLayout.Visible =true; GetScreenLayout(Convert.ToInt32(ddlScreens.SelectedValue)); }else { gvScreenLayout.Visible =false; } }

publicboolMyVisible(stringtxt) {if(txt =="") {returnfalse; }else{returntrue; } }

protectedvoidddlRowType_SelectedIndexChanged(objectsender,EventArgse) {if(ddlRowType.Text =="Empty Line") { txtRowName.ReadOnly =true; txtRowName.Text ="Line"; chkbSeats.Visible =false; chkSelectAll.Visible =false; lblSeatsPostion.Visible =false; Label6.Visible =false;foreach(ListItemltinchkbSeats.Items) { lt.Selected =false; lt.Text =""; } }elseif(ddlRowType.Text =="Row") { txtRowName.ReadOnly =false; txtRowName.Text =""; chkbSeats.Visible =true; chkSelectAll.Checked =false; chkSelectAll.Visible =true; Label6.Visible =true; lblSeatsPostion.Visible =true; } }

protectedvoidgvScreenLayout_PageIndexChanging(objectsender,GridViewPageEventArgse) { gvScreenLayout.PageIndex = e.NewPageIndex; GetScreenLayout(Convert.ToInt32(ddlScreens.SelectedValue)); } }}

UserSelectedMovie.aspx

In this page , page load event all the booked tickets shows red colour chairs and available tickets are shown in green colour.usingSystem;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.Collections.Generic;

namespaceBookFilmTickets{publicpartialclassUserSelectedMovie: System.Web.UI.Page {stringsr;stringST, cost;stringS1, S2, S3, S4, S5, S6;intsm;intfc;string[] words =newstring[6];intcount = 0;SqlConnectioncon =newSqlConnection(ConfigurationManager.ConnectionStrings[""].ConnectionString);

BOLobj =newBOL();protectedvoidPage_Load(objectsender,EventArgse) {if(!Page.IsPostBack) { pan1.Visible =false; Panel1.Visible =false; lblcity.Text = Request.QueryString["city"]; lblmovie.Text = Request.QueryString["movie"]; lblthtre.Text = Request.QueryString["thetre"]; lblshowtim.Text = Request.QueryString["date"];

DateTimedt1115AM =newDateTime(DateTime.UtcNow.Year,DateTime.UtcNow.Month,DateTime.UtcNow.Day, 11, 15, 0);if(DateTime.UtcNow < dt1115AM) { LinkButton1.ForeColor = System.Drawing.Color.SeaGreen; LinkButton1.Enabled =true; }else { LinkButton1.ForeColor = System.Drawing.Color.Red; LinkButton1.Enabled =false; }

DateTimedt215AM =newDateTime(DateTime.UtcNow.Year,DateTime.UtcNow.Month,DateTime.UtcNow.Day, 14, 15, 0);if(DateTime.UtcNow < dt215AM) { LinkButton2.ForeColor = System.Drawing.Color.SeaGreen; LinkButton2.Enabled =true; }else { LinkButton2.ForeColor = System.Drawing.Color.Red; LinkButton2.Enabled =false; }

DateTimedt615AM =newDateTime(DateTime.UtcNow.Year,DateTime.UtcNow.Month,DateTime.UtcNow.Day, 18, 15, 0);if(DateTime.UtcNow < dt615AM) { LinkButton3.ForeColor = System.Drawing.Color.SeaGreen; LinkButton3.Enabled =true; }else { LinkButton3.ForeColor = System.Drawing.Color.Red; LinkButton3.Enabled =false; }

DateTimedt915AM =newDateTime(DateTime.UtcNow.Year,DateTime.UtcNow.Month,DateTime.UtcNow.Day, 21, 15, 0);if(DateTime.UtcNow < dt915AM) { LinkButton4.ForeColor = System.Drawing.Color.SeaGreen; LinkButton4.Enabled =true; } else { LinkButton4.ForeColor = System.Drawing.Color.Red; LinkButton4.Enabled =false; }

intscr = 103; gvScreenLayout.DataSource = obj.GetScreenLayout(scr); gvScreenLayout.DataBind();

stringstr1 ="select T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 from moviedata where movie ='"+ Request.QueryString["movie"] +"' and city = '"+ Request.QueryString["city"] +"' and theatre = '"+ Request.QueryString["thetre"] +"'";SqlDataAdapteradp1 =newSqlDataAdapter(str1, con);DataSetds1 =newDataSet(); adp1.Fill(ds1);if(ds1.Tables[0].Rows.Count != 0) {ArrayListlistp =newArrayList();

foreach(DataRowdrRowinds1.Tables[0].Rows) {foreach(varitmindrRow.ItemArray) { listp.Add(itm);foreach(stringkinlistp) {stringcategory = k.Substring(0, 1);stringseno = k.Remove(0, 1);

for(inti = 0; i < gvScreenLayout.Rows.Count; i++) {

HyperLinkHyp = gvScreenLayout.Rows[i].Cells[0].FindControl("HyperLink1")asHyperLink;

stringcat1 = Hyp.Text;

if(category == cat1) {stringids1 ="ImageButton"+ seno.ToString();ImageButtonimgThumb = (ImageButton)(gvScreenLayout.Rows[i].FindControl(ids1)); imgThumb.ImageUrl ="~/Images/chair_green.jpg";

}

} } } } }stringstr ="select Seat1,Seat2,Seat3,Seat4,Seat5,Seat6 from TransactionMovie where MovieName ='"+ Request.QueryString["movie"] +"' and City = '"+ Request.QueryString["city"] +"' and TheatreName = '"+ Request.QueryString["thetre"] +"'";SqlDataAdapteradp =newSqlDataAdapter(str, con);DataSetds =newDataSet(); adp.Fill(ds);if(ds.Tables[0].Rows.Count != 0) {ArrayListlistp =newArrayList();

foreach(DataRowdrRowinds.Tables[0].Rows) {foreach(varitmindrRow.ItemArray) { listp.Add(itm);foreach(stringkinlistp) {stringcategory = k.Substring(0, 1);stringseno = k.Remove(0, 1);

for(inti = 0; i < gvScreenLayout.Rows.Count; i++) {

HyperLinkHyp = gvScreenLayout.Rows[i].Cells[0].FindControl("HyperLink1")asHyperLink;

stringcat1 = Hyp.Text;

if(category == cat1) {stringids1 ="ImageButton"+ seno.ToString();ImageButtonimgThumb = (ImageButton)(gvScreenLayout.Rows[i].FindControl(ids1)); imgThumb.ImageUrl ="~/Images/chair_red.jpg"; imgThumb.Enabled =false; }

} } } } }

for(inti = 0; i < gvScreenLayout.Rows.Count; i++) {for(intj = 1; j < gvScreenLayout.Columns.Count; j++) {stringidSlv ="ImageButton"+ j.ToString();ImageButtonimgbtnSlv = gvScreenLayout.Rows[i].Cells[j].FindControl(idSlv)asImageButton;if(imgbtnSlv.ImageUrl =="~/images/chair_silver.jpg") { imgbtnSlv.Enabled =false; } } }

} MultiView1.ActiveViewIndex = 0; }

protectedvoidButton3_Click1(objectsender,EventArgse) { pan1.Visible =true; }

publicboolMyVisible(stringtxt) {if(txt =="") {returnfalse; }else{returntrue; } }protectedvoidLinkButton1_Click(objectsender,EventArgse) { Panel1.Visible =true; lbltime.Text ="11:15 AM"; }

protectedvoidLinkButton2_Click(objectsender,EventArgse) { Panel1.Visible =true; lbltime.Text ="2:15 PM"; }

protectedvoidLinkButton3_Click(objectsender,EventArgse) { Panel1.Visible =true; lbltime.Text ="6:15 PM"; }

protectedvoidLinkButton4_Click(objectsender,EventArgse) {

Panel1.Visible =true; lbltime.Text ="9:15 PM"; }

protectedvoidImageButton1_Click(objectsender,ImageClickEventArgse) {stringun =Convert.ToString(Session["username"]);if(un.ToString() !="") {

words = Label2.Text.Split(',');intln = words.Length - 1;if(ln == 1) { S1 = words[0].ToString(); S2 ="0"; S3 ="0"; S4 ="0"; S5 ="0"; S6 ="0";

}if(ln == 2) { S1 = words[0].ToString(); S2 = words[1].ToString(); S3 ="0"; S4 ="0"; S5 ="0"; S6 ="0";

}if(ln == 3) { S1 = words[0].ToString(); S2 = words[1].ToString(); S3 = words[2].ToString(); S4 ="0"; S5 ="0"; S6 ="0";

}if(ln == 4) { S1 = words[0].ToString(); S2 = words[1].ToString(); S3 = words[2].ToString(); S4 = words[3].ToString(); S5 ="0"; S6 ="0";

} if(ln == 5) { S1 = words[0].ToString(); S2 = words[1].ToString(); S3 = words[2].ToString(); S4 = words[3].ToString(); S5 = words[4].ToString(); S6 ="0";

}if(ln == 6) { S1 = words[0].ToString(); S2 = words[1].ToString(); S3 = words[2].ToString(); S4 = words[3].ToString(); S5 = words[4].ToString(); S6 = words[5].ToString();

}

stringus =Convert.ToString(Session["username"]);stringtrans ="INSERT INTO TransactionMovie(UserId, MovieName, City , Date ,TheatreName,Showtime,Seat1,Seat2 ,Seat3 ,Seat4,Seat5,Seat6,TotalCost,Flag,TransTime) VALUES ('"+ us +"','"+ lblmovie.Text +"','"+ lblcity.Text +"','"+ lblshowtim.Text +"','"+ lblthtre.Text +"','"+ lbltime.Text +"','"+ S1 +"' , '"+ S2 +"' ,'"+ S3 +"','"+ S4 +"','"+ S5 +"','"+ S6 +"','"+ lblcost.Text +"', 'T', '"+DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") +"')";

SqlCommandcmd3 =newSqlCommand(trans, con); cmd3.CommandType =CommandType.Text; con.Open(); cmd3.ExecuteNonQuery(); con.Close(); Response.Redirect("http://bookfilmtickets.com/payment/pay.aspx");

ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"Ticket booking completed Succesfully ","alert(' Ticket booking completed Succesfully')",true);

// Response.Redirect("index.aspx"); }else {ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"Please Login to Book ticket ","alert(' Please Login to Book ticket')",true); } }

protectedvoidgvScreenLayout_RowCommand(objectsender,GridViewCommandEventArgse) {if(e.CommandName =="ib1"|| e.CommandName =="ib2"|| e.CommandName =="ib3"|| e.CommandName =="ib4"|| e.CommandName =="ib5"|| e.CommandName =="ib6"|| e.CommandName =="ib7"|| e.CommandName =="ib8"|| e.CommandName =="ib9"|| e.CommandName =="ib10"|| e.CommandName =="ib11"|| e.CommandName =="ib12"|| e.CommandName =="ib13"|| e.CommandName =="ib14"|| e.CommandName =="ib15"|| e.CommandName =="ib16"|| e.CommandName =="ib17"|| e.CommandName =="ib18"|| e.CommandName =="ib19"|| e.CommandName =="ib20"|| e.CommandName =="ib21"|| e.CommandName =="ib22"|| e.CommandName =="ib23"|| e.CommandName =="ib24"|| e.CommandName =="ib25"|| e.CommandName =="ib26"|| e.CommandName =="ib27"|| e.CommandName =="ib28"|| e.CommandName =="ib29"|| e.CommandName =="ib30") {GridViewRowgvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);HyperLinkHyp = gvr.FindControl("HyperLink1")asHyperLink;intind = gvr.RowIndex;stringcat = Hyp.Text;intsno =Convert.ToInt32(e.CommandArgument);stringseat = cat + sno.ToString();stringids ="ImageButton"+ sno.ToString();ImageButtonimgThumb = (ImageButton)(gvScreenLayout.Rows[ind].FindControl(ids));if(imgThumb.ImageUrl =="~/Images/chair_green.jpg"&& fc