コード例 #1
0
        public ActionResult UpdateAssetType(string NoID, string EditAssetTypeCodeId, string EditAssetTypeNameId)
        {
            try
            {
                dc = new DCAssetDataContext();
                try
                {
                    var    query  = dc.MsAssetType_IUD(EditAssetTypeCodeId, EditAssetTypeNameId, 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));
            }
        }