public ActionResult Edit([Bind(Include = "SubCategoryID,CategoryID,SubCategoryName,SubCategoryCode,SubCategoryDescription")] SubCategory subcategory) { if (ModelState.IsValid) { //db.Entry(subcategory).State = EntityState.Modified; //db.SaveChanges(); _subCategoryManager.Update(subcategory); return(RedirectToAction("Index")); } var categoryList = _categoryManager.GetAll(); ViewBag.CategoryID = new SelectList(categoryList, "CategoryID", "CategoryName"); return(View(subcategory)); }
public JsonResult Edit(SubCategoryCreateVM vmObj) { bool isUpdated = _Manager.Update(vmObj.SubCategory); if (isUpdated) { status = true; message = "Update Successfully!!"; } return(new JsonResult { Data = new { status = status, message = message } }); }