Creado Gestión

This commit is contained in:
2026-02-19 08:35:01 +01:00
parent 2d17179401
commit 1da1412c5f
16 changed files with 1109 additions and 25 deletions

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(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