protected void Page_Load(object sender, EventArgs e) { //Then use the cinema id and film id retrieved to display that info too Session["ShowingID"] = Request["sID"]; //Session["SeatPrice"] = string.Format("{0:C}", Convert.ToDecimal(Request["price"])); Session["SeatPrice"] = Request["price"]; DataSetTableAdapters.ShowingsTableAdapter showingsAdapter = new DataSetTableAdapters.ShowingsTableAdapter(); //DataSet.ShowingsDataTable showingsData = showingsAdapter.GetShowingsByCinemaId(Session["ShowingID"].ToString()); //Test********************************************* DataSet.ShowingsDataTable showingsData = showingsAdapter.GetShowingByShowingId(Convert.ToInt64(Session["ShowingID"].ToString())); DataSetTableAdapters.ScreensTableAdapter screenAdapter = new DataSetTableAdapters.ScreensTableAdapter(); DataSet.ScreensDataTable screenData = screenAdapter.GetScreenByScreenId(showingsData[0].ScreenId, true); DataSetTableAdapters.FilmsTableAdapter taFilms = new DataSetTableAdapters.FilmsTableAdapter(); DataSet.FilmsDataTable fData = taFilms.GetFilmById(Convert.ToInt64(Session["SelectedMovieID"])); DataSet.ScreensRow row1 = showingsData[0].ScreensRow; if (screenData[0].Deluxe == false) { Session["ScreenType"] = "Standard"; } else { Session["ScreenType"] = "Deluxe"; } Session["ShowingDateTime"] = showingsData[0].StartTime; lblFilmStuff.Text = "Booking for the " + showingsData[0].StartTime.ToString("H:mm") + " showing of " + fData[0].Title + " in a " + Session["ScreenType"] + " screen on " + showingsData[0].StartTime.ToString("yyyy'-'MM'-'dd"); lblFilmStuff.Text += " " + Session["SeatPrice"]; }
protected void Page_Load(object sender, EventArgs e) { //Session["Username"] = "******"; // get name? user id? adddress? Session["Cinema"] = "Salford"; Session["Movie"] = "Logan"; Session["ShowingDateTime"] = "2007-05-08 12:35:29.123"; Session["BookingID"] = "3"; //Session["PriceTotal"] = ; // costs? int year = Int32.Parse(Session["ShowingDateTime"].ToString().Substring(2, 2)); int month = Int32.Parse(Session["ShowingDateTime"].ToString().Substring(5, 2)); int day = Int32.Parse(Session["ShowingDateTime"].ToString().Substring(8, 2)); //Response.Write("Year is " + year); //Response.Write("<br/>"); //Response.Write("Month is " + month); //Response.Write("<br/>"); //Response.Write("Day is " + day); //Response.Write(Session["Cinema"].ToString().Substring(0, 2) + Session ["Movie"].ToString().Substring(0, 2)); //"NoSeats" - int //Number of seats selected for the current booking // "ShowingID" - int // ID of the showing for the current booking // "SelectedCinemaID" - int // ID of the cinema for the current booking // "SelectedMovieID" - int // ID of the film for the current booking // QUERIES DataSetTableAdapters.CinemasTableAdapter cinematableadapter = new DataSetTableAdapters.CinemasTableAdapter(); DataSet.CinemasDataTable cinemaData = cinematableadapter.GetCinemaByCinemaId(Convert.ToInt64(Session["SelectedCinemaID"]), true); DataSetTableAdapters.FilmsTableAdapter movietableadapter = new DataSetTableAdapters.FilmsTableAdapter(); DataSet.FilmsDataTable movieData = movietableadapter.GetFilmById(Convert.ToInt64(Session["SelectedMovieID"])); //TextArea1.Value = "\nShowing of: " + Session["Movie"] + " at " + Session["Cinema"] + TextArea1.Value = "\nShowing of: " + movieData[0].Title + " at " + cinemaData[0].Name + " Cinema \n \n" + "on " + day + "/" + month + "/" + year + " at: " + Session["ShowingDateTime"].ToString().Substring(11, 5) + "\n \nYour seats are \nseat1 \nseat2 \nseat3" + "\n \nYour confirmation ID is :" + cinemaData[0].Name.ToString().Substring(0, 2).ToUpper() + Session["ShowingDateTime"].ToString().Substring(2, 2) + movieData[0].Title.ToString().Substring(0, 2).ToUpper() + Session["BookingID"] + " \n \nYour total is: "; }
protected void dlstMovie_SelectedIndexChanged(object sender, EventArgs e) { if (dlstMovie.SelectedValue == "0") { lblMovieDescription.Text = "No Film Selected!"; imgSelectedMovie.ImageUrl = null; Session["SelectedMovieID"] = null; } else { DataSetTableAdapters.FilmsTableAdapter taFilms = new DataSetTableAdapters.FilmsTableAdapter(); DataSet.FilmsDataTable fData = taFilms.GetFilmById(Convert.ToInt64(dlstMovie.SelectedValue.ToString())); lblMovieDescription.Text = fData[0].Description; imgSelectedMovie.ImageUrl = fData[0].ImgSmall; Session["SelectedMovieID"] = fData[0].Id; d1.InnerHtml = ""; getFilmShowings(); } }
protected List <String> ListOfFilmSmallImages(long filmid) { string SmallImagesDB; List <String> SmallImagesSplitted = new List <string>(); //Retrieves the film's info DataSetTableAdapters.FilmsTableAdapter filmTA = new DataSetTableAdapters.FilmsTableAdapter(); DataSet.FilmsDataTable dataFilms = filmTA.GetFilmById(filmid); if (dataFilms != null && dataFilms.Count == 1) { DataSet.FilmsRow film = dataFilms[0]; SmallImagesDB = film.ImgSmall; SmallImagesSplitted = SmallImagesDB.Split(',').ToList(); } return(SmallImagesSplitted); }
protected void Page_Load(object sender, EventArgs e) { long retrievedFilmId = 1; //** need to be dynamic -- pulled as a request variable **// //retrievedFilmId = long.Parse(Request["FilmId"].ToString()); //Retrieves the film's info DataSetTableAdapters.FilmsTableAdapter filmTA = new DataSetTableAdapters.FilmsTableAdapter(); DataSet.FilmsDataTable dataFilms = filmTA.GetFilmById(retrievedFilmId); //Retrieves the classification of the film DataSetTableAdapters.ClassificationsTableAdapter classificationTA = new DataSetTableAdapters.ClassificationsTableAdapter(); DataSet.ClassificationsDataTable dataClassification = classificationTA.GetClassificationByFilmId(retrievedFilmId, true); //Retreives a contributor's info DataSetTableAdapters.ContributorsTableAdapter contributorTA = new DataSetTableAdapters.ContributorsTableAdapter(); DataSet.ContributorsDataTable dataContributors; //Retreives actors for the film DataSetTableAdapters.FilmsContributorsTableAdapter filmcontributorActorsTA = new DataSetTableAdapters.FilmsContributorsTableAdapter(); DataSet.FilmsContributorsDataTable dataActors = filmcontributorActorsTA.GetActorsByFilmId(retrievedFilmId, true); //Retreives directors for the film DataSetTableAdapters.FilmsContributorsTableAdapter filmcontributorTA = new DataSetTableAdapters.FilmsContributorsTableAdapter(); DataSet.FilmsContributorsDataTable dataDirectors = filmcontributorTA.GetDirectorsByFilmId(1, true); if (dataFilms != null && dataFilms.Count == 1) { DataSet.FilmsRow film = dataFilms[0]; DataSet.ClassificationsRow classificationFilm = dataClassification[0]; imagelargedata.InnerHtml = "<img src='" + film.ImgLarge + "' class='img-thumbnail' title='" + film.Title + "large' style='max-height:100%;max-width:100%'/>"; classificationdata.InnerHtml = "<img src='" + classificationFilm.ImgSmall + "' class='img-thumbnail' title='" + classificationFilm.Title + "Classification' />"; titledata.InnerHtml = "<h3>" + film.Title + "</h3>"; descriptiondata.InnerHtml = "<p>" + film.Description + "</p>"; moviespecificinformation.InnerHtml += "<dl>"; moviespecificinformation.InnerHtml += "<dt>Release Date</dt>"; moviespecificinformation.InnerHtml += "<dd>" + film.ReleaseDate.ToLongDateString() + "</dd>"; moviespecificinformation.InnerHtml += "<dt>Running Time</dt>"; moviespecificinformation.InnerHtml += "<dd>" + film.Duration.ToString() + " mins</dd>"; if (dataActors.Count == 0 && dataDirectors.Count == 0) //no rows of actors or directors for that film { moviespecificinformation.InnerHtml += "<dt>No actors or directors to be displayed. Please consult site administrator</dt>"; } else { moviespecificinformation.InnerHtml += "<dt>Director</dt>"; //getting each director in the film foreach (DataSet.FilmsContributorsRow row in dataDirectors) { dataContributors = contributorTA.GetContributorByContributorId(row.ContributorId, true); DataSet.ContributorsRow contributorinfo = dataContributors[0]; moviespecificinformation.InnerHtml += "<dd>" + contributorinfo.FirstName + " " + contributorinfo.LastName + "</dd>"; } moviespecificinformation.InnerHtml += "<dt>Cast</dt>"; //getting each actor in the film foreach (DataSet.FilmsContributorsRow row in dataActors) { dataContributors = contributorTA.GetContributorByContributorId(row.ContributorId, true); DataSet.ContributorsRow contributorinfo = dataContributors[0]; moviespecificinformation.InnerHtml += "<dd>" + contributorinfo.FirstName + " " + contributorinfo.LastName + "</dd>"; } } moviespecificinformation.InnerHtml += "</dl>"; } }