Ejemplo n.º 1
0
 private void BtnAnular_Click(object sender, EventArgs e)
 {
     if (dgvVentas.SelectedCells.Count > 0)
     {
         VentaNegocio           negV  = new VentaNegocio();
         ProductoVendidoNegocio negPV = new ProductoVendidoNegocio();
         Venta v = (Venta)dgvVentas.CurrentRow.DataBoundItem;
         try
         {
             using (var popup = new Confirmacion(@"anular la venta """ + v.ToString() + @""""))
             {
                 var R = popup.ShowDialog();
                 if (R == DialogResult.OK)
                 {
                     bool conf = popup.R;
                     if (v != null && conf == true)
                     {
                         negV.AnularVenta(v);
                         LlenarTabla();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog();
         }
     }
     else
     {
         Mensaje m = new Mensaje("Ningun item seleccionado.");
         m.ShowDialog();
     }
 }