public String Insights(int id, int doc_id) { Result result = new Result(); try { result.Objects = iinsight.GetInsightsByDocument(id, doc_id); result.Message = "Success"; return(JsonConvert.SerializeObject(result)); } catch (Exception ex) { result.Objects = null; result.Message = ex.Message; return(JsonConvert.SerializeObject(result)); } }
public ActionResult Create(IFormCollection collection) { if (getCurrentUser() == null) { return(RedirectToAction("Index", "Login")); } else { Insight insight = new Insight(); insight.in_fun_doc_id = Convert.ToInt32(collection["id"]); insight.in_doc_id = Convert.ToInt32(collection["doc_id"]); insight.in_remarks = Convert.ToString(collection["remarks"]); insight.in_cre_by = getCurrentUser().u_id; insight.in_cre_date = DateTime.Now; iinsight.Add(insight); return(View(iinsight.GetInsightsByDocument(Convert.ToInt32(collection["id"]), Convert.ToInt32(collection["doc_id"])))); } }