Exemplo n.º 1
0
        public ActionResult Sources_remove(string id)
        {
            var parameters = AjaxModel.GetAjaxParameters(HttpContext);
            var mng = new CRMManager();

            try
            {
                if (mng.GetClientSource(int.Parse(id)).crm_clients.Count > 0)
                {
                    return Json(new
                    {
                        result = false,
                        mng = "Не удается удалить",
                    }, JsonRequestBehavior.AllowGet);
                }
                else
                {
                    mng.DeleteClientSources(int.Parse(id));
                    return Json(new 
                    {
                        result = true,
                        mng = "Операция прошла успешно"
                    });
                }
            }
            catch (Exception ex)
            {
                RDL.Debug.LogError(ex);
                return Json(new 
                {
                    result = false,
                    mng = "Ошибка"
                });
            }
        }