Example #1
0
        private void devolverFacturaButton_Click(object sender, EventArgs e)
        {
            if (facturaDataGridView.Rows.Count.Equals(0))
            {
                Util.ShowMessage("Primero debe buscar una factura.", MessageBoxIcon.Exclamation);
                return;
            }
            if (errorDeCobroRadioButton.Checked.Equals(false) && retrotraerPagoRadioButton.Checked.Equals(false))
            {
                Util.ShowMessage("Debe escoger un motivo para la devoluciĆ³n", MessageBoxIcon.Exclamation);
                return;
            }

            PagoAgilFrba.Modelo.Devolucion devolucion = new PagoAgilFrba.Modelo.Devolucion();
            if (errorDeCobroRadioButton.Checked)
            {
                devolucion.setMotivo("Error de cobro");
            }
            else if (retrotraerPagoRadioButton.Checked)
            {
                devolucion.setMotivo("Cliente decidiĆ³ retrotraer el pago");
            }

            devolucion.setIDFactura((int)facturaDataGridView.Rows[0].Cells["id_factura"].Value);
            devolucion.setIDPagoFactura((int)facturaDataGridView.Rows[0].Cells["id_pago"].Value);

            int idDevolucion = mapper.CrearDevolucion(devolucion);

            if (idDevolucion > 0)
            {
                mapper.BorrarIDPagoDeLaFactura(devolucion.getIDFactura());
                Util.ShowMessage("Se ha devuelto la factura correctamente.", MessageBoxIcon.Information);
                limpiarButton_Click(this, null);
            }
        }
Example #2
0
 //* Devolucion *//
 public int CrearDevolucion(PagoAgilFrba.Modelo.Devolucion devolucion)
 {
     return(this.Crear(devolucion));
 }