Agregar archivos de proyecto.

This commit is contained in:
2026-01-23 12:45:41 +01:00
parent 5ed4e0bc46
commit c8d1044267
237 changed files with 34721 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<dx:DXWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
x:Class="dxwAgregarNuevoCodigoPostal"
Title="Atención el código postal indicado no se encuentra en nuestra B.D. Por favor introduzca los siguientes datos." Height="230" Width="680" ShowInTaskbar="True" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ShowIcon="False" ResizeMode="NoResize" >
<Grid x:Name="grid">
<dxlc:LayoutControl Header="Header" Orientation="Vertical" UseLayoutRounding="True" View="GroupBox" >
<dxlc:LayoutGroup x:Name="lgTotalesClase" IsCollapsible="True" IsLocked="True" Height="Auto" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" >
<tsWPF:tsLayoutItem Label="Nuevo Código Postal:" FontWeight="Bold" HorizontalAlignment="Left" Width="300">
<dxe:TextEdit TabIndex="1" x:Name="teCodigoPostal" IsEnabled="False" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Municipio:" FontWeight="Bold" HorizontalAlignment="Left" Width="500" >
<dxe:ComboBoxEdit TabIndex="1" x:Name="cbMunicipio" IsEnabled="True" ValueMember="CodigoMunicipio" DisplayMember="Nombre" AutoComplete="True" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Provincia:" FontWeight="Bold" HorizontalAlignment="Left" Width="500" >
<dxe:TextEdit TabIndex="1" x:Name="teProvincia" IsEnabled="False" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Descripción Adicional (Opcional):" HorizontalAlignment="Left" Width="500">
<dxe:TextEdit TabIndex="1" x:Name="teDescripcionAdicional" IsEnabled="True" MaxLength="80" />
</tsWPF:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Height="35" Margin="0,30" >
<Button x:Name="btAceptar" Click="btAceptar_Click" Width="100" HorizontalAlignment="Left" >Aceptar</Button>
<Button x:Name="btCancelar" Click="btCancelar_Click" Margin="30,0,0,0" Width="100">Cancelar </Button>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,71 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports DevExpress.Mvvm
Imports DevExpress.Xpf.Grid
Imports tsWPFCore
Imports tsEFCore8.Extensiones
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Imports bdGrupoSanchoToro
Public Class dxwAgregarNuevoCodigoPostal
' Private _alumno As alumnos
Friend _CodigoPostal As String
Private _bd As tscGrupoSanchoToro
Private Sub dxwAgregarNuevoCodigoPostal_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Me.teCodigoPostal.EditValue = _CodigoPostal
Dim sCodigoProvincia As String = _CodigoPostal.Substring(0, 2)
Me.teProvincia.EditValue = _bd.provincias.First(Function(x) x.CodigoProvincia = sCodigoProvincia).Nombre
Me.cbMunicipio.ItemsSource = _bd.municipios.Where(Function(x) x.CodigoProvincia = sCodigoProvincia).OrderBy(Function(x) x.Nombre).ToList
Me.cbMunicipio.Focus()
End Sub
Public Sub New(CodigoPostal As String, bd As tscGrupoSanchoToro)
_CodigoPostal = CodigoPostal
_bd = bd
' 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 btCancelar_Click(sender As Object, e As RoutedEventArgs)
Me.DialogResult = False
Me.Close()
End Sub
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
Try
If cbMunicipio.EditValue Is Nothing Then
DXMessageBox.Show("El municipio es obligatorio")
Else
Dim _CodigoMunicipio As String = ""
If cbMunicipio.EditValue IsNot Nothing Then _CodigoMunicipio = cbMunicipio.EditValue
Dim sDescripcionAdicional As String = ""
If teDescripcionAdicional.EditValue IsNot Nothing Then sDescripcionAdicional = teDescripcionAdicional.EditValue
Dim ncp As New bdGrupoSanchoToro.db.codigospostales
With ncp
.CodigoMunicipio = _CodigoMunicipio
.CodigoPostal = _CodigoPostal
.DescripcionAdicional = sDescripcionAdicional
End With
_bd.codigospostales.Add(ncp)
_bd.GuardarCambios()
Me.DialogResult = True
Me.Close()
End If
Catch ex As Exception
Comun.GeneraRegistroCorreoExcepcion(Nothing, ex, "dxwAgregarNuevoCodigoPostal.btAceptar_Click")
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
End Class

View File

@@ -0,0 +1,34 @@
<dx:DXWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
x:Class="dxwAgregarNuevoMunicipio"
Title="Nuevo CodigoPostal/Municipio" Height="230" Width="680" ShowInTaskbar="True" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ShowIcon="False" ResizeMode="NoResize" >
<Grid>
<dxlc:LayoutControl Header="Header" Orientation="Vertical" UseLayoutRounding="True" View="GroupBox" >
<dxlc:LayoutGroup x:Name="lgTotalesClase" IsCollapsible="True" IsLocked="True" Height="Auto" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" >
<tsWPF:tsLayoutItem Label="Nuevo Código Postal:" FontWeight="Bold" HorizontalAlignment="Left" Width="300">
<dxe:TextEdit TabIndex="1" x:Name="teCodigoPostal" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Municipio:" FontWeight="Bold" HorizontalAlignment="Left" Width="500" >
<dxe:TextEdit TabIndex="1" x:Name="teMunicipio" IsEnabled="True" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Provincia:" FontWeight="Bold" HorizontalAlignment="Left" Width="500" >
<dxe:TextEdit TabIndex="1" x:Name="cbProvincia" IsEnabled="False" />
</tsWPF:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Height="35" Margin="0,30" >
<Button x:Name="btAceptar" Click="btAceptar_Click" Width="100" HorizontalAlignment="Left" >Aceptar</Button>
<Button x:Name="btCancelar" Click="btCancelar_Click" Margin="30,0,0,0" Width="100">Cancelar </Button>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,82 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports DevExpress.Mvvm
Imports DevExpress.Xpf.Grid
Imports tsWPFCore
Imports tsEFCore8.Extensiones
Imports DevExpress.Xpf.Core
Imports DevExpress.XtraReports.UI
Imports System.IO
Imports DevExpress.Xpf.Printing
Imports Microsoft.Win32
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports DevExpress.Xpf.Editors
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
Imports bdGrupoSanchoToro
Public Class dxwAgregarNuevoMunicipio
' Private _alumno As alumnos
Friend _CodigoPostal As String
Friend _CodigoMunicipio As String
Private bd As tscGrupoSanchoToro
Private Sub dxwAgregarNuevoCodigoPostal_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Me.teCodigoPostal.Focus()
End Sub
Public Sub New(CodigoPostal As String)
' Llamada necesaria para el diseñador.
InitializeComponent()
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
bd = tscGrupoSanchoToro.NuevoContexto
_CodigoPostal = CodigoPostal
teCodigoPostal.EditValue = CodigoPostal
End Sub
Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
Me.DialogResult = False
Me.Close()
End Sub
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
Try
If teMunicipio.EditValue IsNot Nothing AndAlso teCodigoPostal.EditValue IsNot Nothing Then
_CodigoPostal = teCodigoPostal.EditValue
If _CodigoPostal.Length <> 5 Then Throw New Exception("El código postal es erróneo")
Dim codpro = _CodigoPostal.Substring(0, 2)
Dim provincia = bd.provincias.FirstOrDefault(Function(x) x.CodigoProvincia = codpro)
If provincia Is Nothing Then Throw New Exception("El código postal no pertenece a ninguna provincia")
Dim mun As String = teMunicipio.EditValue
If mun.NothingAVacio = "" Then Throw New Exception("El municipio es obligatorio")
_CodigoMunicipio = bdGrupoSanchoToro.db.municipios.ObtieneCodigoMunicipioMasCoincidente(bd, _CodigoPostal, mun)
Me.DialogResult = True
Me.Close()
Else
DXMessageBox.Show("El codigo postal y el municipio son obligatorios", "Atención")
End If
Catch ex As Exception
FuncionesDinamicas.ErrorNoControladoAp("dxwagregarnuevomunicipio_aceptar_click", ex)
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
Private Sub teCodigoPostal_EditValueChanged(sender As Object, e As EditValueChangedEventArgs) Handles teCodigoPostal.EditValueChanged
Dim codpos As String = teCodigoPostal.EditValue
If codpos IsNot Nothing AndAlso codpos.Length = 5 Then
Dim codpro = codpos.Substring(0, 2)
Dim provincia = bd.provincias.FirstOrDefault(Function(x) x.CodigoProvincia = codpro)
If provincia IsNot Nothing Then
cbProvincia.EditValue = provincia.Nombre
Else
cbProvincia.EditValue = ""
End If
Else
cbProvincia.EditValue = ""
End If
End Sub
End Class

View File

@@ -0,0 +1,72 @@
<dx:DXWindow x:Class="dxwArticulos"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="1500" Height="700">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gcArticulos" NombreTablaBase="articulos" TabIndex="16" >
<tsWPF:tsGridControl.PropiedadesTSGC>
<tsWPF:PropiedadesTSGC/>
</tsWPF:tsGridControl.PropiedadesTSGC>
<tsWPF:tsGridControl.View>
<tsWPF:tsTableView x:Name="tvArticulos" ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="False" />
</tsWPF:tsGridControl.View>
<dxg:GridColumn FieldName="CodigoArticulo" Header="Código Artículo" IsSmart="True" Width="100" />
<dxg:GridColumn FieldName="NumeroSerie" Header="Nº Serie" IsSmart="True" Width="100" />
<tsWPF:tsGridColumn FieldName="entidades.RazonSocial" Header="Proveedor" Width="220"/>
<dxg:GridColumn FieldName="NumeroFraCompra" Header="Nº Fra. Compra" Width="100" IsSmart="True" />
<dxg:GridColumn FieldName="FechaCompra" Width="90" >
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="FechaFinGarantia" Width="120" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="FechaBaja" Width="100" IsSmart="True" >
<dxg:GridColumn.EditSettings>
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<tsWPF:tsGridColumn FieldName="UltimoAlbaranEntrega" Header="Último Albarán Entrega" Width="140" />
<tsWPF:tsGridColumn FieldName="UltimaFactura" Header="Última Factura" Width="120" />
<tsWPF:tsGridColumn FieldName="Observaciones" Width="300" IsSmart="True" />
<tsWPF:tsGridColumn FieldName="Averias" Width="300" IsSmart="True" />
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,60 @@
Imports System.Data.Entity
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Public Class dxwArticulos
Private _idProducto As Integer
Private _LArticulos As List(Of articulos)
Friend idArticulo As Integer
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gcArticulos.CurrentItem IsNot Nothing Then
Dim art = DirectCast(gcArticulos.CurrentItem, articulos)
idArticulo = art.idarticulo
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.gcArticulos.ItemsSource = _LArticulos.Where(Function(x) x.idProducto = _idProducto).OrderBy(Function(x) x.CodigoArticulo).ToList
Me.gcArticulos.View.SearchControl.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(lArticulos As List(Of articulos), idProducto As Integer)
' Llamada necesaria para el diseñador.
InitializeComponent()
Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
_LArticulos = lArticulos
_idProducto = idProducto
' 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 tvArticulos.MouseDoubleClick
btAceptar_Click(Nothing, Nothing)
End Sub
End Class

View File

@@ -0,0 +1,51 @@
<dx:DXWindow x:Class="dxwCodigosPostales"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione Población y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="900" Height="350">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gc" Grid.Row="0" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="CodigoPostal" Header="Código Postal" Width="90" />
<dxg:GridColumn FieldName="Poblacion" Header="Poblacion" Width="450" />
<dxg:GridColumn FieldName="Provincia" Header="Provincia" Width="350" IsSmart="True"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPF:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="False" />
</dxg:GridControl.View>
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,69 @@
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Imports bdGrupoSanchoToro
Imports System.Linq.Dynamic.Core
Imports Microsoft.EntityFrameworkCore
Public Class dxwCodigosPostales
Friend CodigoMunicipio As String
Friend CodigoPostal As String
Private _CodigoPostal As String
Friend _bd As tscGrupoSanchoToro
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
Dim cp = DirectCast(gc.CurrentItem, codigospostales)
CodigoMunicipio = cp.CodigoMunicipio
CodigoPostal = cp.CodigoPostal
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 dxwCodigosPostales_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
If _CodigoPostal <> "" Then
Me.gc.ItemsSource = _bd.codigospostales.Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).Where(Function(x) x.CodigoPostal = _CodigoPostal).OrderBy(Function(x) x.CodigoMunicipioNavigation.Nombre).ToList
Else
Me.gc.ItemsSource = _bd.codigospostales.Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).OrderBy(Function(x) x.CodigoMunicipioNavigation.Nombre).ToList
End If
Me.gc.View.SearchControl.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, CodigoPostal As String)
' Llamada necesaria para el diseñador.
InitializeComponent()
Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
_CodigoPostal = CodigoPostal
_bd = bd
' _existentes = Existentes
' 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 tv.MouseDoubleClick
btAceptar_Click(Nothing, Nothing)
End Sub
End Class

View File

@@ -0,0 +1,62 @@
<dx:DXWindow x:Class="dxwEntidades"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="1500" Height="700">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gc">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="RazonSocial" Header="Razón Social" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="NIF" Header="NIF" Width="90" IsSmart="True"/>
<dxg:GridColumn FieldName="Telefono1" Header="Teléfono" Width="90" IsSmart="True"/>
<dxg:GridColumn FieldName="Email" Header="Email" Width="200" IsSmart="True"/>
<dxg:GridColumn FieldName="Direccion" Header="Dirección" Width="400" IsSmart="True" AllowSearchPanel="False" />
<dxg:GridColumn FieldName="CodigoPostal" Header="Código Postal" Width="120" IsSmart="True" AllowSearchPanel="False" />
<dxg:GridColumn FieldName="municipios.Nombre" Header="Población" Width="400" IsSmart="True" AllowSearchPanel="False" />
<dxg:GridColumn FieldName="municipios.provincias.Nombre" Header="Provincia" Width="350" IsSmart="True" AllowSearchPanel="False" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPF:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="False" >
<tsWPF:tsTableView.FormatConditions>
<dxg:FormatCondition Expression="Not IsNull([FechaCierre])" FieldName="{x:Null}" >
<dx:Format Foreground="Red" />
</dxg:FormatCondition>
</tsWPF:tsTableView.FormatConditions>
</tsWPF:tsTableView>
</dxg:GridControl.View>
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,70 @@
Imports System.Data.Entity
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Imports bdGrupoSanchoToro
Public Class dxwEntidades
Friend Entidad As entidades
Friend _bd As tscGrupoSanchoToro
Private _EsCliente As Boolean
Private _EsProveedor As Boolean
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
Dim ent = DirectCast(gc.CurrentItem, entidades)
Entidad = ent
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 dxwEntidades_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
Dim ients = _bd.entidades.Where(Function(x) x.idEmpresa = EmpresaActual.idEmpresa AndAlso x.FechaBaja Is Nothing).Include(Function(x) x.CodigoMunicipioNavigation.CodigoProvinciaNavigation).AsQueryable
ients = ients.Where(Function(x) (x.EsCliente AndAlso _EsCliente) OrElse (x.EsProveedor AndAlso _EsProveedor))
Me.gc.ItemsSource = ients.OrderBy(Function(x) x.RazonSocial).ToList
Me.gc.View.SearchControl.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, EsCliente As Boolean, EsProveedor As Boolean)
' Llamada necesaria para el diseñador.
InitializeComponent()
Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
_EsCliente = EsCliente
_EsProveedor = EsProveedor
_bd = bd
' _existentes = Existentes
' 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 tv.MouseDoubleClick
btAceptar_Click(Nothing, Nothing)
End Sub
End Class

View File

@@ -0,0 +1,43 @@
<dx:DXWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
x:Class="dxwEnvioCorreo"
Title="Envío de Correo Electrónico." Height="390" Width="680" ShowInTaskbar="True" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ShowIcon="False" ResizeMode="NoResize" >
<Grid x:Name="grid">
<dxlc:LayoutControl Header="Header" Orientation="Vertical" UseLayoutRounding="True" View="GroupBox" >
<dxlc:LayoutGroup IsLocked="True" Height="Auto" HorizontalAlignment="Stretch" >
<dxlc:LayoutGroup Orientation="Vertical" >
<tsWPF:tsLayoutItem Label="Destinatario(s):" FontWeight="Bold" >
<dxe:TextEdit TabIndex="1" x:Name="teDestinatario" IsEnabled="True" MaxLength="255" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Con Copia A:" >
<dxe:TextEdit TabIndex="1" x:Name="teCopia" IsEnabled="True" MaxLength="255" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Con Copia Oculta A:" >
<dxe:TextEdit TabIndex="1" x:Name="teCopiaOculta" IsEnabled="False" MaxLength="255" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Asunto:" FontWeight="Bold" >
<dxe:TextEdit TabIndex="1" x:Name="teAsunto" IsEnabled="True" MaxLength="255" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Cuerpo:" >
<dxe:TextEdit TabIndex="1" x:Name="teCuerpo" IsEnabled="True" MaxLength="4096" AcceptsReturn="True" Height="100" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Adjunto:" >
<dxe:TextEdit TabIndex="1" x:Name="teAdjunto" IsEnabled="True" IsReadOnly="True" />
</tsWPF:tsLayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Height="35" Margin="0,30" >
<Button x:Name="btAceptar" Click="btAceptar_Click" Width="100" HorizontalAlignment="Left" >Aceptar</Button>
<Button x:Name="btCancelar" Click="btCancelar_Click" Margin="30,0,0,0" Width="100">Cancelar </Button>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,82 @@

Imports System.Data.Entity
Imports DevExpress.Xpf.Core.ServerMode
Imports DevExpress.Mvvm
Imports DevExpress.Xpf.Grid
Imports tsWPFCore
Imports tsEFCore8.Extensiones
Imports DevExpress.Xpf.Core
Imports DevExpress.XtraReports.UI
Imports System.IO
Imports DevExpress.Xpf.Printing
Imports Microsoft.Win32
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports bdGrupoSanchoToro.db.Utilidades
Public Class dxwEnvioCorreo
Friend _Destinatarios As String
Friend _CC As String
Friend _BCC As String
Friend _Asunto As String
Friend _Cuerpo As String
Friend _Adjunto As String
Private Sub dxw_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
teDestinatario.Text = _Destinatarios
teCuerpo.Text = _Cuerpo
teAdjunto.Text = _Adjunto
teCopia.Text = _CC
teCopiaOculta.Text = _BCC
teAsunto.Text = _Asunto
teDestinatario.Focus()
End Sub
Public Sub New(Destinatarios As String, CC As String, BCC As String, Asunto As String, Cuerpo As String, Adjunto As String)
_Destinatarios = Destinatarios
_CC = CC
_BCC = BCC
_Asunto = Asunto
_Cuerpo = Cuerpo
_Adjunto = Adjunto
' 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 btCancelar_Click(sender As Object, e As RoutedEventArgs)
Me.DialogResult = False
Me.Close()
End Sub
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
Try
If teDestinatario.Text.Trim.ToLower.EsEmailValido AndAlso teAsunto.Text.Trim <> "" Then
_Destinatarios = teDestinatario.Text.Trim.ToLower
_Cuerpo = teCuerpo.Text
_Adjunto = teAdjunto.Text
_CC = teCopia.Text
_BCC = teCopiaOculta.Text
_Asunto = teAsunto.Text
Me.DialogResult = True
Me.Close()
Else
DXMessageBox.Show("El asunto y el destinatario son campos obligatorios")
End If
Catch ex As Exception
Comun.GeneraRegistroCorreoExcepcion(Nothing, ex, "dxwAgregarNuevoCodigoPostal.btAceptar_Click")
DXMessageBox.Show(ex.Message, "Error")
End Try
End Sub
End Class

View File

@@ -0,0 +1,47 @@
<dx:DXWindow x:Class="dxwIVA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="400" Height="200">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gciva" TabIndex="1" >
<tsWPF:tsGridControl.View>
<tsWPF:tsTableView x:Name="tviva" ShowSearchPanelMode="Never" AllowEditing="False" ShowGroupPanel="False" />
</tsWPF:tsGridControl.View>
<dxg:GridColumn FieldName="Descripcion" Header="% I.V.A." IsSmart="True" Width="350" />
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="2">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="3">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,44 @@
<dx:DXWindow x:Name="text" ShowIcon="False" ResizeMode="NoResize" WindowStyle="SingleBorderWindow"
x:Class="dxwIdentificacion"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
Title="Identificación" Height="Auto" Width="390" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" Topmost="True" >
<Grid x:Name="gc" Height="Auto" >
<dxlc:LayoutControl Header="Header" Orientation="Vertical" View="GroupBox" >
<dxlc:LayoutGroup Orientation="Vertical" Height="Auto" >
<tsWPF:tsLayoutItem Label="Usuario:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" >
<dxe:TextEdit Name="teUsuario" VerticalAlignment="Top" TabIndex="0" x:FieldModifier="Public" />
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Contraseña:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" >
<dxe:PasswordBoxEdit Name="pbeContrasenna" VerticalAlignment="Top" TabIndex="1" x:FieldModifier="Public"/>
</tsWPF:tsLayoutItem>
<tsWPF:tsLayoutItem Label="Empresa:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" x:Name="liEmpresa" Visibility="Collapsed" >
<dxe:ComboBoxEdit TabIndex="1" x:Name="cbEmpresa" IsEnabled="True" ValueMember="idEmpresa" DisplayMember="RazonSocial" AutoComplete="True" />
</tsWPF:tsLayoutItem>
</dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical" Margin="0,10" >
<dxlc:LayoutGroup >
<Button Content="Aceptar" Height="23" HorizontalAlignment="Left" Name="Button1" VerticalAlignment="Top" Width="121" />
<Button Content="Cancelar" Height="23" HorizontalAlignment="Right" Name="Button2" VerticalAlignment="Top" Width="121" />
</dxlc:LayoutGroup>
<Label x:Name="lVersion" Content="Versión:" FontSize="9" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="200" />
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
<!--<Grid x:Name="gc" >
<dxe:TextEdit HorizontalAlignment="Left" Margin="99,14,0,0" Name="teUsuario" VerticalAlignment="Top" Width="212" TabIndex="0" x:FieldModifier="Public" />
<Label Content="Usuario:" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="Label1" VerticalAlignment="Top" Width="88" />
<Label Content="Contraseña:" Height="23" HorizontalAlignment="Left" Margin="12,55,0,0" Name="Label2" VerticalAlignment="Top" Width="79" />
<dxe:PasswordBoxEdit HorizontalAlignment="Left" Margin="97,56,0,0" Name="pbeContrasenna" VerticalAlignment="Top" Width="215" TabIndex="1" x:FieldModifier="Public"/>
<dxe:ComboBoxEdit TabIndex="1" x:Name="cbMunicipio" IsEnabled="True" ValueMember="CodigoMunicipio" DisplayMember="Nombre" AutoComplete="True" />
<Button Content="Aceptar" Height="23" HorizontalAlignment="Left" Margin="21,95,0,0" Name="Button1" VerticalAlignment="Top" Width="121" />
<Button Content="Cancelar" Height="23" HorizontalAlignment="Right" Margin="0,95,22,0" Name="Button2" VerticalAlignment="Top" Width="121" />
<Label x:Name="lVersion" Content="Versión:" FontSize="9" Height="23" HorizontalAlignment="Left" Margin="11,139,0,0" VerticalAlignment="Top" Width="200" />
</Grid>-->
</dx:DXWindow>

View File

@@ -0,0 +1,73 @@
Imports DevExpress.Xpf.Editors
Imports DevExpress.Xpf.Core.Native
Imports System.Reflection
Imports bdGrupoSanchoToro.db
Public Class dxwIdentificacion
Private _Empresas As List(Of db.empresas)
Private _Version As String
Public Cancelar As Boolean
Public Sub New(Empresas As List(Of bdGrupoSanchoToro.db.empresas), Version As String)
_Version = Version
_Empresas = Empresas
' Esta llamada es exigida por el diseñador.
InitializeComponent()
If Empresas.Count > 1 Then
Me.Height = 290
liEmpresa.Visibility = Visibility.Visible
Else
Me.Height = 230
End If
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
Cancelar = False
Me.Close()
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
Cancelar = True
Me.Close()
End Sub
Private Sub Window_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles gc.PreviewKeyDown
If e.Key = Key.Return Then
If teUsuario.Text <> "" And Me.pbeContrasenna.Text <> "" Then
Cancelar = False
Me.Close()
Else
Dim te As BaseEdit = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
If te Is Nothing Then
FocusManager.SetFocusedElement(Me, teUsuario)
Else
If te.Name.ToUpper = "TEUSUARIO" Then
FocusManager.SetFocusedElement(Me, pbeContrasenna)
Else
FocusManager.SetFocusedElement(Me, teUsuario)
End If
End If
End If
End If
End Sub
Private Sub dxwIdentificacion_Activated(sender As Object, e As EventArgs) Handles Me.Activated
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() Me.Focus()), System.Windows.Threading.DispatcherPriority.Send)
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() teUsuario.Focus()), System.Windows.Threading.DispatcherPriority.Send)
End Sub
Private Sub dxwIdentificacion_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
'FocusManager.SetFocusedElement(Me, teUsuario)
cbEmpresa.ItemsSource = _Empresas
cbEmpresa.EditValue = _Empresas.First.idEmpresa
teUsuario.Focus()
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() Me.Focus()), System.Windows.Threading.DispatcherPriority.Send)
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() teUsuario.Focus()), System.Windows.Threading.DispatcherPriority.Send)
Cancelar = True
lVersion.Content = "Versión: " & _Version
End Sub
End Class

View File

@@ -0,0 +1,61 @@
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

View File

@@ -0,0 +1,50 @@
<dx:DXWindow x:Class="dxwPoblaciones"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione Población y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="900" Height="350">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gc" Grid.Row="0" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Poblacion" Header="Población" Width="450" />
<dxg:GridColumn FieldName="Provincia" Header="Provincia" Width="350" IsSmart="True"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPF:tsTableView x:Name="tv" ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="False" />
</dxg:GridControl.View>
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,63 @@
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Imports bdGrupoSanchoToro
Imports Microsoft.EntityFrameworkCore
Public Class dxwPoblaciones
Friend CodigoMunicipio As String
' Friend CodigoPostal As String
' Private _CodigoPostal As String
Friend _bd As tscGrupoSanchoToro
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
CodigoMunicipio = DirectCast(gc.CurrentItem, municipios).CodigoMunicipio
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 dxwPoblaciones_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Try
Me.gc.ItemsSource = _bd.municipios.Include(Function(x) x.CodigoProvinciaNavigation).OrderBy(Function(x) x.Nombre).ToList
Me.gc.View.SearchControl.Focus()
Catch ex As Exception
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
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)
' Llamada necesaria para el diseñador.
InitializeComponent()
Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
_bd = bd
' _existentes = Existentes
' 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 tv.MouseDoubleClick
btAceptar_Click(Nothing, Nothing)
End Sub
End Class

View File

@@ -0,0 +1,67 @@
<dx:DXWindow x:Class="dxwProductos"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:tsWPF="clr-namespace:tsWPFCore;assembly=tsWPFCore"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
ShowIcon="False" Title="Seleccione y Pulse Aceptar" WindowStyle="ToolWindow" WindowState="Normal" Topmost="True" WindowStartupLocation="CenterScreen" Width="1200" Height="800">
<dx:DXWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</dx:DXWindow.Resources>
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="45" />
</Grid.RowDefinitions>
<tsWPF:tsGridControl x:Name="gc">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="400" IsSmart="True" />
<dxg:GridColumn FieldName="Stock" x:Name="gcStock" Width="90" IsSmart="True"/>
<dxg:GridColumn FieldName="UnidadesAlquiladas" x:Name="gcUnidadesAlquiladas" Width="130" HorizontalHeaderContentAlignment="Right" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="N0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<!--<dxg:GridColumn FieldName="PrecioAlquiler" Width="120" HorizontalHeaderContentAlignment="Right" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PrecioVenta" Width="120" HorizontalHeaderContentAlignment="Right" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" Mask="c2" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>-->
<dxg:GridColumn FieldName="Observaciones" Width="300" IsSmart="True"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<tsWPF:tsTableView ShowSearchPanelMode="Always" AllowEditing="False" ShowGroupPanel="False" x:Name="tvProductos">
</tsWPF:tsTableView>
</dxg:GridControl.View>
</tsWPF:tsGridControl>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="0">Aceptar</Button>
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="1">Cancelar</Button>
</Grid>
</Grid>
</dx:DXWindow>

View File

@@ -0,0 +1,64 @@
Imports System.Data.Entity
Imports bdGrupoSanchoToro.db
Imports DevExpress.Xpf.Core
Imports bdGrupoSanchoToro.db.Utilidades
Imports bdGrupoSanchoToro
Public Class dxwProductos
Friend idProducto As Integer
Friend _bd As tscGrupoSanchoToro
Private _Lproductos As List(Of productos)
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
If gc.CurrentItem IsNot Nothing Then
Dim pro = DirectCast(gc.CurrentItem, productos)
idProducto = pro.idProducto
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.gc.ItemsSource = _Lproductos.ToList
Me.gc.View.SearchControl.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(lProductos As List(Of productos), Optional OcultarStock As Boolean = False)
' Llamada necesaria para el diseñador.
InitializeComponent()
If OcultarStock Then
gcStock.Visible = False
gcUnidadesAlquiladas.Visible = False
End If
Comun.EscalaVentana(Me, Me.grid.LayoutTransform)
_Lproductos = lProductos
' 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 tvProductos.MouseDoubleClick
btAceptar_Click(Nothing, Nothing)
End Sub
End Class