コード例 #1
0
        public void UpdateMovie(Movie movie)
        {
            try
            {
                _dataSource.Update(movie.GetMappingMovieData());
                CachedMovieList.Instance.Updated();
            }
            catch (Exception ex)
            {

                throw new Exception("Could not update Movie", ex);
            }
        }
コード例 #2
0
        public ActionResult Create(FormCollection collection, Movie model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _service.InsertMovie(model);
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
コード例 #3
0
        public ActionResult Edit(int id, FormCollection collection, Movie model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _service.UpdateMovie(model);
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
コード例 #4
0
 // GET: Movies/Create
 public ActionResult Create()
 {
     var model = new Movie();
     return View(model);
 }