public ActionResult AddCategory(Category category) { using (var context = new searchpdEntities()) { category.ParentID = 36790; context.Categories.Add(category); context.SaveChanges(); } return View(category); }
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); }