예제 #1
0
        private void btnMembresia_Click(object sender, EventArgs e)
        {
            Form formEspera = new FormEspera();

            formEspera.Show();
            try
            {
                Queries.transactionBegin();

                AportacionDetalle detalle = new AportacionDetalle(asociado, "Abono inicial", asociado.fechaIngreso, 10);
                detalle.insert();

                Reportes.comprobanteAportacion(asociado, detalle);
                formEspera.Close();
                Reportes.abrirCarpeta();


                Queries.transactionCommit();
            }
            catch (Exception ex)
            {
                formEspera.Close();
                Queries.transactionRollback();
            }
        }
예제 #2
0
        private void btnContraorden_Click(object sender, EventArgs e)
        {
            Form formEspera = new FormEspera();

            formEspera.Show();

            Reportes.contraorden(ahorro.asociado, ahorro);

            formEspera.Close();
            Reportes.abrirCarpeta();
        }
예제 #3
0
        private void btnGenerar_Click(object sender, EventArgs e)
        {
            Form formEspera = new FormEspera();

            formEspera.Show();

            Reportes.pagosDiariosCredito(dtpFecha.Value);
            Reportes.abrirCarpeta();

            formEspera.Close();
            this.Close();
        }
예제 #4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            int m = dtpFecha.Value.monthsSince(credito.fechaUltimoPago);

            if (credito.detallesPago.Count == 0)
            {
                m++;
            }

            Form formEspera = new FormEspera();

            formEspera.Show();

            try
            {
                Queries.transactionBegin();

                if (m == 0)
                {
                    credito.insertDetalle(nudMonto.Value, 0, 0, dtpFecha.Value);
                    this.Close();
                }
                else if (nudMonto.Value >= m * (credito.cuota_social + credito.aportacion))
                {
                    credito.insertDetalle(nudMonto.Value, credito.aportacion * m, credito.cuota_social * m, dtpFecha.Value);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("El monto pagado es menor de lo que se debe en concepto de cuota social y aportación", "Pago insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                formEspera.Close();
                Queries.transactionCommit();
            }
            catch (Exception ex)
            {
                formEspera.Close();
                Queries.transactionRollback();
            }
        }
// ########################################################################################
// #################           Guardar la nueva aportación         ########################
// ########################################################################################

        private void btnIngresar_Click(object sender, EventArgs e)
        {
            if (cmbAsociados.SelectedIndex < 0)
            {
                MessageBox.Show("Seleccione un asociado", "Error en la entrada de datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (numMonto.Value <= 0)
            {
                MessageBox.Show("El monto de la aportación debe ser mayor que 0", "Error en la entrada de datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Form formEspera = new FormEspera();
                formEspera.Show();
                try
                {
                    Queries.transactionBegin();

                    Asociado          asociado = (Asociado)(cmbAsociados.SelectedItem as ComboBoxItem).Value;
                    AportacionDetalle detalle  = new AportacionDetalle(asociado, "Abono personal", dtpFecha.Value, numMonto.Value);
                    detalle.insert();

                    Reportes.comprobanteAportacion(asociado, detalle);
                    formEspera.Close();
                    Reportes.abrirCarpeta();


                    Queries.transactionCommit();
                    this.Close();
                }
                catch (Exception ex)
                {
                    formEspera.Close();
                    Queries.transactionRollback();
                }
            }
        }
예제 #6
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Form formEspera = new FormEspera();

            formEspera.Show();

            string tipo = btnAbono.Checked ? "Abono" : "Retiro";

            AhorroDetalle detalle = ahorro.insertDetalle(tipo, nudMonto.Value, dtpFecha.Value);

            Reportes.comprobanteMovimiento(ahorro.asociado, ahorro, detalle);

            formEspera.Close();
            this.Close();
        }
예제 #7
0
        //Guardar el crédito.
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (cmbAsociado.SelectedIndex == -1)
            {
                MessageBox.Show("Seleccione un asociado", "Error en la entrada de datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if (String.IsNullOrEmpty(credito.tipo))
            {
                MessageBox.Show("Seleccione un tipo de crédito", "Error en la entrada de datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else if (String.IsNullOrEmpty(credito.forma_pago))
            {
                MessageBox.Show("Seleccione una forma de pago", "Error en la entrada de datos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                //Asociado.
                Asociado asociado = (Asociado)(cmbAsociado.SelectedItem as ComboBoxItem).Value;
                credito.idAsociado = asociado.id;

                //Descuentos del crédito.
                credito.creditoDescuento.escrituracion = credito.monto * 0.01M;
                if (credito.creditoDescuento.escrituracion < 10)
                {
                    credito.creditoDescuento.escrituracion = 10;
                }

                int mult = (int)Math.Ceiling(credito.monto / 800);
                credito.creditoDescuento.seguro = 12 * mult;

                credito.creditoDescuento.papeleria = credito.monto * 0.03M;

                //Otros datos del crédito (no asignados todavia).
                credito.cuota = nudCuota.Value;
                credito.fecha = dtpFecha.Value;
                credito.garantia_aportacion = ckbGarantiaAportacion.Checked;

                Form formEspera = new FormEspera();
                formEspera.Show();
                try
                {
                    Queries.transactionBegin();

                    credito.insert();

                    if (ckbCuotaIngreso.Checked)
                    {
                        AportacionDetalle detalle = new AportacionDetalle(asociado, "Abono inicial", credito.fecha, 10);
                        detalle.insert();
                    }

                    switch (credito.tipo)
                    {
                    case ("Consumo"):
                        TiposCorrelativo.CreditoConsumo.update();
                        break;

                    case ("Comercio"):
                        TiposCorrelativo.CreditoComercio.update();
                        break;

                    case ("Servicio"):
                        TiposCorrelativo.CreditoServicio.update();
                        break;

                    case ("Vivienda"):
                        TiposCorrelativo.CreditoVivienda.update();
                        break;

                    case ("Sobre deposito a plazo"):
                        TiposCorrelativo.CreditoDeposito.update();
                        break;

                    case ("Liquidez o rotativo"):
                        TiposCorrelativo.CreditoRotativo.update();
                        break;

                    default:
                        MessageBox.Show("1");
                        break;
                    }

                    // #### Creación de reportes del crédito ####
                    credito.asociado = AsociadoServicio.selectParcial(credito.idAsociado);

                    //Reportes.cartaAprobacion(credito.asociado, credito);
                    //Reportes.hojaLiquidacion(credito.asociado, credito);
                    //Reportes.mutuo(credito.asociado, credito);
                    //if (credito.forma_pago == "Orden de descuento")
                    //    Reportes.ordenDescuento(credito.asociado, credito);
                    //Reportes.proyeccionPagos(credito.asociado, credito);

                    Queries.transactionCommit();

                    formEspera.Close();
                    //Reportes.abrirCarpeta();
                    this.Close();
                }
                catch (Exception ex)
                {
                    formEspera.Close();
                    Queries.transactionRollback();

                    MessageBox.Show(ex.Message);
                    MessageBox.Show(ex.StackTrace);
                }
            }
        }
예제 #8
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (cmbAsociados.SelectedIndex != -1 && cmbPlan.SelectedIndex != -1 && ahorro.beneficiarios != null && (!cmbFormaPago.Enabled || cmbFormaPago.SelectedIndex != -1))
            {
                Form formEspera = new FormEspera();
                formEspera.Show();

                try
                {
                    Queries.transactionBegin();

                    Asociado asociado = (Asociado)(cmbAsociados.SelectedItem as ComboBoxItem).Value;
                    asociado = AsociadoServicio.selectParcial(asociado.id);

                    ahorro.idAsociado = asociado.id;
                    ahorro.fecha      = dtpFecha.Value;
                    ahorro.interes    = (byte)nudTasa.Value;

                    if (ahorro.tipo == "Depósito a plazo")
                    {
                        AhorroPlazo ahorroPlazo = new AhorroPlazo();

                        ahorroPlazo.montoInicial = nudMonto.Value;
                        ahorroPlazo.plazo        = (byte)nudPlazo.Value;
                        ahorroPlazo.extendido    = 1;
                        ahorroPlazo.codigoCuenta = cmbFormaPago.SelectedItem.ToString();

                        ahorro.ahorroPlazo = ahorroPlazo;
                    }

                    if (ahorro.tipo == "Programado")
                    {
                        AhorroProgramado ahorroProgramado = new AhorroProgramado();

                        ahorroProgramado.cuota     = nudMonto.Value;
                        ahorroProgramado.formaPago = cmbFormaPago.SelectedItem.ToString();
                        ahorroProgramado.plazo     = (byte)nudPlazo.Value;
                        ahorroProgramado.extendido = 1;

                        ahorro.ahorroProgramado = ahorroProgramado;
                    }

                    ahorro.insert();

                    switch (ahorro.tipo)
                    {
                    case "Corriente":
                        TiposCorrelativo.AhorroCorriente.update();
                        Reportes.contratoAhorroCorriente(asociado, ahorro);
                        break;

                    case "Depósito a plazo":
                        TiposCorrelativo.AhorroPlazo.update();
                        Reportes.certificado(asociado, ahorro);
                        break;

                    case "Programado":
                        TiposCorrelativo.AhorroProgramado.update();
                        Reportes.contratoAhorroProgramado(asociado, ahorro);
                        if (ahorro.ahorroProgramado.formaPago == "Orden de descuento")
                        {
                            Reportes.ordenDescuento(asociado, ahorro);
                        }
                        break;
                    }

                    Queries.transactionCommit();

                    formEspera.Close();

                    Reportes.abrirCarpeta();
                    this.Close();
                }
                catch (Exception ex)
                {
                    formEspera.Close();

                    Queries.transactionRollback();
                    MessageBox.Show(ex.Message);
                    MessageBox.Show(ex.StackTrace);
                }
            }
            else
            {
                MessageBox.Show("Debe completar los datos");
            }
        }