コード例 #1
0
ファイル: MovieController.cs プロジェクト: Donblack/MovieShop
 public ActionResult Delete(int id, MovieShopDAL.Movie movie)
 {
     try
     {
         Facade.GetMovieGateway().Delete(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #2
0
 public ActionResult Delete(int id, MovieShopDAL.Customer customer)
 {
     try
     {
         Facade.GetCustomerRepository().Delete(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #3
0
 public ActionResult Edit(MovieShopDAL.Genres genre)
 {
     try
     {
         Facade.GetGenreRepository().Update(genre);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #4
0
 public ActionResult Delete(int id,MovieShopDAL.Genres genre)
 {
     try
     {
         Facade.GetGenreRepository().Delete(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #5
0
 public ActionResult Create(MovieShopDAL.Genres genre)
 {
     try
     {
         Facade.GetGenreGateway().Create(genre);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #6
0
ファイル: MovieConverter.cs プロジェクト: janx360g/nrj-ca2
 public static Movie convertMovie(MovieShopDAL.DomainModel.Movie movie)
 {
     return new Movie()
     {
         ID = movie.ID,
         Title = movie.Title,
         Price = movie.Price,
         Year = movie.Year,
         Description = movie.Description,
         ImageURL = movie.ImageURL,
         TrailerURL = movie.TrailerURL,
         Genres = movie.Genres.Select(x => new GenreDTO()
         {
             ID = x.ID,
             Name = x.Name,
         }).ToList()
     };
 }
コード例 #7
0
ファイル: MovieController.cs プロジェクト: Donblack/MovieShop
        public ActionResult Edit(MovieShopDAL.Movie movie, string[] idGenre)
        {
            if (ModelState.IsValid)
            {
                if (idGenre != null)
                {
                    movie.genres.Clear();
                    foreach (string genreId in idGenre)
                    {
                        movie.genres.Add(new Genres() { id = int.Parse(genreId) });
                    }
                }

                Facade.GetMovieGateway().Update(movie);
                return RedirectToAction("Index");
            }

            MovieViewModel movieViewModel = new MovieViewModel();
            movieViewModel.genreList = Facade.GetGenreGateway().ReadAll().ToList();
            movieViewModel.movie = movie;

            return View(movieViewModel);
        }
コード例 #8
0
ファイル: OrderController.cs プロジェクト: Donblack/MovieShop
 public ActionResult Delete(int id, MovieShopDAL.Orders order)
 {
     Facade.GetOrderGateway().Delete(id);
         return RedirectToAction("Index");
 }
コード例 #9
0
        public ActionResult Edit(MovieShopDAL.Customer customer)
        {
            if (ModelState.IsValid)
            {
                Facade.GetCustomerRepository().Update(customer);
                return RedirectToAction("Index");
            }

            CreateEditCustomerViewModel createEditCustomerViewModel = new CreateEditCustomerViewModel();

            createEditCustomerViewModel.firstName = customer.firstName;
            createEditCustomerViewModel.lastName = customer.lastName;
            createEditCustomerViewModel.streetName = customer.streetName;
            createEditCustomerViewModel.houseNumber = customer.houseNumber;
            createEditCustomerViewModel.zipcode = customer.zipcode;
            createEditCustomerViewModel.confirmEmail = customer.email;
            createEditCustomerViewModel.email = customer.email;
            createEditCustomerViewModel.country = customer.country;

            return View(createEditCustomerViewModel);
        }