Esempio n. 1
0
        public ActionResult AddQuestion(int id)
        {
            if (!user.IsManager())
            {
                return(View("Error"));
            }
            TestQuestion check = db.TestQuestions.FirstOrDefault(c => c.TestCode == id);

            if (check == null)
            {
                //   Model.UpdateLastSeen("Xóa Sinh Viên", Url.Action("DeleteStudent"));
                int id_student = id;
                int del        = managerDal.AddQFT(id_student);
                TempData["CandidateID"] = true;
                TempData["statusAQ"]    = "Add questions successfull!!!!";

                return(RedirectToAction("TestCode"));
            }

            else
            {
                TempData["CandidateID"] = false;
                TempData["statusAQ"]    = "This test already had questions";
                return(RedirectToAction("TestCode"));
            }
        }