public ActionResult ReturnDVD(int id) { var manager = new Manager(); var dvd = manager.GetDVDById(id); return View(dvd); }
public void AddDVDTest() { var manager = new Manager(); var _dvds = manager.GetAllDVDs(); int count = _dvds.Count(); var dvd = new DVD { Title = "Test", Director = "Test", Studio = "Test", Rating = MPAARating.NR, Status = LendingStatus.InStock, //Genre = Genres.Action, UserRating = 4, //ReleaseDate = DateTime.Parse("10-10-2010"), Actors = { }, }; manager.AddDVD(dvd); bool result = (_dvds.Count() == count + 1); Assert.IsTrue(result); }
public ActionResult DeleteDVD(DVD dvd) { var manager = new Manager(); manager.DeleteDVD(dvd.Id); return RedirectToAction("Index", "Home"); }
public ActionResult AddDVD(DVD dvd) { var manager = new Manager(); manager.AddDVD(dvd); dvd.CheckOutDate = DateTime.Now; dvd.Status = LendingStatus.CheckedOut; return RedirectToAction("Index", "Home"); }
public void DeleteDVDTest() { var manager = new Manager(); var _dvds = manager.GetAllDVDs(); int count = _dvds.Count(); var dvd1 = _dvds.FirstOrDefault(d => d.Id == 1); var dvd2 = _dvds.FirstOrDefault(d => d.Id == 2); manager.DeleteDVD(dvd2.Id); manager.DeleteDVD(dvd1.Id); bool result = (_dvds.Count == count - 2); Assert.IsTrue(result); }
public ActionResult ReturnDVD(DVD dvd) { var manager = new Manager(); dvd.ReturnDate = DateTime.Now; dvd.Status = LendingStatus.InStock; manager.ReturnDVD(dvd); return RedirectToAction("Index", "Home"); }
public ActionResult SearchDVD(string searchInput) { if (searchInput != null) { var manager = new Manager(); var dvd = manager.GetDVDByName(searchInput.ToLower()); return View(dvd); } return RedirectToAction("Index", "Home"); }
public DVD Get(int id) { var manager = new Manager(); return manager.GetDVDById(id); }
public List<DVD> Get() { var manager = new Manager(); return manager.GetAllDVDs(); }