// GET: Movie/Details/5
        public ActionResult Details(int id)
        {
            MovieRepositoryClient client = new MovieRepositoryClient();

            client.Open();
            var movie = client.GetMovie(id);

            client.Close();

            return(View(movie));
        }
        // GET: Movie
        public ActionResult Index()
        {
            MovieRepositoryClient client = new MovieRepositoryClient();

            client.Open();
            var movieList = client.GetMovies();

            client.Close();

            return(View(movieList));
        }
 public ActionResult DeleteConfirm(int id)
 {
     try
     {
         MovieRepositoryClient client = new MovieRepositoryClient();
         client.Open();
         client.DeleteMovie(id);
         client.Close();
     }
     catch
     {
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult Edit(Movie model)
        {
            try
            {
                MovieRepositoryClient client = new MovieRepositoryClient();
                client.Open();

                var movie = client.UpdateMovie(model);
                client.Close();

                return(RedirectToAction("Index"));
            }
            catch
            {
            }
            return(View());
        }
        public ActionResult Create(Movie movie)
        {
            try
            {
                MovieRepositoryClient client = new MovieRepositoryClient();
                client.Open();

                movie = client.SaveMovie(movie);
                client.Close();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(movie));
            }
        }