static void Main(string[] args) { //Pesho's Account Deposit peshosAccount = new Deposit(new Individual("Pesho"), 100000m, 25.3f); Console.WriteLine("Pesho's current balance: {0}", peshosAccount.Balance); Console.WriteLine("Pesho's interest amount: {0}", peshosAccount.CalculateInterestAmount(12)); //Add some money in the Pesho's account peshosAccount.Deposit(2131m); Console.WriteLine("Pesho's balance after the deposit: {0}", peshosAccount.Balance); peshosAccount.WithDraw(35000m); Console.WriteLine("Pesho's balance after the draw: {0}", peshosAccount.Balance); //Let us calculate the Pesho's interest amount Console.WriteLine("Pesho's account interest amount: {0}", peshosAccount.CalculateInterestAmount(4)); Console.WriteLine(); //Ivan's Account Account ivansAccount = new Loan(new Company("Ivan"), 1040.4m, 23.3f); Console.WriteLine("Ivan's interest amount: {0}", ivansAccount.CalculateInterestAmount(7)); Console.WriteLine(); //Dido's Account Account didosAccount = new Mortgage(new Individual("Dido"), 3422m, 5.4f); Console.WriteLine("Ivan's interest amount: {0}", didosAccount.CalculateInterestAmount(13)); }
public CalculateAnticipatedFeesStrategy(CreditContractOptions pCCO,Loan pContract, ApplicationSettings pGeneralSettings) { if(pCCO.CancelFees || pCCO.KeepExpectedInstallments) _cFfar = new AnticipatedFeesNotCalculate(); else _cFfar = new AnticipatedFeesCalculate(pCCO,pContract); }
public CalculationBaseForAnticipatedFees(CreditContractOptions pCCO, Loan pContract) { if (pCCO.AnticipatedTotalRepaymentPenaltiesBase == OAnticipatedRepaymentPenaltiesBases.RemainingInterest) _iBtcffar = new RemainingInterest(pContract); else _iBtcffar = new RemainingOLB(pContract); }
static void Main() { Console.WriteLine("Enter number"); int number = int.Parse(Console.ReadLine()); try { for (int count = 0; count < number; count++) { Console.WriteLine("Enter customer kind"); //true equals to individual, and false to company bool customerKind = bool.Parse(Console.ReadLine()); Console.WriteLine("Enter customer name"); string customerName = Console.ReadLine(); Customer customer = new Customer(customerKind, customerName); Console.WriteLine("Enter interest rate"); float currentInterestRate = float.Parse(Console.ReadLine()); Console.WriteLine("Enter account balance"); double currentBalance = double.Parse(Console.ReadLine()); Deposit deposit = new Deposit(customer, currentInterestRate, currentBalance); Loan loan = new Loan(customer, currentInterestRate, currentBalance); Mortgage mortgage = new Mortgage(customer, currentInterestRate, currentBalance); Console.WriteLine("Enter start month"); byte startMonth = byte.Parse(Console.ReadLine()); Console.WriteLine("Enter end month"); byte endMonth = byte.Parse(Console.ReadLine()); Console.WriteLine("Interest for the deposit is {0}", deposit.CalculateInterest(startMonth, endMonth)); Console.WriteLine("Interest for the loan is {0}", loan.CalculateInterest(startMonth, endMonth)); Console.WriteLine("Interest for the morgage is {0}", mortgage.CalculateInterest(startMonth, endMonth)); } } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } }
private static void Main() { var deposit = new Deposit(400m, 0.01m, Customer.Individual); Console.WriteLine("Deposit Account: "); Console.WriteLine("Interest rate: " + deposit.CalculateRate(20)); deposit.DepositMoney(100000m); Console.WriteLine("Balance after depositing: " + deposit.Balance); Console.WriteLine("Interest rate: " + deposit.CalculateRate(20)); deposit.WithdrawMoney(100400m); Console.WriteLine("Balance after withdrawing: " + deposit.Balance); Console.WriteLine(); var mortgage = new Mortgage(500000m, 0.02m, Customer.Company); Console.WriteLine("Mortgage Account: "); Console.WriteLine("Interest rate for company: " + mortgage.CalculateRate(12)); mortgage.Customer = Customer.Individual; Console.WriteLine("Interest rate for individual: " + mortgage.CalculateRate(7)); Console.WriteLine(); var loan = new Loan(500000m, 0.02m, Customer.Company); Console.WriteLine("Loan Account: "); Console.WriteLine("Interest rate for company: " + loan.CalculateRate(24)); loan.Customer = Customer.Individual; Console.WriteLine("Interest rate for individual: " + loan.CalculateRate(3)); }
public DecliningKeepNotExpectedInstallments(Loan contract, User pUser, ApplicationSettings pGeneralSettings) { _user = pUser; _generalSettings = pGeneralSettings; _contract = contract; _paidInstallments = new List<Installment>(); }
public CreditContractRepayment(Loan contract, CreditContractOptions creditOptions, DateTime pDate,int pInstallmentNumber, User user, ApplicationSettings pGeneralSettings,NonWorkingDateSingleton pNonWorkingDate) { _generalSettings = pGeneralSettings; _nWds = pNonWorkingDate; _date = pDate.Date; _installmentNumber = pInstallmentNumber; PaidIstallments = new List<Installment>(); _amountToRepayTotalyLoan = new CalculateMaximumAmountToRepayStrategy(creditOptions, contract.Copy(), user, _generalSettings,_nWds); _amountToRegradingLoan = new CalculateMaximumAmountToRegradingLoanStrategy(creditOptions, contract.Copy(), user, _generalSettings, _nWds); _amountToRepayInstallment = new CalculateAmountToRepaySpecifiedInstallmentStrategy(creditOptions, contract.Copy(), user, _generalSettings, _nWds); _calculateInstallments = new Repayment.RepayLateInstallments.CalculateInstallments(creditOptions, contract, user, _generalSettings, _nWds); _calculateRealInterestInstallments = new CalculateRealInterestInstallments(creditOptions, _amountToRepayTotalyLoan, contract, _generalSettings, _nWds); _feesForAnticipatedRepayment = new CalculateAnticipatedFeesStrategy(creditOptions, contract, _generalSettings); _repayNextInstallments = new RepayNextInstallmentsStrategy(contract, creditOptions, user, _generalSettings); _repaymentMethod = new RepaymentMethod(contract,creditOptions); _loan = contract; CalculateMaximumAmountAuthorizedToRepay(); CalculateAmountToRegradingLoan(); CalculateMaximumAmountForEscapedMember(); LoanOptions = creditOptions; }
static void Main() { Customer examplePerson = new Customer("Example Person", CustomerType.Individual); Customer exampleCompany = new Customer("Example Company", CustomerType.Company); DepositAccount deposit = new DepositAccount(examplePerson, 1200, (decimal)0.02); int period = 2; Console.WriteLine("Interest for: {0}, account type: {1}, balance: {2}, period: {3} months, interest rate: {4}%\n{5}%", deposit.Customer, deposit.GetType(), deposit.Balance, period, deposit.IntrestRate, deposit.CalcInterestAmount(period)); deposit.Withdraw(300); Console.WriteLine("Interest for: {0}, account type: {1}, balance: {2}, period: {3} months, interest rate: {4}%\n{5}%", deposit.Customer, deposit.GetType(), deposit.Balance, period, deposit.IntrestRate, deposit.CalcInterestAmount(period)); deposit.Deposit(1000); Console.WriteLine("Test depositing money balance: {0}", deposit.Balance); period = 3; Loan loan = new Loan(examplePerson, 1200, (decimal)0.02); Console.WriteLine("Interest for: {0}, account type: {1}, balance: {2}, period: {3} months, interest rate: {4}%\n{5}%", loan.Customer, loan.GetType(), loan.Balance, period, loan.IntrestRate, loan.CalcInterestAmount(period)); period = 4; Console.WriteLine("Interest for: {0}, account type: {1}, balance: {2}, period: {3} months, interest rate: {4}%\n{5}%", loan.Customer, loan.GetType(), loan.Balance, period, loan.IntrestRate, loan.CalcInterestAmount(period)); loan.Deposit(1200); Console.WriteLine("After repaying the loan the balance is: {0}", loan.Balance); //invalid period test //Console.WriteLine(loan.CalcInterestAmount(-3)); }
static void Main() { //Deposit test Console.WriteLine("Deposit account test:"); Deposit deposit = new Deposit(Customer.Individual, 2000m, 12.3m); Console.Write("Deposite interest for 3 months and 12.3 interest rate = "); Console.WriteLine(deposit.CalculateInterestAmount(3)); Console.WriteLine(); //Loan test Console.WriteLine("Loan account test:"); Loan loanIndividual = new Loan(Customer.Individual, 1000m, 1.2m); Loan loanCompany = new Loan(Customer.Company, 4000m, 3.3m); Console.Write("Individual interest for 4 months and 1.2 interest rate = "); Console.WriteLine(loanIndividual.CalculateInterestAmount(4)); Console.Write("Company interest for 3 months and 3.3 interest rate = "); Console.WriteLine(loanCompany.CalculateInterestAmount(3)); Console.WriteLine(); //Mortgage test Console.WriteLine("Mortgage account test:"); Mortgage mortgageIndividual = new Mortgage(Customer.Individual, 40000m, 5.4m); Mortgage mortgageCompany = new Mortgage(Customer.Company, 120000m, 6.5m); Console.Write("Individual interest for 4 months and {0} interest rate = ", mortgageIndividual.InterestRate); Console.WriteLine(mortgageIndividual.CalculateInterestAmount(4)); Console.Write("Individual interest for 15 months and 5.4 interest rate = "); Console.WriteLine(mortgageIndividual.CalculateInterestAmount(15)); Console.Write("Company interest for 3 months and 6.5 interest rate = "); Console.WriteLine(mortgageCompany.CalculateInterestAmount(3)); }
static void Main() { Deposit deposit = new Deposit(new Individual("Phili Fry"), 5000m, 5); deposit.DepositIn(1000m); Console.WriteLine(deposit.Balance); deposit.Withdraw(1500m); Console.WriteLine(deposit.Balance); Console.WriteLine(deposit.CalculateInterest(5)); Console.WriteLine("-------------------"); Loan loan = new Loan(new Individual("James"), 2000m, 20); loan.DepositIn(2000m); Console.WriteLine(loan.Balance); Console.WriteLine(loan.CalculateInterest(5)); Console.WriteLine("-------------------"); Loan companyLoan = new Loan(new Company("Telecom"), 2000m, 20); companyLoan.DepositIn(3000m); Console.WriteLine(companyLoan.Balance); Console.WriteLine(companyLoan.CalculateInterest(5)); Console.WriteLine("-------------------"); Mortgage mortgage = new Mortgage(new Individual("Bart"), 2000m, 20); mortgage.DepositIn(3000m); Console.WriteLine(mortgage.Balance); Console.WriteLine(mortgage.CalculateInterest(8)); Console.WriteLine("-------------------"); Mortgage companyMortgate = new Mortgage(new Company("Airline"), 2000m, 20); Console.WriteLine(companyMortgate.CalculateInterest(16)); }
static void Main() { IndividualCustomer pesho = new IndividualCustomer("Petar", "Petrov", "+359894011468", "Sofia, bul.Tcarigradsko shose 15"); IndividualCustomer mimi = new IndividualCustomer("Maria", "Nikolova", "+359894011468", "Sofia, bul.Vitoshka 35"); CompanyCustomer softUni = new CompanyCustomer("Software University Ltd.", "+359894011468", "Sofia, bul.NqkoiSi 9"); CompanyCustomer hardUni = new CompanyCustomer("Hardware University Ltd.", "+359894011468", "Sofia, bul.EdiKoiSi 6"); Deposit d1 = new Deposit(pesho, 1000, 0.1m); Deposit d2 = new Deposit(softUni, 50000, 0.15m); Loan l1 = new Loan(mimi, 5500, 0.2m); Loan l2 = new Loan(hardUni, 90000, 0.18m); Mortgage m1 = new Mortgage(pesho, 60000, 0.12m); Mortgage m2 = new Mortgage(hardUni, 160000, 0.1m); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Deposits and withdraws:"); Console.ForegroundColor = ConsoleColor.Black; Console.Write("Old balance " + d1.Balance + ", new balance: "); d1.DepositMoney(500); Console.WriteLine(d1.Balance); Console.Write("Old balance " + d2.Balance + ", new balance: "); d2.WithdrawMoney(12500.50m); Console.WriteLine(d2.Balance); Console.Write("Old balance " + l1.Balance + ", new balance: "); l1.DepositMoney(500); Console.WriteLine(l1.Balance); Console.Write("Old balance " + m1.Balance + ", new balance: "); m1.DepositMoney(10000.90m); Console.WriteLine(m1.Balance); Console.WriteLine(); IList<Account> accounts = new List<Account> { d1, d2, l1, l2, m1, m2 }; Bank bank = new Bank(accounts); Console.WriteLine("The bank:"); Console.WriteLine(bank); // I have changed the formula for calculating the interest, because // the given formula returns interest plus amount which is not correct Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Calculated interests:"); Console.ForegroundColor = ConsoleColor.Black; Console.WriteLine("Interest = {0:F2} BGN", d1.CalculateInteres(6)); Console.WriteLine("Interest = {0:F2} BGN", l1.CalculateInteres(3)); Console.WriteLine("Interest = {0:F2} BGN", l2.CalculateInteres(6)); Console.WriteLine("Interest = {0:F2} BGN", d2.CalculateInteres(6)); Console.WriteLine("Interest = {0:F2} BGN", m1.CalculateInteres(6)); Console.WriteLine("Interest = {0:F2} BGN", m1.CalculateInteres(13)); Console.WriteLine("Interest = {0:F2} BGN", m2.CalculateInteres(6)); }
public FixedInstallmentStrategy(Loan pContract, OCurrency pStartAmount, int pNumberOfInstalments, ApplicationSettings pGeneralSettings) { _contract = pContract; _startAmount = pStartAmount; _numberOfInstallmentsToPay = pNumberOfInstalments; _roundingPoint = pContract.UseCents ? 2 : 0; _generalSettings = pGeneralSettings; }
public FlatStrategy(DateTime pStartDate, Loan pContract, ApplicationSettings pGeneralSettings, OCurrency pInitialOLBOfContractBeforeRescheduling) { RoundingPoint = pContract.UseCents ? 2 : 0; _initialOLBOfContractBeforeRescheduling = pInitialOLBOfContractBeforeRescheduling; _contract = pContract; GeneralSettings = pGeneralSettings; }
public DecliningKeepExpectedInstallments(Loan pContract, CreditContractOptions pCco) { _paidInstallments = new List<Installment>(); _contract = pContract; _methodToRepayInterest = new RepayInterestStrategy(pCco); _methodToRepayFees = new RepayFeesStrategy(pCco); _methodToRepayCommission = new RepayCommisionStrategy(pCco); }
public FlateKeepExpectedInstallments(Loan contract, CreditContractOptions pCCO) { _contract = contract; _paidInstallments = new List<Installment>(); _methodToRepayInterest = new RepayInterestStrategy(pCCO); _methodToRepayFees = new RepayFeesStrategy(pCCO); _methodToRepayCommission = new RepayCommisionStrategy(pCCO); }
public CalculateInstallmentsOptions(DateTime pStartDate, OLoanTypes pLoanType, bool pIsExotic, Loan pContract, bool pChangeDate) { _loanType = pLoanType; _isExotic = pIsExotic; _contract = pContract; _changeDate = pChangeDate; _startDate = pStartDate; }
public FlatStrategy(Loan pContract, ApplicationSettings pGeneralSettings, OCurrency pInitialOlbOfContractBeforeRescheduling) { _roundingPoint = pContract.UseCents ? 2 : 0; _initialOlbOfContractBeforeRescheduling = pInitialOlbOfContractBeforeRescheduling; _contract = pContract; _generalSettings = pGeneralSettings; }
public void ItemDescription_ShouldHaveMaxLength_200() { //---------------Set up test pack------------------- var loan = new Loan(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- loan.ShouldHaveMaxLengthOf(200, l => l.ItemDescription); //---------------Test Result ----------------------- }
public void BorrowerName_ShouldHaveMaxLenght_100() { //---------------Set up test pack------------------- var loan = new Loan(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- loan.ShouldHaveMaxLengthOf(100, l => l.BorrowerName); //---------------Test Result ----------------------- }
public void ItemDescription_ShouldRequired() { //---------------Set up test pack------------------- var loan = new Loan(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- loan.ShouldBeRequired(l => l.ItemDescription); //---------------Test Result ----------------------- }
public CalculateAmountToRepaySpecifiedInstallmentStrategy(CreditContractOptions pCCo,Loan pContract, User pUser, ApplicationSettings pGeneralSettings,NonWorkingDateSingleton pNonWorkingDate) { _user = pUser; _generalSettings = pGeneralSettings; _nWds = pNonWorkingDate; _contract = pContract; _cCo = pCCo; }
public Tranche(Loan pLoan, ApplicationSettings pGeeneralSettings) { _currentLoan = pLoan; _generalSettings = pGeeneralSettings; foreach (Installment installment in _currentLoan.InstallmentList) { _previousSchedule.Add(installment); } }
public void BorrowerName_ShouldBeRequired() { //---------------Set up test pack------------------- var loan = new Loan(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- loan.ShouldBeRequired(l => l.BorrowerName); //---------------Test Result ----------------------- }
public LoanDisplayManager(Loan loanApplication) { LoanApplication = loanApplication; LoanAmount = loanApplication.LoanAmount.ToString(); MonthlyPayment = string.Format("{0:0.00}",loanApplication.MonthlyPayment); TotalPayment = string.Format("{0:0.00}",loanApplication.TotalPayment); Rate = string.Format("{0:0.0}",(loanApplication.Rate*100.0)); Period = loanApplication.Period.ToString(); }
public static OCurrency CalculateRemainingInterests(Loan pLoan, DateTime pDate) { OCurrency amount = 0; foreach (Installment installment in pLoan.InstallmentList) { if (installment.IsRepaid) continue; if(installment.ExpectedDate < pDate) { amount += installment.InterestsRepayment - installment.PaidInterests; } else if(installment.ExpectedDate == pDate) { amount += installment.InterestsRepayment - installment.PaidInterests; return Math.Round(amount.Value, 2); } else { DateTime date = installment.Number == 1 ? pLoan.StartDate : pLoan.GetInstallment(installment.Number - 2).ExpectedDate; int days; int daysInInstallment = pLoan.NumberOfDaysInTheInstallment(installment.Number, pDate); if (installment.Number != 1) { if(pLoan.GetInstallment(installment.Number - 2).IsRepaid && pLoan.GetInstallment(installment.Number - 2).ExpectedDate > pDate) { days = 0; } else { if (pLoan.GetLastRepaymentDate() > date) { date = pLoan.GetLastRepaymentDate(); daysInInstallment = (installment.ExpectedDate - date).Days; } days = (pDate - date).Days; } } else days = (pDate - date).Days; amount += days >= pLoan.NumberOfDaysInTheInstallment(installment.Number, pDate) ? installment.InterestsRepayment : installment.InterestsRepayment * (double)days / (double) daysInInstallment; if (installment.PaidInterests > amount) amount = 0; if (installment.PaidInterests < amount) amount -= installment.PaidInterests; return amount.Value; } } return amount.Value; }
public CalculateMaximumAmountToRegradingLoanStrategy(CreditContractOptions pCCo,Loan pContract, User pUser, ApplicationSettings pGeneralSettings,NonWorkingDateSingleton pNonWorkingDate) { _user = pUser; _generalSettings = pGeneralSettings; _nWds = pNonWorkingDate; _contract = pContract; _cCo = pCCo; }
public ExoticStrategy(DateTime pStartDate, Loan pContract, ApplicationSettings pGeneralSettings) { //if(pGeneralSettings.UseCents ) // _iCI = new CentsUsed(pStartDate, pContract); //else // _iCI = new CentsNotUsed(pStartDate, pContract); RoundingPoint = pContract.UseCents ? 2 : 0; _contract = pContract; GeneralSettings = pGeneralSettings; }
public CalculateInstallments(CreditContractOptions pCCO, Loan pContract, User pUser, ApplicationSettings pGeneralSettings,NonWorkingDateSingleton pNonWorkingDate) { _generalSettings = pGeneralSettings; _nWds = pNonWorkingDate; _contract = pContract; _cCo = pCCO; _methodToRepayFees = new RepayFeesStrategy(pCCO); _methodToRepayInterest = new RepayInterestStrategy(pCCO); _methodToRepayCommission = new RepayCommisionStrategy(pCCO); PaidIstallments = new List<Installment>(); }
static void Main() { Loan aLoan = new Loan(333, "Hanson", 7000.00); CarLoan aCarLoan = new CarLoan(444, "Carlisle", 30000.00, 2011, "BMW"); Console.WriteLine("Loan #{0} for {1} is for {2}", aLoan.LoanNumber, aLoan.LastName, aLoan.LoanAmount.ToString("C2")); Console.WriteLine("Loan #{0} for {1} is for {2}", aCarLoan.LoanNumber, aCarLoan.LastName, aCarLoan.LoanAmount.ToString("C2")); Console.WriteLine("Loan #{0} is for a {1} {2}", aCarLoan.LoanNumber, aCarLoan.Year, aCarLoan.Make); Console.Read(); }
public FixedInstallmentStrategy(DateTime pStartDate, Loan pContract, int pStartInstallment, OCurrency pStartAmount, int pNumberOfInstalments, ApplicationSettings pGeneralSettings) { _contract = pContract; _startAmount = pStartAmount; _numberOfInstallmentsToPay = pNumberOfInstalments; RoundingPoint = pContract.UseCents ? 2 : 0; GeneralSettings = pGeneralSettings; //if(pGeneralSettings.UseCents) // _iCs = new CentsUsed(pStartDate, pContract, pStartInstallment, pStartAmount, pNumberOfInstalments); //else // _iCs = new CentsNotUsed(pStartDate, pContract, pStartInstallment, pStartAmount, pNumberOfInstalments); }
public VerificationResultDto Verify(Loan loan) { VerificationTestDto arpTestObject = new VerificationTestDto { Name = $"Test ARP Amount for {loan.Address.State} located loan #{loan.Id}", Status = LoanVerificationResultCode.Success }; VerificationTestDto feeTestObject = new VerificationTestDto { Name = $"Test Fee Amount for {loan.Address.State} located loan #{loan.Id}", Status = LoanVerificationResultCode.Success }; VerificationResultDto result = new VerificationResultDto(); // Run test only if Loan type is Conventional or FHA or VA if (loan.LoanType == LoanType.Conventional || loan.LoanType == LoanType.FHA || loan.LoanType == LoanType.VA) { #region # Check Arp if (loan.Address.IsPrimaryOccupancy && loan.LoanType == LoanType.VA) { // check loan ARP if (loan.ARP > 5) { // ARP Amount Error arpTestObject.Status |= LoanVerificationResultCode.ArpIsExceedRates; arpTestObject.Errors.Add(new VerificationErrorDto(ErrorCode.LoanArpRateIsInvalid, Constants.ErrorPayloadType.Loan.LoanArpRateIsInvalidMsg)); } } if (!loan.Address.IsPrimaryOccupancy && loan.LoanType == LoanType.VA) { // check loan ARP if (loan.ARP > 8) { // ARP Amount Error arpTestObject.Status |= LoanVerificationResultCode.ArpIsExceedRates; arpTestObject.Errors.Add(new VerificationErrorDto(ErrorCode.LoanArpRateIsInvalid, Constants.ErrorPayloadType.Loan.LoanArpRateIsInvalidMsg)); } } #endregion //Check Arp // Add test results for ARP result.Tests.Add(arpTestObject); // Check loan Fee if (loan.FeesIncludedInTotal.Intersect(feesIncludedInTotal).Count() == 3) { if (loan.Fee > MaximumPercentThatCanBeCharged) { // Error feeTestObject.Status |= LoanVerificationResultCode.TotalFeesExceedTheAmount; feeTestObject.Errors.Add(new VerificationErrorDto(ErrorCode.LoanTotalFeesInvalid, Constants.ErrorPayloadType.Loan.LoanTotalFeesInvalidMsg)); } // Add test results for Fee result.Tests.Add(feeTestObject); } } return(result); }
public LoanMVVM(Loan loan) { this.Loan = loan; this.PaymentLeft = loan.PaymentLeft; this.MonthsLeft = loan.MonthsLeft; }
public static string SELECT_BY_PAGO(QueryConditions conditions) { return(Loan.SELECT_BY_PAGO(conditions, false)); }
public static string SELECT_PENDIENTES(QueryConditions conditions) { return(Loan.SELECT_PENDIENTES(conditions, false)); }
public async Task BorrowerPairs_ReflectToLoanObject() { var client = await GetTestClientAsync(); var loan = new Loan(client) { Applications = new[] { new Application { Borrower = new Borrower { FirstName = "John", LastName = "Doe" }, Coborrower = new Borrower { FirstName = "Brenda", LastName = "Smith" } } } }; var loanId = await client.Loans.CreateLoanAsync(loan); try { loan = new Loan(client, loanId); Assert.AreEqual(0, loan.Applications.Count); loan.LoanApis.ReflectToLoanObject = true; var borrowerPairs = await loan.LoanApis.BorrowerPairs.GetBorrowerPairsAsync(); Assert.AreSame(loan.Applications, borrowerPairs); Assert.IsTrue(loan.Applications.Count > 0); Assert.AreEqual($@"{{""encompassId"":""{loan.EncompassId}""}}", loan.ToJson()); var oldCount = loan.Applications.Count; var application = new Application(); var applicationId = await loan.LoanApis.BorrowerPairs.CreateBorrowerPairAsync(application); Assert.AreEqual($@"{{""encompassId"":""{loan.EncompassId}""}}", loan.ToJson()); Assert.AreEqual(oldCount + 1, loan.Applications.Count); Assert.AreSame(application, loan.Applications.First(a => a.Id == applicationId)); application.ApplicationSignedDate = DateTime.Now.AddDays(-5); var newApplication = new Application { Id = applicationId, ApplicationSignedDate = DateTime.Now.AddDays(2), Borrower = new Borrower { FirstName = "Bob", LastName = "Smith" }, Coborrower = new Borrower { FirstName = "Jane", LastName = "Doe" } }; await loan.LoanApis.BorrowerPairs.UpdateBorrowerPairAsync(newApplication); Assert.AreEqual($@"{{""encompassId"":""{loan.EncompassId}""}}", loan.ToJson()); Assert.AreEqual(newApplication.ApplicationSignedDate, loan.Applications.First(a => a.Id == applicationId).ApplicationSignedDate); borrowerPairs = await loan.LoanApis.BorrowerPairs.GetBorrowerPairsAsync(); Assert.AreEqual(2, borrowerPairs.Count); await loan.LoanApis.BorrowerPairs.MoveBorrowerPairsAsync(new[] { new Application { Id = borrowerPairs[0].Id, ApplicationIndex = borrowerPairs[1].ApplicationIndex, Borrower = new Borrower { AltId = borrowerPairs[0].Borrower.AltId }, Coborrower = new Borrower { AltId = borrowerPairs[1].Coborrower.AltId } }, new Application { Id = borrowerPairs[1].Id, ApplicationIndex = borrowerPairs[0].ApplicationIndex, Borrower = new Borrower { AltId = borrowerPairs[0].Coborrower.AltId }, Coborrower = new Borrower { AltId = borrowerPairs[1].Borrower.AltId } } }); Assert.AreEqual(2, loan.Applications.Count); var firstApplication = loan.Applications.First(app => app.ApplicationIndex == 0); Assert.AreEqual("Brenda Smith", firstApplication.Borrower.FullName); Assert.AreEqual("Bob Smith", firstApplication.Coborrower.FullName); var secondApplication = loan.Applications.First(app => app.ApplicationIndex == 1); Assert.AreEqual("John Doe", secondApplication.Borrower.FullName); Assert.AreEqual("Jane Doe", secondApplication.Coborrower.FullName); borrowerPairs = await loan.LoanApis.BorrowerPairs.GetBorrowerPairsAsync(); Assert.AreEqual(2, borrowerPairs.Count); Assert.AreEqual("Brenda Smith", borrowerPairs[0].Borrower.FullName); Assert.AreEqual("Bob Smith", borrowerPairs[0].Coborrower.FullName); Assert.AreEqual("John Doe", borrowerPairs[1].Borrower.FullName); Assert.AreEqual("Jane Doe", borrowerPairs[1].Coborrower.FullName); oldCount = loan.Applications.Count; Assert.IsTrue(await loan.LoanApis.BorrowerPairs.DeleteBorrowerPairAsync(applicationId)); Assert.AreEqual($@"{{""encompassId"":""{loan.EncompassId}""}}", loan.ToJson()); Assert.AreEqual(oldCount - 1, loan.Applications.Count); Assert.IsNull(loan.Applications.FirstOrDefault(a => a.Id == applicationId)); } finally { try { await client.Loans.DeleteLoanAsync(loanId); } catch { } } }
private void Approval_Package() { try { string hist = ""; Loan loan = EncompassApplication.CurrentLoan; User user = EncompassApplication.CurrentUser; List <string> alertapprList = new List <string> { "CX.RD.APPR.ALERT1", "CX.RD.APPR.ALERT2", "CX.RD.APPR.ALERT3", "CX.RD.APPR.ALERT4" }; List <string> resolveapprList = new List <string> { "CX.RD.APPR.RESOLVE1", "CX.RD.APPR.RESOLVE2", "CX.RD.APPR.RESOLVE3", "CX.RD.APPR.RESOLVE4" }; List <string> whoapprList = new List <string> { "CX.RD.APPR.WHO1", "CX.RD.APPR.WHO2", "CX.RD.APPR.WHO3", "CX.RD.APPR.WHO4" }; List <string> cocapprList = new List <string> { "CX.RD.APPR.COC1", "CX.RD.APPR.COC2", "CX.RD.APPR.COC3", "CX.RD.APPR.COC4" }; //List<string> docapprList = new List<string> { "CX.RD.COC.DOC1", "CX.RD.COC.DOC2", "CX.RD.COC.DOC3", "CX.RD.COC.DOC4"}; List <string> procapprList = new List <string> { "CX.RD.APPR.COC.PROCESSOR1", "CX.RD.APPR.COC.PROCESSOR2", "CX.RD.APPR.COC.PROCESSOR3", "CX.RD.APPR.COC.PROCESSOR4" }; List <string> closerapprList = new List <string> { "CX.RD.APPR.COC.CLOSER1", "CX.RD.APPR.COC.CLOSER2", "CX.RD.APPR.COC.CLOSER3", "CX.RD.APPR.COC.CLOSER4" }; var apprType = loan.Fields["CX.REDISC.TYPE.TEXT"].Value; for (int i = 0; i < commentBoxList.Count; i++) { if (loan.Fields[commentBoxList[i]].FormattedValue == "") { loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].FormattedValue; loan.Fields[dSpeciaList[i]].Value = loan.Fields["CX.APPROVAL.SEND.ASSIGNED"].Value; if (loan.Fields["CX.LN.HISTORY"].FormattedValue == "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.APPROVAL.SEND.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value); Macro.SetField("CX.LN.HISTORY", hist); } if (loan.Fields["CX.LN.HISTORY"].FormattedValue != "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.APPROVAL.SEND.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value + " " + "\n" + "\n" + Macro.GetField("CX.LN.HISTORY")); Macro.SetField("CX.LN.HISTORY", hist); loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].Value; loan.Fields["CX.REDISC.COMMENTS.VAR"].Value = ""; } break; } } Macro.SetFieldNoRules("CX.APP.SENT.TRIGGER", "X"); for (int x = 0; x < alertList.Count; x++) { if (loan.Fields[alertapprList[x]].Value.ToString() == "") { //MessageBox.Show(loan.Fields["CX.REDISC.TYPE.TEXT"].Value.ToString()); if (apprType.ToString() == "Approval Package") { Macro.CopyField("CX.REDISC.ALERT.APPROVAL", alertapprList[x]); Macro.SetField(resolveapprList[x], DateTime.Today.ToString()); Macro.CopyField("CX.APPROVAL.SEND.ASSIGNED", whoapprList[x]); loan.Fields[cocapprList[x]].Value = apprType; //Macro.SetField(docapprList[x], "Approval"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procapprList[x]); Macro.CopyField("LoanTeamMember.Name.Closer", closerapprList[x]); Macro.SetField("CX.APPROVAL.NOTES", ""); Macro.SetField("CX.APPROVAL.SEND.ASSIGNED", ""); loan.Fields["CX.REDISC.APPROVAL"].Value = ""; loan.Fields["CX.APPROVAL.SENT.DATE"].Value = loan.Fields["CX.REDISC.SENT.DATETIME"].Value; } else if (apprType.ToString() == "Re-Approval Package") { Macro.CopyField("CX.REDISC.ALERT.REAPPROVAL", alertapprList[x]); Macro.SetField(resolveapprList[x], DateTime.Today.ToString()); Macro.CopyField("CX.APPROVAL.SEND.ASSIGNED", whoapprList[x]); loan.Fields[cocapprList[x]].Value = apprType; //Macro.SetField(docList[x], "Approval"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procapprList[x]); Macro.CopyField("LoanTeamMember.Name.Closer", closerapprList[x]); Macro.SetField("CX.APPROVAL.NOTES", ""); Macro.SetField("CX.APPROVAL.SEND.ASSIGNED", ""); loan.Fields["CX.REDISC.APPROVAL"].Value = ""; loan.Fields["CX.APPROVAL.SENT.DATE"].Value = loan.Fields["CX.REDISC.SENT.DATETIME"].Value; } break; } } } catch (Exception) { MessageBox.Show("Something went wrong with computing of Approval Package Data"); } }
public override double Capital(Loan loan) { return(loan.GetCommitment() * loan.GetUnusedPercentage() * Duration(loan) * RiskFactorFor()); }
private void RefreshSchedule(Loan loan) { scheduleUserControl.SetScheduleFor(loan); }
public Loan Create(Loan loan) { throw new NotImplementedException(); }
private void ButtonSaveClick(object sender, EventArgs e) { List <SavingEvent> savingEvents = new List <SavingEvent>(); if (!CheckDateChange()) { return; } _loan.Comments = tbComment.Text; try { DistributeEntryFees(); // If disbursement goes to savings if (cmbPaymentMethod.Text == OPaymentMethods.Savings.ToString()) { if (_loan.CompulsorySavings == null) { throw new OpenCbsSavingException(OpenCbsSavingExceptionEnum.NoCompulsorySavings); } if (_loan.CompulsorySavings.Status == OSavingsStatus.Active) { _loan = ServicesProvider.GetInstance().GetContractServices().Disburse(_loan, _newStartDate, _alignInstallmentsDatesOnRealDisbursmentDate, _disableFees, (PaymentMethod) cmbPaymentMethod. SelectedItem); savingEvents = ServicesProvider.GetInstance().GetAccountServices().LoanDisbursement(_loan.CompulsorySavings, _loan, _newStartDate, "Disbursement of the loan: " + _loan.Code, User.CurrentUser, checkBoxFees.Checked); //slycode MessagingService messagingService = new MessagingService(Person); try { foreach (SavingEvent savingEvent in savingEvents) { messagingService.SendNotification(savingEvent, _loan.CompulsorySavings, "LoanDisburstment"); } } catch (Exception exc) { new frmShowError(CustomExceptionHandler.ShowExceptionText(exc)).ShowDialog(); } } else { throw new OpenCbsSavingException(OpenCbsSavingExceptionEnum.CompulsorySavingsContractIsNotActive); } } else { _loan = ServicesProvider.GetInstance().GetContractServices().Disburse(_loan, _newStartDate, _alignInstallmentsDatesOnRealDisbursmentDate, _disableFees, (PaymentMethod) cmbPaymentMethod.SelectedItem); } } catch (Exception ex) { _loan.Disbursed = false; new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } finally { Close(); } }
private void CD_sent() { try { string hist = ""; Loan loan = EncompassApplication.CurrentLoan; User user = EncompassApplication.CurrentUser; //Begin code added for STRY0575648 - 2 / 10 / 21 LB if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.1"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } else if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.2"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.2"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } else if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.2"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.3"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.3"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } else if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } else if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS3"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS3"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } loan.Fields["CX.BROCOMP.COC.REASON.1"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.2"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.3"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.4"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.5"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.6"].Value = ""; loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASONS"].Value = ""; if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ1"); } else if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ2"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ2"); } else if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ2"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ3"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ3"); } //End code added for STRY0575648 for (int i = 0; i < commentBoxList.Count; i++) { if (loan.Fields[commentBoxList[i]].FormattedValue == "") { loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].FormattedValue; loan.Fields[dSpeciaList[i]].Value = loan.Fields["CX.REDISC.ASSIGNED"].Value; if (loan.Fields["CX.LN.HISTORY"].FormattedValue == "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.REDISC.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value); Macro.SetField("CX.LN.HISTORY", hist); } if (loan.Fields["CX.LN.HISTORY"].FormattedValue != "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.REDISC.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value + " " + "\n" + "\n" + Macro.GetField("CX.LN.HISTORY")); Macro.SetField("CX.LN.HISTORY", hist); loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].Value; loan.Fields["CX.REDISC.COMMENTS.VAR"].Value = ""; } break; } } Macro.SetField("CX.CD.COC.SENT.DATE.TIME", DateTime.Now.ToString()); Macro.SetField("CX.REDISC.COPY", "Y"); Macro.SetField("cx.redisc.data", "Data"); Macro.SetField("CX.redisc.completed.date", DateTime.Today.ToString()); Macro.CopyField("CX.REDISC.ASSIGNED", "CX.REDISC.COMPLETED.USER"); Macro.SetField("CX.HELOC", "N"); Macro.CopyField("1041", "cx.redisc.1041"); Macro.CopyField("1172", "cx.redisc.1172"); Macro.CopyField("1109", "cx.redisc.1109"); Macro.CopyField("1550", "cx.redisc.1550"); Macro.CopyField("19", "cx.redisc.19"); Macro.CopyField("1811", "cx.redisc.1811"); Macro.CopyField("337", "cx.redisc.337"); Macro.CopyField("353", "cx.redisc.353"); Macro.CopyField("4", "cx.redisc.4"); Macro.CopyField("428", "cx.redisc.428"); Macro.CopyField("688", "cx.redisc.688"); Macro.CopyField("NEWHUD.X686", "cx.redisc.NEWHUD.X686"); Macro.CopyField("NEWHUD.X687", "cx.redisc.NEWHUD.X687"); Macro.CopyField("VASUMM.X23", "cx.redisc.VASUMM.X23"); Macro.CopyField("1050", "cx.redisc.1050"); Macro.CopyField("2", "cx.redisc.2"); Macro.CopyField("3", "cx.redisc.3"); Macro.CopyField("640", "cx.redisc.640"); Macro.CopyField("762", "cx.redisc.762"); Macro.CopyField("1199", "cx.redisc.1199"); Macro.CopyField("1198", "cx.redisc.1198"); Macro.CopyField("14", "cx.redisc.14"); Macro.CopyField("16", "cx.redisc.16"); Macro.CopyField("356", "cx.redisc.356"); Macro.CopyField("NEWHUD.X1165", "cx.redisc.newhud.x1165"); Macro.CopyField("NEWHUD.X1149", "cx.redisc.newhud.x1149"); Macro.CopyField("976", "cx.redisc.976"); Macro.CopyField("casasrn.x168", "cx.redisc.casasrn.x168"); Macro.CopyField("1766", "cx.redisc.1766"); Macro.CopyField("1072", "cx.redisc.1072"); Macro.CopyField("454", "cx.redisc.454"); Macro.CopyField("439", "cx.redisc.439"); Macro.CopyField("3533", "cx.redisc.3533"); Macro.CopyField("NEWHUD.X1144", "CX.REDISC.NEWHUD.X1144"); Macro.CopyField("CX.SSP.DIDSHOP.PROC", "CX.RD.SSP.DIDSHOP.PROC"); Macro.CopyField("CX.SSP.DIDSHOP", "CX.RD.SSP.DIDSHOP"); //wipe the CD COC Data - bring in CD CoC data Macro.SetFieldNoRules("CX.RD.CK.1041", ""); Macro.SetFieldNoRules("CX.RD.CK.1172", ""); Macro.SetFieldNoRules("CX.RD.CK.19", ""); Macro.SetFieldNoRules("CX.RD.CK.1811", ""); Macro.SetFieldNoRules("CX.RD.CK.16", ""); Macro.SetFieldNoRules("CX.RD.CK.1109", ""); Macro.SetFieldNoRules("CX.RD.CK.2", ""); Macro.SetFieldNoRules("CX.RD.CK.353", ""); Macro.SetFieldNoRules("CX.RD.CK.976", ""); Macro.SetFieldNoRules("CX.RD.CK.VASUMM.X23", ""); Macro.SetFieldNoRules("CX.RD.CK.4", ""); Macro.SetFieldNoRules("CX.RD.CK.3", ""); Macro.SetFieldNoRules("CX.RD.CK.428", ""); Macro.SetFieldNoRules("CX.RD.CK.CASASRN.X168", ""); Macro.SetFieldNoRules("CX.RD.CK.356", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1165", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1149", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1144", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X686", ""); Macro.SetFieldNoRules("CX.RD.CK.454", ""); Macro.SetFieldNoRules("CX.RD.CK.439", ""); Macro.SetFieldNoRules("CX.RD.CK.640", ""); Macro.SetFieldNoRules("CX.RD.CK.762", ""); Macro.SetFieldNoRules("CX.RD.CK.337", ""); Macro.SetFieldNoRules("CX.RD.CK.1199", ""); Macro.SetFieldNoRules("CX.RD.CK.1766", ""); Macro.SetFieldNoRules("CX.RD.CK.1198", ""); Macro.SetFieldNoRules("CX.RD.CK.1050", ""); Macro.SetFieldNoRules("CX.RD.CK.1550", ""); Macro.SetFieldNoRules("CX.RD.CK.688", ""); Macro.SetFieldNoRules("CX.RD.CK.3533", ""); Macro.SetFieldNoRules("CX.RD.CK.14", ""); Macro.SetFieldNoRules("CX.RD.CK.799", ""); Macro.SetFieldNoRules("CX.RD.CK.136", ""); Macro.SetFieldNoRules("CX.RD.CK.SSP.DIDSHOP", ""); Macro.SetFieldNoRules("CX.RD.COC.COMMENTS", ""); Macro.SetFieldNoRules("CX.RD.COC.REASONS", ""); Macro.SetFieldNoRules("CX.COC.REASON.1", ""); Macro.SetFieldNoRules("CX.COC.REASON.2", ""); Macro.SetFieldNoRules("CX.COC.REASON.3", ""); Macro.SetFieldNoRules("CX.COC.REASON.4", ""); Macro.SetFieldNoRules("CX.COC.REASON.5", ""); Macro.SetFieldNoRules("CX.COC.REASON.6", ""); Macro.SetFieldNoRules("CX.COC.REASON.7", ""); Macro.SetFieldNoRules("CX.COC.REASON.8", ""); Macro.SetFieldNoRules("CX.RD.CURRENT.DATA", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.DATE", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.USER", ""); Macro.SetField("CX.RD.FLOAT.TO.LOCK.IND", ""); //Macro.SetField("CX.3154.REDISC", DateTime.Now.ToString()); if (loan.Fields["CX.REDISC.ALERT"].FormattedValue == "Y") { for (int x = 0; x < alertList.Count; x++) { if (loan.Fields[alertList[x]].Value.ToString() == "") { Macro.CopyField("CX.REDISC.ALERT.REDISC", alertList[x]); Macro.CopyField("CX.REDISC.COMPLETED.DATE", resolveList[x]); Macro.CopyField("CX.REDISC.ASSIGNED", whoList[x]); loan.Fields[cocList[x]].Value = loan.Fields["CX.CD.COC.ALL.REASONS"].Value; Macro.SetField(docList[x], "CD"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procList[x]); Macro.CopyField("LoanTeamMember.Name.Closer", closerList[x]); break; } } } if ((loan.Fields["CX.REDISC.ALERT"].FormattedValue != "Y" & loan.Fields["CD1.X61"].FormattedValue == "Y") || loan.Fields["Cx.redisc.alert2"].FormattedValue == "Y") { for (int y = 0; y < alertList.Count; y++) { if (loan.Fields[alertList[y]].Value.ToString() == "") { Macro.SetField(alertList[y], DateTime.Now.ToString("yyyy-MM-dd H:mm:ss")); Macro.CopyField("CX.REDISC.COMPLETED.DATE", resolveList[y]); Macro.CopyField("CX.REDISC.ASSIGNED", whoList[y]); loan.Fields[cocList[y]].Value = loan.Fields["CX.CD.COC.ALL.REASONS"].Value; Macro.SetField(docList[y], "CD"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procList[y]); Macro.CopyField("LoanTeamMember.Name.Closer", closerList[y]); break; } } } Macro.SetField("CX.REDISC.Alert", "N"); Macro.SetField("CX.REDISC.Alert2", "N"); Macro.SetField("CX.REDISC.ALERT.DATE", ""); Macro.SetField("CX.redisc.closer.req.user", ""); Macro.SetField("CX.redisc.closer.req.date", ""); Macro.SetField("CX.CD.REDISC.COMMENTS", ""); Macro.SetField("CX.redisc.assigned", ""); Macro.SetField("CX.redisc.notes", ""); Macro.SetField("CX.redisc.notes.yn", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.DATE", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.USER", ""); //Added for STRY0237058 if (loan.Fields["CX.REDISC.COMPLETED"].Value.ToString() == "X") { Macro.SetFieldNoRules("CX.REDISC.COMPLETED", ""); Macro.SetFieldNoRules("CX.REDISC.COMPLETED.DATE", ""); Macro.SetFieldNoRules("CX.REDISC.COMPLETED.USER", ""); } Macro.SetFieldNoRules("CX.REDISC.ALERT.ACTIVATED.BY", ""); Macro.SetFieldNoRules("CX.REDISC.FIRST.ALERT.DATE", ""); Macro.SetFieldNoRules("CX.REDISC.DUE.BY", ""); loan.Fields["CX.REDISC.CD"].Value = ""; loan.Fields["CX.DATA.CHANGE.PENDING.1"].Value = ""; } catch (Exception) { MessageBox.Show("Something went wrong with computing of CD Data"); } }
protected override double RiskAmountFor(Loan loan) { return(loan.OutstandingRiskAmount()); }
private void LE_Sent() { try { string hist = ""; Loan loan = EncompassApplication.CurrentLoan; User user = EncompassApplication.CurrentUser; //Begin code added for STRY0575648 - 2 / 10 / 21 LB if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.1"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } else if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.2"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.2"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } else if (loan.Fields["CX.BROCOMP.COC.REQ.1"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.2"].Value != null & loan.Fields["CX.BROCOMP.COC.REQ.3"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.COC.REQ.3"].Value = loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value; } if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } else if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } else if (loan.Fields["CX.BROCOMP.REQ.REASONS1"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS2"].Value != null & loan.Fields["CX.BROCOMP.REQ.REASONS3"].Value == null & loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value != null) { loan.Fields["CX.BROCOMP.REQ.REASONS3"].Value = loan.Fields["CX.BROCOMP.COC.REASONS"].Value; } loan.Fields["CX.BROCOMP.COC.REASON.1"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.2"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.3"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.4"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.5"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASON.6"].Value = ""; loan.Fields["CX.BROCOMP.COC.EXPLAIN"].Value = ""; loan.Fields["CX.BROCOMP.COC.REASONS"].Value = ""; if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ1"); } else if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ2"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ2"); } else if (loan.Fields["CX.BROCOMP.REDUCED.REQ1"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ2"].Value.ToString() != "" & loan.Fields["CX.BROCOMP.REDUCED.REQ3"].Value.ToString() == "") { Macro.CopyField("CX.BROCOMP.REDUCED.AMOUNT", "CX.BROCOMP.REDUCED.REQ3"); } //End code added for STRY0575648 for (int i = 0; i < commentBoxList.Count; i++) { if (loan.Fields[commentBoxList[i]].FormattedValue == "") { loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].FormattedValue; loan.Fields[dSpeciaList[i]].Value = loan.Fields["CX.REDISC.ASSIGNED"].Value; if (loan.Fields["CX.LN.HISTORY"].FormattedValue == "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.REDISC.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value); Macro.SetField("CX.LN.HISTORY", hist); } if (loan.Fields["CX.LN.HISTORY"].FormattedValue != "") { hist = (user + " " + DateTime.Now + " - " + "\n" + Macro.GetField("CX.REDISC.ASSIGNED") + "\n" + loan.Fields["CX.REDISC.COMMENTS.VAR"].Value + " " + "\n" + "\n" + Macro.GetField("CX.LN.HISTORY")); Macro.SetField("CX.LN.HISTORY", hist); loan.Fields[commentBoxList[i]].Value = loan.Fields["CX.REDISC.COMMENTS.VAR"].Value; loan.Fields["CX.REDISC.COMMENTS.VAR"].Value = ""; } break; } } Macro.SetField("CX.REDISC.DATA", "Data"); Macro.SetField("CX.REDISC.COMPLETED.DATE", DateTime.Today.ToString()); Macro.CopyField("CX.REDISC.ASSIGNED", "CX.REDISC.COMPLETED.USER"); Macro.SetField("CX.HELOC", "N"); Macro.CopyField("1041", "CX.REDISC.1041"); Macro.CopyField("1172", "CX.REDISC.1172"); Macro.CopyField("1109", "CX.REDISC.1109"); Macro.CopyField("1550", "CX.REDISC.1550"); Macro.CopyField("19", "CX.REDISC.19"); Macro.CopyField("1811", "CX.REDISC.1811"); Macro.CopyField("337", "CX.REDISC.337"); Macro.CopyField("353", "CX.REDISC.353"); Macro.CopyField("4", "CX.REDISC.4"); Macro.CopyField("640", "CX.REDISC.640"); Macro.CopyField("428", "CX.REDISC.428"); Macro.CopyField("688", "CX.REDISC.688"); Macro.CopyField("NEWHUD.X686", "CX.REDISC.NEWHUD.X686"); Macro.CopyField("NEWHUD.X687", "CX.REDISC.NEWHUD.X687"); Macro.CopyField("VASUMM.X23", "CX.REDISC.VASUMM.X23"); Macro.CopyField("1050", "CX.REDISC.1050"); Macro.CopyField("2", "CX.REDISC.2"); Macro.CopyField("3", "CX.REDISC.3"); Macro.CopyField("762", "CX.REDISC.762"); Macro.CopyField("1199", "CX.REDISC.1199"); Macro.CopyField("1198", "CX.REDISC.1198"); Macro.CopyField("14", "CX.REDISC.14"); Macro.CopyField("16", "CX.REDISC.16"); Macro.CopyField("356", "CX.REDISC.356"); Macro.CopyField("NEWHUD.X1165", "CX.REDISC.NEWHUD.X1165"); Macro.CopyField("NEWHUD.X1149", "CX.REDISC.NEWHUD.X1149"); Macro.CopyField("976", "CX.REDISC.976"); Macro.CopyField("CASASRN.x168", "CX.REDISC.CASASRN.X168"); Macro.CopyField("1766", "CX.REDISC.1766"); // Macro.CopyField("799", "3121") Macro.CopyField("454", "CX.REDISC.454"); Macro.CopyField("439", "CX.REDISC.439"); Macro.CopyField("3533", "CX.REDISC.3533"); Macro.CopyField("NEWHUD.X1144", "CX.REDISC.NEWHUD.X1144"); Macro.CopyField("CX.SSP.DIDSHOP.PROC", "CX.RD.SSP.DIDSHOP.PROC"); Macro.CopyField("CX.SSP.DIDSHOP", "CX.RD.SSP.DIDSHOP"); Macro.SetField("CX.3154.REDISC", DateTime.Now.ToString()); Macro.SetFieldNoRules("CX.RD.CK.1041", ""); Macro.SetFieldNoRules("CX.RD.CK.1172", ""); Macro.SetFieldNoRules("CX.RD.CK.19", ""); Macro.SetFieldNoRules("CX.RD.CK.1811", ""); Macro.SetFieldNoRules("CX.RD.CK.16", ""); Macro.SetFieldNoRules("CX.RD.CK.1109", ""); Macro.SetFieldNoRules("CX.RD.CK.2", ""); Macro.SetFieldNoRules("CX.RD.CK.353", ""); Macro.SetFieldNoRules("CX.RD.CK.976", ""); Macro.SetFieldNoRules("CX.RD.CK.VASUMM.X23", ""); Macro.SetFieldNoRules("CX.RD.CK.4", ""); Macro.SetFieldNoRules("CX.RD.CK.3", ""); Macro.SetFieldNoRules("CX.RD.CK.428", ""); Macro.SetFieldNoRules("CX.RD.CK.CASASRN.X168", ""); Macro.SetFieldNoRules("CX.RD.CK.356", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1165", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1149", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X1144", ""); Macro.SetFieldNoRules("CX.RD.CK.NEWHUD.X686", ""); Macro.SetFieldNoRules("CX.RD.CK.454", ""); Macro.SetFieldNoRules("CX.RD.CK.439", ""); Macro.SetFieldNoRules("CX.RD.CK.640", ""); Macro.SetFieldNoRules("CX.RD.CK.762", ""); Macro.SetFieldNoRules("CX.RD.CK.337", ""); Macro.SetFieldNoRules("CX.RD.CK.1199", ""); Macro.SetFieldNoRules("CX.RD.CK.1766", ""); Macro.SetFieldNoRules("CX.RD.CK.1198", ""); Macro.SetFieldNoRules("CX.RD.CK.1050", ""); Macro.SetFieldNoRules("CX.RD.CK.1550", ""); Macro.SetFieldNoRules("CX.RD.CK.688", ""); Macro.SetFieldNoRules("CX.RD.CK.3533", ""); Macro.SetFieldNoRules("CX.RD.CK.14", ""); Macro.SetFieldNoRules("CX.RD.CK.799", ""); Macro.SetFieldNoRules("CX.RD.CK.136", ""); Macro.SetFieldNoRules("CX.RD.CK.SSP.DIDSHOP", ""); Macro.SetFieldNoRules("CX.RD.COC.COMMENTS", ""); Macro.SetFieldNoRules("CX.RD.COC.REASONS", ""); Macro.SetFieldNoRules("CX.COC.REASON.1", ""); Macro.SetFieldNoRules("CX.COC.REASON.2", ""); Macro.SetFieldNoRules("CX.COC.REASON.3", ""); Macro.SetFieldNoRules("CX.COC.REASON.4", ""); Macro.SetFieldNoRules("CX.COC.REASON.5", ""); Macro.SetFieldNoRules("CX.COC.REASON.6", ""); Macro.SetFieldNoRules("CX.COC.REASON.7", ""); Macro.SetFieldNoRules("CX.COC.REASON.8", ""); Macro.SetFieldNoRules("CX.RD.CURRENT.DATA", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.DATE", ""); Macro.SetFieldNoRules("CX.COC.RUSH.REQUEST.USER", ""); Macro.SetField("CX.RD.FLOAT.TO.LOCK.IND", ""); //MessageBox.Show(loan.Fields["CX.REDISC.LE.HIST.COMM"].Value.ToString()); if (loan.Fields["CX.REDISC.ALERT"].FormattedValue == "Y") { for (int x = 0; x < alertList.Count; x++) { if (loan.Fields[alertList[x]].Value.ToString() == "") { Macro.CopyField("CX.REDISC.ALERT.REDISC", alertList[x]); Macro.CopyField("CX.REDISC.COMPLETED.DATE", resolveList[x]); Macro.CopyField("CX.REDISC.ASSIGNED", whoList[x]); loan.Fields[cocList[x]].Value = loan.Fields["CX.REDISC.LE.HIST.COMM"].Value; Macro.SetField(docList[x], "LE"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procList[x]); Macro.CopyField("LoanTeamMember.Name.Closer", closerList[x]); break; } } } if (loan.Fields["CX.REDISC.ALERT"].FormattedValue != "Y") { for (int y = 0; y < alertList.Count; y++) { if (loan.Fields[alertList[y]].Value.ToString() == "") { Macro.SetField(alertList[y], DateTime.Now.ToString("yyyy-MM-dd H:mm:ss")); Macro.CopyField("CX.REDISC.COMPLETED.DATE", resolveList[y]); Macro.CopyField("CX.REDISC.ASSIGNED", whoList[y]); loan.Fields[cocList[y]].Value = loan.Fields["CX.REDISC.LE.HIST.COMM"].Value; Macro.SetField(docList[y], "LE"); Macro.CopyField("LoanTeamMember.Name.Loan Processor", procList[y]); Macro.CopyField("LoanTeamMember.Name.Closer", closerList[y]); break; } } } Macro.SetField("CX.REDISC.ALERT", "N"); Macro.SetField("CX.REDISC.ALERT2", "N"); Macro.SetField("CX.REDISC.ALERT.DATE", null); Macro.SetField("CX.REDISC.ASSIGNED", ""); Macro.SetField("CX.REDISC.NOTES", ""); Macro.SetField("CX.REDISC.NOTES.YN", ""); Macro.SetField("CX.REDISC.COMMENTS", ""); Macro.SetField("CX.REDISC.BORR.ADD.REM", ""); Macro.SetField("CX.REDISC.FEE.OVER.TOL", ""); Macro.SetField("CX.REDISC.LOCK.EVENT", ""); Macro.SetField("CX.REDISC.MTG.INS", ""); Macro.SetField("CX.REDISC.LOAN.PROGRAM", ""); Macro.SetField("CX.REDISC.DISC.PTS", ""); Macro.SetField("CX.REDISC.LOAN.TERM", ""); Macro.SetField("CX.REDISC.PMI.MIP.CHANGE", ""); Macro.SetField("CX.REDISC.LA.CHANGE", ""); Macro.SetField("CX.REDISC.APR.CHANGE", ""); Macro.SetField("CX.REDISC.PERSON.TITLE", ""); Macro.SetField("CX.REDISC.STATE.FORMS", ""); Macro.SetField("CX.REDISC.ESCROW.ADD.REM", ""); Macro.SetField("CX.REDISC.TITLE.ISSUE", ""); Macro.SetField("CX.REDISC.OTHER", ""); Macro.SetField("CX.REDISC.OTHER.COMMENT", ""); Macro.SetField("CX.REDISC.FULL", ""); Macro.SetField("CX.REDISC.BORROWER", ""); Macro.SetField("CX.REDISC.BORR.REQ", ""); Macro.SetField("CX.REDISC.MEET.BEAT", ""); Macro.SetField("CX.REDISC.LOAN.PARAMETERS", ""); Macro.SetField("CX.REDISC.NO.COC", ""); Macro.SetField("CX.REDISC.NOT.COMPLETED", ""); Macro.SetField("CX.REDISC.NOT.COMPLETED.DATE", ""); Macro.SetField("CX.RD.BORR", ""); Macro.SetField("CX.RD.FEE", ""); Macro.SetField("CX.RD.LOCK", ""); Macro.SetField("CX.RD.LOANPROG", ""); Macro.SetField("CX.RD.DISCPTS", ""); Macro.SetField("CX.RD.LOANTERM", ""); Macro.SetField("CX.RD.LOANAMT", ""); Macro.SetField("CX.RD.APR", ""); Macro.SetField("CX.RD.STATE", ""); Macro.SetField("CX.RD.OTHER", ""); Macro.SetField("CX.REDISC.PROC.REQ.USER", ""); Macro.SetField("CX.REDISC.PROC.REQ.DATE", ""); loan.Fields["CX.REDISC.LE"].Value = ""; if (loan.Fields["CX.REDISC.COMPLETED"].Value.ToString() == "X") { Macro.SetField("CX.REDISC.COMPLETED", ""); Macro.SetField("CX.REDISC.COMPLETED.DATE", ""); Macro.SetField("CX.REDISC.COMPLETED.USER", ""); } loan.Fields["CX.REDISC.ALERT.ACTIVATED.BY"].Value = ""; loan.Fields["CX.REDISC.FIRST.ALERT.DATE"].Value = ""; loan.Fields["CX.REDISC.DUE.BY"].Value = ""; loan.Fields["CX.DATA.CHANGE.PENDING.1"].Value = ""; } catch (Exception) { MessageBox.Show("Something went wrong with computing data for LE disclosure"); } }
private double UnusedRiskFactorFor(Loan loan) { return(UnusedRiskFactors.GetFactors().ForRating(loan.GetRiskRating())); }