Beispiel #1
0
        }         // RescheduleLoan

        public NLModelActionResult BuildLoanFromOffer(int?userID, int?customerID, NL_Model model)
        {
            ActionMetaData     amd      = null;
            BuildLoanFromOffer strategy = new BuildLoanFromOffer(model);

            try {
                amd = ExecuteSync(out strategy, customerID, userID, model);
                // ReSharper disable once CatchAllClause
            } catch (Exception e) {
                Log.Alert("BuildLoanFromOffer failed: {0}", e);
                strategy.Result.Error = "InternalServerError";
            }
            return(new NLModelActionResult()
            {
                MetaData = amd,
                Value = strategy.Result
            });
        }
Beispiel #2
0
		public void BuildLoanFromOffer() {
			NL_Model model = new NL_Model(1394) {
				UserID = 357,
				Loan = new NL_Loans()
			};
			model.Loan.Histories.Add(new NL_LoanHistory() { EventTime = DateTime.UtcNow });
			BuildLoanFromOffer strategy = new BuildLoanFromOffer(model);
			strategy.Context.UserID = model.UserID;
			try {
				strategy.Execute();
				//if (string.IsNullOrEmpty(strategy.Result.Error)) {
				//	this.m_oLog.Debug(strategy.Result.Offer);
				m_oLog.Debug(strategy.Result.Loan);
				//} else
				m_oLog.Debug("error: {0}", strategy.Result.Error);
			} catch (Exception ex) {
				Console.WriteLine(ex);
			}
		}
Beispiel #3
0
		public void CreateSchedule() {
			DateTime issueDate = DateTime.UtcNow; // new DateTime(2015, 12, 8, 19, 12, 00);
			NL_Model model = new NL_Model(1394) { UserID = 357, Loan = new NL_Loans() };
			model.Loan.Histories.Add(new NL_LoanHistory() { EventTime = issueDate });
			BuildLoanFromOffer strategy = new BuildLoanFromOffer(model);
			strategy.Execute();
			if (!string.IsNullOrEmpty(strategy.Error)) {
				m_oLog.Debug("error: {0}", strategy.Error);
				return;
			}
			model = strategy.Result;
			m_oLog.Debug("=================================={0}\n", model.Loan);
			try {
				ALoanCalculator calc = new LegacyLoanCalculator(model);
				calc.CreateSchedule();
				m_oLog.Debug("=================Calculator end================={0}\n", model.Loan);
			} catch (Exception exception) {
				m_oLog.Error("{0}", exception.Message);
			}
		}