public ActionResult EditProduct(int id) { Product p = catalogDao.GetProduct(id); if (p != null) { return(View(p)); } return(Redirect("/Admin/EditCatalog")); }
public Dictionary <Product, int> GetProducts() { CatalogDao catalogDao = new CatalogDao(); Dictionary <Product, int> res = new Dictionary <Product, int>(); foreach (var id in keyValuePairs.Keys) { res[catalogDao.GetProduct(id)] = keyValuePairs[id]; } return(res); }
public ActionResult Model(int id) { ViewBag.product = catalogDao.GetProduct(id); return(View()); }