Ejemplo n.º 1
0
        public void GeneratingBankSlips()
        {
            List <int> installments = new List <int>();

            BCrediTest.Viewmodels.ContractDetailViewModel contractDetail = _bLContract.GetContractDetail("123");


            installments = contractDetail.DelayedInstallments.Select(x => x.InstallmentId).ToList();

            BCrediTest.Viewmodels.BankSlipScheduleViewModel detailsToSchedule = _bLContract.GetDetailsToSchedule(installments);

            detailsToSchedule.FeeValue      = 5;
            detailsToSchedule.InterestValue = 1;

            detailsToSchedule.DueDate = DateTime.Now.AddDays(2);

            BankSlip bankSlip = _bLContract.CreateBankSlip(detailsToSchedule, "123");


            if (bankSlip != null)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
Ejemplo n.º 2
0
        public IActionResult CreateSlip(BankSlipScheduleViewModel bankslipSchedule)
        {
            string currentId = (TempData["currentId"]).ToString();
            var    data      = _blContract.GetContractDetail(currentId);

            if (bankslipSchedule.DueDate.Date < DateTime.Now.Date)
            {
                return(RedirectToAction("Details", new { id = currentId, success = false }));
            }


            BankSlip bl = _blContract.CreateBankSlip(bankslipSchedule, currentId);

            if (bl == null)
            {
                return(RedirectToAction("Details", new { id = currentId, success = false }));
            }

            return(RedirectToAction("Details", new { id = currentId }));
        }