예제 #1
0
 public InquilinoController(IConfiguration configuration)
 {
     this.configuration = configuration;
     inmuebleData       = new InmuebleData(configuration);
     inquilinoData      = new InquilinoData(configuration);
     contratoData       = new ContratoData(configuration);
 }
예제 #2
0
 public ActionResult EditarContrato(Contrato contrato)
 {
     if (ModelState.IsValid)
     {
         ContratoData.EditaContrato(contrato);
     }
     return(RedirectToAction("ContratoIndex"));
 }
예제 #3
0
        public HomeController(ILogger <HomeController> logger, IConfiguration configuration)
        {
            _logger            = logger;
            this.configuration = configuration;

            contratoData = new ContratoData(configuration);
            inmuebleData = new InmuebleData(configuration);
            pagoData     = new PagoData(configuration);
        }
예제 #4
0
 public ImagenController(IConfiguration configuration, IWebHostEnvironment enviroment)
 {
     this.configuration = configuration;
     inmuebleData       = new InmuebleData(configuration);
     imagenData         = new ImagenData(configuration);
     contratoData       = new ContratoData(configuration);
     this.environment   = enviroment;
     e = new Estados();
 }
예제 #5
0
 public InmuebleController(IConfiguration configuration)
 {
     this.configuration = configuration;
     inmuebleData       = new InmuebleData(configuration);
     propietarioData    = new PropietarioData(configuration);
     contratoData       = new ContratoData(configuration);
     imagenData         = new ImagenData(configuration);
     e = new Estados();
 }
예제 #6
0
        public ActionResult CreaContrato([Bind(Include = "NumContrato,FechaInicio,FechaFinal,NombreEmpresa")] Contrato contrato)
        {
            if (ModelState.IsValid)
            {
                ContratoData.CreaContrato(contrato);
                return(RedirectToAction("ContratoIndex"));
            }

            return(View("Contrato"));
        }
예제 #7
0
        public ActionResult ContratoEdita(string numContrato)
        {
            Contrato contrato = ContratoData.traerContrato(int.Parse(numContrato));

            if (contrato == null)
            {
                HttpNotFound();
            }
            return(View(contrato));
        }
예제 #8
0
        public void Criar_contrato(ContratoData data)
        {
            var id       = Guid.NewGuid();
            var contrato = ContratoDeEmprestimoAggregate.CriarContrato(
                new ParametrosDeContratoDeEmprestimo
            {
                Id                   = id,
                ValorLiquido         = data.ValorLiquido,
                QuantidadeDeParcelas = data.Prazo,
                TaxaAoMes            = data.TaxaAoMes,
                Tac                  = data.Tac,
                Iof                  = data.Iof,
                DiasDeCarencia       = data.DiasDeCarencia
            });

            contrato.Id.Should().Be(id);
            contrato.TaxaAoDia.Should().BeEquivalentTo(new Percentual(data.TaxaAoDia));
            contrato.ValorCarencia.Should().BeEquivalentTo(new ValorMonetario(data.ValorCarencia));
            contrato.ValorFinanciado.Should().BeEquivalentTo(new ValorMonetario(data.ValorFinanciado));
            ValorMonetario.ToDecimal(contrato.ValorDaParcela)
            .Should()
            .BeApproximately(data.ValorDaParcela, PRECISION);
            contrato.Parcelas.Should().HaveCount(data.Prazo);

            foreach (var parcela in contrato.Parcelas)
            {
                var parcelaExpected = data.Parcelas.Single(p => p.Numero == parcela.Numero);

                ValorMonetario.ToDecimal(parcela.SaldoDevedorInicial)
                .Should()
                .BeApproximately(ValorMonetario.ToDecimal(parcelaExpected.SaldoDevedorInicial), PRECISION);

                ValorMonetario.ToDecimal(parcela.Valor)
                .Should()
                .BeApproximately(ValorMonetario.ToDecimal(parcelaExpected.Valor), PRECISION);

                ValorMonetario.ToDecimal(parcela.Principal)
                .Should()
                .BeApproximately(ValorMonetario.ToDecimal(parcelaExpected.Principal), PRECISION);

                ValorMonetario.ToDecimal(parcela.Juros)
                .Should()
                .BeApproximately(ValorMonetario.ToDecimal(parcelaExpected.Juros), PRECISION);

                ValorMonetario.ToDecimal(parcela.SaldoDevedorFinal)
                .Should()
                .BeApproximately(ValorMonetario.ToDecimal(parcelaExpected.SaldoDevedorFinal), PRECISION);
            }
        }
예제 #9
0
 public PagoController(IConfiguration configuration)
 {
     this.configuration = configuration;
     pagoData           = new PagoData(configuration);
     contratoData       = new ContratoData(configuration);
 }
예제 #10
0
        //**********************************//
        //      CÓDIGO CONTRATO             //
        //**********************************//

        public ActionResult ContratoIndex()
        {
            ViewBag.ListaContrato = ContratoData.ListContrato();
            return(View());
        }