Exemple #1
0
        // GET: Movie
        public ActionResult Index()
        {
            var dal       = new Deltax.DeltaXRepository();
            var list      = dal.GetMoviesUsingLinq();
            var modelList = new List <Models.Movie>();

            foreach (var i in list)
            {
                modelList.Add(Mapper.Map <Models.Movie>(i));
            }


            return(View(modelList));
        }
Exemple #2
0
        public ActionResult EditPost(Models.Movie obj)
        {
            try
            {
                // TODO: Add update logic here
                var dal    = new Deltax.DeltaXRepository();
                var dalObj = Mapper.Map <Movie>(obj);
                if (dal.updateMovies(dalObj))
                {
                    return(RedirectToAction("Index"));
                }

                else
                {
                    return(View("Error"));
                }
            }

            catch
            {
                return(View("Error"));
            }
        }