Exemplo n.º 1
0
        public JsonResult SaveAnswer(Questions_Answers data)
        {
            if (data.Key == 0)
            {
                return(Json(new { Message = "Failed", JsonRequestBehavior.AllowGet }));
            }
            Questions_Answers qn = db.Questions_Answers.Where(w => w.Key == data.Key).FirstOrDefault();

            qn.Answer = data.Answer;
            db.SaveChanges();
            return(Json(new { Message = "Success", JsonRequestBehavior.AllowGet }));
        }
Exemplo n.º 2
0
        public ActionResult QnA(Questions_Answers cnt)
        {
            Questions_Answers qna = new Questions_Answers();

            qna.Name     = cnt.Name;
            qna.Email    = cnt.Email;
            qna.Question = cnt.Question;
            qna.Date     = DateTime.Now;
            qna.Type     = cnt.Type;
            db.Questions_Answers.Add(qna);
            db.SaveChanges();
            return(Json(JsonRequestBehavior.AllowGet, ""));
        }
Exemplo n.º 3
0
        public JsonResult getQuestionData(int?id)
        {
            Questions_Answers qdata = db.Questions_Answers.Where(w => w.Key == id).FirstOrDefault();

            return(Json(qdata, JsonRequestBehavior.AllowGet));
        }