예제 #1
0
        public ActionResult CreateProducer(Models.Producer record)
        {
            DeltaXMapper <Models.Producer, Producer> mapobj = new DeltaXMapper <Models.Producer, Producer>();
            DeltaXRepository obj = new DeltaXRepository();

            obj.AddProducer(mapobj.Translate(record));
            return(RedirectToAction("CreateMovie"));
        }
예제 #2
0
        public ActionResult UpdateMovieDetails(Models.Movie record)
        {
            DeltaXMapper <Models.Movie, Movie> mapobj = new DeltaXMapper <Models.Movie, Movie>();
            DeltaXRepository obj = new DeltaXRepository();
            var ActorsIdArray    = record.ActorList.Split(',');
            var mov = obj.UpdateMovie(mapobj.Translate(record), ActorsIdArray);

            return(RedirectToAction("GetAllMovieDetails"));
        }
예제 #3
0
        public ActionResult UpdateMovie(int id)
        {
            DeltaXRepository obj = new DeltaXRepository();
            DeltaXMapper <Movie, Models.Movie> mapobj = new DeltaXMapper <Movie, Models.Movie>();

            ViewBag.producerList = obj.FetchProducer();
            ViewBag.ActorList    = obj.FetchActor();
            var mov = obj.FetchMovie().Where(x => x.MovieId == id).Single();

            return(View(mapobj.Translate(mov)));
        }
예제 #4
0
        public ActionResult GetAllMovieDetails()
        {
            DeltaXMapper <Movie, Models.Movie> mapobj = new DeltaXMapper <Movie, Models.Movie>();
            DeltaXRepository obj = new DeltaXRepository();
            var mov       = obj.FetchMovie();
            var MovieList = new List <Models.Movie>();

            MovieList = mov.Select(x => new Models.Movie
            {
                MovieName          = x.MovieName,
                MoviePlot          = x.MoviePlot,
                MoviePoster        = x.MoviePoster,
                MovieYearOfRelease = x.MovieYearOfRelease,
                MovieId            = x.MovieId,
                ProducerId         = x.ProducerId,
                ProducerName       = x.Producer.ProducerName,
                Actors             = x.Actors.Select(z => z.ActorName).ToList()
            }).ToList();
            return(View(MovieList));
        }