public ActionResult Menu(SMAM_Menu_ST Menu) { try { string strMessage = ""; bool _success = false; if (Menu.MenuId > 0) { Menu.MenuIdSpecified = true; Menu.ParentMenuIdSpecified = true; Menu.MenuSeqSpecified = true; int maxValue = dbUser.UpdateMenu(Menu); if (maxValue > 0) { strMessage = "Record successfully updated."; _success = true; } else { strMessage = "Application server error."; } } else { Menu.ParentMenuIdSpecified = true; Menu.MenuSeqSpecified = true; int maxValue = dbUser.InsertMenu(Menu); Menu.MenuId = maxValue; if (maxValue > 0) { strMessage = "Record successfully saved."; _success = true; } else { strMessage = "Application server error."; } } return(Json(new { success = _success, response = strMessage })); } catch (Exception ex) { Log.LogWrite(ex.Message, "Menu Insert/Edit", ex); return(Json(new { success = false, response = ex.Message.ToString() })); } }