Ejemplo n.º 1
0
        public ActionResult UpdateAssetStatus(string NoID, string EditAssetStatusCodeId, string EditAssetStatusNameId)
        {
            try
            {
                dc = new DCAssetDataContext();
                try
                {
                    var    query = dc.MsAssetStatus_IUD(EditAssetStatusCodeId, EditAssetStatusNameId, UserId, 2);
                    string Exx   = "";
                    foreach (var res in query)
                    {
                        Exx = res.Exx;
                    }

                    if (Exx.Trim().Substring(0, 4) == "Err ")
                    {
                        return(Json(new { success = false, responseText = Exx.Trim().Replace("err ", "") }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = true, responseText = Exx.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));
            }
        }