Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var address  = new DataSetTableAdapters.AddressesTableAdapter();
            var cinima   = new DataSetTableAdapters.CinemasTableAdapter();
            int cinemaId = 1;

            DataSetTableAdapters.CinemasTableAdapter cinemas = new DataSetTableAdapters.CinemasTableAdapter();

            if (!IsPostBack)
            {
                DataSet.CinemasDataTable listCinemas = cinima.GetData();

                DDLCinimas.DataSource = listCinemas;
                DDLCinimas.DataBind();
            }



            if (Request["cinema"] != null)
            {
                cinemaId = Int32.Parse(Request["cinema"].ToString());
            }

            cinemaId = Int32.Parse(DDLCinimas.SelectedValue);
            DataSet.AddressesDataTable addressData = address.GetAddressByCinemaId(cinemaId, true);

            if (addressData != null && addressData.Count == 1)
            {
                //cords for google maps
                lat = Convert.ToDecimal(addressData[0].CoordY);
                lon = Convert.ToDecimal(addressData[0].CoordX);

                //address details
                line1    = addressData[0].Line1;
                line2    = addressData[0].Line2;
                city     = addressData[0].City;
                region   = addressData[0].Region;
                country  = addressData[0].Country;
                postcode = addressData[0].Postcode;
            }

            DataSet.CinemasDataTable cinemaData = cinima.GetCinemaByCinemaId(cinemaId, true);

            if (cinemaData != null && cinemaData.Count == 1)
            {
                name        = cinemaData[0].Name;
                cinemaImg   = cinemaData[0].ImgLarge;
                parkingImg  = cinemaData[0].ImgParking;
                Description = cinemaData[0].Description;
            }
        }
        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:  ";
        }