Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //use data item to retrieve all the cinemas and populate dlstCinema. Then use the default cinema (select main one or
            //the one nearest to user if location data is turned on?) to select all the available screens and populate
            //dlstScreens using them.
            //Also display images for the default cinema / screen so the image area isn't empty.

            //imgScreenView.ImageUrl =
            //imgSeatLayout.ImageUrl =

            if (!IsPostBack)
            {
                DataSetTableAdapters.CinemasTableAdapter cinematableadapter = new DataSetTableAdapters.CinemasTableAdapter();
                DataSet.CinemasDataTable data = cinematableadapter.GetData();

                foreach (DataSet.CinemasRow row in data)
                {
                    dlstCinema.Items.Add(new ListItem(row.Name.ToString(), row.Id.ToString()));
                }

                DataSetTableAdapters.ScreensTableAdapter screenTableadApter = new DataSetTableAdapters.ScreensTableAdapter();
                DataSet.ScreensDataTable screenData = screenTableadApter.GetScreensByCinemaId(1, true);
                dlstScreen.Items.Clear();
                foreach (DataSet.ScreensRow row in screenData)
                {
                    dlstScreen.Items.Add(new ListItem(row.Name.ToString(), row.Id.ToString()));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataSetTableAdapters.CinemasTableAdapter cinematableadapter = new DataSetTableAdapters.CinemasTableAdapter();
                DataSet.CinemasDataTable data = cinematableadapter.GetData();

                foreach (DataSet.CinemasRow row in data)
                {
                    dlstCinema.Items.Add(new ListItem(row.Name.ToString(), row.Id.ToString()));
                }

                Session["SelectedCinemaID"] = dlstCinema.SelectedValue;

                dlstMovie.Items.Add(new ListItem("<Select>", "0"));

                DataSetTableAdapters.FilmsTableAdapter taFilms = new DataSetTableAdapters.FilmsTableAdapter();
                DataSet.FilmsDataTable fData = taFilms.GetData();

                foreach (DataSet.FilmsRow row in fData)
                {
                    dlstMovie.Items.Add(new ListItem(row.Title.ToString(), row.Id.ToString()));
                }

                dlstScreenType.Items.Add(new ListItem("Any", "0"));
                dlstScreenType.Items.Add(new ListItem("Standard", "false"));
                dlstScreenType.Items.Add(new ListItem("Delux", "true"));

                Session["ScreenType"] = dlstScreenType.SelectedValue;
            }
        }
Exemplo n.º 3
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;
            }
        }