예제 #1
0
        public async Task <IActionResult> MortgageRate(CreateMortgageRateViewModel model)
        {
            _logger.LogInformation(GetLogDetails());

            var userId = _userManager.GetUserId(User);
            var result = await _mortgageService.SaveMortgageRateAsync(model, userId);

            if (result.Success)
            {
                SetSiteMessage(MessageType.Success, DisplayFor.FullRequest, "Mortgage rate has been saved successfully.");
            }
            else
            {
                SetSiteMessage(MessageType.Error, DisplayFor.FullRequest, result.Error);
            }
            return(RedirectToAction(nameof(Index)));
        }