예제 #1
0
        private void ModifHaberNotaButton_Click(object sender, EventArgs e)
        {
            if (IsGridEmpty(DgvNotas, "notas"))
            {
                return;
            }

            try
            {
                var haber = (decimal)DgvCuentas.SelectedRows[0].Cells[3].Value;

                cuentaCorriente = new DCuentaCorriente();
                dNotaCredito    = new DNotaCredito();

                cuentaCorriente.UpdateHaberCuenta(haber, codCuentaCorriente);

                dNotaCredito.RegistrarNotaCredito((int)DgvNotas.SelectedRows[0].Cells[0].Value, codCuentaCorriente);
            }

            catch (Exception ex)
            {
                MessageBox.Show($"ERROR: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            MessageBox.Show("Cuenta modificada y nota de crédito registrada con éxito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);

            VaciarGrids();
        }
예제 #2
0
 private void CargarNotasCredito()
 {
     dNotaCredito        = new DNotaCredito();
     DgvNotas.DataSource = dNotaCredito.SelectNotasCreditoNoRegistradas();
     DgvNotas.Refresh();
 }