Ejemplo n.º 1
0
        // Parameter in URL are
        // m: Movie id.
        // f: Movie Format id.
        // t: Theater id.
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();

            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName      = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection        = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            movieList = mmc.RetrieveMovieList();
            mc        = mmc.RetriveMovieCatalog();

            string m = Request.QueryString["m"];
            string t = Request.QueryString["t"];
            string f = Request.QueryString["f"];

            if (m == null)
            {
                m = "0";
            }
            if (t == null)
            {
                t = "-1";
            }
            if (f == null)
            {
                f = "-1";
            }

            if (!IsPostBack)
            {
                LoadData(m, ref f, ref t);
                LoadDetailedData(m, ref f, ref t);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Page Load Event
        /// </summary>
        /// <param name="sender">Object which fires the event</param>
        /// <param name="e">Event argument</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Starts");
            }

            ManageMovieCatalog mmc = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies);

            string m = Request.QueryString["m"];

            if (m == null)
            {
                m = "";
            }
            if (log.IsDebugEnabled)
            {
                log.Debug("Parameter received m=[" + m + "]");
            }
            Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (m == null || (m != "1" && m != "2"))
            {
                Response.Write("Información incorrecta");
                if (log.IsDebugEnabled)
                {
                    log.Debug("No info returned");
                }
                return;
            }
            Response.Write(mmc.RetrieveJSonContentsForModule(m));
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Ends");
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();

            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName      = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection        = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            string t = Request.QueryString["t"];
            string m = Request.QueryString["m"];
            string g = Request.QueryString["g"];

            if (t == null)
            {
                t = "-1";
            }
            if (m == null)
            {
                m = "-1";
            }
            if (g == null)
            {
                g = "-1";
            }
            Response.Write(mmc.Search(t, m, g));
            Response.AddHeader("Access-Control-Allow-Origin", "*");
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();
            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            string t = Request.QueryString["t"];
            string m = Request.QueryString["m"];
            string g = Request.QueryString["g"];

            if (t == null)
            {
                t = "-1";
            }
            if (m == null)
            {
                m = "-1";
            }
            if (g == null)
            {
                g = "-1";
            }
            Response.Write(mmc.Search(t, m, g));
            Response.AddHeader("Access-Control-Allow-Origin", "*");
        }
Ejemplo n.º 5
0
        protected void OnButtonActualizarCartelera(object sender, EventArgs e)
        {
            string             imgPathUrl = Request.Url.Scheme + "://" + Request.Url.Authority + "/" + Settings.ImageFolder + "/";
            ManageMovieCatalog mmc        = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, imgPathUrl.Replace(@"\", "/"));

            mmc.CompileAllMoviesSchedule();
            lblMsg.Text = "Cartelera actualizada";
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Given parameters 't:for theater id', 'm:Movie Id', and 'g:Gender id', computes a lookup in the catalog
        /// matched records. All results must be guaranteed to be sorted.
        /// </summary>
        /// <param name="t">Theater Id. Possible value are '-1', or '2'</param>
        /// <param name="m">Movie Id. Possible value are '-1', or '1|29' this means movieId=1 and movieIdFormat=29</param>
        /// <param name="g">Gender Id. Possible value are '-1', or '2'</param>
        /// <returns>A list of 'Movie'  objects serialized as JSON. If list is empty, serialized should be empty.</returns>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Starts");
            }

            ManageMovieCatalog mmc = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies);
            string             t   = Request.QueryString["t"];
            string             m   = Request.QueryString["m"];
            string             g   = Request.QueryString["g"];

            if (t == null)
            {
                t = "-1";
            }
            if (m == null)
            {
                m = "-1";
            }
            if (g == null)
            {
                g = "-1";
            }

            // Check that parameters are OK
            int tst;

            try {
                tst = Convert.ToInt32(t);
            } catch (Exception) {
                t = "-1";
            }
            try {
                var aVal = m.Split('|');
                tst = Convert.ToInt32(aVal[0]);
            } catch (Exception) {
                m = "-1";
            }
            try {
                tst = Convert.ToInt32(g);
            } catch (Exception) {
                g = "-1";
            }
            if (log.IsDebugEnabled)
            {
                log.Debug("Parameters received");
                log.Debug("t=[" + t + "]");
                log.Debug("t=[" + m + "]");
                log.Debug("t=[" + g + "]");
            }
            Response.Write(mmc.Search(t, m, g));
            Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Ends");
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string             imgPathUrl = Request.Url.Scheme + "://" + Request.Url.Authority + "/" + Settings.ImageFolder + "/";
            ManageMovieCatalog mmc        = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, imgPathUrl.Replace(@"\", "/"));

            mmc.CompileAllMoviesSchedule();
            Response.Write("Movie Schedule generated on " + DateTime.Now.ToString());
            Response.AddHeader("Access-Control-Allow-Origin", "*");
        }
Ejemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ManageMovieCatalog mmc = new ManageMovieCatalog();
     mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
     mmc.moviesFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
     mmc.dbConnection = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];
     mmc.CompileAllMoviesSchedule();
     Response.Write("Movie Schedule generated on " + DateTime.Now.ToString());
     Response.AddHeader("Access-Control-Allow-Origin", "*");
 }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();

            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName      = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection        = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];
            mmc.CompileAllMoviesSchedule();
            Response.Write("Movie Schedule generated on " + DateTime.Now.ToString());
            Response.AddHeader("Access-Control-Allow-Origin", "*");
        }
Ejemplo n.º 10
0
        protected void OnButtonGuardar(object sender, EventArgs e)
        {
            int idPelicula = Convert.ToInt32(ListBoxPeliculas.SelectedValue);
            int idTeatro   = Convert.ToInt32(Session["teatroSeleccionado"].ToString());
            List <PeliculaFullInfoDto> listaProgramacion = obtenerProgramacion(idPelicula, idTeatro);
            // pintarProgramacion();
            string             imgPathUrl = Request.Url.Scheme + "://" + Request.Url.Authority + "/" + Settings.ImageFolder + "/";
            ManageMovieCatalog mmc        = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, imgPathUrl.Replace(@"\", "/"));

            mmc.CompileAllMoviesSchedule();

            Response.Redirect("~/CinesHorarios.aspx");
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies);

            string m = Request.QueryString["m"];

            Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (m == null || (m != "1" && m != "2"))
            {
                Response.Write("Información incorrecta");
                return;
            }
            Response.Write(mmc.RetrieveJSonContentsForModule(m));
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();
            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            string m = Request.QueryString["m"];
            Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (m == null || (m != "1" && m != "2"))
            {
                Response.Write("Invalid");
                return;
            }
            Response.Write(mmc.RetrieveJSonContentsForModule(m));            
        }
Ejemplo n.º 13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender">Objet which sends event</param>
        /// <param name="e">event parameteres</param>
        protected void OnButtonActualizarCartelera(object sender, EventArgs e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("OnButtonActualizarCartelera Starts");
            }
            string             imgPathUrl = Request.Url.Scheme + "://" + Request.Url.Authority + "/" + Settings.ImageFolder + "/";
            ManageMovieCatalog mmc        = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, imgPathUrl.Replace(@"\", "/"));

            mmc.CompileAllMoviesSchedule();
            registerToastrMsg(MessageType.Success, "Cartelera actualizada con éxito");
            if (log.IsDebugEnabled)
            {
                log.Debug("OnButtonActualizarCartelera Ends");
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Saves current state for schedule and updates the billboard.
        /// </summary>
        /// <param name="sender">Objet which sends event</param>
        /// <param name="e">event parameteres</param>
        protected void OnButtonGuardar(object sender, EventArgs e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("OnButtonGuardar Starts");
            }
            guardarHorario();
            string             imgPathUrl = Request.Url.Scheme + "://" + Request.Url.Authority + "/" + Settings.ImageFolder + "/";
            ManageMovieCatalog mmc        = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, imgPathUrl.Replace(@"\", "/"));

            mmc.CompileAllMoviesSchedule();
            if (log.IsDebugEnabled)
            {
                log.Debug("OnButtonGuardar Ends and redirects to CinesHorarios.aspx");
            }
            Response.Redirect("~/CinesHorarios.aspx");
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();

            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName      = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection        = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            string m = Request.QueryString["m"];

            Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (m == null || (m != "1" && m != "2"))
            {
                Response.Write("Invalid");
                return;
            }
            Response.Write(mmc.RetrieveJSonContentsForModule(m));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Test for reading a file from JSON for Movie List and print to log as a ToString.
        /// </summary>
        public void executeLoadMovieFileAndLog()
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("executeLoadMovieFileAndLog");
            }
            ManageMovieCatalog mmc       = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, "");
            List <Movie>       movieList = mmc.RetrieveMovieList();

            if (log.IsInfoEnabled)
            {
                movieList.ForEach(m => log.Info(m.ToString()));
                log.Info(movieList[0].ToString());
            }

            if (log.IsDebugEnabled)
            {
                log.Debug("executeLoadMovieFileAndLog ends");
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Page Load Event
        /// Parameter in URL are
        /// m: Movie id.
        /// f: Movie Format id.
        /// t: Theater id.
        /// </summary>
        /// <param name="sender">Object which fires event</param>
        /// <param name="e">Event argument</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Starts");
            }

            // Load parameters.
            m = Request.QueryString["m"];
            t = Request.QueryString["t"];
            f = Request.QueryString["f"];

            // Let's compute parameters as true integers.
            int tst = 0;

            if (m == null)
            {
                m = "0";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(m);
                } catch (Exception) {
                    m = "0";
                }
            }
            if (t == null)
            {
                t = "-1";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(t);
                    if (tst == 0)
                    {
                        t = "-1";
                    }
                } catch (Exception) {
                    t = "-1";
                }
            }
            if (f == null)
            {
                f = "-1";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(f);
                    if (tst == 0)
                    {
                        f = "-1";
                    }
                } catch (Exception) {
                    f = "-1";
                }
            }
            if (log.IsDebugEnabled)
            {
                log.Debug("Parameters received");
                log.Debug(" m: Movie id. =[" + m + "]");
                log.Debug(" f: Movie Format id. =[" + f + "]");
                log.Debug(" t: Theater id. =[" + t + "]");
            }

            int movieId = Convert.ToInt32(m);

            mmc           = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, "");
            movieToShow   = mmc.SearchToShowDetail(movieId);
            movieID.Value = m;
            if (!IsPostBack)
            {
                LoadData();
                LoadDetailedData();
            }
            if (log.IsDebugEnabled)
            {
                log.Debug("Page_Load Starts");
            }
        }
Ejemplo n.º 18
0
        // Parameter in URL are
        // m: Movie id.
        // f: Movie Format id.
        // t: Theater id.
        protected void Page_Load(object sender, EventArgs e)
        {
            ManageMovieCatalog mmc = new ManageMovieCatalog();
            mmc.catalogNameFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesCatalogKey];
            mmc.moviesFileName = @ConfigurationManager.AppSettings[GlobalConstants.FileMoviesKey];
            mmc.dbConnection = @ConfigurationManager.AppSettings[GlobalConstants.ConnectionKey];

            movieList = mmc.RetrieveMovieList();
            mc = mmc.RetriveMovieCatalog();

            string m = Request.QueryString["m"];
            string t = Request.QueryString["t"];
            string f = Request.QueryString["f"];

            if (m == null)
            {
                m = "0";
            }
            if (t == null)
            {
                t = "-1";
            }
            if (f == null)
            {
                f = "-1";
            }

            if (!IsPostBack)
            {
                LoadData(m, ref f, ref t);
                LoadDetailedData(m, ref f, ref t);
            }
        }
Ejemplo n.º 19
0
        // Parameter in URL are
        // m: Movie id.
        // f: Movie Format id.
        // t: Theater id.
        protected void Page_Load(object sender, EventArgs e)
        {
            // Load parameters.
            m = Request.QueryString["m"];
            t = Request.QueryString["t"];
            f = Request.QueryString["f"];

            // Let's compute parameters as true integers.
            int tst = 0;

            if (m == null)
            {
                m = "0";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(m);
                } catch (Exception) {
                    m = "0";
                }
            }
            if (t == null)
            {
                t = "-1";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(t);
                    if (tst == 0)
                    {
                        t = "-1";
                    }
                } catch (Exception) {
                    t = "-1";
                }
            }
            if (f == null)
            {
                f = "-1";
            }
            else
            {
                try {
                    tst = Convert.ToInt32(f);
                    if (tst == 0)
                    {
                        f = "-1";
                    }
                } catch (Exception) {
                    f = "-1";
                }
            }

            ManageMovieCatalog mmc = new ManageMovieCatalog(Settings.JSONFolder + @"\" + Settings.FileMovieCatalog, Settings.JSONFolder + @"\" + Settings.FileMovies, "");
            int movieId            = Convert.ToInt32(m);

            movieList = mmc.RetrieveMovieList();
            mc        = mmc.RetriveMovieCatalog();

            movieToShow   = movieList.Where(x => x.id == movieId).FirstOrDefault <Movie>();
            movieID.Value = m;
            if (!IsPostBack)
            {
                LoadData();
                LoadDetailedData();
            }
        }