public ActionResult FormUp(string id) { CatProdDAO cdao = new CatProdDAO(); ProdCategory cat = cdao.FindById(Convert.ToInt32(id)); ViewBag.CatId = cat; return(View()); }
public ActionResult Remove(string id) { CatProdDAO cdao = new CatProdDAO(); ProdCategory c = cdao.FindById(Convert.ToInt32(id)); cdao.Remove(c); return(RedirectToAction("Index")); }
public ActionResult Update(ProdCategory c) { CatProdDAO cdao = new CatProdDAO(); ProdCategory cat = cdao.FindById(Convert.ToInt32(c.Id)); cat.Name = c.Name; cat.Description = c.Description; cdao.Update(); return(RedirectToAction("Index")); }
public ActionResult Details(int Id) { ProductDAO pdao = new ProductDAO(); CatProdDAO cdao = new CatProdDAO(); IList <ProdCategory> cat = cdao.CategoryList(); Product p = pdao.FindById(Convert.ToInt32(Id)); ProdCategory catid = cdao.FindById(Convert.ToInt32(p.CategoryId)); ViewBag.CatId = catid; ViewBag.ProdId = p; return(View()); }
public ActionResult FormUp(string id) { ProductDAO pdao = new ProductDAO(); CatProdDAO cdao = new CatProdDAO(); IList <ProdCategory> cat = cdao.CategoryList(); ViewBag.Categorys = cat; Product prod = pdao.FindById(Convert.ToInt32(id)); ViewBag.ProdId = prod; ProdCategory catid = cdao.FindById(Convert.ToInt32(prod.CategoryId)); ViewBag.CatId = catid; return(View()); }