Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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;
            }
        }