Imports System.Data.Entity Imports bdGrupoSanchoToro.db Imports DevExpress.Xpf.Core Imports bdGrupoSanchoToro.db.Utilidades Imports bdGrupoSanchoToro Public Class dxwIVA Friend IVA As Double Private _bd As tscGrupoSanchoToro Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs) If gciva.CurrentItem IsNot Nothing Then Dim eniva = DirectCast(gciva.CurrentItem, enumeraciones) IVA = eniva.ValorNumerico1 Me.DialogResult = True Me.Close() End If End Sub Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs) Me.DialogResult = False Me.Close() End Sub Private Sub dxwproductos_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded Try Me.gciva.ItemsSource = _bd.enumeraciones.Where(Function(x) x.idGrupoEnumeracionNavigation.Grupo = "PIVA").OrderByDescending(Function(X) X.ValorNumerico1).ToList Me.gciva.View.Focus() Catch ex As Exception DXMessageBox.Show(ex.Message, "Error") Finally If DXSplashScreen.IsActive Then DXSplashScreen.Close() End Try End Sub 'Public Sub New(bd As m3academiaEntities, Existentes As List(Of Integer?)) Public Sub New(bd As tscGrupoSanchoToro) _bd = bd IVA = _bd.enumeraciones.First(Function(x) x.Codigo = "PIVA.DEFECTO").ValorNumerico1 ' Llamada necesaria para el diseñador. InitializeComponent() Comun.EscalaVentana(Me, Me.grid.LayoutTransform) ' Agregue cualquier inicialización después de la llamada a InitializeComponent(). End Sub Private Sub dxw_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown If e.Key = Key.Enter Then btAceptar_Click(Nothing, Nothing) End If End Sub Private Sub tv_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles tviva.MouseDoubleClick btAceptar_Click(Nothing, Nothing) End Sub End Class