public ActionResult ReclamationsGetText(int id, string code) { var res = false; var text = ""; var mng = new CRMManager(); var r = new recl_items(); try { r = mng.GetReclamation(id); switch (code) { case "customerText": text = r.customerText; break; case "whatToDo": text = r.whatToDo; break; case "report": text = r.report; break; } res = true; } catch (Exception ex) { res = false; } return(Json(new { result = res, text = text })); }
public ActionResult ReclamationsTable_remove(int id) { var res = false; var msg = ""; var mng = new CRMManager(); var item = mng.GetReclamation(id); if (item != null) { mng.DeleteReclamation(id); msg = "Запись успешно удалена!"; res = true; } return(Json(new { result = res, msg = msg })); }