예제 #1
0
        public IActionResult token(string id)
        {
            var resultModel = examsession.ValidateToken(id);

            if (resultModel.status)
            {
                var data = new { ExamDetailId = resultModel.Data.ExamDetailId, FirstName = resultModel.Data.FirstName, LastName = resultModel.Data.LastName };
                return(Ok(data));
            }
            else
            {
                return(BadRequest(resultModel.message));
            }
        }
예제 #2
0
        //[HttpGet]
        //[Route("CreateSession/token/{id}")]
        /// <summary>
        /// Verify the token
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult token(string id)
        {
            CreateSessionModel model = new CreateSessionModel();
            var resultModel          = examsession.ValidateToken(id);

            if (resultModel.status)
            {
                return(RedirectToAction("Index", "TechnicalTest", new { name = resultModel.Data.FirstName + " " + resultModel.Data.LastName, examDetailId = resultModel.Data.ExamDetailId }));
            }
            else
            {
                ViewBag.ErrorMessage = resultModel.message;
                return(View("Error"));
            }
        }