Beispiel #1
0
        private void BtnInsertar_Click(object sender, EventArgs e)
        {
            if (DatoCuenta.IDCuentaMovimiento == 0)
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un código de cuenta.");
                TxtCodigoCuenta.Focus();
                return;
            }
            if (TxtConcepto.Text == null || TxtConcepto.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un concepto.");
                TxtConcepto.Focus();
                return;
            }
            if (Convert.ToDecimal(TxtDebe.Text) == 0 && Convert.ToDecimal(TxtHaber.Text) == 0)
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar valor en el DEBE o en el HABER.");
                TxtDebe.Focus();
                return;
            }

            LlenarDgv = new ClassLlenarDgv();
            LlenarDgv.Crear(DatoCuenta, ListDatos, TxtConcepto.Text, Convert.ToDecimal(TxtDebe.Text), Convert.ToDecimal(TxtHaber.Text));
            LlenarDgv.LlenarDgv(DgvDatos, ListDatos);
            LlenarDgv.TDebeHaber(ListDatos, TxtTotalDebe, TxtTotalHaber);
            TxtCodigoCuenta.Text = null;
            TxtNombreCuenta.Text = null;
            TxtConcepto.Text     = null;
            TxtDebe.Text         = "0";
            TxtHaber.Text        = "0";
        }
        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));
                }
            }
        }
Beispiel #3
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (TxtCodigoClase.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un código.");
                return;
            }
            if (TxtNombreClase.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un nombre de cuenta.");
                return;
            }

            FrmPregunta FrmGuardar = new FrmPregunta();

            FrmGuardar.ShowDialog();
            if (FrmGuardar.Estado == true)
            {
                if (GuardarCrear(TxtNombreClase.Text.ToUpper(), TxtCodigoClase.Text.ToUpper()) == 1)
                {
                    Alerta = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "GUARDADO", "Registro guardado correctamente.");
                    return;
                }
            }
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
        private void BtnGuardar_Click(object sender, System.EventArgs e)
        {
            if (TxtCodigoClaseNu.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un código.");
                return;
            }
            if (TxtNombreClaseNu.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Debe ingresar un nombre de cuenta.");
                return;
            }

            FrmPregunta FrmGuardar = new FrmPregunta();

            FrmGuardar.ShowDialog();
            if (FrmGuardar.Estado == true)
            {
                if (GuardarEditar(TxtNombreClaseNu.Text.ToUpper(), TxtCodigoClaseNu.Text.ToUpper()) == 1)
                {
                    Alerta = new ClassToast(ClassColorAlerta.Alerta.Actualizado.ToString(), "ACTUALIZADO", "Registro actualizado correctamente.");
                    this.Close();
                }
            }
        }
Beispiel #7
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (TxtComprobante.Text == null || TxtComprobante.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar un código de comprobante.");
                TxtComprobante.Focus();
                return;
            }
            if (TxtDocReferencia.Text == null || TxtDocReferencia.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar un doc. de referencia.");
                TxtDocReferencia.Focus();
                return;
            }
            if (TxtConceptoGeneral.Text == null || TxtConceptoGeneral.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar concepto general.");
                TxtDocReferencia.Focus();
                return;
            }
            if (ListDatos.Count == 0)
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Error.ToString(), "ALTO", "Debe ingresar cuentas.");
                TxtCodigoCuenta.Focus();
                return;
            }
            if (Convert.ToDecimal(TxtTotalDebe.Text) != Convert.ToDecimal(TxtTotalHaber.Text))
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "El DEBE es diferente al HABER.");
                return;
            }

            string Fecha = TxtFecha.Value.Date.ToString("dd-MM-yyyy ") + TxtHora.Value.ToLongTimeString();
            ClassGuardarAsiento Guardar = new ClassGuardarAsiento();

            FrmPregunta FrmGuardar = new FrmPregunta();

            FrmGuardar.ShowDialog();
            if (FrmGuardar.Estado == true)
            {
                Guardar.GuardarAsientoContable(Estado, Convert.ToInt32(TxtComprobante.Text), TxtDocReferencia.Text.ToUpper(), TxtConceptoGeneral.Text.ToUpper(),
                                               ListDatos, Convert.ToDateTime(Fecha));

                TxtFecha.Value          = DateTime.Now;
                TxtHora.Value           = DateTime.Now;
                TxtDocReferencia.Text   = null;
                TxtConceptoGeneral.Text = null;
                TxtComprobante.Text     = null;
                ListDatos.Clear();
                DgvDatos.Rows.Clear();
                LlenarDgv = new ClassLlenarDgv();
                LlenarDgv.TDebeHaber(ListDatos, TxtTotalDebe, TxtTotalHaber);
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "GUARDADO", "Registro guardado perfectamente.");
            }
        }
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            if (TxtCodigo.Text == null || TxtCodigo.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar código.");
                TxtCodigo.Focus();
                return;
            }
            if (TxtCodigoReferencia.Text == null || TxtCodigoReferencia.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar código referencia.");
                TxtCodigoReferencia.Focus();
                return;
            }
            if (TxtPorcentaje.Text == null || TxtPorcentaje.Text == "")
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar el procentaje.");
                TxtPorcentaje.Focus();
                return;
            }

            if (Convert.ToDecimal(TxtPorcentaje.Text) <= 0)
            {
                Alerta = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Ingresar el procentaje mayor a cero.");
                TxtPorcentaje.Focus();
                return;
            }
            FrmPregunta FrmGuardar = new FrmPregunta();

            FrmGuardar.ShowDialog();
            if (FrmGuardar.Estado == true)
            {
                CADRetencion Guardar = new CADRetencion();
                Guardar.InsertRetencion(Convert.ToInt32(CbTipoRetencion.SelectedValue),
                                        CJ3, CJ4, CJ5, TxtCodigo.Text.ToUpper(), TxtCodigoReferencia.Text.ToUpper(),
                                        TxtDescripcion.Text.ToUpper(), Convert.ToDecimal(TxtPorcentaje.Text));

                Alerta = new ClassToast(ClassColorAlerta.Alerta.Guardado.ToString(), "GUARDADO", "Registro guardado perfectamente.");

                TxtCodCuenta.Text        = null;
                TxtCodigo.Text           = null;
                TxtCodigoReferencia.Text = null;
                TxtCuenta.Text           = null;
                TxtDescripcion.Text      = null;
                TxtPorcentaje.Text       = "0";
                DgvLLenar = new ClassDgvRetencion();
                DgvLLenar.GetRetencion(DgvDato, Convert.ToInt32(CbTipoRetencion.SelectedValue));
            }
        }
Beispiel #9
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();
            }
        }
 private static void ApplyButter(ClassToast toast) => Console.WriteLine("Putting butter on the toast");
 // sync methods
 private static void ApplyJam(ClassToast toast) => Console.WriteLine("Putting jam on the toast");
Beispiel #12
0
 private void Btnlv2_Click(object sender, EventArgs e)
 {
     ClassToast Estados = new ClassToast(ClassColorAlerta.Alerta.Validado.ToString(), "ALERTA", "Error al picar");
 }