Esempio n. 1
0
        public ActionResult CreateTestingUrl(TestingUrlViewModel testingUrl)
        {
            var testUrlDomain = _advancedMapper.MapTestingUrlViewModel(testingUrl);

            _highLevelTestManagementService.CreateTestingUrl(testUrlDomain);
            return(RedirectToAction("TestingUrlManagement", "Admin"));
        }
Esempio n. 2
0
        public ActionResult CreateTestingUrl(string testGuid)
        {
            var model = new TestingUrlViewModel
            {
                Guid = testGuid
            };

            return(View(model));
        }
        public TestingUrlViewModel MapTestingUrl(TestingUrl testingUrl)
        {
            var testingUrlViewModel = new TestingUrlViewModel
            {
                AllowedStartDate = testingUrl.AllowedStartDate?.ToString("MM/dd/yyyy HH:mm:ss") ?? "No restrictions",
                AllowedEndDate   = testingUrl.AllowedEndDate?.ToString("MM/dd/yyyy HH:mm:ss") ?? "No restrictions",
                Guid             = testingUrl.Guid,
                Interviewee      = testingUrl.Interviewee,
                IsValid          = _advancedLogicService.IsTestValid(testingUrl.Test),
                TestGuid         = testingUrl.Test.Guid,
                NumberOfRuns     = testingUrl.NumberOfRuns,
                TestName         = testingUrl.Test.Name
            };

            return(testingUrlViewModel);
        }
Esempio n. 4
0
        public ActionResult Quiz(string guid)
        {
            var testUrlDomain = _getInfoService.GetTestingUrlByGuid(guid);
            var error         = _advancedLogicService.CheckTestingUrlForAvailability(testUrlDomain);
            //if (!string.IsNullOrEmpty(error))
            //{
            //    return View("TestingErrorView",(object)error);
            //}
            //if all is ok
            var testUrl = _advancedMapper.MapTestingUrl(testUrlDomain);
            var model   = new TestingUrlViewModel
            {
                Guid = guid
            };

            return(View(testUrl));
        }
        public TestingUrl MapTestingUrlViewModel(TestingUrlViewModel testingUrlViewModel)
        {
            var testingUrl = _mapper.Map <TestingUrl>(testingUrlViewModel);

            testingUrl.Test = _getInfoService.GetTestByGuid(testingUrlViewModel.TestGuid);
            if (testingUrl.NumberOfRuns == 0)
            {
                testingUrl.NumberOfRuns = -1;
            }
            if (testingUrl.AllowedStartDate == new DateTime(1900, 01, 01))
            {
                testingUrl.AllowedStartDate = null;
            }
            if (testingUrl.AllowedEndDate == new DateTime(1900, 01, 01))
            {
                testingUrl.AllowedEndDate = null;
            }
            return(testingUrl);
        }
Esempio n. 6
0
        public ActionResult CreateTestingUrl(TestingUrlViewModel model)
        {
            if (model != null)
            {
                if (model.AllowedEndDate == null)
                {
                    model.AllowedEndDate = new DateTime().ToString();
                }
                if (model.AllowedStartDate == null)
                {
                    model.AllowedStartDate = new DateTime().ToString();
                }
            }
            if (ModelState.IsValid)
            {
                var testUrlDomain = _advancedMapper.MapTestingUrlViewModel(model);
                _highLevelTestManagementService.CreateTestingUrl(testUrlDomain);
                return(RedirectToAction("TestingUrlManagement", "Admin"));
            }

            return(View(model));
        }
Esempio n. 7
0
        public void CreateTestingUrl(TestingUrlViewModel testingUrl)
        {
            var testUrlDomain = _advancedMapper.MapTestingUrlViewModel(testingUrl);

            _highLevelTestManagementService.CreateTestingUrl(testUrlDomain);
        }