コード例 #1
0
        public FormCreditoNuevo()
        {
            InitializeComponent();
            AsociadoServicio.fillComboBox(cmbAsociado);

            valoresIniciales();
        }
コード例 #2
0
        public FormAportacionNueva(String nombre)
        {
            InitializeComponent();
            AsociadoServicio.fillComboBox(cmbAsociados);

            cmbAsociados.Text    = nombre;
            cmbAsociados.Enabled = false;
        }
コード例 #3
0
        public FormCreditoNuevo(string nombre)
        {
            InitializeComponent();
            AsociadoServicio.fillComboBox(cmbAsociado);

            valoresIniciales();

            cmbAsociado.Text    = nombre;
            cmbAsociado.Enabled = false;
        }
コード例 #4
0
        public FormAhorroNuevo()
        {
            InitializeComponent();
            AsociadoServicio.fillComboBox(cmbAsociados);

            nudPlazo.Enabled     = false;
            nudTasa.Enabled      = false;
            nudMonto.Enabled     = false;
            cmbFormaPago.Enabled = false;

            ahorro = new Ahorro();
        }
コード例 #5
0
 private void tblAsociados_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         if (e.ColumnIndex == tblAsociados.Columns["btnEliminar"].Index)
         {
             DialogResult dialogResult = MessageBox.Show("¿Elimiar asociado?", "Confirmación", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 int id = (int)tblAsociados.Rows[e.RowIndex].Cells["id"].Value;
                 if (AsociadoServicio.eliminar(id))
                 {
                     tblAsociados.Rows.RemoveAt(e.RowIndex);
                 }
             }
         }
     }
 }
コード例 #6
0
// ###############################################################################################
// #############################          Constructor y load            ##########################
// ###############################################################################################

        public FormAsociado(int idAsociado)
        {
            InitializeComponent();

            //Validación de campos.
            txtNit.KeyPress           += new KeyPressEventHandler(Validar.nit);
            txtNombre.KeyPress        += new KeyPressEventHandler(Validar.soloLetrasyEspacios);
            txtApellido.KeyPress      += new KeyPressEventHandler(Validar.soloLetrasyEspacios);
            txtConyugeNombre.KeyPress += new KeyPressEventHandler(Validar.soloLetrasyEspacios);
            txtTelefono.KeyPress      += new KeyPressEventHandler(Validar.soloNumeros);

            //Cambiar de color las filas de la tabla.
            tblAportaciones.CellMouseEnter += new DataGridViewCellEventHandler(Style.dataGridMouseEnter);
            tblAportaciones.CellMouseLeave += new DataGridViewCellEventHandler(Style.dataGridMouseLeave);

            this.asociado = AsociadoServicio.select(idAsociado);
            enableChange  = false;

            btnMembresia.Visible = !asociado.abonoInicial;
        }
コード例 #7
0
// #########################################################################################
// ##############       Llenar las tablas cuando se active el form      ####################
// #########################################################################################

        private void FormMain_Activated(object sender, EventArgs e)
        {
            AhorroServicio.fillTable(tblAhorros);
            CreditoServicio.fillTable(tblCreditos);
            AsociadoServicio.fillTable(tblAsociados);
        }
コード例 #8
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);
                }
            }
        }
コード例 #9
0
// ########################################################################################
// #######################        Constructor y load        ###############################
// ########################################################################################

        public FormAportacionNueva()
        {
            InitializeComponent();
            AsociadoServicio.fillComboBox(cmbAsociados);
        }
コード例 #10
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");
            }
        }