Beispiel #1
0
        public ActionResult UpdateAssetModel(string NoID, string EditAssetModelCodeId, string EditAssetModelNameId, string EditAssetBrandCodeId)
        {
            try
            {
                dc = new DCAssetDataContext();
                try
                {
                    var    query  = dc.MsAssetModel_IUD(EditAssetModelCodeId, EditAssetModelNameId, EditAssetBrandCodeId, 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));
            }
        }