private void Eliminar_Event(object sender, RoutedEventArgs e) { DataRowView dataRowView = (DataRowView)((Button)e.Source).DataContext; var deleteConfirmation = new DeleteConfirmation("DELETE FROM [FlemidraDB].[dbo].[Products] Where id =", dataRowView[0].ToString()); deleteConfirmation.ShowDialog(); Update_DataGrid(); }
private void Eliminar_Event(object sender, RoutedEventArgs e) { try { var dataRowView = (DataRowView)((Button)e.Source).DataContext; var deleteConfirmation = new DeleteConfirmation("DELETE FROM dbo.Users Where id = ", dataRowView[0].ToString()); deleteConfirmation.ShowDialog(); Update_DataGrid(); } catch (Exception exception) { MessageBox.Show("Error inesperado al eliminar usuario. " + exception); } }
private void Eliminar_Event(object sender, RoutedEventArgs e) { try { var dataRowView = (DataRowView)((Button)e.Source).DataContext; var deleteConfirmation = new DeleteConfirmation("DELETE FROM [FlemidraDB].[dbo].[Categories] Where id =", dataRowView[0].ToString()); deleteConfirmation.ShowDialog(); Update_DataGrid(); } catch (Exception en) { MessageBox.Show("Error al realizar operacion de borrado de categoria. " + en); } }