예제 #1
0
        public ActionResult AddCategory(Category category)
        {
            using (var context = new searchpdEntities())
            {
                category.ParentID = 36790;
                context.Categories.Add(category);
                context.SaveChanges();
            }

            return View(category);
        }
예제 #2
0
        public ActionResult AddProduct(Product product)
        {
            using (var context = new searchpdEntities())
            {
                product.CategoryID = 36790;
                product.NodeID = 36790;
                product.Image = "";
                context.Products.Add(product);
                context.SaveChanges();
            }

            return View(product);
        }