public RedirectToRouteResult Create(ProductModel objModel) { ProductInfo pInfo = new ProductInfo(); pInfo.Add(objModel); return(RedirectToAction("List")); }
public ActionResult AddProducts(ProductInfo Product) { int value = Product.Add(Product); //Product.CreateImage(Product); if (value == 1) { TempData["Message"] = "Product Added Successfully"; return(RedirectToAction("AddProducts")); } else if (value == 0) { TempData["Message"] = "Error while Inserting the Product"; return(View()); } else { TempData["Message"] = "Error while Adding Product Image"; return(View()); } }