private void btnModificarConvenio_Click(object sender, EventArgs e)
        {
            convenios         oConvenios         = new convenios();
            ConvenioImplement oConvenioImplement = new ConvenioImplement();
            DataGridViewRow   row = this.dgvConvenio.CurrentRow;

            if (btnModificarConvenio.Text == "&Modificar Convenio")
            {
                if (row != null)
                {
                    row.ReadOnly              = false;
                    row.Cells[0].ReadOnly     = true;
                    row.Cells[1].ReadOnly     = true;
                    row.Cells[2].ReadOnly     = true;
                    row.Cells[3].ReadOnly     = true;
                    row.Cells[4].ReadOnly     = true;
                    row.Cells[5].ReadOnly     = true;
                    row.Cells[7].ReadOnly     = true;
                    _facturadasOriginal       = Convert.ToInt32(row.Cells[6].Value);
                    _idConvenio               = Convert.ToInt32(row.Cells[1].Value);
                    oConvenios                = oConvenioImplement.Get(_idConvenio);
                    btnModificarConvenio.Text = "&Terminar Modificacion";
                }
            }
            else
            {
                if (row != null)
                {
                    int _facturadasNuevas = Convert.ToInt32(row.Cells[6].Value);
                    int _cuotas           = Convert.ToInt32(row.Cells[5].Value);
                    if (_facturadasNuevas >= _facturadasOriginal && _facturadasNuevas <= _cuotas)
                    {
                        _idConvenio = Convert.ToInt32(row.Cells[1].Value);
                        oConvenios  = oConvenioImplement.Get(_idConvenio);
                        oConvenios.fecha_convenio = Convert.ToDateTime(row.Cells[2].Value);
                        oConvenios.importe_total  = Convert.ToDecimal(row.Cells[3].Value);
                        oConvenios.cuotas         = Convert.ToInt32(row.Cells[5].Value);
                        oConvenios.valor_cuota    = Convert.ToDecimal(row.Cells[4].Value);
                        oConvenios.facturadas     = Convert.ToInt32(row.Cells[6].Value);
                        if (oConvenios.cuotas == oConvenios.facturadas)
                        {
                            //if (row.Cells[7].Value == "Si")
                            oConvenios.finalizado = true;
                        }
                        else
                        {
                            oConvenios.finalizado = false;
                        }
                        oConvenioImplement.Update(oConvenios);
                        btnModificarConvenio.Text = "&Modificar Convenio";
                        frmConvenios_Load(sender, e);
                    }
                    else
                    {
                        frmVentanaInformativa f = new frmVentanaInformativa("Cantidad facturadas incorrecta.");
                        f.ShowDialog();
                    }
                }
            }
        }
        private void btnTransferir_Click(object sender, EventArgs e)
        {
            convenios         oConvenios         = new convenios();
            ConvenioImplement oConvenioImplement = new ConvenioImplement();
            DataGridViewRow   row = this.dgvConvenio.CurrentRow;

            if (row != null)
            {
                int _idConvenio             = Convert.ToInt32(row.Cells[1].Value);
                Buscadores.frmBuscarSocio f = new Buscadores.frmBuscarSocio();
                f.Text = "Facturas Seleccion";
                int _idSocioATransferir = 0;
                if (f.ShowDialog() == DialogResult.OK)
                {
                    _idSocioATransferir = f.ValorIdRetorno;
                    if (_idSocioATransferir > 0)
                    {
                        oConvenios          = oConvenioImplement.Get(_idConvenio);
                        oConvenios.id_socio = _idSocioATransferir;
                        oConvenioImplement.Update(oConvenios);
                        CargarConveniosBySocio();
                    }
                    else
                    {
                        frmVentanaInformativa frmInfo = new frmVentanaInformativa("No se selecciono ningun socio.");
                        frmInfo.ShowDialog();
                    }
                }
            }
        }
        private void btnNota_Click(object sender, EventArgs e)
        {
            frmVentanaInformativa f = new frmVentanaInformativa("Descuentos preautorizados a partir del 15/09/2005" + Environment.NewLine +
                                                                "1 Pago:           Sin interés" + Environment.NewLine + "2 a 6 Pagos:          50 % de descuento" + Environment.NewLine +
                                                                "7 a 12 Pagos:         25 % de descuento" + Environment.NewLine + "Más de 12 pagos:     Sin descuento" + Environment.NewLine +
                                                                Environment.NewLine + "No se permiten convenios que no sean por el total de la deuda");

            f.ShowDialog();
        }
 private void btnEliminarConvenio_Click(object sender, EventArgs e)
 {
     convenios oConvenios = new convenios();
     ConvenioImplement oConvenioImplement = new ConvenioImplement();
     DataGridViewRow row = this.dgvConvenio.CurrentRow;
     if (row != null)
     {
         int _facturadas = Convert.ToInt32(row.Cells[6].Value);
         if (_facturadas == 0)
         {
             _idConvenio = Convert.ToInt32(row.Cells[1].Value);
             //limpio facturas
             oConvenioImplement.Delete(_idConvenio);
             CargarConveniosBySocio();
         }
         else {
             frmVentanaInformativa f = new frmVentanaInformativa("No se puede eliminar convenio si hay cuotas facturadas.");
             f.ShowDialog();
         }
     }
 }
        private void Guardar()
        {
            intimacion          oIntimacion          = new intimacion();
            IntimacionImplement oIntimacionImplement = new IntimacionImplement();
            string Mensaje;

            Mensaje = "";
            if (this.txtFecha.Text.Length == 0)
            {
                Mensaje += "Falta ingresar fecha." + Environment.NewLine;
            }
            ;
            if (int.Parse(cmbTipoIntimacion.SelectedValue.ToString()) == 0)
            {
                Mensaje += "Falta tipo de intimacion." + Environment.NewLine;
            }
            ;

            if (Mensaje.Length > 0)
            {
                frmVentanaInformativa ofrmVentanaInformativa = new frmVentanaInformativa(Mensaje);
                ofrmVentanaInformativa.ShowDialog();
            }
            else
            {
                oIntimacion.fecha    = DateTime.Parse(this.txtFecha.Text);
                oIntimacion.id_socio = _idSocio;
                oIntimacion.tipo     = int.Parse(this.cmbTipoIntimacion.SelectedValue.ToString());
                oIntimacionImplement.Save(oIntimacion);
                CargarGrilla(_idSocio);
                this.panelAdd.Visible = false;
                //Asigno Marca para el Socio
                socios_varios        oSocioVarios         = new socios_varios();
                SocioVariosImplement oSocioVarioImplement = new SocioVariosImplement();
                oSocioVarios          = oSocioVarioImplement.Get(_idSocio);
                oSocioVarios.intimado = true;
                oSocioVarioImplement.Update(oSocioVarios);
                this.panelAdd.Visible = false;
            }
        }
        private void btnEliminarConvenio_Click(object sender, EventArgs e)
        {
            convenios         oConvenios         = new convenios();
            ConvenioImplement oConvenioImplement = new ConvenioImplement();
            DataGridViewRow   row = this.dgvConvenio.CurrentRow;

            if (row != null)
            {
                int _facturadas = Convert.ToInt32(row.Cells[6].Value);
                if (_facturadas == 0)
                {
                    _idConvenio = Convert.ToInt32(row.Cells[1].Value);
                    //limpio facturas
                    oConvenioImplement.Delete(_idConvenio);
                    CargarConveniosBySocio();
                }
                else
                {
                    frmVentanaInformativa f = new frmVentanaInformativa("No se puede eliminar convenio si hay cuotas facturadas.");
                    f.ShowDialog();
                }
            }
        }
        private void Guardar()
        {
            AccionImplement oAccionImplement=new AccionImplement();
            acciones oAccion = new acciones();

            string Mensaje;
            Mensaje = "";
            if (this.txtCuotas.Text.Length == 0) { Mensaje += "Falta ingresar cuotas." + Environment.NewLine; };
            if (this.dtpFecha.Text.Length == 0) { Mensaje += "Falta ingresar fecha." + Environment.NewLine; };
            if (this.txtImporteTotal.Text.Length == 0) { Mensaje += "Falta ingresar importe total." + Environment.NewLine; };
            if (this.txtCuotasAbonadas.Text.Length == 0) { Mensaje += "Falta ingresar cuotas abonadas." + Environment.NewLine; };

            //txtValorCuotas

            if (Mensaje.Length > 0)
            {
                frmVentanaInformativa ofrmVentanaInformativa = new frmVentanaInformativa(Mensaje);
                ofrmVentanaInformativa.ShowDialog();
            }
            else
            {
                oAccion.cuotas = int.Parse(this.txtCuotas.Text);
                oAccion.fecha = DateTime.Parse(this.dtpFecha.Text);
                oAccion.importe = Decimal.Parse(this.txtImporteTotal.Text);
                oAccion.finalizado = false;
                oAccion.id_socio = _idSocio;
                oAccion.valor_cuota = Decimal.Parse(this.txtValorCuotas.Text);

                if (_idAccion == 0)
                {
                    oAccion.facturadas = int.Parse(this.txtCuotasAbonadas.Text);
                    oAccion.pendientes = oAccion.cuotas - oAccion.facturadas;
                    if (oAccion.facturadas == oAccion.cuotas)
                        oAccion.finalizado = true;
                    oAccionImplement.Save(oAccion);
                    this.Close();
                }
                else
                {
                    oAccion.facturadas = int.Parse(this.txtCuotasAbonadas.Text);
                    oAccion.pendientes = oAccion.cuotas - oAccion.facturadas;
                    if (oAccion.facturadas == oAccion.cuotas)
                        oAccion.finalizado = true;
                    oAccion.id_accion=_idAccion;
                    oAccionImplement.Update(oAccion);
                    this.Close();
                }
            }
        }
Exemple #8
0
        private void Guardar()
        {
            AccionImplement oAccionImplement = new AccionImplement();
            acciones        oAccion          = new acciones();

            string Mensaje;

            Mensaje = "";
            if (this.txtCuotas.Text.Length == 0)
            {
                Mensaje += "Falta ingresar cuotas." + Environment.NewLine;
            }
            ;
            if (this.dtpFecha.Text.Length == 0)
            {
                Mensaje += "Falta ingresar fecha." + Environment.NewLine;
            }
            ;
            if (this.txtImporteTotal.Text.Length == 0)
            {
                Mensaje += "Falta ingresar importe total." + Environment.NewLine;
            }
            ;
            if (this.txtCuotasAbonadas.Text.Length == 0)
            {
                Mensaje += "Falta ingresar cuotas abonadas." + Environment.NewLine;
            }
            ;

            //txtValorCuotas

            if (Mensaje.Length > 0)
            {
                frmVentanaInformativa ofrmVentanaInformativa = new frmVentanaInformativa(Mensaje);
                ofrmVentanaInformativa.ShowDialog();
            }
            else
            {
                oAccion.cuotas      = int.Parse(this.txtCuotas.Text);
                oAccion.fecha       = DateTime.Parse(this.dtpFecha.Text);
                oAccion.importe     = Decimal.Parse(this.txtImporteTotal.Text);
                oAccion.finalizado  = false;
                oAccion.id_socio    = _idSocio;
                oAccion.valor_cuota = Decimal.Parse(this.txtValorCuotas.Text);

                if (_idAccion == 0)
                {
                    oAccion.facturadas = int.Parse(this.txtCuotasAbonadas.Text);
                    oAccion.pendientes = oAccion.cuotas - oAccion.facturadas;
                    if (oAccion.facturadas == oAccion.cuotas)
                    {
                        oAccion.finalizado = true;
                    }
                    oAccionImplement.Save(oAccion);
                    this.Close();
                }
                else
                {
                    oAccion.facturadas = int.Parse(this.txtCuotasAbonadas.Text);
                    oAccion.pendientes = oAccion.cuotas - oAccion.facturadas;
                    if (oAccion.facturadas == oAccion.cuotas)
                    {
                        oAccion.finalizado = true;
                    }
                    oAccion.id_accion = _idAccion;
                    oAccionImplement.Update(oAccion);
                    this.Close();
                }
            }
        }
Exemple #9
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                #region <Validacion>
                    string Mensaje;
                    Mensaje = "";
                    if (txtNombre.Text.Length == 0) { Mensaje += "Falta Ingresar el nombre del socio." + Environment.NewLine; };
                    if (int.Parse(cmbTipoDni.SelectedValue.ToString()) == 0) { Mensaje += "Falta el tipo de documento del socio." + Environment.NewLine; };
                    if (mtxtDocumento.Text.Length == 0) { Mensaje += "Falta el numero de documento del socio." + Environment.NewLine; };
                    if (int.Parse(cmbIVA.SelectedValue.ToString()) == 0) { Mensaje += "Falta el tipo de IVA." + Environment.NewLine; };
                    if (int.Parse(cmbCategoria.SelectedValue.ToString()) == 0) { Mensaje += "Falta la categoria de conexion." + Environment.NewLine; };
                    if (int.Parse(cmbEstadoConexion.SelectedValue.ToString()) == 0) { Mensaje += "Falta el estado de conexion." + Environment.NewLine; };

                    if (int.Parse(cmbTarifa.SelectedValue.ToString()) == 0) { Mensaje += "Falta el tipo de tarifa." + Environment.NewLine; };
                    if (int.Parse(cmbZona.SelectedValue.ToString()) == 0) { Mensaje += "Falta la zona de facturacion." + Environment.NewLine; };
                    if (int.Parse(cmbDcBarrio.SelectedValue.ToString()) == 0) { Mensaje += "Falta el barrio de la conexion." + Environment.NewLine; };
                    if (int.Parse(cmbDcCalle.SelectedValue.ToString()) == 0) { Mensaje += "Falta el codigo de la calle de conexion." + Environment.NewLine; };
                    if (txtDcDistrito.Text.Length == 0) { Mensaje += "Falta el districto electoral." + Environment.NewLine; };

                    if (int.Parse(cmbDlProvincia.SelectedValue.ToString()) == 0) { Mensaje += "Falta provincia de residencia legal." + Environment.NewLine; };
                    if (int.Parse(cmbDLLocalidad.SelectedValue.ToString()) == 0) { Mensaje += "Falta localidad de residencia legal." + Environment.NewLine; };
                    if (int.Parse(cmbDlBarrio.SelectedValue.ToString()) == 0) { Mensaje += "Falta barrio de residencia legal." + Environment.NewLine; };
                    if (int.Parse(cmbDlCalle.SelectedValue.ToString()) == 0) { Mensaje += "Falta calle de residencia legal." + Environment.NewLine; };
                    if (txtDlAltura.Text.Length == 0) { Mensaje += "Falta altura de residencia legal." + Environment.NewLine; };
                    if (txtDLCP.Text.Length == 0) { Mensaje += "Falta codigo postal de residencia legal." + Environment.NewLine; };

                    if (mtbLNomenclarura.Text.Length == 0) { Mensaje += "Falta nomenclatura catastral." + Environment.NewLine; }
                    if (txtLManzana.Text.Length == 0) { Mensaje += "Falta la identificacion de la manzana." + Environment.NewLine; };
                    if (txtLLote.Text.Length == 0) { Mensaje += "Falta la identificacion del lote." + Environment.NewLine; };

                    if (int.Parse(cmbDTTipoConexion.SelectedValue.ToString()) == 0) { Mensaje += "Falta el tipo de conexion." + Environment.NewLine; };
                #endregion
                if (Mensaje.Length > 0)
                {
                    frmVentanaInformativa ofrmVentanaInformativa = new frmVentanaInformativa(Mensaje);
                    ofrmVentanaInformativa.ShowDialog();
                }
                else {
                    Guardar();
                    Inicializar();
                    Deshabilitar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error en " + ex.Source + " Mensaje: " + ex.Message);
            }
        }
        private void btnModificarConvenio_Click(object sender, EventArgs e)
        {
            convenios oConvenios = new convenios();
            ConvenioImplement oConvenioImplement = new ConvenioImplement();
            DataGridViewRow row = this.dgvConvenio.CurrentRow;

            if (btnModificarConvenio.Text == "&Modificar Convenio")
            {
                if (row != null)
                {
                    row.ReadOnly = false;
                    row.Cells[0].ReadOnly = true;
                    row.Cells[1].ReadOnly = true;
                    row.Cells[2].ReadOnly = true;
                    row.Cells[3].ReadOnly = true;
                    row.Cells[4].ReadOnly = true;
                    row.Cells[5].ReadOnly = true;
                    row.Cells[7].ReadOnly = true;
                    _facturadasOriginal = Convert.ToInt32(row.Cells[6].Value);
                    _idConvenio = Convert.ToInt32(row.Cells[1].Value);
                    oConvenios = oConvenioImplement.Get(_idConvenio);
                    btnModificarConvenio.Text="&Terminar Modificacion";
                }
            }
            else {
                if (row != null)
                {
                    int _facturadasNuevas=Convert.ToInt32(row.Cells[6].Value);
                    int _cuotas = Convert.ToInt32(row.Cells[5].Value);
                    if (_facturadasNuevas >= _facturadasOriginal && _facturadasNuevas <= _cuotas)
                    {
                        _idConvenio = Convert.ToInt32(row.Cells[1].Value);
                        oConvenios = oConvenioImplement.Get(_idConvenio);
                        oConvenios.fecha_convenio = Convert.ToDateTime(row.Cells[2].Value);
                        oConvenios.importe_total = Convert.ToDecimal(row.Cells[3].Value);
                        oConvenios.cuotas = Convert.ToInt32(row.Cells[5].Value);
                        oConvenios.valor_cuota = Convert.ToDecimal(row.Cells[4].Value);
                        oConvenios.facturadas = Convert.ToInt32(row.Cells[6].Value);
                        if (oConvenios.cuotas == oConvenios.facturadas)
                        {
                            //if (row.Cells[7].Value == "Si")
                            oConvenios.finalizado = true;
                        }
                        else
                            oConvenios.finalizado = false;
                        oConvenioImplement.Update(oConvenios);
                        btnModificarConvenio.Text = "&Modificar Convenio";
                        frmConvenios_Load(sender, e);
                    }
                    else
                    {
                        frmVentanaInformativa f = new frmVentanaInformativa("Cantidad facturadas incorrecta.");
                        f.ShowDialog();
                    }

                }
            }
        }
        private void btnTransferir_Click(object sender, EventArgs e)
        {
            convenios oConvenios = new convenios();
            ConvenioImplement oConvenioImplement = new ConvenioImplement();
            DataGridViewRow row = this.dgvConvenio.CurrentRow;
            if (row != null)
            {

                int _idConvenio = Convert.ToInt32(row.Cells[1].Value);
                Buscadores.frmBuscarSocio f = new Buscadores.frmBuscarSocio();
                f.Text = "Facturas Seleccion";
                int _idSocioATransferir = 0;
                if (f.ShowDialog() == DialogResult.OK)
                {
                    _idSocioATransferir = f.ValorIdRetorno;
                    if (_idSocioATransferir > 0)
                    {
                        oConvenios = oConvenioImplement.Get(_idConvenio);
                        oConvenios.id_socio = _idSocioATransferir;
                        oConvenioImplement.Update(oConvenios);
                        CargarConveniosBySocio();
                    }
                    else
                    {
                        frmVentanaInformativa frmInfo = new frmVentanaInformativa("No se selecciono ningun socio.");
                        frmInfo.ShowDialog();
                    }
                }
            }
        }
 private void btnNota_Click(object sender, EventArgs e)
 {
     frmVentanaInformativa f = new frmVentanaInformativa("Descuentos preautorizados a partir del 15/09/2005" + Environment.NewLine +
         "1 Pago:           Sin interés" + Environment.NewLine + "2 a 6 Pagos:          50 % de descuento" + Environment.NewLine +
         "7 a 12 Pagos:         25 % de descuento" + Environment.NewLine + "Más de 12 pagos:     Sin descuento" + Environment.NewLine +
         Environment.NewLine + "No se permiten convenios que no sean por el total de la deuda");
     f.ShowDialog();
 }
        private void Guardar()
        {
            intimacion oIntimacion = new intimacion();
            IntimacionImplement oIntimacionImplement = new IntimacionImplement();
            string Mensaje;
            Mensaje = "";
            if (this.txtFecha.Text.Length == 0) { Mensaje += "Falta ingresar fecha." + Environment.NewLine; };
            if (int.Parse(cmbTipoIntimacion.SelectedValue.ToString()) == 0) { Mensaje += "Falta tipo de intimacion." + Environment.NewLine; };

            if (Mensaje.Length > 0)
            {
                frmVentanaInformativa ofrmVentanaInformativa = new frmVentanaInformativa(Mensaje);
                ofrmVentanaInformativa.ShowDialog();
            }
            else
            {
                oIntimacion.fecha = DateTime.Parse(this.txtFecha.Text);
                oIntimacion.id_socio = _idSocio;
                oIntimacion.tipo = int.Parse(this.cmbTipoIntimacion.SelectedValue.ToString());
                oIntimacionImplement.Save(oIntimacion);
                CargarGrilla(_idSocio);
                this.panelAdd.Visible = false;
                //Asigno Marca para el Socio
                socios_varios oSocioVarios = new socios_varios();
                SocioVariosImplement oSocioVarioImplement = new SocioVariosImplement();
                oSocioVarios = oSocioVarioImplement.Get(_idSocio);
                oSocioVarios.intimado = true;
                oSocioVarioImplement.Update(oSocioVarios);
                this.panelAdd.Visible = false;
            }
        }