} // AddLoanLegals public NL_Offers GetLastOffer(int userID, int customerID) { GetLastOffer s = new GetLastOffer(customerID); s.Context.UserID = userID; s.Context.CustomerID = customerID; ExecuteSync(out s, customerID, userID, customerID); return(s.Offer); } // GetLastOffer
public void AddOffer() { GetLastOffer lastOfferstrategy = new GetLastOffer(374); lastOfferstrategy.Execute(); NL_Offers lastOffer = lastOfferstrategy.Offer; long crID = 337; long decisionID = 23; ICashRequestRepository crRep = ObjectFactory.GetInstance<CashRequestRepository>(); CashRequest oldCashRequest = crRep.Get(crID); lastOffer.DecisionID = decisionID; lastOffer.LoanSourceID = oldCashRequest.LoanSource.ID; lastOffer.LoanTypeID = oldCashRequest.LoanType.Id; lastOffer.RepaymentIntervalTypeID = (int)RepaymentIntervalTypes.Month; lastOffer.StartTime = (DateTime)oldCashRequest.OfferStart; lastOffer.EndTime = (DateTime)oldCashRequest.OfferValidUntil; lastOffer.RepaymentCount = oldCashRequest.ApprovedRepaymentPeriod ?? 0; lastOffer.Amount = (decimal)oldCashRequest.ManagerApprovedSum; lastOffer.MonthlyInterestRate = oldCashRequest.InterestRate; lastOffer.CreatedTime = DateTime.UtcNow; lastOffer.BrokerSetupFeePercent = oldCashRequest.BrokerSetupFeePercent; lastOffer.Notes = "bbb"; lastOffer.DiscountPlanID = oldCashRequest.DiscountPlan.Id; lastOffer.IsLoanTypeSelectionAllowed = oldCashRequest.IsLoanTypeSelectionAllowed == 1; lastOffer.SendEmailNotification = !oldCashRequest.EmailSendingBanned; lastOffer.IsRepaymentPeriodSelectionAllowed = oldCashRequest.IsCustomerRepaymentPeriodSelectionAllowed; lastOffer.IsAmountSelectionAllowed = true; // offer-fees NL_OfferFees setupFee = new NL_OfferFees() { LoanFeeTypeID = (int)NLFeeTypes.SetupFee, Percent = oldCashRequest.ManualSetupFeePercent, //OneTimePartPercent = 1, DistributedPartPercent = 0 // default }; if (oldCashRequest.SpreadSetupFee != null && oldCashRequest.SpreadSetupFee == true) { setupFee.LoanFeeTypeID = (int)NLFeeTypes.ServicingFee; setupFee.OneTimePartPercent = 0; setupFee.DistributedPartPercent = 1; } List<NL_OfferFees> offerFees = new List<NL_OfferFees>() { setupFee }; //this.m_oLog.Debug("NL: offer: {0}, offerFees: {1}" + "", lastOffer, offerFees); AddOffer offerStrategy = new AddOffer(lastOffer, offerFees); offerStrategy.Execute(); Console.WriteLine(offerStrategy.OfferID); Console.WriteLine(offerStrategy.Error); }