// GET: ProductMaster/Edit/5 public ActionResult Edit(int id) { mProductMaster mProduct = new mProductMaster(); IEnumerable <mCatergory> Category = DataAccess.GetCategory(); ViewBag.Category = Category; return(View(DataAccess.SelectByPrimary(id))); }
// GET: ProductMaster/Create public ActionResult Create() { mProductMaster mProduct = new mProductMaster(); IEnumerable <mCatergory> Category = DataAccess.GetCategory(); ViewBag.Category = Category; return(View()); }
public ActionResult Edit(int id, mProductMaster model) { try { if (ModelState.IsValid) { Message _message = DataAccess.AddUpdate(id, model.CategoryID, model.ProductName, model.IsActive); return(RedirectToAction("Index")); } return(View(model)); // TODO: Add insert logic here } catch { return(View()); } }