public IActionResult Index(Registration _data) { try { string nationalId = TempData["NationalId"].ToString(); string yob = TempData["YOB"].ToString(); TempData.Keep("YOB"); TempData.Keep("NationalId"); if (!_authenticationService.IsAdmin()) { ViewBag.lang = langcode; var policies = policyHandler.GetPoliciesById(nationalId, yob); var approvals = ApprovalsHandler.GetApprovById(nationalId, yob); if (policies != null && policies.Count > 0) { ViewBag.Policies = policies.OrderByDescending(x => x.PolicyToDate).FirstOrDefault(); } if (approvals != null && approvals.Count > 0) { ViewBag.Approvals = approvals.OrderByDescending(x => x.CL_DATEOT).FirstOrDefault(); } } } catch (Exception ex) { _logger.LogInformation("HomeController::Index::" + ex.Message); } return(View()); }
public IActionResult Index(Registration _data) { string nationalId = TempData["NationalId"].ToString(); string yob = TempData["YOB"].ToString(); TempData.Keep("YOB"); TempData.Keep("NationalId"); ViewBag.lang = langcode; ViewBag.Policies = policyHandler.GetPoliciesById(nationalId, yob).OrderByDescending(x => x.PolicyToDate).FirstOrDefault(); ViewBag.Approvals = ApprovalsHandler.GetApprovById(nationalId, yob).OrderByDescending(x => x.CL_DATEOT).FirstOrDefault(); return(View()); }