public ActionResult TransactionInfo(TransactionViewModel viewModel) { //TODO: Save the model if (ModelState.IsValid) { Transaction transaction = db.Transactions.Find(viewModel.TransactionId); transaction.LoanAmount = viewModel.Transaction.LoanAmount; transaction.SalePrice = viewModel.Transaction.SalePrice; transaction.UnpaidPrincipalAmount = viewModel.Transaction.UnpaidPrincipalAmount; transaction.OriginalDebtAmount = viewModel.Transaction.OriginalDebtAmount; transaction.TransactionTypeId = viewModel.Transaction.TransactionType.Id; transaction.InterestTypeId = viewModel.Transaction.InterestType.Id; transaction.LoanTypeId = viewModel.Transaction.LoanType.Id; //transaction.Endorsements = viewModel.Transaction.Endorsements; db.SaveChanges(); return RedirectToAction("AffiliatedFees", new { transactionId = transaction.Id, loanAmount = viewModel.Transaction.LoanAmount } ); } return View(viewModel); }
public ActionResult PriorTransactionInfo(TransactionViewModel viewModel) { if (ModelState.IsValid) { Transaction transaction = db.Transactions.Find(viewModel.TransactionId); transaction.BuyerPriorLenderPolicyAmount = viewModel.Transaction.BuyerPriorLenderPolicyAmount; transaction.BuyerPriorLenderPolicyAvailableAsProof = viewModel.Transaction.BuyerPriorLenderPolicyAvailableAsProof; transaction.BuyerPriorLenderPolicyDate = viewModel.Transaction.BuyerPriorLenderPolicyDate; transaction.BuyerPriorOwnerPolicyAmount = viewModel.Transaction.BuyerPriorOwnerPolicyAmount; transaction.BuyerPriorOwnerPolicyAvailableAsProof = viewModel.Transaction.BuyerPriorOwnerPolicyAvailableAsProof; transaction.BuyerPriorOwnerPolicyDate = viewModel.Transaction.BuyerPriorOwnerPolicyDate; transaction.BuyerUnpaidBalance = viewModel.Transaction.BuyerUnpaidBalance; transaction.BuyerUnpaidBalanceOfPriorLoan = viewModel.Transaction.BuyerUnpaidBalanceOfPriorLoan; transaction.SellerPriorLenderPolicyAmount = viewModel.Transaction.SellerPriorLenderPolicyAmount; transaction.SellerPriorLenderPolicyAvailableAsProof = viewModel.Transaction.SellerPriorLenderPolicyAvailableAsProof; transaction.SellerPriorLenderPolicyDate = viewModel.Transaction.SellerPriorLenderPolicyDate; transaction.SellerPriorOwnerPolicyAmount = viewModel.Transaction.SellerPriorOwnerPolicyAmount; transaction.SellerPriorOwnerPolicyAvailableAsProof = viewModel.Transaction.SellerPriorOwnerPolicyAvailableAsProof; transaction.SellerPriorOwnerPolicyDate = viewModel.Transaction.SellerPriorOwnerPolicyDate; transaction.SellerUnpaidBalance = viewModel.Transaction.SellerUnpaidBalance; transaction.SellerUnpaidBalanceOfPriorLoan = viewModel.Transaction.SellerUnpaidBalanceOfPriorLoan; db.SaveChanges(); //Call ResWare Fee Service to do the final calc EstimateFeesServiceFacade reswareFacade = new EstimateFeesServiceFacade(); FeeEstimateRequest request = new FeeEstimateRequest(); request.City = transaction.Property.City; request.ClientID = transaction.UserProfile.PartnerCompanyId; request.County = transaction.Property.County; request.LoanAmount = transaction.LoanAmount; request.OfficeID = transaction.UserProfile.OfficeId; request.OriginalDebtAmount = transaction.OriginalDebtAmount ?? 0; request.ProductTypeID = transaction.TransactionType.ResWareProductTypeId; request.SalesPrice = transaction.SalePrice ?? 0; request.State = transaction.Property.State; request.TransactionTypeID = transaction.TransactionType.ResWareTransactionTypeId; request.UnpaidPrincipalAmount = transaction.UnpaidPrincipalAmount ?? 0; ResWare.Service.EstimateFeesService.EstimateFeesResponse response = reswareFacade.GetFeeEstimate(request); //This needs some work and needs to be moved out. FeeEstimateResult result; if (response.HUDFees == null) { result = new FeeEstimateResult(); result.WasSuccessful = false; result.Message = response.Message; } else { IList<Models.Fee> fees = new List<Models.Fee>(); response.HUDFees.ToList().ForEach(reswareFee => { Models.Fee fee = new Models.Fee(); fee.Amount = reswareFee.Amount; fee.HudLine = reswareFee.HUDLine; fee.HudLineDescription = reswareFee.HUDLineDescription; fees.Add(fee); }); result = new FeeEstimateResult(fees, true, string.Empty); } db.FeeEstimateResults.Add(result); db.SaveChanges(); transaction.FeeEstimateResult = result; db.SaveChanges(); return RedirectToAction("AssessmentComplete", new { transactionId = transaction.Id }); } return View(viewModel); }
public ActionResult TransactionInfo(int transactionId) { TransactionViewModel viewModel = new TransactionViewModel(); viewModel.Endorsements = db.Endorsements.ToList(); viewModel.InterestTypes = db.InterestTypes.ToList(); viewModel.LoanTypes = db.LoanTypes.ToList(); viewModel.TransactionTypes = db.TransactionTypes.ToList(); viewModel.TransactionId = transactionId; return View("TransactionInfo", viewModel); }
public ActionResult PriorTransactionInfo(int transactionId) { TransactionViewModel viewModel = new TransactionViewModel(); viewModel.TransactionId = transactionId; return View(viewModel); }