public List<Installment> SimulateScheduleCreation(Loan loan) { try { if (loan.Product.ScriptName != null) return SimulateScriptSchedule(loan); var scheduleConfiguration = _configurationFactory .Init() .WithLoan(loan) .Finish() .GetConfiguration(); var scheduleBuilder = new ScheduleBuilder(); var installmentList = scheduleBuilder.BuildSchedule(scheduleConfiguration); //var schedule = Mapper.Map<IEnumerable<IInstallment>, List<Installment>>(installmentList); return installmentList; } catch (Exception ex) { MessageBox.Show(ex.Message); return null; } }
public List<Installment> SimulateScheduleCreation(Loan loan) { var scheduleConfiguration = _configurationFactory .Init() .WithLoan(loan) .Finish() .GetConfiguration(); var scheduleBuilder = new ScheduleBuilder(); var installmentList = scheduleBuilder.BuildSchedule(scheduleConfiguration); var schedule = Mapper.Map<IEnumerable<IInstallment>, List<Installment>>(installmentList); return schedule; }
public List<Installment> SimulateScheduleCreation(Loan loan) { try { if (loan.ScriptName != null) { var scheduleGenerator = ScheduleGenerators .Where(x => x.Metadata.ContainsKey("Implementation") && x.Metadata["Implementation"].ToString() == loan.ScriptName) .Select(x => x.Value) .FirstOrDefault(); return scheduleGenerator != null ? scheduleGenerator.GetSchedule(loan) : SimulateScriptSchedule(loan); } var scheduleConfiguration = _configurationFactory .Init() .WithLoan(loan) .Finish() .GetConfiguration(); var scheduleBuilder = new ScheduleBuilder(); var installmentList = scheduleBuilder.BuildSchedule(scheduleConfiguration); return installmentList; } catch (Exception ex) { MessageBox.Show(ex.Message); return null; } }