Exemple #1
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");
            }
        }
Exemple #2
0
 /// <summary>
 /// Page load event
 /// </summary>
 /// <param name="sender">Object which fires the event</param>
 /// <param name="e">Event arguments</param>
 protected void Page_Load(object sender, EventArgs e) {
     if (log.IsDebugEnabled) {
         log.Debug("Page_Load Starts");
         log.Debug("JSON files compiled");
     }
     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", "*");
     if (log.IsDebugEnabled) {
         log.Debug("Page_Load Ends");                
     }
 }
        /// <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");
            }
        }
        /// <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");
            }
        }
Exemple #5
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");
            }
        }
Exemple #6
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");
     }
 }
Exemple #7
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");
 }