Ejemplo n.º 1
0
        public ActionResult UpdateCurrency(string NoID, string EditCurrencyCodeId, string EditCurrencyNameId)
        {
            try
            {
                dc = new DCAssetDataContext();
                try
                {
                    var    query  = dc.MsCurrency_IUD(EditCurrencyCodeId, EditCurrencyNameId, 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));
            }
        }