public JsonResult Edit(ProductType model) { try { if (!ModelState.IsValid) { return(Json(new { Result = "ERROR", Message = "Form is not valid! Please correct it and try again." })); } ProductType itemFound = ProductTypeManager.GetById(model.kProductTypeId); if (itemFound == null) { return(Json(new { Result = "ERROR", Message = "Item Not Found" })); } model.dtDateAdd = itemFound.dtDateAdd; model.dtDateUpdate = DateTime.Now; ProductTypeManager.Edit(model); return(Json(new { Result = "OK" })); } catch (Exception ex) { return(Json(new { Result = "ERROR", Message = ex.Message })); } }