Exemplo n.º 1
0
        private void btnAnular_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            string            msj = "Confirma anular el pago de la comisión ";
            var result            = MessageBox.Show(msj, "Información",
                                                    MessageBoxButtons.YesNo,
                                                    MessageBoxIcon.Question);

            // If the no button was pressed ...
            if (result == DialogResult.No)
            {
                return;
            }

            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            Int32    CodComision = Convert.ToInt32(txtCodComision.Text);
            DateTime Fecha       = Convert.ToDateTime(txtFecha.Text);

            Clases.cComisionVendedor com = new Clases.cComisionVendedor();
            com.AnularPagoComision(CodComision);
            string Descripcion = "ANULACIÓN PAGO COMISIÓN " + txtNombre.Text + " " + txtApellido.Text;

            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            double Importe = fun.ToDouble(txtImporte.Text);

            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion);
            MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje());

            btnGrabar.Enabled = false;
            btnAnular.Enabled = false;
        }