Esempio n. 1
0
		public void UpdateRolloverTest() {
			const int oldID = 5116;
			const int customerID = 385;
			DateTime now = DateTime.UtcNow;
			PaymentRolloverRepository rep = ObjectFactory.GetInstance<PaymentRolloverRepository>();
			var rollovers = rep.GetByLoanId(oldID);
			var paymentRollovers = rollovers as IList<PaymentRollover> ?? rollovers.ToList();
			//paymentRollovers.ForEach(rr => this.m_oLog.Debug(rr));
			var r = paymentRollovers.FirstOrDefault(rr => rr.ExpiryDate > now);
			m_oLog.Debug(r);
			if (r == null) {
				return;
			}

			var s = new GetLoanIDByOldID(oldID);
			s.Execute();
			GetLoanState state = new GetLoanState(customerID, s.LoanID, now, 1, false);
			state.Execute();

			NL_LoanRollovers nlr = state.Result.Loan.Rollovers.FirstOrDefault(nr => nr.CreationTime.Date == r.Created.Date && nr.ExpirationTime.Date == r.ExpiryDate);

			if (nlr == null)
				return;

			nlr.ExpirationTime = nlr.ExpirationTime.AddDays(4);

			m_oLog.Debug(nlr);

			SaveRollover saver = new SaveRollover(nlr, state.Result.Loan.LoanID);
			saver.Execute();
			m_oLog.Debug(saver.Error);
		}
Esempio n. 2
0
		public void GetLoanIDByOldID() {
			int oldLoanId = 1063;
			var strategy = new GetLoanIDByOldID(oldLoanId);
			strategy.Execute();

			m_oLog.Debug(strategy.Error);
			m_oLog.Debug(strategy.LoanID);
		}
Esempio n. 3
0
        public long GetLoanByOldID(int loanId, int customerID = 1, int userID = 1)
        {
            var stra = new GetLoanIDByOldID(loanId);

            stra.Context.CustomerID = customerID;
            stra.Context.UserID     = userID;
            stra.Execute();
            return(stra.LoanID);
        }
Esempio n. 4
0
        }         // GetLoanState

        public NLLongActionResult GetLoanByOldID(int oldId, int customerID = 1, int userID = 1)
        {
            GetLoanIDByOldID s = new GetLoanIDByOldID(oldId);

            s.Context.UserID     = userID;
            s.Context.CustomerID = customerID;
            var amd = ExecuteSync(out s, customerID, userID, oldId);

            return(new NLLongActionResult {
                MetaData = amd,
                Value = s.LoanID,
                Error = s.Error
            });
        }         // GetLoanByOldID