// GET: Movie/Edit/5 public ActionResult Edit(int id) { if (Authenticate.IsAuthenticated()) { MovieGenresDirectorsRatingsFormats mgdrf = new MovieGenresDirectorsRatingsFormats(); mgdrf.Movie = MovieManager.LoadById(id); mgdrf.DirectorList = DirectorManager.Load(); mgdrf.RatingList = RatingManager.Load(); mgdrf.FormatList = FormatManager.Load(); mgdrf.Genres = GenreManager.Load(); // Load them all // Deal with the selected ones mgdrf.Movie.Genres = MovieManager.LoadGenres(id); mgdrf.GenreIds = mgdrf.Movie.Genres.Select(a => a.Id); // Select the ids // Put them into session Session["genreids"] = mgdrf.GenreIds; return(View(mgdrf)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
// GET: Movie/Edit/5 public ActionResult Edit(int id) { if (Authenticate.IsAuthenticated()) { ViewBag.Title = "Edit"; MovieGenresDirectorsRatingsFormats mgdrf = new MovieGenresDirectorsRatingsFormats(); mgdrf.Movie = MovieManager.LoadByID(id); mgdrf.Directors = DirectorManager.Load(); mgdrf.Genres = GenreManager.Load(); mgdrf.Ratings = RatingManager.Load(); mgdrf.Formats = FormatManager.Load(); IEnumerable <int> existingGenreIds = new List <int>(); mgdrf.Movie.Genres = MovieManager.LoadGenres(id); mgdrf.GenreIds = mgdrf.Movie.Genres.Select(a => a.Id); //put genres in session Session["genreids"] = mgdrf.GenreIds; return(View(mgdrf)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
// GET: Movie/Edit/5 public ActionResult Edit(int id) { if (Authenticate.IsAuthenticated()) { ViewBag.Title = "Edit"; MovieGenresDirectorsRatingsFormats mgdrf = new MovieGenresDirectorsRatingsFormats(); mgdrf.Movie = MovieManager.LoadById(id); mgdrf.RatingList = RatingManager.Load(); mgdrf.FormatList = FormatManager.Load(); mgdrf.GenreList = GenreManager.Load(); mgdrf.DirectorList = DirectorManager.Load(); mgdrf.Movie.Genres = MovieManager.LoadGenres(id); mgdrf.GenreIds = mgdrf.Movie.Genres.Select(g => g.Id); Session["genreids"] = mgdrf.GenreIds; return(View(mgdrf)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
public void LoadTest() { List <Format> formats = new List <Format>(); formats = FormatManager.Load(); int expected = 3; Assert.AreEqual(expected, formats.Count); }
// GET: Format #region "Pre-WebAPI" public ActionResult Index() { if (Authenticate.IsAuthenticated()) { formats = FormatManager.Load(); return(View(formats)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) //is it the first time here { items = FormatManager.Load(); Rebind(); Session["items"] = items; ddlExisting_SelectedIndexChanged(sender, e); //Put ratings in session so i can use them later } else { items = (List <Format>)Session["items"]; } }
// GET: Movie/Create public ActionResult Create() { if (Authenticate.IsAuthenticated()) { ViewBag.Title = "Create"; MovieGenresDirectorsRatingsFormats mgdrf = new MovieGenresDirectorsRatingsFormats(); mgdrf.Movie = new Movie(); mgdrf.Directors = DirectorManager.Load(); mgdrf.Genres = GenreManager.Load(); mgdrf.Ratings = RatingManager.Load(); mgdrf.Formats = FormatManager.Load(); return(View(mgdrf)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
// GET: Movie/Create public ActionResult Create() { if (Authenticate.IsAuthenticated()) { ViewBag.Title = "Create"; MovieGenresDirectorsRatingsFormats mdf = new MovieGenresDirectorsRatingsFormats(); mdf.Movie = new DVDCentral.BL.Models.Movie(); mdf.FormatList = FormatManager.Load(); mdf.RatingList = RatingManager.Load(); mdf.DirectorList = DirectorManager.Load(); mdf.GenreList = GenreManager.Load(); return(View(mdf)); } else { return(RedirectToAction("Login", "User", new { returnurl = HttpContext.Request.Url })); } }
public void LoadTest() { List <Format> formats = FormatManager.Load(); Assert.AreEqual(3, formats.Count); }
// GET: api/Format public IEnumerable <Format> Get() { List <Format> formats = FormatManager.Load(); return(formats); }
// GET: api/Format public IEnumerable <Format> Get() { List <Format> programs = FormatManager.Load(); return(programs); }
public void LoadTest() { List <Format> formats = FormatManager.Load(); Assert.IsTrue(formats.Count > 0); }