public int QuestionReactionCountWhenThinkAboutAnswer(Model.Question q, Reaction react, Model.Answer ans) { var query = $"SELECT Count(*) FROM {_tblGdetails} INNER JOIN {_tblGhistory} ON ({_tblGdetails}.game_id = {_tblGhistory}.game_id) WHERE question_id = {q.Id} AND reaction_id = {(int) react} AND answer_id={ans.Id}"; return(_db.SingleOrDefault <int>(query)); }
public void QuestionUpdateOnDbSide(Model.Question q) { var a = _db.SingleOrDefault <Question>($"SELECT * FROM {_tblQ} WHERE question_id={q.Id}"); a.hidden_from_ui = q.HiddenFromUi; a.shown_only_for_doctors = q.ShownOnlyForDoctors; a.text = q.Text; _db.Update(a); }
public void QuestionRemove(Model.Question q) { QuestionRemove(q.Id); }
public void QuestionAdd(ref Model.Question q) { q.Id = QuestionAdd(q.Text, q.ShownOnlyForDoctors, q.HiddenFromUi); }
public int GeneralReactionCountForExactQuestion(Reaction react, Model.Question q) { return(_db.SingleOrDefault <int>($"SELECT Count(*) FROM {_tblGdetails} WHERE question_id = {q.Id} AND reaction_id = {(int)react}")); }
public int QuestionAskedWhenThinkAboutAnswer(Model.Question q, Model.Answer ans) { return(QuestionAskedWhenThinkAboutAnswer(q.Id, ans.Id)); }