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"));
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            DeltaXRepository obj = new DeltaXRepository();

            //DateTime dt = Convert.ToDateTime("09-21-1995").Date;
            // Console.WriteLine(dt);
            Console.WriteLine(obj.AddActor("Anurag King", "09-21-1995", "Popularly known as King", "M"));
        }
        public ActionResult CreateMovie()
        {
            DeltaXRepository obj = new DeltaXRepository();

            ViewBag.producerList = obj.FetchProducer();
            ViewBag.ActorList    = obj.FetchActor();
            return(View());
        }
        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"));
        }
        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)));
        }
Esempio n. 6
0
        public JsonResult AjaxMethodGetActors()
        {
            DeltaXRepository obj   = new DeltaXRepository();
            List <string>    names = new List <string>();

            try
            {
                names = obj.GetActorNames();
            }
            catch
            {
                names = null;
            }
            return(Json(names, JsonRequestBehavior.AllowGet));
        }
        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));
        }
Esempio n. 8
0
        public JsonResult AjaxMethodAddMovies(string name, string yearOfRelease, string Plot, string producer, string[] actors)
        {
            DeltaXRepository obj = new DeltaXRepository();

            try
            {
                if (obj.AddMovie(name, yearOfRelease, Plot, producer, actors))
                {
                    return(Json("Movie Added succesfully"));
                }
                else
                {
                    return(Json("Errror in adding Data"));
                }
            }
            catch
            {
                return(Json("Errror in adding Data"));
            }
        }
Esempio n. 9
0
        public JsonResult AjaxMethodAddActors(string name, string sex, string dob, string bio)
        {
            DeltaXRepository obj = new DeltaXRepository();

            try
            {
                if (obj.AddActor(name, sex, dob, bio))
                {
                    return(Json("Data is successfully added"));
                }
                else
                {
                    return(Json("Errror in adding Data"));
                }
            }
            catch
            {
                return(Json("Errror in adding Data"));
            }
        }