Exemplo n.º 1
0
        private void inicio()
        {
            lblTrabajando.Visible = false;

            btnSeleccionarSocio.Enabled = true;
            btnCancelarBusqueda.Enabled = true;

            DataSet  dsEmpresas = empresa.DevolverEmpresa();
            DateTime fechaPresupuestoAnterior = Convert.ToDateTime(dsEmpresas.Tables["empresas"].Rows[0][23].ToString().ToString());
            DateTime horaPresupuestoAnterior  = Convert.ToDateTime(dsEmpresas.Tables["empresas"].Rows[0][24].ToString().ToString());

            DateTime fechaPresupuestoUltimo = Convert.ToDateTime(dsEmpresas.Tables["empresas"].Rows[0][25].ToString().ToString());
            DateTime horaPresupuestoUltimo  = Convert.ToDateTime(dsEmpresas.Tables["empresas"].Rows[0][26].ToString().ToString());

            DateTime fechaVencimientoPresupuesto = Convert.ToDateTime(dsEmpresas.Tables["empresas"].Rows[0][27].ToString().ToString());



            this.lblFechaPresupuestoAnterior.Text = fechaPresupuestoAnterior.ToString("dd/MM/yyyy");
            //   this.lblHoraPresupuestoAnterior.Text = horaPresupuestoAnterior.AddHours(12).ToString("HH:mm:ss");
            this.lblHoraPresupuestoAnterior.Text = horaPresupuestoAnterior.ToString("HH:mm:ss");
            this.lblFechaPresupuestoUltimo.Text  = fechaPresupuestoUltimo.ToString("dd/MM/yyyy");
            //this.lblHoraPresupuestoUltimo.Text = horaPresupuestoUltimo.AddHours(12).ToString("HH:mm:ss");
            this.lblHoraPresupuestoUltimo.Text       = horaPresupuestoUltimo.ToString("HH:mm:ss");
            this.lblFechaVencimientoPresupuesto.Text = fechaVencimientoPresupuesto.ToString("dd/MM/yyyy");

            this.lblFechaCierre.Text = empresa.presupuesto();
        }
Exemplo n.º 2
0
        private void actualizar()
        {
            dsEmpresas = empresa.DevolverEmpresa();

            txtNombreCoop.Text      = dsEmpresas.Tables["empresas"].Rows[0][0].ToString();
            txtSiglaCoop.Text       = dsEmpresas.Tables["empresas"].Rows[0][1].ToString();
            txtDirecciónCoop.Text   = dsEmpresas.Tables["empresas"].Rows[0][2].ToString();
            txtDeptoCoop.Text       = dsEmpresas.Tables["empresas"].Rows[0][3].ToString();
            txtCodPostal.Text       = dsEmpresas.Tables["empresas"].Rows[0][4].ToString();
            txtTelCoop.Text         = dsEmpresas.Tables["empresas"].Rows[0][5].ToString();
            txtFaxCoop.Text         = dsEmpresas.Tables["empresas"].Rows[0][6].ToString();
            txtRUTCoop.Text         = dsEmpresas.Tables["empresas"].Rows[0][7].ToString();
            txtAporteCoop.Text      = dsEmpresas.Tables["empresas"].Rows[0][8].ToString();
            txtMaxUnidCoop.Text     = dsEmpresas.Tables["empresas"].Rows[0][9].ToString();
            txtIVACoop.Text         = dsEmpresas.Tables["empresas"].Rows[0][10].ToString();
            txtInteresMoraCoop.Text = dsEmpresas.Tables["empresas"].Rows[0][11].ToString();
            txtEmailCoop.Text       = dsEmpresas.Tables["empresas"].Rows[0][12].ToString();
            txtPresidenteCoop.Text  = dsEmpresas.Tables["empresas"].Rows[0][13].ToString();
            txtTesoreroCoop.Text    = dsEmpresas.Tables["empresas"].Rows[0][14].ToString();
            txtSecretarioCoop.Text  = dsEmpresas.Tables["empresas"].Rows[0][15].ToString();
            txtPrimerVocalCoop.Text = dsEmpresas.Tables["empresas"].Rows[0][16].ToString();
            txtSegVocalCoop.Text    = dsEmpresas.Tables["empresas"].Rows[0][17].ToString();
            dtpFechaEleccion.Text   = dsEmpresas.Tables["empresas"].Rows[0][18].ToString();
        }
        private void cargaPrestamosCancelacion()
        {
            DataSet socioSeleccionado = empresa.buscarSociosPorCampo("socio_id", this.idSocioSeleccionado.ToString());

            if (socioSeleccionado.Tables["socios"].Rows.Count > 0)
            {
                bool excedido = estaExcedido();

                if (!excedido)
                {
                    this.txtApeNomCA.Text   = socioSeleccionado.Tables["socios"].Rows[0][3].ToString().Trim() + "," + socioSeleccionado.Tables["socios"].Rows[0][2].ToString().Trim();
                    this.txtCiCA.Text       = socioSeleccionado.Tables["socios"].Rows[0][1].ToString();
                    this.txtNroCobroCA.Text = socioSeleccionado.Tables["socios"].Rows[0][4].ToString();

                    DataSet dsCobranzaProvisoriaSocio = empresa.devolverCobranzaProvisoriaSocio(idSocioSeleccionado);
                    DataSet dsCobranzaSocio           = empresa.devolverCobranzaSocio(idSocioSeleccionado);
                    DataSet dsParametros = empresa.DevolverEmpresa();

                    if (dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows.Count == 0)
                    {
                        if (dsCobranzaSocio.Tables["cobranzaSocio"].Rows.Count > 0)
                        {
                            idCobranza                    = Convert.ToInt32(dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][0].ToString());
                            txtNroPrestamoCA.Text         = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][1].ToString();
                            txtCuotasPactadasCA.Text      = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][6].ToString();
                            txtCuotasPagadasCA.Text       = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][7].ToString();
                            txtTasAnualEfecCA.Text        = String.Format(dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][3].ToString(), "##0.00");
                            txtMontoDelValeCA.Text        = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][5].ToString();
                            txtImporteCuotaCA.Text        = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][8].ToString();
                            txtAmortizacionAVencerCA.Text = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][12].ToString();
                            txtInteresesAVencerCA.Text    = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][13].ToString();
                            txtOficinaCA.Text             = oficina;
                            txtIncisoCA.Text              = inciso;

                            if (Convert.ToDouble(txtAmortizacionAVencerCA.Text) != 0)
                            {
                                txtAPagarPorCajaCA.Text = txtAmortizacionAVencerCA.Text;

                                DateTime FechaVto = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15);
                                txtPresupuestoDeCancelacion.Text = empresa.formatoFechaMid4(FechaVto);
                                sePuedeCancelar = true;
                            }
                            else
                            {
                                if (Convert.ToInt32(txtNroPrestamoCA.Text) != 0)
                                {
                                    string anio = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15).ToString().Substring(6, 4);
                                    string mes  = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15).ToString().Substring(3, 2);

                                    MessageBox.Show("El Préstamo queda cancelado a partir del vencimiento del presupuesto del mes " + mes + "/" + anio);
                                    sePuedeCancelar = false;
                                    this.Close();
                                }
                                else
                                {
                                    MessageBox.Show("El Socio no tiene Préstamos");
                                    sePuedeCancelar = false;
                                    this.Close();
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("El Socio no tiene Préstamos");
                            sePuedeCancelar = false;
                            this.Close();
                        }
                    }
                    else
                    {
                        txtNroPrestamoCA.Text         = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][1].ToString();
                        txtCuotasPactadasCA.Text      = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][6].ToString();
                        txtCuotasPagadasCA.Text       = 0.ToString();
                        txtTasAnualEfecCA.Text        = String.Format(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][3].ToString(), "##0.00");
                        txtMontoDelValeCA.Text        = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][5].ToString();
                        txtImporteCuotaCA.Text        = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][8].ToString();
                        txtAmortizacionAVencerCA.Text = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][12].ToString();

                        double CalculotxtInteresesAVencer = (Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][6].ToString()) * Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][8].ToString())) - Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][5].ToString());
                        txtInteresesAVencerCA.Text = Convert.ToString(CalculotxtInteresesAVencer);

                        MessageBox.Show("No puede realizar la cancelación. Debe Anular el Presente Préstamo");
                        sePuedeCancelar = false;
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("No puede realizar la cancelación. Debe cancelar la deuda pendiente como excedido");
                    sePuedeCancelar = false;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Debe seleccionar un socio para poder cancelar");
                sePuedeCancelar = false;
                this.Close();
            }
        }
Exemplo n.º 4
0
        private void cargaPrestamosCancelacion(int idSocio)
        {
            DataSet socioSeleccionado = empresa.buscarSociosPorCampo("socio_id", idSocio.ToString());

            if (socioSeleccionado.Tables["socios"].Rows.Count > 0)
            {
                if (Convert.ToInt32(socioSeleccionado.Tables["socios"].Rows[0][19].ToString()) == 1)
                {
                    this.txtApeNomCA.Text   = socioSeleccionado.Tables["socios"].Rows[0][3].ToString().Trim() + "," + socioSeleccionado.Tables["socios"].Rows[0][2].ToString().Trim();
                    this.txtNroCobroCA.Text = socioSeleccionado.Tables["socios"].Rows[0][4].ToString();

                    txtOficinaCA.Text = socioSeleccionado.Tables["socios"].Rows[0][17].ToString() + " - " + socioSeleccionado.Tables["socios"].Rows[0][23].ToString();
                    txtIncisoCA.Text  = socioSeleccionado.Tables["socios"].Rows[0][18].ToString() + " - " + socioSeleccionado.Tables["socios"].Rows[0][24].ToString();

                    DataSet dsCobranzaProvisoriaSocio = empresa.devolverCobranzaProvisoriaSocio(idSocio);
                    DataSet dsCobranzaSocio           = empresa.devolverCobranzaSocio(idSocio);
                    DataSet dsParametros = empresa.DevolverEmpresa();

                    if (dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows.Count == 0)
                    {
                        if (dsCobranzaSocio.Tables["cobranzaSocio"].Rows.Count > 0)
                        {
                            idCobranza                    = Convert.ToInt32(dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][0].ToString());
                            txtNroPrestamoCA.Text         = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][1].ToString();
                            txtCuotasPactadasCA.Text      = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][6].ToString();
                            txtCuotasPagadasCA.Text       = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][7].ToString();
                            txtTasAnualEfecCA.Text        = String.Format(dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][3].ToString(), "##0.00");
                            txtMontoDelValeCA.Text        = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][5].ToString();
                            txtImporteCuotaCA.Text        = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][8].ToString();
                            txtAmortizacionAVencerCA.Text = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][12].ToString();
                            txtInteresesAVencerCA.Text    = dsCobranzaSocio.Tables["cobranzaSocio"].Rows[0][13].ToString();


                            if (Convert.ToDouble(txtAmortizacionAVencerCA.Text) != 0)
                            {
                                /*    txtAPagarPorCajaCA.Text = txtAmortizacionAVencerCA.Text;
                                 *
                                 *  DateTime FechaVto = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15);
                                 *  txtPresupuestoDeCancelacion.Text = empresa.formatoFechaMid4(FechaVto);*/

                                sePuedeCancelar = true;
                            }
                            else
                            {
                                if (Convert.ToInt32(txtNroPrestamoCA.Text) != 0)
                                {
                                    string anio = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15).ToString().Substring(6, 4);
                                    string mes  = Convert.ToDateTime(dsParametros.Tables["empresas"].Rows[0][27].ToString()).AddDays(15).ToString().Substring(3, 2);

                                    MessageBox.Show("El Préstamo queda cancelado a partir del vencimiento del presupuesto del mes " + mes + "/" + anio);
                                    sePuedeCancelar = true;
                                }
                                else
                                {
                                    MessageBox.Show("El Socio no tiene Préstamos");
                                    sePuedeCancelar = true;
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("El Socio no tiene Préstamos");
                        }
                    }
                    else
                    {
                        idCobranzaProvisoria          = Convert.ToInt32(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][0].ToString());
                        txtNroPrestamoCA.Text         = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][1].ToString();
                        txtCuotasPactadasCA.Text      = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][6].ToString();
                        txtCuotasPagadasCA.Text       = 0.ToString();
                        txtTasAnualEfecCA.Text        = String.Format(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][3].ToString(), "##0.00");
                        txtMontoDelValeCA.Text        = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][5].ToString();
                        txtImporteCuotaCA.Text        = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][8].ToString();
                        txtAmortizacionAVencerCA.Text = dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][12].ToString();

                        double CalculotxtInteresesAVencer = (Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][6].ToString()) * Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][8].ToString())) - Convert.ToDouble(dsCobranzaProvisoriaSocio.Tables["cobranzasProvisoriasSocio"].Rows[0][5].ToString());
                        txtInteresesAVencerCA.Text = Convert.ToString(CalculotxtInteresesAVencer);

                        sePuedeCancelar = true;
                    }
                }
                else
                {
                    MessageBox.Show("El Socio esta dado de Baja.");
                }
            }
            else
            {
                MessageBox.Show("No se ubica al socio");
            }

            if (sePuedeCancelar)
            {
                this.btnCancelarDeudas.Enabled = true;
            }
            else
            {
                this.btnCancelarDeudas.Enabled = false;
            }
        }