Example #1
0
        public ViewResult CreateMovieData(MovieModelUI movieModel, HttpPostedFileBase file)
        {
            if (file != null && file.ContentLength > 0)
            {
                string fileName = Path.GetFileName(movieModel.File.FileName);
                string imgPath  = Path.Combine(Server.MapPath("~/Content/MoviesImages/"), fileName);
                file.SaveAs(imgPath);
            }

            MovieModel data = new MovieModel
            {
                NameOfMovie = movieModel.NameOfMovie,
                ImagePath   = "~/Content/MoviesImages/" + file.FileName,
            };

            DataProcessor.InsertMovieData(data);

            return(View());
        }
Example #2
0
        public ViewResult CreateMovieData()
        {
            MovieModelUI movie = new MovieModelUI();

            return(View(movie));
        }