Example #1
0
        public ActionResult ShowReDisclosureSection(string LoanId)
        {
            Guid loanId = Guid.Empty;
            var  model  = new ReDisclosureModel()
            {
                LoanChangeIndicators = new LoanChangeIndicators()
            };

            if (Guid.TryParse(LoanId, out loanId))
            {
                model.LoanId = loanId;

                LoanServiceFacade loanServiceFacade = new LoanServiceFacade();
                var loanIndicators = loanServiceFacade.RetrieveLoanChangeIndicators(loanId, false);
                if (loanIndicators == null)
                {
                    loanIndicators = new LoanChangeIndicatorsRetrieved();
                }

                model.LoanChangeIndicators.ChangeOfCircumstanceList       = loanIndicators.ChangeOfCircumstanceList;
                model.LoanChangeIndicators.CounterOfferApprovalItems      = loanIndicators.CounterOfferApprovalItems;
                model.LoanChangeIndicators.MdiaIndicator                  = loanIndicators.MdiaIndicator;
                model.LoanChangeIndicators.ChangeOfCircumstancesIndicator = loanIndicators.ChangeOfCircumstancesIndicator;
                model.LoanChangeIndicators.CafIndicator = loanIndicators.CafIndicator;
                model.DisplayCounterOfferApproval       = loanIndicators.CafIndicator;

                BorrowerServiceFacade borrowerServiceFacade = new BorrowerServiceFacade();
                model.IsOnlineBorrower = borrowerServiceFacade.IsOnlineBorrower(loanId);
            }

            return(PartialView("ReDisclosure/_reDisclosure", model));
        }
Example #2
0
        public void SubmitForm(ReDisclosureModel model)
        {
            string counterOfferApproval = null;

            var userAccountId = IdentityManager.GetUserAccountId();

            LoanServiceFacade loanServiceFacade = new LoanServiceFacade();

            model.LoanChangeIndicators.ChangeOfCircumstancesIndicator = model.LoanChangeIndicators.ChangeOfCircumstanceList != null && model.LoanChangeIndicators.ChangeOfCircumstanceList.Exists(c => c.Checked);
            loanServiceFacade.SaveLoanChangeIndicators(userAccountId, model.LoanId, model.LoanChangeIndicators, counterOfferApproval, true);
            // Delete any previous LoanChangeIndicators which may had been created
            loanServiceFacade.DeleteDiscardedLoanChangeIndicators(model.LoanId);
        }