Пример #1
0
        public void Create(TestEntity test)
        {
            DalTest dalTest = new DalTest { MinAmountOfCorrAnswers = test.MinAmountOfCorrAnswers, TimeLimit = test.TimeLimit, Title = test.Title };
            testRepo.Create(dalTest);

            uow.Commit();
        }
Пример #2
0
        public ActionResult MakeTest(TestEntity test)
        {
            testService.Create(test);
            var testId = testService.GetAllTestEntities().Last().Id;

            return RedirectToAction("AddQuestion", new { testId });
        }
Пример #3
0
        public ActionResult Edit(TestEntity test, int page = 1)
        {
            testService.Update(test);

            if (Request.IsAjaxRequest())
            {
                var editModel = PrepareEditModel(page, 5, test.Id);
                return PartialView("_Questions", editModel);
            }
            else
                return RedirectToAction("Edit", new { testId = test.Id });
            //return View(test);
        }
Пример #4
0
 public void Update(TestEntity entity)
 {
     testRepo.Update(entity.ToDalTest());
     uow.Commit();
 }
Пример #5
0
 public void Delete(TestEntity entity)
 {
     testRepo.Delete(entity.ToDalTest());
     uow.Commit();
 }