public ActionResult Create() { CategoryDao categoryDao = new CategoryDao(); CountryDao countryDao = new CountryDao(); ViewBag.Categories = categoryDao.GetAll(); ViewBag.Countries = countryDao.GetAll(); return(View()); }
public ActionResult Edit(int productId) { ProductDao productDao = new ProductDao(); Product product = productDao.GetById(productId); CategoryDao categoryDao = new CategoryDao(); CountryDao countryDao = new CountryDao(); ViewBag.Categories = categoryDao.GetAll(); ViewBag.Countries = countryDao.GetAll(); TempData["tempProductId"] = productId; return(View(product)); }
// GET: Customer/Home public ActionResult Index() { CategoryDao categoryDao = new CategoryDao(); IList <Category> categories = categoryDao.GetAll(); ViewBag.Categories = categories; if (TempData["foundProducts"] != null) { IList <Product> incomingProducts = TempData["foundProducts"] as List <Product>; return(View(incomingProducts)); } ProductDao productDao = new ProductDao(); IList <Product> products = productDao.GetAll(); return(View(products)); }
public ActionResult Create() { ViewBag.Categories = categoryDao.GetAll(); return(View(new Content())); }
public CategoryCollection GetAll() { return(_dao.GetAll()); }