public ActionResult EditUnit([Bind(Include = "UnitId,UnitName,IsActive")] Unit unit) { if (ModelState.IsValid) { db.Entry(unit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("UnitsLists")); } return(View(unit)); }
public async Task <ActionResult> BrandEdit([Bind(Include = "VehicleBrandId,BrandName,IsActive")] VehicleBrand brand) { if (ModelState.IsValid) { db.Entry(brand).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (Exception e) { string s = e.ToString(); } return(Json(new { success = true })); } return(PartialView("_BrandEdit", brand)); }