Esempio n. 1
0
 public CourseBs()
 {
     _tbl_Course            = new GenericPattern <Course>();
     _CourseModel           = new CourseModel();
     _CourseTestAnswerModel = new CourseTestAnswerModel();
     _CourseTestModel       = new CourseTestModel();
     _CourseSessionModel    = new CourseSessionModel();
 }
Esempio n. 2
0
 public QuestionController()
 {
     _courseTestModel       = new CourseTestModel();
     _courseTestBs          = new CourseTestBs();
     apiResponse            = new APIResponseModel();
     _courseBs              = new CourseBs();
     _courseTestAnswerBs    = new CourseTestAnswerBs();
     _courseTestAnswerModel = new CourseTestAnswerModel();
 }
Esempio n. 3
0
 public CourseController()
 {
     _courseModel        = new CourseModel();
     _courseBs           = new CourseBs();
     _courseSessionModel = new CourseSessionModel();
     _courseSessionBs    = new CourseSessionBs();
     _courseTestBs       = new CourseTestBs();
     _courseTestModel    = new CourseTestModel();
 }
Esempio n. 4
0
 public Course_Test(CourseTestModel item)
 {
     Id            = item.Id;
     CourseID      = item.CourseID;
     Question      = item.Question;
     Answer1       = item.Answer1;
     Answer2       = item.Answer2;
     Answer3       = item.Answer3;
     Answer4       = item.Answer4;
     CorrectAnswer = item.CorrectAnswer;
     Mark          = item.Mark;
     Reason        = item.Reason;
     CreatedOn     = item.CreatedOn;
     //CreatedBy = item.CreatedBy;
 }
Esempio n. 5
0
        public long Save(CourseTestModel model)
        {
            Course_Test _tbl_course = new Course_Test(model);

            if (model.Id != null && model.Id != 0)
            {
                _CourseTest.Update(_tbl_course);
            }
            else
            {
                _CourseTest.Insert(_tbl_course);
            }

            return(_tbl_course.Id);
        }
Esempio n. 6
0
        public ActionResult CourseTestCreate(long?id)
        {
            if (id != null)
            {
                var Varial = _courseTestBs.GetById(id.Value);
                return(View(Varial));
            }
            CourseTestModel model = new CourseTestModel();

            if (TempData["CourseID"] != null)
            {
                model.CourseID = Convert.ToInt64(TempData["CourseID"]);
            }

            return(View(model));
        }
Esempio n. 7
0
        public ActionResult CourseTestCreate(FormCollection form)
        {
            List <CourseTestModel> model = new List <CourseTestModel>();

            var keys = form.AllKeys.Where(x => x.StartsWith("Question")).ToList();

            var obj = new CourseTestModel();

            foreach (var item in keys)
            {
                var currentKeyNum = item.Replace("Question", "");
                obj.Id            = Convert.ToInt64(form["Id"]);
                obj.CourseID      = Convert.ToInt64(form["CourseID"]);
                obj.Question      = form["Question" + currentKeyNum];
                obj.Answer1       = form["Answer1" + currentKeyNum];
                obj.Answer2       = form["Answer2" + currentKeyNum];
                obj.Answer3       = form["Answer3" + currentKeyNum];
                obj.Answer4       = form["Answer4" + currentKeyNum];
                obj.CorrectAnswer = form["CorrectAnswer" + currentKeyNum];
                obj.Mark          = form["Mark" + currentKeyNum];
                obj.Reason        = form["Reason" + currentKeyNum];
                obj.CreatedBy     = new UserRegistrationBs().UserRegistrationList().Where(x => x.UserName == User.Identity.Name).FirstOrDefault().Id;
                obj.CreatedOn     = System.DateTime.Now;
                _courseTestBs.Save(obj);
            }


            //long i = 0;

            //if (model != null)
            //{
            //    i = _courseSessionBs.Save(model);
            //}

            //if (i > 0)
            //{
            //    TempData["msg"] = "Save Successfully";
            //}
            //else
            //{
            //    TempData["msg"] = "Error while saving data";
            //}

            return(RedirectToAction("CourseTest", "Course", new { area = "Admin", id = obj.CourseID }));
        }
Esempio n. 8
0
 public CourseTestModel GetCourseTest(CourseTestModel model)
 {
     throw new NotImplementedException();
 }