private void DgvDato_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (DgvDato.CurrentRow == null)
            {
                return;
            }

            int Fila   = e.RowIndex;
            int Column = e.ColumnIndex;

            if (Column == 0)
            {
                FrmPreguntaBorrar FrmBorrar = new FrmPreguntaBorrar();
                FrmBorrar.ShowDialog();
                if (FrmBorrar.Estado == true)
                {
                    CADRetencion Borrar = new CADRetencion();
                    Borrar.DeleteRetencion(Convert.ToInt32(DgvDato.Rows[Fila].Cells[2].Value));

                    Alerta    = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "ELIMINADO", "Registro borrado perfectamente.");
                    DgvLLenar = new ClassDgvRetencion();
                    DgvLLenar.GetRetencion(DgvDato, Convert.ToInt32(CbTipoRetencion.SelectedValue));
                }
            }
        }
示例#2
0
        private void BtnBorrar2_Click(object sender, EventArgs e)
        {
            FrmMensajeBorrar = new FrmPreguntaBorrar();
            FrmMensajeBorrar.ShowDialog();
            if (FrmMensajeBorrar.Estado == true)
            {
                try
                {
                    CADNivel2 CN2      = new CADNivel2();
                    int       IDNivel2 = Convert.ToInt32(CbNivel2.SelectedValue);
                    CN2.DeleteJerar2(IDNivel2);

                    Mensajes = new ClassToast(ClassColorAlerta.Alerta.Actualizado.ToString(), "ACTUALIZADO", "Registro borrado correctamente.");
                    // LLENAR GRUPO
                    CbGrupo = new ClassLLenarCbGrupo();
                    CbGrupo.Llenar(CbNivel2, Convert.ToInt32(CbNivel1.SelectedValue), TxtCodigoGrupo);
                    // LLENAR CUENTA
                    CbCuenta = new ClassLlenarCbCuenta();
                    CbCuenta.Llenar(CbNivel3, Convert.ToInt32(CbNivel2.SelectedValue), RbTransaccional3, TxtCodigoCuenta);
                    // LLENAR SUBCUENTA
                    CbSubCuenta = new ClassLlenarCbSubCuenta();
                    CbSubCuenta.Llenar(CbNivel4, Convert.ToInt32(CbNivel3.SelectedValue), RbTransaccional4, TxtCodigoSubCuenta);
                    // LLENAR AUXILIAR
                    CbAuxiliar = new ClassLlenarCbAuxiliar();
                    CbAuxiliar.Llenar(CbNivel5, Convert.ToInt32(CbNivel4.SelectedValue), RbTransaccional5, TxtCodigoAuxiliar);
                }
                catch (Exception)
                {
                    Mensajes = new ClassToast(ClassColorAlerta.Alerta.Error.ToString(), "ERROR", "Problemas entre tablas enlazadas.");
                }
            }
            RefreshCb(2);
        }
示例#3
0
        private void BtnBorrar5_Click(object sender, EventArgs e)
        {
            FrmMensajeBorrar = new FrmPreguntaBorrar();
            FrmMensajeBorrar.ShowDialog();
            if (FrmMensajeBorrar.Estado == true)
            {
                try
                {
                    CADNivel5        CN5         = new CADNivel5();
                    CADCoDMovimiento CMovimiento = new CADCoDMovimiento();

                    int IDNivel5 = Convert.ToInt32(CbNivel5.SelectedValue);
                    CN5.DeleteJerar5(IDNivel5);
                    CMovimiento.DeleteJerar5(IDNivel5);

                    Mensajes = new ClassToast(ClassColorAlerta.Alerta.Actualizado.ToString(), "ACTUALIZADO", "Registro borrado correctamente.");

                    // LLENAR AUXILIAR
                    CbAuxiliar = new ClassLlenarCbAuxiliar();
                    CbAuxiliar.Llenar(CbNivel5, Convert.ToInt32(CbNivel4.SelectedValue), RbTransaccional5, TxtCodigoAuxiliar);
                }
                catch (Exception)
                {
                    Mensajes = new ClassToast(ClassColorAlerta.Alerta.Error.ToString(), "ERROR", "Problemas entre tablas enlazadas.");
                }
            }
            RefreshCb(5);
        }
示例#4
0
        private void BtnBorrar_Click(object sender, EventArgs e)
        {
            FrmPreguntaBorrar FrmBorrar = new FrmPreguntaBorrar();

            FrmBorrar.ShowDialog();
            if (FrmBorrar.Estado == true)
            {
                CADAsientoDetalle Borrar = new CADAsientoDetalle();
                Borrar.DeleteAsiento(Convert.ToInt32(TxtIDAsiento.Text));

                Alerta = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "ELIMINADO", "Registro borrado correctamente.");

                PanelBusqueda.Visible = true;
                panelDetalle.Visible  = false;

                DgvDatos.Rows.Clear();
            }
        }