public ActionResult DeleteUser(int Code) { try { string strMessage = ""; bool _success = false; var User = dbUser.GetUserById(Code); int maxValue = dbUser.DeleteUser(User); if (maxValue > 0) { strMessage = "Record successfully deleted."; _success = true; } else { strMessage = "Application server error."; } return(Json(new { success = _success, response = strMessage })); } catch (Exception ex) { Log.LogWrite(ex.Message, "User Delete", ex); return(Json(new { success = false, response = ex.Message.ToString() })); } }