public ActionResult Delete(int id, MovieShopDAL.Movie movie) { try { Facade.GetMovieGateway().Delete(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, MovieShopDAL.Customer customer) { try { Facade.GetCustomerRepository().Delete(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(MovieShopDAL.Genres genre) { try { Facade.GetGenreRepository().Update(genre); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id,MovieShopDAL.Genres genre) { try { Facade.GetGenreRepository().Delete(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(MovieShopDAL.Genres genre) { try { Facade.GetGenreGateway().Create(genre); return RedirectToAction("Index"); } catch { return View(); } }
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() }; }
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); }
public ActionResult Delete(int id, MovieShopDAL.Orders order) { Facade.GetOrderGateway().Delete(id); return RedirectToAction("Index"); }
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); }