示例#1
0
        public async Task <IActionResult> GetUserDetails(CitizenResponse citizenResponse)
        {
            if (citizenResponse.BVN == 0)
            {
                TempData["EmptyUserDetails"] = "Please input your bvn to continue.";
                return(View("GetUserDetails"));
            }
            var citizenExist = _citizenService.IsExist(citizenResponse.BVN);

            if (citizenExist)
            {
                var userDetails = await _citizenService.SelectByBvnAsync(citizenResponse.BVN);

                TempData["UserDetails"] = "Congratulations you have been enrolled, view your Enrollment data below.";
                return(View("EnrollmentDetails", userDetails));
            }
            TempData["Failed"] = "Sorry you have not been enrolled";
            return(RedirectToAction("Index"));
        }