// // GET: /CatalogManager/Delete/5 public ActionResult Delete(int id) { /*Car car = db.Cars.Find(id);*/ CatalogManagerDAL dal = new CatalogManagerDAL(); Car car = dal.delete(id); return View(car); }
// [HostType("ASP.NET")] // [AspNetDevelopmentServerHost("C:\\Users\\cezar\\MvcAA\\MvcAutoAuction1\\MvcAutoAuction", "/")] public void indexCarsTest() { CatalogManagerDAL target = new CatalogManagerDAL(); // TODO: Initialize to an appropriate value // List<Car> expected = null; // TODO: Initialize to an appropriate value List<Car> actual; actual = target.indexCars(); Assert.IsNotNull(actual); // Assert.Inconclusive("Verify the correctness of this test method."); }
public ActionResult DeleteConfirmed(int id) { /*Car car = db.Cars.Find(id); db.Cars.Remove(car); db.SaveChanges();*/ CatalogManagerDAL dal = new CatalogManagerDAL(); dal.deleteConfirm(id); return RedirectToAction("Index"); }
// // GET: /CatalogManager/Create public ActionResult Create() { /*ViewBag.BrandId = new SelectList(db.Brands, "BrandId", "Name"); ViewBag.AutoId = new SelectList(db.Autos, "AutoId", "Name");*/ CatalogManagerDAL dal = new CatalogManagerDAL(); List<SelectList> id = dal.create(); ViewBag.BrandId = id[0]; ViewBag.AutoId = id[1]; return View(); }
public ActionResult Create(Car car) { if (ModelState.IsValid) { CatalogManagerDAL dal = new CatalogManagerDAL(); dal.createStore(car); return RedirectToAction("Index"); } /* ViewBag.BrandId = new SelectList(db.Brands, "BrandId", "Name", car.BrandId); ViewBag.AutoId = new SelectList(db.Autos, "AutoId", "Name", car.AutoId); return View(car);*/ CatalogManagerDAL dal2 = new CatalogManagerDAL(); List<SelectList> id = dal2.create(); ViewBag.BrandId = id[0]; ViewBag.AutoId = id[1]; return View(car); }
public void CatalogDALConstructorTest() { CatalogManagerDAL target = new CatalogManagerDAL(); // Assert.Inconclusive("TODO: Implement code to verify target"); }
// // GET: /CatalogManager/Edit/5 public ActionResult Edit(int id) { /*Car car = db.Cars.Find(id); ViewBag.BrandId = new SelectList(db.Brands, "BrandId", "Name", car.BrandId); ViewBag.AutoId = new SelectList(db.Autos, "AutoId", "Name", car.AutoId);*/ CatalogManagerDAL dal = new CatalogManagerDAL(); Car car = dal.edit(id); CatalogManagerDAL dal2 = new CatalogManagerDAL(); List<SelectList> id2 = dal2.create(); ViewBag.BrandId = id2[0]; ViewBag.AutoId = id2[1]; return View(car); }
// // GET: /CatalogManager/Details/5 public ViewResult Details(int id) { /*Car car = db.Cars.Find(id);*/ CatalogManagerDAL dal = new CatalogManagerDAL(); Car car = dal.details(id); return View(car); }
// // GET: /CatalogManager/ public ViewResult Index() { /*var cars = db.Cars.Include(c => c.Brand).Include(c => c.Auto); return View(cars.ToList());*/ CatalogManagerDAL dal = new CatalogManagerDAL(); var cars = dal.indexCars(); return View(cars); }
public ActionResult Edit(Car car) { if (ModelState.IsValid) { db.Entry(car).State = EntityState.Modified; db.SaveChanges(); /* CatalogManagerDAL dal = new CatalogManagerDAL(); dal.editStore(car); return RedirectToAction("Index");*/ } /*ViewBag.BrandId = new SelectList(db.Brands, "BrandId", "Name", car.BrandId); ViewBag.AutoId = new SelectList(db.Autos, "AutoId", "Name", car.AutoId);*/ CatalogManagerDAL dal2 = new CatalogManagerDAL(); List<SelectList> id = dal2.create(); ViewBag.BrandId = id[0]; ViewBag.AutoId = id[1]; return View(car); }