// This is the Insert method to insert the entered Question item
        // USAGE: <asp:FormView InsertMethod="InsertItem">
        public void InsertItem()
        {
            using (_db)
            {
                var item = new Authorization_App.Model.Question();

                TryUpdateModel(item);

                string userId = HttpContext.Current.User.Identity.GetUserId();
                item.AuthorId = userId;

                if (ModelState.IsValid)
                {
                    // Save changes
                    _db.Question.Add(item);
                    _db.SaveChanges();

                    Response.Redirect("Default");
                }
            }
        }
 public string GetQuestionType(Question question)
 {
     var qType = question.QuestionType;
     return qType.ToString();
 }
 public Question Add(Question q)
 {
     Question res = QuestionManager.Add(q);
     return res;
 }
 public bool IsLastQuestionInTest(Question q, Test ts)
 {
     return ts.Questions.Last().Id == q.Id;
 }