public JsonResult FailReviewUpdate(int questionId, string questionName, int ChatIntentId) { bool changed = true; try { ChatFailureResponse fail = db.ChatFailureResponse.Where(x => x.DefectId == questionId).FirstOrDefault(); fail.Reviewed = true; fail.UpdatedDate = DateTime.Now; changed = true; ChatIntentQuestion question = new ChatIntentQuestion(); question.QuestionDesc = questionName; question.ChatIntentId = ChatIntentId; db.ChatIntentQuestion.Add(question); db.SaveChanges(); return(Json(changed, JsonRequestBehavior.AllowGet)); } catch (Exception e) { Console.WriteLine(e.Message); return(Json(changed, JsonRequestBehavior.AllowGet)); } }
public bool LogFailureResponse() { ChatFailureResponse fail = new ChatFailureResponse(); try { fail.QuestionByUser = Message; fail.ParentId = Node; fail.Reviewed = false; fail.UpdatedDate = DateTime.UtcNow; db.ChatFailureResponse.Add(fail); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }