Esempio n. 1
0
        public ActionResult FormUp(string id)
        {
            CatProdDAO   cdao = new CatProdDAO();
            ProdCategory cat  = cdao.FindById(Convert.ToInt32(id));

            ViewBag.CatId = cat;
            return(View());
        }
Esempio n. 2
0
        public ActionResult Remove(string id)
        {
            CatProdDAO   cdao = new CatProdDAO();
            ProdCategory c    = cdao.FindById(Convert.ToInt32(id));

            cdao.Remove(c);
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        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());
        }
Esempio n. 5
0
        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());
        }