public CourseBs() { _tbl_Course = new GenericPattern <Course>(); _CourseModel = new CourseModel(); _CourseTestAnswerModel = new CourseTestAnswerModel(); _CourseTestModel = new CourseTestModel(); _CourseSessionModel = new CourseSessionModel(); }
public QuestionController() { _courseTestModel = new CourseTestModel(); _courseTestBs = new CourseTestBs(); apiResponse = new APIResponseModel(); _courseBs = new CourseBs(); _courseTestAnswerBs = new CourseTestAnswerBs(); _courseTestAnswerModel = new CourseTestAnswerModel(); }
public CourseController() { _courseModel = new CourseModel(); _courseBs = new CourseBs(); _courseSessionModel = new CourseSessionModel(); _courseSessionBs = new CourseSessionBs(); _courseTestBs = new CourseTestBs(); _courseTestModel = new CourseTestModel(); }
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; }
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); }
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)); }
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 })); }
public CourseTestModel GetCourseTest(CourseTestModel model) { throw new NotImplementedException(); }