public ActionResult UpdateSite(string EditSiteCodeId, string EditSiteNameId, string EditAddressId, string EditCityId, string EditPostalCodeId, string EditTelephoneId, int ActiveId) { try { dc = new DCAssetDataContext(); try { var query = dc.MsSite_IUD(EditSiteCodeId, EditSiteNameId, EditAddressId, EditCityId, EditPostalCodeId, EditTelephoneId, ActiveId, UserId, 2); string status = ""; foreach (var res in query) { status = res.Status; } if (status.Trim().Substring(0, 4) == "Err ") { return(Json(new { success = false, responseText = status.Trim().Replace("err ", "") }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = true, responseText = status.Trim().Replace("err ", "") }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { success = false, responseText = ex.ToString().Trim().Replace("err ", "") }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { success = false, responseText = ex.Message.ToString().Trim().Replace("err ", "") }, JsonRequestBehavior.AllowGet)); } }