Exemplo n.º 1
0
        private void btn_EliminarReporte_Click(object sender, RoutedEventArgs e)
        {
            int index = dg_Reportes.SelectedIndex;

            if (index >= 0)
            {
                Reporte rep = listReporte[index];
                if (MessageBox.Show("¿Desea eliminar el reporte con numero: " + rep.IdReporte + "?", "Eliminar reporte", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    ImagenDAO.eliminarImagenes(rep.IdReporte);
                    Reporte_VehiculoDAO.eliminarVehiculosReporte(rep.IdReporte);
                    ReporteDAO.eliminarReporte(rep.IdReporte);
                    MessageBox.Show("Reporte eliminado completamente");
                }
                cargarReportes();
            }
            else
            {
                MessageBox.Show("Seleccione un Reporte");
            }
        }