示例#1
0
        public virtual void RowEnter(DataGridViewCellEventArgs e)
        {
            if (dgvGrilla.RowCount > 0)
            {
                _prestamo = (PrestamoDto)dgvGrilla.Rows[e.RowIndex].DataBoundItem;
            }

            IdComprobanteSeleccionado = _prestamo.PrestamoId;
            PersonaId = _prestamo.PersonaId;
        }
示例#2
0
        public virtual void RowEnter(DataGridViewCellEventArgs e)
        {
            if (dgvGrilla.RowCount > 0)
            {
                _prestamo = (PrestamoDto)dgvGrilla.Rows[e.RowIndex].DataBoundItem;
            }

            IdComprobanteSeleccionado = _prestamo.PrestamoId;
            PersonaId = _prestamo.PersonaId;
            //nudTotal.Value = _prestamo.TotalFinal;
            //nudInteres.Value = _prestamo.TasaInteres;
        }
示例#3
0
        public override bool EjecutarComandoNuevo()
        {
            if (string.IsNullOrEmpty(txtBusquedaCliente.Text))
            {
                MessageBox.Show("No Hay Ningun Cliente Seleccionado Por Favor Cargue Uno", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (string.IsNullOrEmpty(txtDescripcion.Text))
            {
                MessageBox.Show("Agregue una Descripcion", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (nudValorCuota.Value <= 0)
            {
                MessageBox.Show("No Ingreso Ningun Monto A Cobrar", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (MessageBox.Show("Esta Seguro De Realizar El Plan?...", "Stop", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                MessageBox.Show("Plan CANCELADO ...", "Cancelado", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(false);
            }

            var idpersona = _clienteServicio.ObtenerPorDni(txtDni.Text).Id;

            var nuevoPrestamo = new PrestamoDto
            {
                CantidadCuotas = 12,
                CodigoCredito  = txtCredito.Text,
                EstadoPrestamo = EstadoPrestamo.EnProceso,
                FechaInicio    = DateTime.Now,
                Notas          = txtNotas.Text,
                PersonaId      = idpersona,
                Descripcion    = txtDescripcion.Text
            };

            decimal valorCuotas = nudValorCuota.Value;

            prestamoServico.NuevoPrestamo(nuevoPrestamo);//creacion del prestamo

            var idprestamo = prestamoServico.TrerIdDelPrestamoPorFechaIinicio(nuevoPrestamo.FechaInicio);

            var cuota = new MiniGym.Cuota.Servicios.CuotaDto
            {
                ValorCuota = Math.Round(valorCuotas, 2),
                Saldo      = valorCuotas,
                PrestamoId = idprestamo
            };

            _CuotaServicio.CargarCuotas(12, cuota, dtpFechaPrestamo.Value);//creacion de las cuotas

            nudValorCuota.Value = 0;
            txtDescripcion.Text = $"{DateTime.Now.Year}";
            txtNotas.Text       = "";
            TraerCodigoCredito();

            return(true);
        }