Esempio n. 1
0
        public void Save(CallQuestionItem uiQuestion)
        {
            CallQuestion dbQuestion;

            if (uiQuestion.Id == 0)
            {
                dbQuestion = new CallQuestion();
                Db.CallQuestions.Add(dbQuestion);
            }
            else
            {
                dbQuestion = Db.CallQuestions.Single(x => x.Id == uiQuestion.Id);
            }

            dbQuestion.Text         = uiQuestion.Text;
            dbQuestion.CallScriptId = uiQuestion.CallScriptId;
            Db.SaveChanges();
            uiQuestion.Id = dbQuestion.Id;
        }
Esempio n. 2
0
 public ActionResult EditQuestion([FromBody] CallQuestionItem item)
 {
     this.Service.CallQuestion.Save(item);
     return(Json(item));
 }