Agregar archivos de proyecto.
93
App.config
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<section name="DXThemeManager" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
</configSections>
|
||||||
|
<entityFramework>
|
||||||
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<!--<dependentAssembly>
|
||||||
|
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>-->
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.8.3.0" newVersion="6.8.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.5" newVersion="10.0.0.5" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-10.0.0.7" newVersion="10.0.0.7" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="IronOcr.Spanish" publicKeyToken="5f366048dc436899" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.0.20747" newVersion="4.0.0.20747" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<userSettings>
|
||||||
|
<DXThemeManager>
|
||||||
|
<setting name="ApplicationThemeName" serializeAs="String">
|
||||||
|
<value>Office2016White</value>
|
||||||
|
</setting>
|
||||||
|
</DXThemeManager>
|
||||||
|
</userSettings>
|
||||||
|
</configuration>
|
||||||
72
App.config.bak
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
|
||||||
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
|
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||||
|
</configSections>
|
||||||
|
<entityFramework>
|
||||||
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.8.3.0" newVersion="6.8.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<publisherPolicy apply="no" />
|
||||||
|
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
|
</startup>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="IronOcr" publicKeyToken="5f366048dc436899" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.2.17158" newVersion="4.2.2.17158" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="IronOcr.Spanish" publicKeyToken="5f366048dc436899" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.0.20747" newVersion="4.0.0.20747" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<system.data>
|
||||||
|
<DbProviderFactories>
|
||||||
|
<remove invariant="Oracle.ManagedDataAccess.Client" />
|
||||||
|
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
|
||||||
|
</DbProviderFactories>
|
||||||
|
</system.data>
|
||||||
|
<oracle.manageddataaccess.client>
|
||||||
|
<version number="*">
|
||||||
|
<dataSources>
|
||||||
|
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
|
||||||
|
</dataSources>
|
||||||
|
</version>
|
||||||
|
</oracle.manageddataaccess.client>
|
||||||
|
</configuration>
|
||||||
75
BDContexto.vb
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
Option Strict Off
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
|
||||||
|
Public Class BDContexto
|
||||||
|
'Friend Shared Sub Contexto_SavingChanges(GrupoDocumentos As DocumentGroup, TagsApArefrescar() As String, DocPanelTag As String, Aplicacion As String, RegistroNuevo As Boolean, idRegistro As Object)
|
||||||
|
' Try
|
||||||
|
' Dim dcs As IEnumerable(Of BaseLayoutItem)
|
||||||
|
' If Not TagsApArefrescar Is Nothing Then
|
||||||
|
' For Each Etiqueta In TagsApArefrescar
|
||||||
|
' dcs = (From p In GrupoDocumentos.Items Where p.Tag = Etiqueta)
|
||||||
|
' If dcs.Count > 0 Then
|
||||||
|
' Dim dc As DocumentPanel = dcs.First
|
||||||
|
' If dc.Content.GetType Is GetType(tsWPF.ContenedorCabLin) Then
|
||||||
|
' 'DirectCast(dc.Content, tsWPF.ContenedorCabLin).Aplicacion.Refrescar = True
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorCabLin).Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(, True)), Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorLineas) Then
|
||||||
|
' 'DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea.Refrescar = True
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(True)), Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorAplicacion) Then
|
||||||
|
' 'DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea.Refrescar = True
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorAplicacion)._Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(, True, Aplicacion, RegistroNuevo, idRegistro)), Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' Else
|
||||||
|
' dcs = (From p In GrupoDocumentos.Items Where p.Tag <> DocPanelTag)
|
||||||
|
' For Each dc As DocumentPanel In dcs
|
||||||
|
' If dc.Content.GetType Is GetType(tsWPF.ContenedorCabLin) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorCabLin).Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' ' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' 'If Not a.DeshabilitarRefresco Then
|
||||||
|
' ' Dim th = New System.Threading.Thread(Sub() a.RefrescaUC(, False))
|
||||||
|
' ' th.Start()
|
||||||
|
' 'End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorLineas) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(True)), Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' 'If Not a.DeshabilitarRefresco Then
|
||||||
|
' ' Dim t As Task = Task.Run(New Action(Sub() a.RefrescaUC(True)))
|
||||||
|
' 'End If
|
||||||
|
|
||||||
|
' 'If Not a.DeshabilitarRefresco Then
|
||||||
|
' ' If Not a.DeshabilitarRefresco Then
|
||||||
|
' ' Dim th = New System.Threading.Thread(Sub() a.RefrescaUC(True))
|
||||||
|
' ' th.Start()
|
||||||
|
' ' End If
|
||||||
|
' 'End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorAplicacion) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorAplicacion)._Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True, Aplicacion, RegistroNuevo, idRegistro)), Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' 'If Not a.DeshabilitarRefresco Then
|
||||||
|
' ' Dim th = New System.Threading.Thread(Sub() a.RefrescaUC(, False, Aplicacion, RegistroNuevo, idRegistro))
|
||||||
|
' ' th.SetApartmentState(System.Threading.ApartmentState.STA)
|
||||||
|
' ' th.Start()
|
||||||
|
' 'End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Debug.Write(ex.Message)
|
||||||
|
' End Try
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
' Friend Shared Sub Contexto_SavingChanges(tsuc As tsUserControl, lg As LayoutGroup, TagsApArefrescar() As String, DocPanelTag As String)
|
||||||
|
' Comun.RefrescaAplicaciones(lg, TagsApArefrescar, DocPanelTag)
|
||||||
|
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
BIN
Baget/nuget.exe
Normal file
18
Baget/tsWPF.nuspec
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<package>
|
||||||
|
<metadata>
|
||||||
|
<id>tsWPF</id>
|
||||||
|
<version>5.0.0.1</version>
|
||||||
|
<authors>Manuel</authors>
|
||||||
|
<owners>Tecnosis S.A.</owners>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<description>Nucleo aplicaciones WPF Tecnosis.</description>
|
||||||
|
<tags>tsWPF .net48</tags>
|
||||||
|
<dependencies>
|
||||||
|
<group targetFramework=".NETFramework4.8" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="C:\tecnosis.git\Comunes\tsWPFV4\bin\Debug\tsWPF.dll" target="lib\net48\" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
291
ClasesComunes.vb
Normal file
@@ -0,0 +1,291 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
|
||||||
|
Public Enum TiposModificacion
|
||||||
|
Modificable = 0
|
||||||
|
ModificableEnNuevos = 1
|
||||||
|
ModificableEnExistentes = 2
|
||||||
|
NoModificable = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
<TypeConverterAttribute(GetType(System.ComponentModel.ExpandableObjectConverter))>
|
||||||
|
Public Class PropiedadesTS
|
||||||
|
' Public Property ApCablin As ApCabLin
|
||||||
|
Public Property NombreCampo As String = ""
|
||||||
|
Public Property Modificable As TiposModificacion
|
||||||
|
Public Property Obligatorio As Boolean
|
||||||
|
Public Property UsualCorreccion As Boolean = True
|
||||||
|
Public Property Unico As Boolean = False
|
||||||
|
Public Property NumeroObjeto As Integer
|
||||||
|
Public Property CapturarEnter As Boolean = True
|
||||||
|
Public Property MayusculasMinusculas As CharacterCasing = CharacterCasing.Upper
|
||||||
|
|
||||||
|
End Class
|
||||||
|
<TypeConverterAttribute(GetType(System.ComponentModel.ExpandableObjectConverter))>
|
||||||
|
Public Class PropiedadesTSGC
|
||||||
|
Public Property Descripcion As String
|
||||||
|
Public Property CamposObligatorios As String
|
||||||
|
Public Property CamposUnicos As String
|
||||||
|
Public Property PermitirEliminar As Boolean = True
|
||||||
|
Public Property PermitirExportar As Boolean? = True
|
||||||
|
Public Property EnlazarNulosOVacios As Boolean = False
|
||||||
|
Public Property PermisosDefecto As Permisos
|
||||||
|
Public Property CabeceraImpresion As String
|
||||||
|
Public Property BusquedaAcentosInsensitivo As Boolean = False
|
||||||
|
End Class
|
||||||
|
Public Class Permisos
|
||||||
|
Property Consultar As Boolean
|
||||||
|
Property Nuevos As Boolean
|
||||||
|
Property Eliminar As Boolean
|
||||||
|
Property Modificar As Boolean
|
||||||
|
Property Impresion As Boolean
|
||||||
|
Property Otros As Boolean
|
||||||
|
Property Exportar As Boolean
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class Plantilla
|
||||||
|
Property idPlantilla As Integer
|
||||||
|
Property Descripcion As String
|
||||||
|
|
||||||
|
End Class
|
||||||
|
Public Class Accion
|
||||||
|
Property idAccion As Integer
|
||||||
|
Property Descripcion As String
|
||||||
|
End Class
|
||||||
|
Public Enum TiposPermisosEnum
|
||||||
|
Consultar = 0
|
||||||
|
Nuevos = 1
|
||||||
|
Eliminar = 2
|
||||||
|
Modificar = 3
|
||||||
|
Otros = 4
|
||||||
|
End Enum
|
||||||
|
Public Enum ModoContextoSavingChangesEnum
|
||||||
|
EventoSavingChanges = 0
|
||||||
|
SoloDespuesGuardar = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Public Class Configuracion
|
||||||
|
Public Shared ModoBusquedaAND As Boolean = False
|
||||||
|
Public Shared ComportamientoValidacion As Validation.InvalidValueBehavior = Validation.InvalidValueBehavior.AllowLeaveEditor
|
||||||
|
' Public Shared ComportamientoValidacion As Validation.InvalidValueBehavior = Validation.InvalidValueBehavior.WaitForValidValue
|
||||||
|
' Public Shared ModoEventosContextoSavingChanges As ModoContextoSavingChangesEnum = ModoContextoSavingChangesEnum.EventoSavingChanges
|
||||||
|
Public Shared ModoEventosContextoSavingChanges As ModoContextoSavingChangesEnum = ModoContextoSavingChangesEnum.SoloDespuesGuardar
|
||||||
|
Public Shared MostrarBotonCerrarEnPestaña As Boolean = True
|
||||||
|
Public Shared NuevosRapido As Boolean = True
|
||||||
|
Public Shared BusquedaAcentosInsensitivo As Boolean = False
|
||||||
|
Public Delegate Function DelegadoModoSuperUsuario(Aplicacion As tsUserControl) As Boolean
|
||||||
|
Public Shared FuncionModoSuperUsuario As DelegadoModoSuperUsuario
|
||||||
|
' Public Delegate Function DelegadoModoSuperUsuarioTsAplicacion(Aplicacion As tsAplicacion) As Boolean
|
||||||
|
' Public Shared FuncionModoSuperUsuarioTsAplicacion As DelegadoModoSuperUsuarioTsAplicacion
|
||||||
|
Public Shared ComportamientoGuardar As ComportamientoGuardarEnum = ComportamientoGuardarEnum.GUARDAR_CERRAR_BUSCAR
|
||||||
|
Public Shared Property OcultarBotonEliminarSinPermisos As Boolean = False
|
||||||
|
End Class
|
||||||
|
Public Enum ComportamientoGuardarEnum As Integer
|
||||||
|
GUARDAR_CERRAR_BUSCAR = 0
|
||||||
|
GUARDAR_CERRAR_ULTIMA_PESTAÑA = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
|
||||||
|
Public Class Comun
|
||||||
|
Public Shared WithEvents dm As DockLayoutManager
|
||||||
|
Public Shared DocPanelActual As DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
Public Shared DocPanelAnterior As DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
Public Delegate Sub ErrorNoControlado(Aplicacion As String, ex As Exception)
|
||||||
|
'Public Shared Sub RefrescaAplicaciones(lg As LayoutGroup, TagsApArefrescar() As String, DocPanelTag As String)
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' Dim dcs As IEnumerable(Of BaseLayoutItem)
|
||||||
|
' If Not TagsApArefrescar Is Nothing Then
|
||||||
|
' For Each grupodocumentos As DocumentGroup In lg.Items.Where(Function(x) x.GetType Is GetType(DocumentGroup))
|
||||||
|
' For Each Etiqueta In TagsApArefrescar
|
||||||
|
' dcs = (From p In grupodocumentos.Items Where p.Tag = Etiqueta)
|
||||||
|
' If dcs.Count > 0 Then
|
||||||
|
' Dim dc As DocumentPanel = dcs.First
|
||||||
|
' If dc.Content.GetType Is GetType(tsWPF.ContenedorCabLin) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorCabLin).Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.uc.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorLineas) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea
|
||||||
|
' If Not a.DeshabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.uc.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(True)), System.Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorAplicacion) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorAplicacion)._Aplicacion
|
||||||
|
' If a.HabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.Dispatcher.BeginInvoke(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.SystemIdle)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' Next
|
||||||
|
' Else
|
||||||
|
' For Each grupodocumentos As DocumentGroup In lg.Items.Where(Function(x) x.GetType Is GetType(DocumentGroup))
|
||||||
|
' dcs = (From p In grupodocumentos.Items Where p.Tag <> DocPanelTag)
|
||||||
|
' For Each dc As DocumentPanel In dcs
|
||||||
|
' If dc.Content.GetType Is GetType(tsWPF.ContenedorCabLin) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorCabLin).Aplicacion
|
||||||
|
' If Not a.DeshabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorLineas) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorLineas).apLinea
|
||||||
|
' If Not a.DeshabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.uc.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' ElseIf dc.Content.GetType Is GetType(tsWPF.ContenedorAplicacion) Then
|
||||||
|
' Dim a = DirectCast(dc.Content, tsWPF.ContenedorAplicacion)._Aplicacion
|
||||||
|
' If a.HabilitarRefresco Then
|
||||||
|
' If a.RefrescoSolicitado = False Then
|
||||||
|
' a.RefrescoSolicitado = True
|
||||||
|
' a.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Debug.Write(ex.Message)
|
||||||
|
' End Try
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Public Shared Sub RefrescaAplicaciones(lg As LayoutGroup, TagsApArefrescar() As String, DocPanelTag As String, Optional AplicacionPadre As Type = Nothing)
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim dcs As IEnumerable(Of BaseLayoutItem)
|
||||||
|
If Not TagsApArefrescar Is Nothing Then
|
||||||
|
For Each grupodocumentos As DocumentGroup In lg.Items.Where(Function(x) x.GetType Is GetType(DocumentGroup))
|
||||||
|
For Each Etiqueta In TagsApArefrescar
|
||||||
|
dcs = (From p In grupodocumentos.Items Where p.Tag = Etiqueta)
|
||||||
|
If dcs.Count > 0 Then
|
||||||
|
Dim dc As DocumentPanel = dcs.First
|
||||||
|
Select Case dc.Content.GetType
|
||||||
|
Case GetType(ContenedorAplicacion)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorAplicacion)._Aplicacion
|
||||||
|
If a.HabilitarRefresco OrElse (AplicacionPadre IsNot Nothing AndAlso a.GetType Is AplicacionPadre) Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Case GetType(ContenedorLineas)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorLineas).apLinea
|
||||||
|
If a.DeshabilitarRefresco = False Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.ContenedorL.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Case GetType(ContenedorCabLin)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorCabLin).Aplicacion
|
||||||
|
If a.DeshabilitarRefresco = False Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.ContenedorCL.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
For Each grupodocumentos As DocumentGroup In lg.Items.Where(Function(x) x.GetType Is GetType(DocumentGroup))
|
||||||
|
dcs = (From p In grupodocumentos.Items Where p.Tag <> DocPanelTag)
|
||||||
|
For Each dc As DocumentPanel In dcs
|
||||||
|
Select Case dc.Content.GetType
|
||||||
|
Case GetType(ContenedorAplicacion)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorAplicacion)._Aplicacion
|
||||||
|
If a.HabilitarRefresco OrElse (AplicacionPadre IsNot Nothing AndAlso a.GetType Is AplicacionPadre) Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Case GetType(ContenedorLineas)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorLineas).apLinea
|
||||||
|
If a.DeshabilitarRefresco = False Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.ContenedorL.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Case GetType(ContenedorCabLin)
|
||||||
|
Dim a = DirectCast(dc.Content, ContenedorCabLin).Aplicacion
|
||||||
|
If a.DeshabilitarRefresco = False Then
|
||||||
|
If a.RefrescoSolicitado = False Then
|
||||||
|
a.RefrescoSolicitado = True
|
||||||
|
a.ContenedorCL.Dispatcher.InvokeAsync(New Action(Sub() a.RefrescaUC(, True)), System.Windows.Threading.DispatcherPriority.Background)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Shared Sub dm_DockItemClosed(sender As Object, e As Base.DockItemClosedEventArgs) Handles dm.DockItemClosed
|
||||||
|
If e.Item.Tag = "visualizadorinformes" Then
|
||||||
|
Try
|
||||||
|
Dim uc = DirectCast(DirectCast(e.Item, DocumentPanel).Content, ucVisualizadorInformesa)
|
||||||
|
Dim modelo As tsXtraReportPreviewModel = uc.Visualizador.Model
|
||||||
|
modelo.Report.Dispose()
|
||||||
|
modelo.Dispose()
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
'GC.Collect()
|
||||||
|
End Sub
|
||||||
|
Private Shared Sub dm_DockItemActivated(sender As Object, ea As Base.DockItemActivatedEventArgs) Handles dm.DockItemActivated
|
||||||
|
If Not ea.Item Is Nothing AndAlso ea.Item.GetType Is GetType(DocumentPanel) Then
|
||||||
|
Dim contenedor = DirectCast(ea.Item, DocumentPanel).Content
|
||||||
|
If contenedor.GetType Is GetType(ContenedorCabLin) Then
|
||||||
|
Dim apcl As ApCabLin = DirectCast(contenedor, ContenedorCabLin).Aplicacion
|
||||||
|
If apcl.Refrescar And Not apcl.DeshabilitarRefresco Then apcl.RefrescaUC()
|
||||||
|
Comun.DocPanelAnterior = Comun.DocPanelActual
|
||||||
|
Comun.DocPanelActual = apcl.DocPanel
|
||||||
|
ElseIf contenedor.GetType Is GetType(ContenedorLineas) Then
|
||||||
|
Dim apl As ApLineas = DirectCast(contenedor, ContenedorLineas).apLinea
|
||||||
|
If apl.Refrescar Then
|
||||||
|
apl.RefrescaUC(, False)
|
||||||
|
End If
|
||||||
|
apl.Refrescar = False
|
||||||
|
Comun.DocPanelAnterior = Comun.DocPanelActual
|
||||||
|
Comun.DocPanelActual = apl.DocPanel
|
||||||
|
ElseIf contenedor.GetType Is GetType(ContenedorAplicacion) Then
|
||||||
|
Dim ap As tsUserControl = DirectCast(contenedor, ContenedorAplicacion)._Aplicacion
|
||||||
|
Comun.DocPanelAnterior = Comun.DocPanelActual
|
||||||
|
Comun.DocPanelActual = ap.docpanel
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Public Enum EstadosAplicacion
|
||||||
|
SinDatos = 0
|
||||||
|
Nuevo = 1
|
||||||
|
ModificandoRegistro = 2
|
||||||
|
AplicacionSinIndice = 3
|
||||||
|
Cancelado = 100
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
157
ContenedorAplicacion.xaml
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<UserControl x:Class="ContenedorAplicacion"
|
||||||
|
x:ClassModifier="Public"
|
||||||
|
x:Name="ContenedorAplicacion"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:my="clr-namespace:tsWPF"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
|
||||||
|
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
mc:Ignorable="d" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" d:DesignHeight="497" d:DesignWidth="1280" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<Storyboard x:Key="sbDesvanecer">
|
||||||
|
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
|
||||||
|
From="1.0" To="0.0" Duration="0:0:2"
|
||||||
|
AutoReverse="False" />
|
||||||
|
</Storyboard>
|
||||||
|
<Style TargetType="dxdo:LayoutPanel" x:Key="estilomensaje">
|
||||||
|
<Setter Property="Appearance">
|
||||||
|
<Setter.Value>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
|
||||||
|
<dxdo:Appearance.Active>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Active>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Storyboard x:Key="tsBlink">
|
||||||
|
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
|
||||||
|
From="1.0" To="0.0" Duration="0:0:0.7"
|
||||||
|
AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<dxb:BarManager Name="BarraBotones" x:FieldModifier="public" ShowScreenTips="true" AllowCustomization="False" AllowQuickCustomization="False">
|
||||||
|
<dxb:BarManager.Items>
|
||||||
|
<dxb:BarButtonItem Name="btGuardarYBuscar" Glyph="{dx:DXImageGrayscale Image=SaveAndClose_16x16.png}" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guarda, cierra y busca otro registro (F1)"/>
|
||||||
|
<dxb:BarButtonItem Name="btGuardar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Save/Save_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar (F2)" />
|
||||||
|
<dxb:BarButtonItem Name="btBuscar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Find/Find_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Buscar Otro Registro (F3)" />
|
||||||
|
<dxb:BarButtonItem Name="btNuevo" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/AddItem_32x32.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo (F4)" />
|
||||||
|
<dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/Refresh_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Cargar datos de nuevo (F5)" />
|
||||||
|
<dxb:BarSubItem Name="MenuExportar" Glyph="{dx:DXImageGrayscale Image=ExportFile_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Exportar/Imprimir">
|
||||||
|
<dxb:BarButtonItem Name="btExportar" Glyph="{dx:DXImageGrayscale Image=ExportToXLSX_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Exportar A Excel" ItemClick="BtExportar_ItemClick"/>
|
||||||
|
<dxb:BarButtonItem Name="btCapturar" Glyph="Images/Icons/capture.png" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem Name="btSeleccionar" Glyph="Images/Icons/checklist-25.png" x:FieldModifier="public" Focusable="False" CheckedChanged="btSeleccionar_CheckedChanged" Hint="Selección múltiple" />
|
||||||
|
<dxb:BarButtonItem Name="btEliminar" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Actions/DeleteItem_16x16.png" x:FieldModifier="public" Focusable="False" Hint="Eliminar Registro" />
|
||||||
|
<!--<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=Fixed_Column_Width_32x32.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btDiseño_ItemClick" />-->
|
||||||
|
|
||||||
|
<dxb:BarSubItem Name="MenuDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Diseño Columnas">
|
||||||
|
<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Guardar Diseño Columnas" ItemClick="btDiseño_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btRestaurarDiseño" Glyph="{dx:DXImageGrayscale Image=Columns_16x16.png}" Content="Restaurar Diseño Columnas" ItemClick="btRestaurarDiseño_ItemClick" />
|
||||||
|
<dxb:BarItemSeparator />
|
||||||
|
<dxb:BarButtonItem Name="btAbrirDiseñoGuardado" Glyph="Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="Images/Icons/GuardarGrid.png" Content="Guardar Diseño Como ..." ItemClick="btGuardarDiseñoComo_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem Name="btAyuda" Glyph="{dx:DXImageGrayscale Image=Index_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btAyuda_ItemClick" />
|
||||||
|
<dxb:BarStaticItem Name="siEstado" x:FieldModifier="public" Content="Operación Actual:" />
|
||||||
|
<dxb:BarEditItem Name="bePlantilla" x:FieldModifier="public" Focusable="true" ForceCursor="True" IsEnabled="True" Hint="Modelo a Imprimir"
|
||||||
|
EditWidth="300" EditValueChanged="bePlantilla_EditValueChanged" >
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbPlantillaAImprimir" x:FieldModifier="Public" ValueMember="idPlantilla" DisplayMember="Descripcion">
|
||||||
|
</dxe:ComboBoxEditSettings>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btImprimirPlantilla" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Print/Print_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btImprimirPlantilla_ItemClick" Hint="Imprimir" />
|
||||||
|
<dxb:BarEditItem Name="beAcciones" x:FieldModifier="public" Focusable="True" ForceCursor="True" IsEnabled="True" Hint="Accion a Ejecutar" EditWidth="390" EditValueChanged="beAcciones_EditValueChanged" >
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbAcciones" x:FieldModifier="Public" ValueMember="idAccion" DisplayMember="Descripcion" />
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btAcciones" Glyph="pack://application:,,,/DevExpress.Images.v22.2;component/GrayScaleImages/Arrows/Next_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btAcciones_ItemClick" Hint="Ejecutar Acción" />
|
||||||
|
<dxb:BarStaticItem Name="siMensaje" ShowBorder="False">
|
||||||
|
<dxb:BarStaticItem.ContentTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Name="tbMensaje" FontWeight="ExtraBold" />
|
||||||
|
</DataTemplate>
|
||||||
|
</dxb:BarStaticItem.ContentTemplate>
|
||||||
|
</dxb:BarStaticItem>
|
||||||
|
</dxb:BarManager.Items>
|
||||||
|
<dxb:BarManager.Bars>
|
||||||
|
<dxb:Bar AllowDrop="False" AllowHide="False" x:Name="BarraPrincipal" x:FieldModifier="public" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" ShowSizeGrip="False" AllowCollapse="False">
|
||||||
|
<dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarDockInfo ContainerType="Top" />
|
||||||
|
</dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btGuardarYBuscar" x:Name="ilGuardarYBuscar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btGuardar" x:Name="ilGuardar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btBuscar" x:Name="ilBuscar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btNuevo" x:Name="ilNuevo" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btActualizar" x:Name="ilActualizar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuExportar" x:FieldModifier="Public" x:Name="ilExportar" />
|
||||||
|
<dxb:BarCheckItemLink BarItemName="btSeleccionar" x:FieldModifier="Public" x:Name="ilSeleccionar" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btEliminar" x:Name="ilEliminar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuDiseño" x:Name="ilDiseño" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAyuda" x:Name="ilAyuda" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="bePlantilla" x:FieldModifier="Public" x:Name="ilPlantilla" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btImprimirPlantilla" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="beAcciones" x:FieldModifier="Public" x:Name="ilAcciones" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAcciones" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siEstado" x:FieldModifier="Public" x:Name="ilEstado" />
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siMensaje" x:FieldModifier="Public" x:Name="ilMensaje" />
|
||||||
|
</dxb:Bar>
|
||||||
|
</dxb:BarManager.Bars>
|
||||||
|
<Grid>
|
||||||
|
<dxdo:DockLayoutManager Name="dockManager" ClosedPanelsBarVisibility="Manual">
|
||||||
|
<dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:AutoHideGroup DockType="Bottom">
|
||||||
|
<dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Collapsed" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160" Style="{StaticResource estilomensaje}">
|
||||||
|
<!--<dxdo:LayoutPanel.Appearance>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="Red" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</dxdo:LayoutPanel.Appearance>-->
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
|
||||||
|
<Grid>
|
||||||
|
<my:tsGridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||||
|
<my:tsGridControl.Columns>
|
||||||
|
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" />
|
||||||
|
</my:tsGridControl.Columns>
|
||||||
|
<my:tsGridControl.View>
|
||||||
|
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||||
|
</my:tsGridControl.View>
|
||||||
|
</my:tsGridControl>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:AutoHideGroup>
|
||||||
|
</dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:LayoutGroup x:Name="RootGroup" Orientation="Horizontal">
|
||||||
|
<dxdo:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxdo:LayoutPanel AllowFloat="False" AllowHide="False" AllowMove="False" ShowCloseButton="False" Name="lpContenido" ShowCaption="False">
|
||||||
|
<Grid Name="contenido" />
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:DockLayoutManager>
|
||||||
|
</Grid>
|
||||||
|
</dxb:BarManager>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
157
ContenedorAplicacion.xaml.bak
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<UserControl x:Class="ContenedorAplicacion"
|
||||||
|
x:ClassModifier="Public"
|
||||||
|
x:Name="ContenedorAplicacion"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:my="clr-namespace:tsWPF"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
|
||||||
|
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
mc:Ignorable="d" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" d:DesignHeight="497" d:DesignWidth="1280" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<Storyboard x:Key="sbDesvanecer">
|
||||||
|
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
|
||||||
|
From="1.0" To="0.0" Duration="0:0:2"
|
||||||
|
AutoReverse="False" />
|
||||||
|
</Storyboard>
|
||||||
|
<Style TargetType="dxdo:LayoutPanel" x:Key="estilomensaje">
|
||||||
|
<Setter Property="Appearance">
|
||||||
|
<Setter.Value>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
|
||||||
|
<dxdo:Appearance.Active>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Active>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Storyboard x:Key="tsBlink">
|
||||||
|
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)"
|
||||||
|
From="1.0" To="0.0" Duration="0:0:0.7"
|
||||||
|
AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<dxb:BarManager Name="BarraBotones" x:FieldModifier="public" ShowScreenTips="true" AllowCustomization="False" AllowQuickCustomization="False">
|
||||||
|
<dxb:BarManager.Items>
|
||||||
|
<dxb:BarButtonItem Name="btGuardarYBuscar" Glyph="{dx:DXImageGrayscale Image=SaveAndClose_16x16.png}" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guarda, cierra y busca otro registro (F1)"/>
|
||||||
|
<dxb:BarButtonItem Name="btGuardar" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Save/Save_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar (F2)" />
|
||||||
|
<dxb:BarButtonItem Name="btBuscar" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Find/Find_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Buscar Otro Registro (F3)" />
|
||||||
|
<dxb:BarButtonItem Name="btNuevo" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Actions/AddItem_32x32.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo (F4)" />
|
||||||
|
<dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Actions/Refresh_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Cargar datos de nuevo (F5)" />
|
||||||
|
<dxb:BarSubItem Name="MenuExportar" Glyph="{dx:DXImageGrayscale Image=ExportFile_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Exportar/Imprimir">
|
||||||
|
<dxb:BarButtonItem Name="btExportar" Glyph="{dx:DXImageGrayscale Image=ExportToXLSX_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Exportar A Excel" ItemClick="BtExportar_ItemClick"/>
|
||||||
|
<dxb:BarButtonItem Name="btCapturar" Glyph="Images/Icons/capture.png" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem Name="btSeleccionar" Glyph="Images/Icons/checklist-25.png" x:FieldModifier="public" Focusable="False" CheckedChanged="btSeleccionar_CheckedChanged" Hint="Selección múltiple" />
|
||||||
|
<dxb:BarButtonItem Name="btEliminar" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Actions/DeleteItem_16x16.png" x:FieldModifier="public" Focusable="False" Hint="Eliminar Registro" />
|
||||||
|
<!--<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=Fixed_Column_Width_32x32.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btDiseño_ItemClick" />-->
|
||||||
|
|
||||||
|
<dxb:BarSubItem Name="MenuDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Diseño Columnas">
|
||||||
|
<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Guardar Diseño Columnas" ItemClick="btDiseño_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btRestaurarDiseño" Glyph="{dx:DXImageGrayscale Image=Columns_16x16.png}" Content="Restaurar Diseño Columnas" ItemClick="btRestaurarDiseño_ItemClick" />
|
||||||
|
<dxb:BarItemSeparator />
|
||||||
|
<dxb:BarButtonItem Name="btAbrirDiseñoGuardado" Glyph="Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="Images/Icons/GuardarGrid.png" Content="Guardar Diseño Como ..." ItemClick="btGuardarDiseñoComo_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem Name="btAyuda" Glyph="{dx:DXImageGrayscale Image=Index_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btAyuda_ItemClick" />
|
||||||
|
<dxb:BarStaticItem Name="siEstado" x:FieldModifier="public" Content="Operación Actual:" />
|
||||||
|
<dxb:BarEditItem Name="bePlantilla" x:FieldModifier="public" Focusable="true" ForceCursor="True" IsEnabled="True" Hint="Modelo a Imprimir"
|
||||||
|
EditWidth="300" EditValueChanged="bePlantilla_EditValueChanged" >
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbPlantillaAImprimir" x:FieldModifier="Public" ValueMember="idPlantilla" DisplayMember="Descripcion">
|
||||||
|
</dxe:ComboBoxEditSettings>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btImprimirPlantilla" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Print/Print_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btImprimirPlantilla_ItemClick" Hint="Imprimir" />
|
||||||
|
<dxb:BarEditItem Name="beAcciones" x:FieldModifier="public" Focusable="True" ForceCursor="True" IsEnabled="True" Hint="Accion a Ejecutar" EditWidth="390" EditValueChanged="beAcciones_EditValueChanged" >
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbAcciones" x:FieldModifier="Public" ValueMember="idAccion" DisplayMember="Descripcion" />
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btAcciones" Glyph="pack://application:,,,/DevExpress.Images.v21.2;component/GrayScaleImages/Arrows/Next_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btAcciones_ItemClick" Hint="Ejecutar Acción" />
|
||||||
|
<dxb:BarStaticItem Name="siMensaje" ShowBorder="False">
|
||||||
|
<dxb:BarStaticItem.ContentTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Name="tbMensaje" FontWeight="ExtraBold" />
|
||||||
|
</DataTemplate>
|
||||||
|
</dxb:BarStaticItem.ContentTemplate>
|
||||||
|
</dxb:BarStaticItem>
|
||||||
|
</dxb:BarManager.Items>
|
||||||
|
<dxb:BarManager.Bars>
|
||||||
|
<dxb:Bar AllowDrop="False" AllowHide="False" x:Name="BarraPrincipal" x:FieldModifier="public" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" ShowSizeGrip="False" AllowCollapse="False">
|
||||||
|
<dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarDockInfo ContainerType="Top" />
|
||||||
|
</dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btGuardarYBuscar" x:Name="ilGuardarYBuscar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btGuardar" x:Name="ilGuardar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btBuscar" x:Name="ilBuscar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btNuevo" x:Name="ilNuevo" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btActualizar" x:Name="ilActualizar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuExportar" x:FieldModifier="Public" x:Name="ilExportar" />
|
||||||
|
<dxb:BarCheckItemLink BarItemName="btSeleccionar" x:FieldModifier="Public" x:Name="ilSeleccionar" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btEliminar" x:Name="ilEliminar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuDiseño" x:Name="ilDiseño" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAyuda" x:Name="ilAyuda" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="bePlantilla" x:FieldModifier="Public" x:Name="ilPlantilla" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btImprimirPlantilla" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="beAcciones" x:FieldModifier="Public" x:Name="ilAcciones" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAcciones" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siEstado" x:FieldModifier="Public" x:Name="ilEstado" />
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siMensaje" x:FieldModifier="Public" x:Name="ilMensaje" />
|
||||||
|
</dxb:Bar>
|
||||||
|
</dxb:BarManager.Bars>
|
||||||
|
<Grid>
|
||||||
|
<dxdo:DockLayoutManager Name="dockManager" ClosedPanelsBarVisibility="Manual">
|
||||||
|
<dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:AutoHideGroup DockType="Bottom">
|
||||||
|
<dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Collapsed" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160" Style="{StaticResource estilomensaje}">
|
||||||
|
<!--<dxdo:LayoutPanel.Appearance>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="Red" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</dxdo:LayoutPanel.Appearance>-->
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
|
||||||
|
<Grid>
|
||||||
|
<my:tsGridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||||
|
<my:tsGridControl.Columns>
|
||||||
|
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" />
|
||||||
|
</my:tsGridControl.Columns>
|
||||||
|
<my:tsGridControl.View>
|
||||||
|
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||||
|
</my:tsGridControl.View>
|
||||||
|
</my:tsGridControl>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:AutoHideGroup>
|
||||||
|
</dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:LayoutGroup x:Name="RootGroup" Orientation="Horizontal">
|
||||||
|
<dxdo:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxdo:LayoutPanel AllowFloat="False" AllowHide="False" AllowMove="False" ShowCloseButton="False" Name="lpContenido" ShowCaption="False">
|
||||||
|
<Grid Name="contenido" />
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:DockLayoutManager>
|
||||||
|
</Grid>
|
||||||
|
</dxb:BarManager>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
437
ContenedorAplicacion.xaml.vb
Normal file
@@ -0,0 +1,437 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports System.Windows.Media.Animation
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports System.IO
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports System.Data.Objects
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
Imports DevExpress.Spreadsheet
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports DevExpress.Mvvm.UI.Interactivity
|
||||||
|
Imports tsl5.Extensiones
|
||||||
|
|
||||||
|
Public Class ContenedorAplicacion
|
||||||
|
Public _Aplicacion As tsUserControl
|
||||||
|
Dim _DescripcionDiseño As String
|
||||||
|
Dim _TodosUsuariosDiseño As Boolean
|
||||||
|
Public Sub New(Ap As tsUserControl)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
_Aplicacion = Ap
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' Private Sub mv_CurrentChanged(sender As Object, e As System.EventArgs) Handles mv.CurrentChanged
|
||||||
|
' cabecera = Me.mv.CurrentEditItem
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Public Sub Nuevo(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btNuevo.ItemClick
|
||||||
|
Dim Respuesta As MsgBoxResult = MsgBoxResult.No
|
||||||
|
If _Aplicacion.Estado <> EstadosAplicacion.AplicacionSinIndice Then
|
||||||
|
Dim be As BaseEdit = Nothing
|
||||||
|
Try
|
||||||
|
be = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If Not be Is Nothing Then
|
||||||
|
Select Case be.GetType
|
||||||
|
Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
If Configuracion.ComportamientoValidacion = Validation.InvalidValueBehavior.AllowLeaveEditor Then
|
||||||
|
be.DoValidate()
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
Else
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
be.DoValidate()
|
||||||
|
End If
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Cancelar As Boolean = False
|
||||||
|
For Each linea In Me._Aplicacion.Lineas
|
||||||
|
linea.View.CommitEditing()
|
||||||
|
If linea.View.HasValidationError Then Cancelar = True
|
||||||
|
Next
|
||||||
|
If Not Cancelar Then
|
||||||
|
Dim Preguntar As Boolean
|
||||||
|
If _Aplicacion.Contexto.GetType.BaseType Is GetType(ObjectContext) Then
|
||||||
|
Dim bd = DirectCast(_Aplicacion.Contexto, ObjectContext)
|
||||||
|
Preguntar = bd.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added + System.Data.EntityState.Deleted + System.Data.EntityState.Modified).Count > 0
|
||||||
|
Else
|
||||||
|
'TODO: dbcontext
|
||||||
|
End If
|
||||||
|
If Preguntar Then
|
||||||
|
If Configuracion.NuevosRapido = False Or _Aplicacion.Estado <> EstadosAplicacion.Nuevo Then
|
||||||
|
Respuesta = DXMessageBox.Show("Atención el registro actual ha sido modificado. ¿Desea guardar los cambios antes de añadir uno nuevo?", "Atención", MessageBoxButton.YesNoCancel)
|
||||||
|
Else
|
||||||
|
Respuesta = MsgBoxResult.Yes
|
||||||
|
End If
|
||||||
|
If Respuesta = MsgBoxResult.Yes Then
|
||||||
|
If _Aplicacion.Guardar(sender, e,,, 1) Then
|
||||||
|
Respuesta = MsgBoxResult.Cancel
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Respuesta <> MsgBoxResult.Cancel Then
|
||||||
|
_Aplicacion.ValidarControles = False
|
||||||
|
_Aplicacion.Estado = _Aplicacion.DCPrincipal(, True)
|
||||||
|
If _Aplicacion.docpanel IsNot Nothing Then
|
||||||
|
_Aplicacion.docpanel.Tag = _Aplicacion.idRegistroAplicacionActual
|
||||||
|
End If
|
||||||
|
_Aplicacion.EstableceTitulo()
|
||||||
|
_Aplicacion.EstableceFocoPrimerControl()
|
||||||
|
_Aplicacion.ValidarControles = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Respuesta <> MsgBoxResult.Cancel Then _Aplicacion.LanzaBotonNuevoPulsado()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btEliminar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btEliminar.ItemClick
|
||||||
|
_Aplicacion.Eliminar(sender, e)
|
||||||
|
End Sub
|
||||||
|
Friend Sub IniciaAnimacion(Mensaje As String, Color As Color)
|
||||||
|
Try
|
||||||
|
Me.siMensaje.Content = Mensaje
|
||||||
|
Dim tbm As TextBlock = LayoutHelper.FindElementByName(Me.BarraBotones, "tbMensaje")
|
||||||
|
If tbm IsNot Nothing Then
|
||||||
|
tbm.Foreground = New SolidColorBrush(Color)
|
||||||
|
Dim sb As Storyboard = Nothing
|
||||||
|
Try
|
||||||
|
sb = Me.FindResource("sbDesvanecer")
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
If sb IsNot Nothing Then
|
||||||
|
Storyboard.SetTarget(sb, tbm)
|
||||||
|
BeginStoryboard(sb)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Friend Sub IniciaAnimacionBlink(Mensaje As String, Color As Color)
|
||||||
|
Try
|
||||||
|
Me.siMensaje.Content = Mensaje
|
||||||
|
Dim tbm As TextBlock = LayoutHelper.FindElementByName(Me.BarraBotones, "tbMensaje")
|
||||||
|
tbm.Foreground = New SolidColorBrush(Color)
|
||||||
|
Dim sb As Storyboard = Nothing
|
||||||
|
Try
|
||||||
|
sb = Me.FindResource("tsBlink")
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
If sb IsNot Nothing Then
|
||||||
|
Storyboard.SetTarget(sb, tbm)
|
||||||
|
BeginStoryboard(sb)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub btImprimirPlantilla_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
_Aplicacion.ValidaControlObjetoActual()
|
||||||
|
Dim idPlantilla As Integer = bePlantilla.EditValue
|
||||||
|
_Aplicacion.LanzaImprimirPlantilla(sender, e, idPlantilla)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAcciones_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
_Aplicacion.ValidaControlObjetoActual()
|
||||||
|
Dim idAccion As Integer = beAcciones.EditValue
|
||||||
|
_Aplicacion.LanzaEjecutaAccion(sender, e, idAccion)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub beAcciones_EditValueChanged(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim idAccion As Integer = beAcciones.EditValue
|
||||||
|
Dim acs As List(Of Accion) = Me.cbAcciones.ItemsSource
|
||||||
|
Dim ac As Accion = (From a In acs Where a.idAccion = idAccion).First
|
||||||
|
Me.btAcciones.Hint = ac.Descripcion
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub bePlantilla_EditValueChanged(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim idPlantilla As Integer = bePlantilla.EditValue
|
||||||
|
Dim plantillas As List(Of tsWPF.Plantilla) = Me.cbPlantillaAImprimir.ItemsSource
|
||||||
|
Dim pl As Plantilla = (From p In plantillas Where p.idPlantilla = idPlantilla).First
|
||||||
|
Me.btImprimirPlantilla.Hint = pl.Descripcion & " (F7) "
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorCabLin_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
Try
|
||||||
|
If _Aplicacion IsNot Nothing AndAlso _Aplicacion.Contexto IsNot Nothing AndAlso _Aplicacion.Contexto.GetType Is GetType(ObjectContext) Then
|
||||||
|
Dim bd = DirectCast(_Aplicacion.Contexto, ObjectContext)
|
||||||
|
If bd.Connection.State <> System.Data.ConnectionState.Closed Then bd.Connection.Close()
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAyuda_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
_Aplicacion.DelegadoAyuda.Invoke(_Aplicacion.GetType.ToString)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
_Aplicacion.DelegadoDiseño.Invoke(_Aplicacion.Contexto, OperacionDiseñoEnum.GUARDAR, _Aplicacion.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If _Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then _Aplicacion.DelegadoErrorNoControlado.Invoke(_Aplicacion, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function ObtieneDiseñoActual() As Byte()
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
Dim i As Integer
|
||||||
|
For Each l In _Aplicacion.Lineas
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Dim dr As New DiseñoRejilla
|
||||||
|
dr.Nombre = l.Name
|
||||||
|
dr.Version = "1"
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
l.SaveLayoutToStream(ms)
|
||||||
|
dr.Diseño = ms.ToArray
|
||||||
|
ld.Rejillas.Add(dr)
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
Return drs
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btRestaurarDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
If _Aplicacion.DiseñoOriginal IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(_Aplicacion.DiseñoOriginal), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
For Each l In _Aplicacion.Lineas
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If _Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then _Aplicacion.DelegadoErrorNoControlado.Invoke(_Aplicacion, ex)
|
||||||
|
' Debug.Write("Error DelegadoDiseño Rejilla")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
_Aplicacion.DelegadoDiseño.Invoke(_Aplicacion.Contexto, OperacionDiseñoEnum.RESTAURAR_ORIGINAL, _Aplicacion.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If _Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then _Aplicacion.DelegadoErrorNoControlado.Invoke(_Aplicacion, ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btGuardarDiseñoComo_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
_Aplicacion.DelegadoDiseño.Invoke(_Aplicacion.Contexto, OperacionDiseñoEnum.GUARDAR_COMO, _Aplicacion.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If _Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then _Aplicacion.DelegadoErrorNoControlado.Invoke(_Aplicacion, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseñoComo_Itemclick")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAbrirDiseñoGuardado_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim b = _Aplicacion.DelegadoDiseño.Invoke(_Aplicacion.Contexto, OperacionDiseñoEnum.ABRIR_DISEÑO_GUARDADO, _Aplicacion.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, Nothing)
|
||||||
|
If b IsNot Nothing Then
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(Me, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If _Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then _Aplicacion.DelegadoErrorNoControlado.Invoke(_Aplicacion, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseñoGuardado_Itemclick")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub btGuardar_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btGuardar.ItemClick
|
||||||
|
btGuardar.IsEnabled = False
|
||||||
|
btGuardarYBuscar.IsEnabled = False
|
||||||
|
Dim cancelar = _Aplicacion.Guardar(sender, e,,, 2)
|
||||||
|
If Not cancelar And (_Aplicacion.Estado = EstadosAplicacion.AplicacionSinIndice Or _Aplicacion.Estado = EstadosAplicacion.SinDatos) Then btGuardar.IsEnabled = True
|
||||||
|
End Sub
|
||||||
|
Private Sub BtCapturar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim sficherojpg = tsl5.Utilidades.ObtieneFicheroAleatorio("jpg")
|
||||||
|
IO.File.WriteAllBytes(sficherojpg, Me._Aplicacion.ObtieneImagen(1, 100))
|
||||||
|
Process.Start(sficherojpg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtExportar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = "Exportacion.xlsx"
|
||||||
|
sfd.Filter = "Fichero Excel (*.xls, *.xlsx|*.xls;*.xlsx"
|
||||||
|
sfd.DefaultExt = ".xlsx"
|
||||||
|
Dim ms As New List(Of Stream)
|
||||||
|
Dim formato As DocumentFormat
|
||||||
|
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||||
|
Case ".xls"
|
||||||
|
formato = DocumentFormat.Xls
|
||||||
|
Case ".xlsx"
|
||||||
|
formato = DocumentFormat.Xlsx
|
||||||
|
End Select
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Dim ls = New MemoryStream
|
||||||
|
Dim i As Integer = 0
|
||||||
|
If Me._Aplicacion.Estado <> EstadosAplicacion.AplicacionSinIndice Then
|
||||||
|
Dim ngc As New tsGridControl
|
||||||
|
For Each oc In Me._Aplicacion.ControlesTS
|
||||||
|
Dim gc As New tsGridColumn()
|
||||||
|
gc.FieldName = oc.PropiedadesTS.NombreCampo
|
||||||
|
gc.Header = oc.Label.ToString.TrimEnd(":")
|
||||||
|
gc.Width = oc.Width
|
||||||
|
ngc.Columns.Add(gc)
|
||||||
|
Next
|
||||||
|
ngc.ItemsSource = Me._Aplicacion.Contexto
|
||||||
|
ngc.View.ExportToXlsx(ls)
|
||||||
|
ms.Add(ls)
|
||||||
|
End If
|
||||||
|
For Each l In Me._Aplicacion.Lineas
|
||||||
|
ls = New MemoryStream
|
||||||
|
ms.Add(ls)
|
||||||
|
Dim vista As TableView = l.View
|
||||||
|
Select Case formato
|
||||||
|
Case DocumentFormat.Xls
|
||||||
|
vista.ExportToXls(ls)
|
||||||
|
Case DocumentFormat.Xlsx
|
||||||
|
vista.ExportToXlsx(ls)
|
||||||
|
End Select
|
||||||
|
i += 1
|
||||||
|
Next
|
||||||
|
Dim wb As New Workbook
|
||||||
|
For i = 0 To ms.Count - 1
|
||||||
|
Dim wbc As New Workbook
|
||||||
|
ms(i).Position = 0
|
||||||
|
wbc.LoadDocument(ms(i), formato)
|
||||||
|
wb.Worksheets(i).CopyFrom(wbc.Worksheets(0))
|
||||||
|
Dim sNombre As String
|
||||||
|
If i = 0 Then
|
||||||
|
sNombre = If(Me._Aplicacion.DescripcionRegistro.NothingAVacio <> "", Me._Aplicacion.DescripcionRegistro.NothingAVacio, "Hoja")
|
||||||
|
Else
|
||||||
|
sNombre = Me._Aplicacion.Lineas(i - 1).NombreTablaBase
|
||||||
|
End If
|
||||||
|
Dim j As Integer = 0
|
||||||
|
Dim sNombreFinal = sNombre
|
||||||
|
Do Until wb.Worksheets.Any(Function(x) x.Name.ToLower = sNombreFinal.ToLower) = False
|
||||||
|
j += 1
|
||||||
|
sNombreFinal = sNombre & "-" & j.ToString
|
||||||
|
Loop
|
||||||
|
Dim sNombreHoja = sNombreFinal.Replace("/", " ").Acortar(30)
|
||||||
|
Dim k As Integer
|
||||||
|
Do Until wb.Worksheets.Any(Function(x) x.Name = sNombreHoja) = False
|
||||||
|
sNombreHoja = (k.ToString & " - " & sNombreHoja).Acortar(30)
|
||||||
|
Loop
|
||||||
|
wb.Worksheets(i).Name = sNombreHoja
|
||||||
|
If i < ms.Count - 1 Then wb.Worksheets.Add()
|
||||||
|
Next
|
||||||
|
If Me._Aplicacion.Estado <> EstadosAplicacion.AplicacionSinIndice Then
|
||||||
|
Dim nc As Integer = 0
|
||||||
|
For Each c In Me._Aplicacion.ControlesTS
|
||||||
|
Select Case c.Content.GetType
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
Dim Ce As CheckEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(If(Ce.IsChecked, "SI", "NO"))
|
||||||
|
Case GetType(ButtonEdit)
|
||||||
|
Dim te As ButtonEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(te.EditValue)
|
||||||
|
Case GetType(TextEdit)
|
||||||
|
Dim te As TextEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(te.EditValue)
|
||||||
|
Case GetType(DateEdit)
|
||||||
|
Dim de As DateEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(de.EditValue)
|
||||||
|
Case GetType(ComboBoxEdit)
|
||||||
|
Dim cbe As ComboBoxEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(cbe.DisplayText)
|
||||||
|
Case GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim le As DevExpress.Xpf.Grid.LookUp.LookUpEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(le.EditValue)
|
||||||
|
End Select
|
||||||
|
nc += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
wb.SaveDocument(sfd.FileName, formato)
|
||||||
|
Process.Start(sfd.FileName)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub btBuscar_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btBuscar.ItemClick
|
||||||
|
Me._Aplicacion.LanzaBuscarNuevoRegistro(False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub btGuardarYBuscar_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btGuardarYBuscar.ItemClick
|
||||||
|
btGuardar.IsEnabled = False
|
||||||
|
btGuardarYBuscar.IsEnabled = False
|
||||||
|
If Not _Aplicacion.Guardar(sender, e,,, 1) Then
|
||||||
|
Me._Aplicacion.LanzaBuscarNuevoRegistro(True)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub btActualizar_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btActualizar.ItemClick
|
||||||
|
Me._Aplicacion.RefrescaUC()
|
||||||
|
End Sub
|
||||||
|
Private Sub btSeleccionar_CheckedChanged(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
If _Aplicacion IsNot Nothing AndAlso _Aplicacion.GridSeleccion IsNot Nothing Then
|
||||||
|
Dim tv = DirectCast(_Aplicacion.GridSeleccion.View, TableView)
|
||||||
|
If tv IsNot Nothing Then
|
||||||
|
If btSeleccionar.IsChecked Then
|
||||||
|
_Aplicacion.GridSeleccion.SelectionMode = MultiSelectMode.MultipleRow
|
||||||
|
_Aplicacion.GridSeleccion.UnselectAll()
|
||||||
|
tv.ShowCheckBoxSelectorColumn = True
|
||||||
|
Else
|
||||||
|
tv.ShowCheckBoxSelectorColumn = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorAplicacion_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
|
||||||
|
If e.Key = Key.F1 Or e.Key = Key.F2 Or e.Key = Key.F3 Or e.Key = Key.F4 Or e.Key = Key.F5 Or e.Key = Key.F6 Or e.Key = Key.F7 Or e.Key = Key.F8 Or e.Key = Key.F9 Or e.Key = Key.F10 Or e.Key = Key.F11 Or e.Key = Key.F12 Or e.Key = Key.System Then
|
||||||
|
_Aplicacion.LanzaTeclaFuncionPulsada(sender, e)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorAplicacion_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs) Handles Me.IsVisibleChanged
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN
DXSplashScreen/SplashScreenBackground.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
23
DXSplashScreen/SplashScreenTecnosis.xaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<UserControl
|
||||||
|
x:Class="SplashScreenTecnosis"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{x:Static dx:SplashScreenViewModel.DesignTimeData}" Height="328"
|
||||||
|
>
|
||||||
|
<Grid Margin="20" Width="438" Height="100">
|
||||||
|
<Grid.Effect>
|
||||||
|
<DropShadowEffect ShadowDepth="1" Direction="-90" BlurRadius="10" Opacity="0.25" />
|
||||||
|
</Grid.Effect>
|
||||||
|
<Border Background="Black" CornerRadius="3" Opacity="0.25" />
|
||||||
|
<Border CornerRadius="2" Margin="0,2,2,0" Background="White" />
|
||||||
|
<StackPanel Orientation="Vertical" Margin="12">
|
||||||
|
<TextBlock x:Name="Rotulo" TextWrapping="Wrap" Text="{Binding State}" Margin="12,12,12,0" Foreground="#FF2D2D2D" />
|
||||||
|
<!--<TextBlock x:Name="Rotulo" TextWrapping="Wrap" Text="Cargando ..." Margin="12,12,12,0" Foreground="#FF2D2D2D" />-->
|
||||||
|
<ProgressBar Height="14" Margin="12" IsIndeterminate="{Binding IsIndeterminate}" Value="{Binding Progress}" Maximum="{Binding MaxProgress}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
5
DXSplashScreen/SplashScreenTecnosis.xaml.vb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
|
||||||
|
Public Class SplashScreenTecnosis
|
||||||
|
|
||||||
|
End Class
|
||||||
6907
Diccionarios/Spanish.aff
Normal file
70158
Diccionarios/Spanish.dic
Normal file
75
Diccionarios/Spanish.txt
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
****************************************************************************
|
||||||
|
** **
|
||||||
|
** Diccionario para corrección ortográfica en español de **
|
||||||
|
** LibreOffice/Apache OpenOffice **
|
||||||
|
** **
|
||||||
|
****************************************************************************
|
||||||
|
|
||||||
|
Para: es (ALL)
|
||||||
|
|
||||||
|
****************************************************************************
|
||||||
|
|
||||||
|
Versión 2.6
|
||||||
|
|
||||||
|
SUMARIO
|
||||||
|
|
||||||
|
1. AUTOR
|
||||||
|
2. LICENCIA
|
||||||
|
3. COLABORACIÓN
|
||||||
|
4. AGRADECIMIENTOS
|
||||||
|
|
||||||
|
|
||||||
|
1. AUTOR
|
||||||
|
|
||||||
|
Este diccionario ha sido desarrollado inicialmente por Santiago Bosio;
|
||||||
|
quien actualmente coordina el desarrollo de todos los diccionarios localizados.
|
||||||
|
|
||||||
|
El diccionario es un desarrollo completamente nuevo, y NO ESTÁ BASADO en el
|
||||||
|
trabajo de Jesús Carretero y Santiago Rodríguez, ni en la versión adaptada al
|
||||||
|
formato de MySpell por Richard Holt.
|
||||||
|
|
||||||
|
2. LICENCIA
|
||||||
|
|
||||||
|
Este diccionario para corrección ortográfica, integrado por el fichero
|
||||||
|
de afijos y la lista de palabras (__LOCALE__[.aff|.dic]) se distribuye
|
||||||
|
bajo un triple esquema de licencias disjuntas: GNU GPL versión 3 o posterior,
|
||||||
|
GNU LGPL versión 3 o posterior, ó MPL versión 1.1 o posterior. Puede
|
||||||
|
seleccionar libremente bajo cuál de estas licencias utilizará este diccionario.
|
||||||
|
En el fichero LICENSE.md encontrá más detalles.
|
||||||
|
|
||||||
|
3. COLABORACIÓN
|
||||||
|
|
||||||
|
Este diccionario es resultado del trabajo colaborativo de muchas personas.
|
||||||
|
La buena noticia es que ¡usted también puede participar!
|
||||||
|
|
||||||
|
¿Tiene dudas o sugerencias? ¿Desearía ver palabras agregadas, o que se
|
||||||
|
realizaran correcciones? Consulte las indicaciones técnicas publicadas en
|
||||||
|
CONTRIBUTING.md. Estaremos encantados de atenderle.
|
||||||
|
|
||||||
|
4. AGRADECIMIENTOS
|
||||||
|
|
||||||
|
Hay varias personas que han colaborado con aportes o sugerencias a la
|
||||||
|
creación de este diccionario. Se agradece especialmente a:
|
||||||
|
|
||||||
|
- Richard Holt.
|
||||||
|
- Marcelo Garrone.
|
||||||
|
- Kevin Hendricks.
|
||||||
|
- Juan Rey Saura.
|
||||||
|
- Carlos Dávila.
|
||||||
|
- Román Gelbort.
|
||||||
|
- J. Eduardo Moreno.
|
||||||
|
- Gonzalo Higuera Díaz.
|
||||||
|
- Ricardo Palomares Martínez.
|
||||||
|
- Sergio Medina.
|
||||||
|
- Ismael Olea.
|
||||||
|
- Alejandro Moreno.
|
||||||
|
- Alexandro Colorado.
|
||||||
|
- Andrés Sánchez.
|
||||||
|
- Juan Rafael Fernández García.
|
||||||
|
- eksperimental.
|
||||||
|
- Ezequiel (ezeperez26).
|
||||||
|
- KNTRO.
|
||||||
|
- Ricardo Berlasso.
|
||||||
|
- Edward Villegas-Pulgarin (cosmocalibur)
|
||||||
|
- y a todos los integrantes de la comunidad en español que proponen mejoras
|
||||||
|
a este diccionario.
|
||||||
130
ErrorValidacion.vb
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
Imports DevExpress.Xpf.Editors.Helpers
|
||||||
|
Imports DevExpress.Xpf.Editors.Validation
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
|
||||||
|
Public Class ErrorValidacion
|
||||||
|
Public id As String
|
||||||
|
Public Objeto As Object
|
||||||
|
Public ErrorContent As Object
|
||||||
|
Public Excepcion As Exception
|
||||||
|
Public Tipo As DevExpress.XtraEditors.DXErrorProvider.ErrorType
|
||||||
|
Public Sub New(id As String, Objeto As Object, ErrorContent As Object, excepcion As Exception, tipo As DevExpress.XtraEditors.DXErrorProvider.ErrorType)
|
||||||
|
Me.id = id
|
||||||
|
Me.Objeto = Objeto
|
||||||
|
Me.ErrorContent = ErrorContent
|
||||||
|
Me.Excepcion = excepcion
|
||||||
|
Me.Tipo = tipo
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Public Sub New(Objeto As Object, ErrorContent As Object, excepcion As Exception, tipo As DevExpress.XtraEditors.DXErrorProvider.ErrorType)
|
||||||
|
' Me.id = Objeto.name
|
||||||
|
' Me.Objeto = Objeto
|
||||||
|
' Me.ErrorContent = ErrorContent
|
||||||
|
' Me.Excepcion = excepcion
|
||||||
|
' Me.Tipo = tipo
|
||||||
|
'End Sub
|
||||||
|
End Class
|
||||||
|
Public Class ErroresValidacion
|
||||||
|
|
||||||
|
Public Errores As New List(Of ErrorValidacion)
|
||||||
|
' Private ApCabLin As ApCabLin
|
||||||
|
Private PanelErrores As LayoutPanel
|
||||||
|
Public ReadOnly Property Count As Integer
|
||||||
|
Get
|
||||||
|
Return Errores.Count
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
'Public Sub New(apcablin As ApCabLin)
|
||||||
|
' Me.ApCabLin = apcablin
|
||||||
|
'End Sub
|
||||||
|
Public Sub New(PanelErrores As LayoutPanel)
|
||||||
|
Me.PanelErrores = PanelErrores
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub AgregaError(ErrorValidacion As ErrorValidacion, e As DevExpress.Xpf.Editors.ValidationEventArgs)
|
||||||
|
Dim ev = (From er In Errores Select er Where er.id = ErrorValidacion.id)
|
||||||
|
If ev.Count = 0 Then
|
||||||
|
Errores.Add(ErrorValidacion)
|
||||||
|
Else
|
||||||
|
ev.First.Objeto = ErrorValidacion.Objeto
|
||||||
|
ev.First.ErrorContent = ErrorValidacion.ErrorContent
|
||||||
|
ev.First.Excepcion = ErrorValidacion.Excepcion
|
||||||
|
ev.First.Tipo = ErrorValidacion.Tipo
|
||||||
|
End If
|
||||||
|
MuestraErrores()
|
||||||
|
If (e Is Nothing OrElse e.IsValid) Then
|
||||||
|
If ErrorValidacion.Objeto IsNot Nothing Then BaseEditHelper.SetValidationError(ErrorValidacion.Objeto, New BaseValidationError(ErrorValidacion.ErrorContent, ErrorValidacion.Excepcion, ErrorValidacion.Tipo))
|
||||||
|
Else
|
||||||
|
If Not e.IsValid Then
|
||||||
|
e.SetError(ErrorValidacion.ErrorContent, ErrorValidacion.Tipo)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Public Sub EliminaError(id As String)
|
||||||
|
Dim ev = (From er In Errores Select er Where er.id = id)
|
||||||
|
If ev.Count > 0 Then
|
||||||
|
BaseEditHelper.SetValidationError(ev.First.Objeto, Nothing)
|
||||||
|
Errores.Remove(ev.First)
|
||||||
|
If Errores.Count = 0 Then
|
||||||
|
PanelErrores.Visibility = Visibility.Collapsed
|
||||||
|
Else
|
||||||
|
RellenaErrores()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub LimpiarErrores(Patron As String)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim ev As ErrorValidacion
|
||||||
|
For i = Errores.Count - 1 To 0 Step -1
|
||||||
|
ev = Errores(i)
|
||||||
|
If Errores(i).id.ToLower.StartsWith(Patron.ToLower) Then
|
||||||
|
If Not ev.Objeto Is Nothing Then
|
||||||
|
BaseEditHelper.SetValidationError(ev.Objeto, Nothing)
|
||||||
|
End If
|
||||||
|
Errores.Remove(ev)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If Errores.Count = 0 Then
|
||||||
|
PanelErrores.Visibility = Visibility.Collapsed
|
||||||
|
' PanelErrores.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub LimpiarErrores(Optional SoloCritical As Boolean = True)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim ev As ErrorValidacion
|
||||||
|
|
||||||
|
For i = Errores.Count - 1 To 0 Step -1
|
||||||
|
If Not SoloCritical Or Errores(i).Tipo = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical Then
|
||||||
|
ev = Errores(i)
|
||||||
|
If Not ev.Objeto Is Nothing Then
|
||||||
|
BaseEditHelper.SetValidationError(ev.Objeto, Nothing)
|
||||||
|
End If
|
||||||
|
Errores.Remove(ev)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
PanelErrores.Visibility = Visibility.Collapsed
|
||||||
|
'PanelErrores.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Sub MuestraErrores()
|
||||||
|
Try
|
||||||
|
RellenaErrores()
|
||||||
|
PanelErrores.Visibility = System.Windows.Visibility.Visible
|
||||||
|
Dim dm = PanelErrores.GetDockLayoutManager
|
||||||
|
dm.DockController.Dock(PanelErrores)
|
||||||
|
Catch ex As Exception
|
||||||
|
Console.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Sub RellenaErrores()
|
||||||
|
Dim ecvs As New CollectionViewSource
|
||||||
|
Dim le = (From er In Errores Select er.ErrorContent).ToList
|
||||||
|
PanelErrores.DataContext = le
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
||||||
8
IVentanaProgreso.vb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports System.ComponentModel
|
||||||
|
|
||||||
|
Public Interface IVentanaProgreso
|
||||||
|
Sub IniciarTareas(Worker As BackgroundWorker)
|
||||||
|
Function Cancelar() As Boolean
|
||||||
|
|
||||||
|
End Interface
|
||||||
BIN
Images/Icons/AbrirGrid.png
Normal file
|
After Width: | Height: | Size: 302 B |
BIN
Images/Icons/GuardarGrid.png
Normal file
|
After Width: | Height: | Size: 329 B |
BIN
Images/Icons/Invertir-25.png
Normal file
|
After Width: | Height: | Size: 291 B |
BIN
Images/Icons/Select.png
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
Images/Icons/capture.png
Normal file
|
After Width: | Height: | Size: 396 B |
BIN
Images/Icons/checklist-25.png
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
Images/Icons/close-16x16.png
Normal file
|
After Width: | Height: | Size: 746 B |
BIN
Images/Icons/copy-16x16.png
Normal file
|
After Width: | Height: | Size: 504 B |
BIN
Images/Icons/cut-16x16.png
Normal file
|
After Width: | Height: | Size: 885 B |
BIN
Images/Icons/find-16x16.png
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
Images/Icons/new-16x16.png
Normal file
|
After Width: | Height: | Size: 485 B |
BIN
Images/Icons/open-16x16.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
Images/Icons/papelera.png
Normal file
|
After Width: | Height: | Size: 292 B |
BIN
Images/Icons/paste-16x16.png
Normal file
|
After Width: | Height: | Size: 695 B |
BIN
Images/Icons/print-16x16.png
Normal file
|
After Width: | Height: | Size: 869 B |
BIN
Images/Icons/redo-16x16.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
Images/Icons/save-16x16.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
Images/Icons/save-as-16x16.png
Normal file
|
After Width: | Height: | Size: 632 B |
BIN
Images/Icons/undo-16x16.png
Normal file
|
After Width: | Height: | Size: 849 B |
230
Informes/InformesGenerico.vb
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
Imports System.Text.RegularExpressions
|
||||||
|
Imports DevExpress.Spreadsheet
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
|
Public Class InformesGenerico
|
||||||
|
|
||||||
|
Public Shared Sub ExcelAInforme(Titulo As String, Fichero As Byte(), GrupoDocumentos As DocumentGroup, dc As DockController, Optional FicheroDestino As String = Nothing, Optional Parametros As Hashtable = Nothing, Optional MostrarPanelParametros As Boolean = False)
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Fichero)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
Try
|
||||||
|
Dim xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
ExcelAInforme(Titulo, xr, GrupoDocumentos, dc, FicheroDestino, Parametros, MostrarPanelParametros)
|
||||||
|
Catch ex As Reflection.ReflectionTypeLoadException
|
||||||
|
Dim sLista As String
|
||||||
|
sLista = ""
|
||||||
|
For Each item In ex.LoaderExceptions
|
||||||
|
sLista &= item.Message & vbCrLf
|
||||||
|
If item.InnerException IsNot Nothing Then
|
||||||
|
sLista &= item.InnerException.Message & vbCrLf
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
MsgBox(sLista)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Sub ExcelAInforme(Titulo As String, xr As XtraReport, GrupoDocumentos As DocumentGroup, dc As DockController, Optional FicheroDestino As String = Nothing, Optional Parametros As Hashtable = Nothing, Optional MostrarPanelParametros As Boolean = False)
|
||||||
|
Dim fb As New OpenFileDialog
|
||||||
|
fb.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
|
||||||
|
fb.DefaultExt = ".xls"
|
||||||
|
If fb.ShowDialog Then
|
||||||
|
Dim Rango As String
|
||||||
|
Dim FilaInicio, FilaFin As Integer
|
||||||
|
Do
|
||||||
|
Try
|
||||||
|
Rango = InputBox("Introduzca Rango de filas", "Rango de Filas", "2-10")
|
||||||
|
If Rango = "" Then Exit Do
|
||||||
|
If Rango <> "" Then
|
||||||
|
If Rango.Split("-").Length <> 2 Then Throw New Exception("Rango Incorrecto")
|
||||||
|
Dim sInicio As String = Rango.Split("-")(0)
|
||||||
|
If Not IsValid(sInicio) Then Throw New Exception("Rango Incorrecto")
|
||||||
|
Dim sFin As String = Rango.Split("-")(1)
|
||||||
|
If Not IsValid(sFin) Then Throw New Exception("Rango Incorrecto")
|
||||||
|
FilaInicio = Integer.Parse(Rango.Split("-")(0))
|
||||||
|
FilaFin = Integer.Parse(Rango.Split("-")(1))
|
||||||
|
If FilaInicio > FilaFin Then Throw New Exception("Rango Incorrecto")
|
||||||
|
End If
|
||||||
|
Exit Do
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show("Rango incorrecto", "Error")
|
||||||
|
End Try
|
||||||
|
Loop
|
||||||
|
If Rango <> "" Then
|
||||||
|
Dim wb As New Workbook
|
||||||
|
Dim datos As New List(Of FilaExcel)
|
||||||
|
Select Case fb.FileName.Split(".").Last.ToLower
|
||||||
|
Case "xls"
|
||||||
|
wb.LoadDocument(fb.FileName, DevExpress.Spreadsheet.DocumentFormat.Xls)
|
||||||
|
Case "xlsx"
|
||||||
|
wb.LoadDocument(fb.FileName, DevExpress.Spreadsheet.DocumentFormat.Xlsx)
|
||||||
|
Case "csv"
|
||||||
|
wb.LoadDocument(fb.FileName, DevExpress.Spreadsheet.DocumentFormat.Csv)
|
||||||
|
End Select
|
||||||
|
For i = FilaInicio To FilaFin
|
||||||
|
Dim reg As New FilaExcel
|
||||||
|
For l = 65 To 90
|
||||||
|
Dim valor As String = wb.Worksheets(0).Cells(Chr(l) & i.ToString).Value.ToString
|
||||||
|
reg.GetType.GetProperty(Chr(l)).SetValue(reg, valor, Nothing)
|
||||||
|
Next
|
||||||
|
datos.Add(reg)
|
||||||
|
Next
|
||||||
|
MuestraImpresos(Titulo, xr, datos, GrupoDocumentos, dc, FicheroDestino, Parametros, MostrarPanelParametros)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Shared Function IsValid(ByVal inputString As String) As Boolean
|
||||||
|
Dim validValues As New Regex("^[1-9]?[0-9]{1}$|^100000$")
|
||||||
|
Return validValues.IsMatch(inputString)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Sub MuestraImpresos(Titulo As String, Fichero As Byte(), Datasource As Object, GrupoDocumentos As DocumentGroup, dc As DockController, Optional FicheroDestino As String = Nothing, Optional Parametros As Hashtable = Nothing, Optional MostrarPanelParametros As Boolean = False)
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Fichero)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
Try
|
||||||
|
Dim xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
MuestraImpresos(Titulo, xr, Datasource, GrupoDocumentos, dc, FicheroDestino, Parametros, MostrarPanelParametros)
|
||||||
|
Catch ex As Reflection.ReflectionTypeLoadException
|
||||||
|
Dim sLista As String
|
||||||
|
sLista = ""
|
||||||
|
For Each item In ex.LoaderExceptions
|
||||||
|
sLista &= item.Message & vbCrLf
|
||||||
|
If item.InnerException IsNot Nothing Then
|
||||||
|
sLista &= item.InnerException.Message & vbCrLf
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
MsgBox(sLista)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
End Sub
|
||||||
|
Public Shared Function GeneraPDF(Plantilla As Byte(), Datasource As Object, Optional Parametros As List(Of DictionaryEntry) = Nothing) As MemoryStream
|
||||||
|
Try
|
||||||
|
Dim xr As New XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each item As DictionaryEntry In Parametros
|
||||||
|
Try
|
||||||
|
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = item.Key).First
|
||||||
|
pr.Value = item.Value
|
||||||
|
pr.Visible = False
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Try
|
||||||
|
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").First
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
xr.DataSource = Datasource
|
||||||
|
xr.CreateDocument()
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
xr.ExportToPdf(ms)
|
||||||
|
Return ms
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
Public Shared Sub MuestraImpresos(Titulo As String, xr As XtraReport, Datasource As Object, GrupoDocumentos As DocumentGroup, dc As DockController, Optional FicheroDestino As String = Nothing, Optional Parametros As Hashtable = Nothing, Optional MostrarPanelParametros As Boolean = False)
|
||||||
|
Try
|
||||||
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").First
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each pm As DictionaryEntry In Parametros
|
||||||
|
Try
|
||||||
|
Dim pr As DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = pm.Key).First
|
||||||
|
pr.Value = pm.Value
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
xr.DataSource = Datasource
|
||||||
|
|
||||||
|
If FicheroDestino <> "" Then
|
||||||
|
Select Case FicheroDestino.Split(".").Last.ToLower
|
||||||
|
Case "pdf"
|
||||||
|
xr.ExportToPdf(FicheroDestino)
|
||||||
|
Case "xls"
|
||||||
|
xr.ExportToXls(FicheroDestino)
|
||||||
|
Case "xlsx"
|
||||||
|
xr.ExportToXlsx(FicheroDestino)
|
||||||
|
Case "csv"
|
||||||
|
xr.ExportToXlsx(FicheroDestino)
|
||||||
|
End Select
|
||||||
|
Else
|
||||||
|
Dim docpanel As New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
docpanel.Caption = Titulo
|
||||||
|
Dim modelo As New tsWPF.tsXtraReportPreviewModel(xr)
|
||||||
|
modelo.IsParametersPanelVisible = MostrarPanelParametros
|
||||||
|
modelo.AutoShowParametersPanel = MostrarPanelParametros
|
||||||
|
xr.RequestParameters = MostrarPanelParametros
|
||||||
|
Dim vi As New tsWPF.ucVisualizadorInformesa()
|
||||||
|
vi.Visualizador.Model = modelo
|
||||||
|
xr.CreateDocument(True)
|
||||||
|
|
||||||
|
docpanel.Content = vi
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
GrupoDocumentos.Items.Add(docpanel)
|
||||||
|
dc.Activate(docpanel)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message & vbCrLf & ex.ToString & vbCrLf & ex.StackTrace, "Atención", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||||
|
Finally
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
Public Class FilaExcel
|
||||||
|
Property A As String
|
||||||
|
Property B As String
|
||||||
|
Property C As String
|
||||||
|
Property D As String
|
||||||
|
Property E As String
|
||||||
|
Property F As String
|
||||||
|
Property G As String
|
||||||
|
Property H As String
|
||||||
|
Property I As String
|
||||||
|
Property J As String
|
||||||
|
Property K As String
|
||||||
|
Property L As String
|
||||||
|
Property M As String
|
||||||
|
Property N As String
|
||||||
|
Property O As String
|
||||||
|
Property P As String
|
||||||
|
Property Q As String
|
||||||
|
Property R As String
|
||||||
|
Property S As String
|
||||||
|
Property T As String
|
||||||
|
Property U As String
|
||||||
|
Property V As String
|
||||||
|
Property W As String
|
||||||
|
Property X As String
|
||||||
|
Property Y As String
|
||||||
|
Property Z As String
|
||||||
|
|
||||||
|
End Class
|
||||||
14
Informes/TabHeaderPrintInfoControl.xaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<UserControl x:Class="Controles.TabHeaderPrintInfoControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
|
<Grid VerticalAlignment="Center">
|
||||||
|
<ProgressBar Background="{x:Null}" Margin="-9,-2,-25,-3" BorderThickness="0" x:Name="progress" />
|
||||||
|
<TextBlock Margin="0,1,0,1" x:Name="tabNameTextBlock" />
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
59
Informes/TabHeaderPrintInfoControl.xaml.vb
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
Imports Microsoft.VisualBasic
|
||||||
|
Imports System
|
||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports System.Linq
|
||||||
|
Imports System.Text
|
||||||
|
Imports System.Windows
|
||||||
|
Imports System.Windows.Controls
|
||||||
|
Imports System.Windows.Data
|
||||||
|
Imports System.Windows.Documents
|
||||||
|
Imports System.Windows.Input
|
||||||
|
Imports System.Windows.Media
|
||||||
|
Imports System.Windows.Media.Imaging
|
||||||
|
Imports System.Windows.Navigation
|
||||||
|
Imports System.Windows.Shapes
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
|
||||||
|
Namespace Controles
|
||||||
|
Partial Public Class TabHeaderPrintInfoControl
|
||||||
|
Inherits UserControl
|
||||||
|
Public Property LinkPreviewModel() As LinkPreviewModel
|
||||||
|
Get
|
||||||
|
Return CType(GetValue(LinkPreviewModelProperty), LinkPreviewModel)
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As LinkPreviewModel)
|
||||||
|
SetValue(LinkPreviewModelProperty, value)
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Public Shared ReadOnly LinkPreviewModelProperty As DependencyProperty = DependencyProperty.Register("LinkPreviewModel", GetType(LinkPreviewModel), GetType(TabHeaderPrintInfoControl), New PropertyMetadata(Nothing, New PropertyChangedCallback(AddressOf OnLinkPreviewModelChanged)))
|
||||||
|
|
||||||
|
Public Property TabName() As String
|
||||||
|
Get
|
||||||
|
Return CStr(GetValue(TabNameProperty))
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As String)
|
||||||
|
SetValue(TabNameProperty, value)
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Public Shared ReadOnly TabNameProperty As DependencyProperty = DependencyProperty.Register("TabName", GetType(String), GetType(TabHeaderPrintInfoControl), New PropertyMetadata(Nothing, New PropertyChangedCallback(AddressOf OnTabNameChanged)))
|
||||||
|
Private Shared Sub OnLinkPreviewModelChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||||
|
CType(d, TabHeaderPrintInfoControl).OnLinkPreviewModelChanged()
|
||||||
|
End Sub
|
||||||
|
Private Shared Sub OnTabNameChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
|
||||||
|
CType(d, TabHeaderPrintInfoControl).OnTabNameChanged()
|
||||||
|
End Sub
|
||||||
|
Public Sub New()
|
||||||
|
InitializeComponent()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OnLinkPreviewModelChanged()
|
||||||
|
progress.SetBinding(FrameworkElement.VisibilityProperty, New Binding("ProgressVisibility") With {.Source = LinkPreviewModel, .Converter = New BoolToVisibilityConverter()})
|
||||||
|
progress.SetBinding(ProgressBar.MaximumProperty, New Binding("ProgressMaximum") With {.Source = LinkPreviewModel})
|
||||||
|
progress.SetBinding(ProgressBar.ValueProperty, New Binding("ProgressValue") With {.Source = LinkPreviewModel, .Mode = BindingMode.OneWay})
|
||||||
|
End Sub
|
||||||
|
Private Sub OnTabNameChanged()
|
||||||
|
tabNameTextBlock.Text = TabName
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
501
Informes/dxwEditor.xaml
Normal file
@@ -0,0 +1,501 @@
|
|||||||
|
<Window
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
|
||||||
|
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||||
|
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
|
||||||
|
xmlns:dxspch="http://schemas.devexpress.com/winfx/2008/xaml/spellchecker"
|
||||||
|
x:Class="dxwEditor"
|
||||||
|
Title="Editor" Height="1024" Width="1024" WindowState="Maximized" WindowStyle="ToolWindow">
|
||||||
|
<Window.Resources>
|
||||||
|
<dxre:RichEditUICommand x:Key="commands"/>
|
||||||
|
<dxre:RichEditStringIdConverter x:Key="stringIdConverter"/>
|
||||||
|
<dxre:DefaultBarItemDataTemplates x:Key="defaultBarItemTemplates"/>
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<dxb:BarManager x:Name="BarManager1" ToolbarGlyphSize="Small">
|
||||||
|
<dxb:BarManager.Items>
|
||||||
|
<dxb:BarButtonItem x:Name="biGuardarYSalir" Content="Guardar y Salir" ItemClick="biGuardarYSalir_ItemClick" LargeGlyph="{dx:DXImage SvgImages/Save/SaveAndClose.svg}" />
|
||||||
|
<dxb:BarButtonItem x:Name="biGuardar" Content="Guardar" LargeGlyph="{dx:DXImage Image=Save_32x32.png}" ItemClick="biGuardar_ItemClick" />
|
||||||
|
<dxb:BarButtonItem x:Name="biFileNew" Command="{Binding FileNew, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFileOpen" Command="{Binding FileOpen, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<!--<dxb:BarButtonItem x:Name="biFileSave" Command="{Binding FileSave, Mode=OneTime, Source={StaticResource commands}}"/>-->
|
||||||
|
<dxb:BarButtonItem x:Name="biFileSaveAs" Command="{Binding FileSaveAs, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFileQuickPrint" Command="{Binding FileQuickPrint, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFilePrint" Command="{Binding FilePrint, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFilePrintPreview" Command="{Binding FilePrintPreview, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditUndo" Command="{Binding EditUndo, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditRedo" Command="{Binding EditRedo, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertPageBreak" Command="{Binding InsertPageBreak, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertTable" Command="{Binding InsertTable, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertPicture" Command="{Binding InsertPicture, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertFloatingPicture" Command="{Binding InsertFloatingPicture, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertBookmark" Command="{Binding InsertBookmark, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertHyperlink" Command="{Binding InsertHyperlink, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertHeader" Command="{Binding InsertHeader, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertFooter" Command="{Binding InsertFooter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertPageNumber" Command="{Binding InsertPageNumber, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertPageCount" Command="{Binding InsertPageCount, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertTextBox" Command="{Binding InsertTextBox, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertSymbol" Command="{Binding InsertSymbol, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biPageLayoutMargins" Command="{Binding PageLayoutMargins, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutNormalMargins"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutNarrowMargins"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutModerateMargins"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutWideMargins"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biPageLayoutPageMarginsOptions"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutNormalMargins" GlyphSize="Large" Command="{Binding PageLayoutNormalMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutNarrowMargins" GlyphSize="Large" Command="{Binding PageLayoutNarrowMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutModerateMargins" GlyphSize="Large" Command="{Binding PageLayoutModerateMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutWideMargins" GlyphSize="Large" Command="{Binding PageLayoutWideMargins, Mode=OneTime, Source={StaticResource commands}}" ContentTemplate="{Binding SectionMarginBarItemContentTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biPageLayoutPageMarginsOptions" Command="{Binding PageLayoutPageMarginsOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biPageLayoutOrientation" Command="{Binding PageLayoutOrientation, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutPortraitOrientation"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutLandscapeOrientation"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutPortraitOrientation" Command="{Binding PageLayoutPortraitOrientation, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutLandscapeOrientation" Command="{Binding PageLayoutLandscapeOrientation, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biPageLayoutSize" Command="{Binding PageLayoutSize, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxre:PaperKindBarListItemLink BarItemName="biPageLayoutSizeList"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biPageLayoutPagePaperOptions"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxre:PaperKindBarListItem x:Name="biPageLayoutSizeList" RichEditControl="{Binding ElementName=recEditor}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biPageLayoutPagePaperOptions" Command="{Binding PageLayoutPagePaperOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biPageLayoutColumns" Command="{Binding PageLayoutColumns, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutOneColumn"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutTwoColumns"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutThreeColumns"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biPageLayoutColumnsOptions"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutOneColumn" Command="{Binding PageLayoutOneColumn, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutTwoColumns" Command="{Binding PageLayoutTwoColumns, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutThreeColumns" Command="{Binding PageLayoutThreeColumns, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biPageLayoutColumnsOptions" Command="{Binding PageLayoutColumnsOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biInsertBreak" Command="{Binding InsertBreak, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertPageBreak"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertColumnBreak"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakNextPage"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakContinuous"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakEvenPage"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertSectionBreakOddPage"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertColumnBreak" Command="{Binding InsertColumnBreak, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertSectionBreakNextPage" Command="{Binding InsertSectionBreakNextPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertSectionBreakContinuous" Command="{Binding InsertSectionBreakContinuous, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertSectionBreakEvenPage" Command="{Binding InsertSectionBreakEvenPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biInsertSectionBreakOddPage" Command="{Binding InsertSectionBreakOddPage, Mode=OneTime, Source={StaticResource commands}}" GlyphSize="Large"/>
|
||||||
|
<dxb:BarSubItem x:Name="biPageLayoutLineNumbering" Command="{Binding PageLayoutLineNumbering, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingNone"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingContinuous"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingRestartNewPage"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biPageLayoutLineNumberingRestartNewSection"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphSuppressLineNumbers"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biPageLayoutLineNumberingOptions"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingNone" Command="{Binding PageLayoutLineNumberingNone, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingContinuous" Command="{Binding PageLayoutLineNumberingContinuous, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingRestartNewPage" Command="{Binding PageLayoutLineNumberingRestartNewPage, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biPageLayoutLineNumberingRestartNewSection" Command="{Binding PageLayoutLineNumberingRestartNewSection, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphSuppressLineNumbers" Command="{Binding FormatParagraphSuppressLineNumbers, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biPageLayoutLineNumberingOptions" Command="{Binding PageLayoutLineNumberingOptions, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxre:BarButtonColorEditItem x:Name="biPageLayoutPageColor" Command="{Binding PageLayoutPageColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxre:BarButtonColorEditItem.PopupControl>
|
||||||
|
<dxb:PopupControlContainerInfo>
|
||||||
|
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biPageLayoutPageColor, Mode=TwoWay}" ShowBorder="False"/>
|
||||||
|
</dxb:PopupControlContainerInfo>
|
||||||
|
</dxre:BarButtonColorEditItem.PopupControl>
|
||||||
|
</dxre:BarButtonColorEditItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewDraft" Command="{Binding ViewDraft, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewPrintLayout" Command="{Binding ViewPrintLayout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewSimple" Command="{Binding ViewSimple, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewHorizontalRuler" Command="{Binding ViewHorizontalRuler, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewVerticalRuler" Command="{Binding ViewVerticalRuler, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biViewZoomOut" Command="{Binding ViewZoomOut, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biViewZoomIn" Command="{Binding ViewZoomIn, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biGoToHeader" Command="{Binding GoToHeader, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biGoToFooter" Command="{Binding GoToFooter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biHeaderFooterGoToPrevious" Command="{Binding HeaderFooterGoToPrevious, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biHeaderFooterGoToNext" Command="{Binding HeaderFooterGoToNext, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biHeaderFooterLinkToPrevious" Command="{Binding HeaderFooterLinkToPrevious, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biHeaderFooterDifferentFirstPage" Command="{Binding HeaderFooterDifferentFirstPage, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biHeaderFooterDifferentOddEvenPages" Command="{Binding HeaderFooterDifferentOddEvenPages, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biHeaderFooterClose" Command="{Binding HeaderFooterClose, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditPaste" Command="{Binding EditPaste, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditCut" Command="{Binding EditCut, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditCopy" Command="{Binding EditCopy, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditPasteSpecial" Command="{Binding EditPasteSpecial, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biFont">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarEditItemLink BarItemName="biFormatFontName"/>
|
||||||
|
<dxb:BarEditItemLink BarItemName="biFormatFontSize"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarEditItem x:Name="biFormatFontName" Command="{Binding FormatFontName, Mode=OneTime, Source={StaticResource commands}}" EditWidth="150">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxre:FontComboBoxEditSettings/>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarEditItem x:Name="biFormatFontSize" Command="{Binding FormatFontSize, Mode=OneTime, Source={StaticResource commands}}" EditWidth="50">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxre:FontSizeComboBoxEditSettings OfficeFontSizeProvider="{Binding ElementName=recEditor}"/>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxr:BarButtonGroup x:Name="biFontSize">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatIncreaseFontSize"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatDecreaseFontSize"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatIncreaseFontSize" Command="{Binding FormatIncreaseFontSize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatDecreaseFontSize" Command="{Binding FormatDecreaseFontSize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biClearFormatting">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatClearFormatting"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatClearFormatting" Command="{Binding FormatClearFormatting, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biFontShape">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontBold"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontItalic"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontUnderline"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontDoubleUnderline"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontStrikeout"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontDoubleStrikeout"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontSuperscript"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatFontSubscript"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biEditChangeCase"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontBold" Command="{Binding FormatFontBold, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontItalic" Command="{Binding FormatFontItalic, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontUnderline" Command="{Binding FormatFontUnderline, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontDoubleUnderline" Command="{Binding FormatFontDoubleUnderline, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontStrikeout" Command="{Binding FormatFontStrikeout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontDoubleStrikeout" Command="{Binding FormatFontDoubleStrikeout, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontSuperscript" Command="{Binding FormatFontSuperscript, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatFontSubscript" Command="{Binding FormatFontSubscript, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarSubItem x:Name="biEditChangeCase" Command="{Binding EditChangeCase, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditMakeUpperCase"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditMakeLowerCase"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditToggleCase"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditMakeUpperCase" Command="{Binding EditMakeUpperCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditMakeLowerCase" Command="{Binding EditMakeLowerCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditToggleCase" Command="{Binding EditToggleCase, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biFontColor">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontBackColor"/>
|
||||||
|
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontForeColor"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxre:BarSplitButtonColorEditItem x:Name="biFormatFontBackColor" Command="{Binding FormatFontBackColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
<dxb:PopupControlContainerInfo>
|
||||||
|
<dxe:ColorEdit ChipSize="Large" ChipMargin="5" ColumnCount="5" EditValue="{Binding EditValue, ElementName=biFormatFontBackColor, Mode=TwoWay}" ShowMoreColorsButton="False" ShowDefaultColorButton="False" ShowNoColorButton="True" ShowBorder="False">
|
||||||
|
<dxe:ColorEdit.Palettes>
|
||||||
|
<dxre:CharactersBackgroundColorPaletteCollection/>
|
||||||
|
</dxe:ColorEdit.Palettes>
|
||||||
|
</dxe:ColorEdit>
|
||||||
|
</dxb:PopupControlContainerInfo>
|
||||||
|
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
</dxre:BarSplitButtonColorEditItem>
|
||||||
|
<dxre:BarSplitButtonColorEditItem x:Name="biFormatFontForeColor" Command="{Binding FormatFontForeColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
<dxb:PopupControlContainerInfo>
|
||||||
|
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biFormatFontForeColor, Mode=TwoWay}" ShowBorder="False"/>
|
||||||
|
</dxb:PopupControlContainerInfo>
|
||||||
|
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
</dxre:BarSplitButtonColorEditItem>
|
||||||
|
<dxr:BarButtonGroup x:Name="biNumberingList">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatBulletedList"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatNumberingList"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatMultilevelList"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatBulletedList" Command="{Binding FormatBulletedList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatNumberingList" Command="{Binding FormatNumberingList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatMultilevelList" Command="{Binding FormatMultilevelList, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biParagraphIndent">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatDecreaseIndent"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatIncreaseIndent"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatDecreaseIndent" Command="{Binding FormatDecreaseIndent, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatIncreaseIndent" Command="{Binding FormatIncreaseIndent, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biShowWhitespace">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewShowWhitespace"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarCheckItem x:Name="biViewShowWhitespace" Command="{Binding ViewShowWhitespace, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biParagraphAlignment">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignLeft"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignCenter"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignRight"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignJustify"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphAlignLeft" Command="{Binding FormatParagraphAlignLeft, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphAlignCenter" Command="{Binding FormatParagraphAlignCenter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphAlignRight" Command="{Binding FormatParagraphAlignRight, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphAlignJustify" Command="{Binding FormatParagraphAlignJustify, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxr:BarButtonGroup x:Name="biLineSpacing">
|
||||||
|
<dxr:BarButtonGroup.ItemLinks>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biFormatParagraphLineSpacing"/>
|
||||||
|
<dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatParagraphBackColor"/>
|
||||||
|
</dxr:BarButtonGroup.ItemLinks>
|
||||||
|
</dxr:BarButtonGroup>
|
||||||
|
<dxb:BarSubItem x:Name="biFormatParagraphLineSpacing" Command="{Binding FormatParagraphLineSpacing, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxb:BarSubItem.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSingle"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSesquialteral"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingDouble"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatParagraphLineSpacingCustomize"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingBefore"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingBefore"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingAfter"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingAfter"/>
|
||||||
|
</dxb:BarSubItem.ItemLinks>
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingSingle" Command="{Binding FormatParagraphLineSpacingSingle, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingSesquialteral" Command="{Binding FormatParagraphLineSpacingSesquialteral, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biFormatParagraphLineSpacingDouble" Command="{Binding FormatParagraphLineSpacingDouble, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatParagraphLineSpacingCustomize" Command="{Binding FormatParagraphLineSpacingCustomize, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatParagraphAddSpacingBefore" Command="{Binding FormatParagraphAddSpacingBefore, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatParagraphRemoveSpacingBefore" Command="{Binding FormatParagraphRemoveSpacingBefore, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatParagraphAddSpacingAfter" Command="{Binding FormatParagraphAddSpacingAfter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biFormatParagraphRemoveSpacingAfter" Command="{Binding FormatParagraphRemoveSpacingAfter, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxre:BarSplitButtonColorEditItem x:Name="biFormatParagraphBackColor" Command="{Binding FormatParagraphBackColor, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
<dxb:PopupControlContainerInfo>
|
||||||
|
<dxe:ColorEdit EditValue="{Binding EditValue, ElementName=biFormatParagraphBackColor, Mode=TwoWay}" ShowDefaultColorButton="False" ShowNoColorButton="True" ShowBorder="False"/>
|
||||||
|
</dxb:PopupControlContainerInfo>
|
||||||
|
</dxre:BarSplitButtonColorEditItem.PopupControl>
|
||||||
|
</dxre:BarSplitButtonColorEditItem>
|
||||||
|
<dxr:BarButtonGroup x:Name="biParagraph"/>
|
||||||
|
<dxre:GalleryStyleItem x:Name="biGalleryStyle" Command="{Binding FormatFontStyle, Mode=OneTime, Source={StaticResource commands}}" RichEditControl="{Binding ElementName=recEditor }">
|
||||||
|
<dxre:GalleryStyleItem.Gallery>
|
||||||
|
<dxre:RichEditStyleGallery ColCount="10" ItemCheckMode="Single" IsItemGlyphVisible="False" ItemCaptionTemplate="{Binding StyleGalleryItemCaptionTemplate, Mode=OneTime, Source={StaticResource defaultBarItemTemplates}}" IsItemDescriptionVisible="False" MinColCount="3"/>
|
||||||
|
</dxre:GalleryStyleItem.Gallery>
|
||||||
|
</dxre:GalleryStyleItem>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditFind" Command="{Binding EditFind, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biEditReplace" Command="{Binding EditReplace, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxre:InsertMergeFieldsBarSubItem x:Name="biMailMergeInsertFieldPlaceholder" Content="Insertar Campo Combinación" Command="{Binding MailMergeInsertFieldPlaceholder, Mode=OneTime, Source={StaticResource commands}}" RichEditControl="{Binding ElementName=recEditor}"/>
|
||||||
|
<dxb:BarCheckItem x:Name="biMailMergeViewMergedData" Command="{Binding MailMergeViewMergedData, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeShowAllFieldCodes" Command="{Binding MailMergeShowAllFieldCodes, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeShowAllFieldResults" Command="{Binding MailMergeShowAllFieldResults, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeFirstDataRecord" Command="{Binding MailMergeFirstDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergePreviousDataRecord" Command="{Binding MailMergePreviousDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeNextDataRecord" Command="{Binding MailMergeNextDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeLastDataRecord" Command="{Binding MailMergeLastDataRecord, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
<dxb:BarButtonItem x:Name="biMailMergeSaveDocumentAs" Command="{Binding MailMergeSaveDocumentAs, Mode=OneTime, Source={StaticResource commands}}"/>
|
||||||
|
</dxb:BarManager.Items>
|
||||||
|
<DockPanel>
|
||||||
|
<dxr:RibbonControl x:Name="RibbonControl1" DockPanel.Dock="Top" ToolbarShowMode="Hide" ShowApplicationButton="False" MinimizationButtonVisibility="Auto" PageCategoryAlignment="Left" RibbonStyle="Office2010">
|
||||||
|
<dxr:RibbonDefaultPageCategory>
|
||||||
|
<dxr:RibbonPage x:Name="pageFile" Caption="{Binding ConverterParameter=Caption_PageFile, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpFileCommon" Caption="{Binding ConverterParameter=Caption_GroupCommon, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biGuardarYSalir" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biGuardar" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFileNew"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFileOpen"/>
|
||||||
|
<!--<dxb:BarButtonItemLink BarItemName="biFileSave"/>-->
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFileSaveAs"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFileQuickPrint"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFilePrint"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biFilePrintPreview"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditUndo"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditRedo"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
<dxr:RibbonPage x:Name="pageHome" Caption="{Binding ConverterParameter=Caption_PageHome, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpHomeClipboard" Caption="{Binding ConverterParameter=Caption_GroupClipboard, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditPaste"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditCut"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditCopy"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditPasteSpecial"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpHomeFont" CaptionButtonCommand="{Binding FormatFont, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupFont, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biFont"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biFontSize"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biClearFormatting"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biFontShape"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biFontColor"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpHomeParagraph" CaptionButtonCommand="{Binding FormatParagraph, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupParagraph, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biNumberingList"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biParagraphIndent"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biShowWhitespace"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biParagraphAlignment"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biLineSpacing"/>
|
||||||
|
<dxr:BarButtonGroupLink BarItemName="biParagraph"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpHomeStyles" CaptionButtonCommand="{Binding FormatEditFontStyle, Mode=OneTime, Source={StaticResource commands}}" Caption="{Binding ConverterParameter=Caption_GroupStyles, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxre:RibbonStyleGalleryItemLink BarItemName="biGalleryStyle"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpHomeEditing" Caption="{Binding ConverterParameter=Caption_GroupEditing, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditFind"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biEditReplace"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
<dxr:RibbonPage x:Name="pageInsert" Caption="{Binding ConverterParameter=Caption_PageInsert, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertPages" Caption="{Binding ConverterParameter=Caption_GroupPages, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertPageBreak"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertTables" Caption="{Binding ConverterParameter=Caption_GroupTables, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertTable"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertIllustrations" Caption="{Binding ConverterParameter=Caption_GroupIllustrations, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertPicture"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertFloatingPicture"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertLinks" Caption="{Binding ConverterParameter=Caption_GroupLinks, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertBookmark"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertHyperlink"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertHeaderFooter" Caption="{Binding ConverterParameter=Caption_GroupHeaderFooter, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertHeader"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertFooter"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertPageNumber"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertPageCount"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertText" Caption="{Binding ConverterParameter=Caption_GroupText, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertTextBox"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpInsertSymbols" Caption="{Binding ConverterParameter=Caption_GroupSymbols, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biInsertSymbol"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
<dxr:RibbonPage x:Name="pagePageLayout" Caption="{Binding ConverterParameter=Caption_PagePageLayout, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpPageLayoutPageSetup" Caption="{Binding ConverterParameter=Caption_GroupPageSetup, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" CaptionButtonCommand="{Binding PageLayoutPageOptions, Mode=OneTime, Source={StaticResource commands}}">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biPageLayoutMargins"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biPageLayoutOrientation"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biPageLayoutSize"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biPageLayoutColumns"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biInsertBreak"/>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biPageLayoutLineNumbering"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpPageLayoutPageBackground" ShowCaptionButton="False" Caption="{Binding ConverterParameter=Caption_GroupPageBackground, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxre:BarButtonColorEditItemLink BarItemName="biPageLayoutPageColor"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
<dxr:RibbonPage x:Name="pageView" Caption="{Binding ConverterParameter=Caption_PageView, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpViewDocumentViews" Caption="{Binding ConverterParameter=Caption_GroupDocumentViews, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewDraft"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewPrintLayout"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewSimple"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpViewShow" Caption="{Binding ConverterParameter=Caption_GroupShow, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewHorizontalRuler"/>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biViewVerticalRuler"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpViewZoom" Caption="{Binding ConverterParameter=Caption_GroupZoom, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biViewZoomOut"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biViewZoomIn"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
<dxr:RibbonPage x:Name="pageMailMerge" Caption="{Binding ConverterParameter=Caption_PageMailings, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}">
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpMailMergeWriteInsertFields" Caption="{Binding ConverterParameter=Caption_GroupWriteInsertFields, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarSubItemLink BarItemName="biMailMergeInsertFieldPlaceholder"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
<dxr:RibbonPageGroup x:Name="grpMailMergePreviewResults" Caption="{Binding ConverterParameter=Caption_GroupPreviewResults, Converter={StaticResource stringIdConverter}, Mode=OneTime, Source={StaticResource stringIdConverter}}" ShowCaptionButton="False">
|
||||||
|
<dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
<dxb:BarCheckItemLink BarItemName="biMailMergeViewMergedData"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeShowAllFieldCodes"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeShowAllFieldResults"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeFirstDataRecord"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergePreviousDataRecord"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeNextDataRecord"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeLastDataRecord"/>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="biMailMergeSaveDocumentAs"/>
|
||||||
|
</dxr:RibbonPageGroup.ItemLinks>
|
||||||
|
</dxr:RibbonPageGroup>
|
||||||
|
</dxr:RibbonPage>
|
||||||
|
</dxr:RibbonDefaultPageCategory>
|
||||||
|
</dxr:RibbonControl>
|
||||||
|
|
||||||
|
<dxre:RichEditControl x:FieldModifier="Public" x:Name="recEditor" BarManager="{Binding ElementName=BarManager1, Mode=OneTime}" Ribbon="{Binding ElementName=RibbonControl1, Mode=OneTime}" Unit="Millimeter">
|
||||||
|
<dxre:RichEditControl.SpellCheckerOptions>
|
||||||
|
<dxre:DXRichEditSpellCheckerOptions AutoDetectDocumentCulture="True"/>
|
||||||
|
</dxre:RichEditControl.SpellCheckerOptions>
|
||||||
|
<dxmvvm:Interaction.Behaviors>
|
||||||
|
<dxspch:RichEditSpellChecker CheckAsYouType="True"
|
||||||
|
Culture="es-ES"
|
||||||
|
IgnoreMixedCaseWords="False"
|
||||||
|
IgnoreUri="True"
|
||||||
|
SpellingFormType="Word">
|
||||||
|
<dxspch:RichEditSpellChecker.Dictionaries>
|
||||||
|
<dxspch:SpellCheckerOpenOfficeDictionary AlphabetUri="pack://siteoforigin:,,,/Diccionarios/Spanish.txt"
|
||||||
|
Culture="es-ES"
|
||||||
|
DictionaryUri="pack://siteoforigin:,,,/Diccionarios/Spanish.dic"
|
||||||
|
GrammarUri="pack://siteoforigin:,,,/Diccionarios/Spanish.aff"/>
|
||||||
|
</dxspch:RichEditSpellChecker.Dictionaries>
|
||||||
|
</dxspch:RichEditSpellChecker>
|
||||||
|
</dxmvvm:Interaction.Behaviors>
|
||||||
|
</dxre:RichEditControl>
|
||||||
|
</DockPanel>
|
||||||
|
</dxb:BarManager>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
111
Informes/dxwEditor.xaml.vb
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.RichEdit
|
||||||
|
Imports DevExpress.XtraRichEdit.Export
|
||||||
|
Imports DevExpress.XtraRichEdit.Export.Html
|
||||||
|
Imports DevExpress.XtraRichEdit.Commands
|
||||||
|
Imports DevExpress.Office.Services
|
||||||
|
Public Class dxwEditor
|
||||||
|
Public Delegate Sub Guardar(ms As IO.Stream)
|
||||||
|
Public Delegate Sub GuardarYExportarHTML(ms As IO.Stream, msHTML As IO.Stream)
|
||||||
|
Private DlGuardar As Guardar
|
||||||
|
Private DlGuardarYExportarHTML As GuardarYExportarHTML
|
||||||
|
Public Delegate Sub CargarDatosMailMerge(dxrte As RichEditControl)
|
||||||
|
Private DlCargarDatosMailMerge As CargarDatosMailMerge
|
||||||
|
Private _FormatoOrigen As DevExpress.XtraRichEdit.DocumentFormat
|
||||||
|
Private _FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat
|
||||||
|
Private _SoloLectura As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub biGuardar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
'If _Formato = DevExpress.XtraRichEdit.DocumentFormat.Html Then
|
||||||
|
' Dim options As New HtmlDocumentExporterOptions()
|
||||||
|
' options.ExportRootTag = ExportRootTag.Html
|
||||||
|
' options.CssPropertiesExportType = CssPropertiesExportType.Inline
|
||||||
|
' options.EmbedImages = True
|
||||||
|
' Dim exporter = New HtmlExporter(Me.recEditor.Model, options)
|
||||||
|
' Dim s As String = exporter.Export()
|
||||||
|
' ms = New IO.MemoryStream(System.Text.Encoding.Unicode.GetBytes(s))
|
||||||
|
'Else
|
||||||
|
Me.recEditor.SaveDocument(ms, _FormatoDestino)
|
||||||
|
'End If
|
||||||
|
If Me.DlGuardar IsNot Nothing Then
|
||||||
|
Me.DlGuardar.Invoke(ms)
|
||||||
|
End If
|
||||||
|
If Me.DlGuardarYExportarHTML IsNot Nothing Then
|
||||||
|
Dim options As New HtmlDocumentExporterOptions()
|
||||||
|
options.ExportRootTag = ExportRootTag.Html
|
||||||
|
options.CssPropertiesExportType = CssPropertiesExportType.Inline
|
||||||
|
options.EmbedImages = True
|
||||||
|
Dim exporter = New HtmlExporter(Me.recEditor.Model, options)
|
||||||
|
Dim s As String = exporter.Export()
|
||||||
|
Dim mshtml = New IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(s))
|
||||||
|
Me.DlGuardarYExportarHTML(ms, mshtml)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Private Sub biGuardarYSalir_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
biGuardar_ItemClick(sender, e)
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(Documento As IO.Stream, DelegadoGuardar As Guardar, Optional DelegadoCargaMailMerge As CargarDatosMailMerge = Nothing, Optional SoloLectura As Boolean = False)
|
||||||
|
_FormatoOrigen = DevExpress.XtraRichEdit.DocumentFormat.OpenXml
|
||||||
|
_FormatoDestino = DevExpress.XtraRichEdit.DocumentFormat.OpenXml
|
||||||
|
_SoloLectura = SoloLectura
|
||||||
|
Nuevo(Documento, DelegadoGuardar, Nothing, DelegadoCargaMailMerge)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Public Sub New(Documento As IO.Stream, FormatoOrigen As DevExpress.XtraRichEdit.DocumentFormat, FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat, Optional DelegadoGuardarYExportarHTML As GuardarYExportarHTML = Nothing, Optional DelegadoCargaMailMerge As CargarDatosMailMerge = Nothing, Optional SoloLectura As Boolean = False)
|
||||||
|
_FormatoOrigen = FormatoOrigen
|
||||||
|
_FormatoDestino = FormatoDestino
|
||||||
|
_SoloLectura = SoloLectura
|
||||||
|
Nuevo(Documento, Nothing, DelegadoGuardarYExportarHTML, DelegadoCargaMailMerge)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(Documento As IO.Stream, FormatoOrigen As DevExpress.XtraRichEdit.DocumentFormat, FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat, DelegadoGuardar As Guardar, Optional DelegadoCargaMailMerge As CargarDatosMailMerge = Nothing, Optional SoloLectura As Boolean = False)
|
||||||
|
_FormatoOrigen = FormatoOrigen
|
||||||
|
_FormatoDestino = FormatoDestino
|
||||||
|
_SoloLectura = SoloLectura
|
||||||
|
Nuevo(Documento, DelegadoGuardar, Nothing, DelegadoCargaMailMerge)
|
||||||
|
End Sub
|
||||||
|
Private Sub Nuevo(Documento As IO.Stream, Optional DelegadoGuardar As Guardar = Nothing, Optional DelegadoGuardaryExportarHTML As GuardarYExportarHTML = Nothing, Optional DelegadoCargaMailMerge As CargarDatosMailMerge = Nothing)
|
||||||
|
Try
|
||||||
|
DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)()
|
||||||
|
DXSplashScreen.SetState("Cargando Documento ...")
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
DlGuardar = DelegadoGuardar
|
||||||
|
If _SoloLectura OrElse DlGuardar Is Nothing Then Me.biGuardar.IsEnabled = False
|
||||||
|
DlGuardarYExportarHTML = DelegadoGuardaryExportarHTML
|
||||||
|
|
||||||
|
DlCargarDatosMailMerge = DelegadoCargaMailMerge
|
||||||
|
If Documento IsNot Nothing Then
|
||||||
|
Me.recEditor.LoadDocument(Documento, _FormatoOrigen)
|
||||||
|
Else
|
||||||
|
Me.recEditor.Document.Sections(0).Page.PaperKind = System.Drawing.Printing.PaperKind.A4
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
DXMessageBox.Show(ex.Message, "Error Cargando Documento")
|
||||||
|
Finally
|
||||||
|
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
End Try
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub dxwEditor_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
If Me.DlCargarDatosMailMerge IsNot Nothing Then
|
||||||
|
Me.DlCargarDatosMailMerge.Invoke(Me.recEditor)
|
||||||
|
'Else
|
||||||
|
' Me.pageMailMerge.IsVisible = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
34
Informes/tsDocumentPreviewControl.vb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
Imports Microsoft.VisualBasic
|
||||||
|
Imports System
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports System.Linq
|
||||||
|
Imports System.Text
|
||||||
|
Imports DevExpress.XtraPrinting
|
||||||
|
Imports DevExpress.Xpf.Printing.PreviewControl
|
||||||
|
Imports System.IO
|
||||||
|
Imports DevExpress.XtraPrinting.Native.ExportOptionsControllers
|
||||||
|
Public Class tsDocumentPreviewControl
|
||||||
|
Inherits DocumentPreviewControl
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Sub Save()
|
||||||
|
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = MyBase.Document.DefaultFileName
|
||||||
|
sfd.Filter = "Archivo pdf|*.pdf"
|
||||||
|
sfd.DefaultExt = ".pdf"
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Dim optionsModel = ExportOptionsViewModel.Create(Document.PrintingSystem, ExportFormat.Pdf)
|
||||||
|
optionsModel.FileName = sfd.FileName
|
||||||
|
optionsModel.OpenFileAfterExport = True
|
||||||
|
MyBase.Export(optionsModel)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
25
Informes/tsXtraReportPreviewModel.vb
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Imports Microsoft.VisualBasic
|
||||||
|
Imports System
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
|
||||||
|
Public Class tsXtraReportPreviewModel
|
||||||
|
Inherits XtraReportPreviewModel
|
||||||
|
|
||||||
|
Public Sub New(ByVal report As DevExpress.XtraReports.UI.XtraReport)
|
||||||
|
MyBase.New(report)
|
||||||
|
End Sub
|
||||||
|
Protected Overrides Sub Save(parameter As Object)
|
||||||
|
'MyBase.Save(parameter)
|
||||||
|
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = PrintingSystem.ExportOptions.PrintPreview.DefaultFileName
|
||||||
|
sfd.Filter = "Archivo pdf|*.pdf"
|
||||||
|
sfd.DefaultExt = ".pdf"
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
PrintingSystem.ExportToPdf(sfd.FileName)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
155
Informes/tsXtraReports.vb
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
Imports System.IO
|
||||||
|
|
||||||
|
|
||||||
|
Public Class tsXtraReport
|
||||||
|
Public Shared Sub ExportarAPDF(Plantilla() As Byte, Datos As Object, FicheroPDF As String, Optional Parametros As Hashtable = Nothing)
|
||||||
|
Dim xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
If xr.Parameters IsNot Nothing Then
|
||||||
|
Dim pr As Global.DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").FirstOrDefault
|
||||||
|
If pr IsNot Nothing Then
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
End If
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each entry As DictionaryEntry In Parametros
|
||||||
|
Dim par = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = entry.Key).FirstOrDefault
|
||||||
|
If par IsNot Nothing Then
|
||||||
|
par.Value = entry.Value
|
||||||
|
par.Visible = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
xr.DataSource = Datos
|
||||||
|
xr.CreateDocument()
|
||||||
|
xr.ExportToPdf(FicheroPDF)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Sub ExportarAxls(Plantilla() As Byte, Datos As Object, Ficheroxls As String, Optional Parametros As Hashtable = Nothing)
|
||||||
|
Dim xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
If xr.Parameters IsNot Nothing Then
|
||||||
|
Dim pr As Global.DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").FirstOrDefault
|
||||||
|
If pr IsNot Nothing Then
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
End If
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each entry As DictionaryEntry In Parametros
|
||||||
|
Dim par = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = entry.Key).FirstOrDefault
|
||||||
|
If par IsNot Nothing Then
|
||||||
|
par.Value = entry.Value
|
||||||
|
par.Visible = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
xr.DataSource = Datos
|
||||||
|
xr.CreateDocument()
|
||||||
|
xr.ExportToXls(Ficheroxls)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub ExportarAxlsx(Plantilla() As Byte, Datos As Object, Ficheroxlsx As String, Optional Parametros As Hashtable = Nothing)
|
||||||
|
Dim xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
If xr.Parameters IsNot Nothing Then
|
||||||
|
Dim pr As Global.DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").FirstOrDefault
|
||||||
|
If pr IsNot Nothing Then
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
End If
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each entry As DictionaryEntry In Parametros
|
||||||
|
Dim par = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = entry.Key).FirstOrDefault
|
||||||
|
If par IsNot Nothing Then
|
||||||
|
par.Value = entry.Value
|
||||||
|
par.Visible = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
xr.DataSource = Datos
|
||||||
|
xr.CreateDocument()
|
||||||
|
xr.ExportToXlsx(Ficheroxlsx)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub ExportarAcsv(Plantilla() As Byte, Datos As Object, Ficherocsv As String, Optional Parametros As Hashtable = Nothing)
|
||||||
|
Dim xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
If xr.Parameters IsNot Nothing Then
|
||||||
|
Dim pr As Global.DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").FirstOrDefault
|
||||||
|
If pr IsNot Nothing Then
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
End If
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each entry As DictionaryEntry In Parametros
|
||||||
|
Dim par = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = entry.Key).FirstOrDefault
|
||||||
|
If par IsNot Nothing Then
|
||||||
|
par.Value = entry.Value
|
||||||
|
par.Visible = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
xr.DataSource = Datos
|
||||||
|
xr.CreateDocument()
|
||||||
|
xr.ExportToCsv(Ficherocsv)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function ExportarAPDF(Plantilla() As Byte, Datos As Object, Optional Parametros As Hashtable = Nothing) As MemoryStream
|
||||||
|
Dim xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Dim s As String = System.Text.Encoding.UTF8.GetString(Plantilla)
|
||||||
|
Using sw As New StreamWriter(New MemoryStream())
|
||||||
|
sw.Write(s)
|
||||||
|
sw.Flush()
|
||||||
|
|
||||||
|
xr = DevExpress.XtraReports.UI.XtraReport.FromStream(sw.BaseStream, True)
|
||||||
|
End Using
|
||||||
|
If xr.Parameters IsNot Nothing Then
|
||||||
|
Dim pr As Global.DevExpress.XtraReports.Parameters.Parameter = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = "Fecha").FirstOrDefault
|
||||||
|
If pr IsNot Nothing Then
|
||||||
|
pr.Value = Now
|
||||||
|
pr.Visible = False
|
||||||
|
End If
|
||||||
|
If Parametros IsNot Nothing Then
|
||||||
|
For Each entry As DictionaryEntry In Parametros
|
||||||
|
Dim par = (From p As DevExpress.XtraReports.Parameters.Parameter In xr.Parameters Where p.Name = entry.Key).FirstOrDefault
|
||||||
|
If par IsNot Nothing Then
|
||||||
|
par.Value = entry.Value
|
||||||
|
par.Visible = False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
xr.DataSource = Datos
|
||||||
|
xr.CreateDocument()
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
xr.ExportToPdf(ms)
|
||||||
|
Return ms
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
38
Informes/ucDiseñadorInformes.xaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<UserControl
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:dxrd="http://schemas.devexpress.com/winfx/2008/xaml/reportdesigner"
|
||||||
|
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
|
||||||
|
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||||
|
xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner" x:Class="ucDiseñadorInformes" >
|
||||||
|
<!--<UserControl.Resources>
|
||||||
|
<DataTemplate x:Key="RibbonTemplate">
|
||||||
|
<dxr:RibbonActionContainer>
|
||||||
|
<dxb:RemoveBarItemAndLinkAction ItemName="reportNew" />
|
||||||
|
|
||||||
|
<dxb:AddBarItemAction>
|
||||||
|
<dxb:AddBarItemAction.Item>
|
||||||
|
<dxb:BarButtonItem Name="myTestButton"
|
||||||
|
Command="{Binding DoWork}"
|
||||||
|
Content="{Binding ButtonContent}"
|
||||||
|
Hint="A custom button." />
|
||||||
|
</dxb:AddBarItemAction.Item>
|
||||||
|
</dxb:AddBarItemAction>
|
||||||
|
|
||||||
|
<dxr:AddRibbonPageGroupItemLinkAction GroupName="report">
|
||||||
|
<dxr:AddRibbonPageGroupItemLinkAction.ItemLink>
|
||||||
|
<dxb:BarItemLink BarItemName="myTestButton" />
|
||||||
|
</dxr:AddRibbonPageGroupItemLinkAction.ItemLink>
|
||||||
|
</dxr:AddRibbonPageGroupItemLinkAction>
|
||||||
|
</dxr:RibbonActionContainer>
|
||||||
|
</DataTemplate>
|
||||||
|
</UserControl.Resources>-->
|
||||||
|
<dxrud:ReportDesigner x:Name="tsrd" >
|
||||||
|
<dxrud:ReportDesignerClassicView x:Name="tsrdv" ></dxrud:ReportDesignerClassicView>
|
||||||
|
<!--<dxrud:ReportDesigner.RibbonCustomizationActions>
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxrud:DefaultBarItemNames.SaveAs}" />
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxrud:DefaultBarItemNames.Open}" />
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxrud:DefaultBarItemNames.New}" />
|
||||||
|
</dxrud:ReportDesigner.RibbonCustomizationActions>-->
|
||||||
|
</dxrud:ReportDesigner>
|
||||||
|
</UserControl>
|
||||||
190
Informes/ucDiseñadorInformes.xaml.vb
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
Imports DevExpress.Xpf.Reports.UserDesigner
|
||||||
|
Imports DevExpress.Xpf.Reports.UserDesigner.Native
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports System
|
||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports System.ComponentModel
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Linq
|
||||||
|
Imports System.Text
|
||||||
|
Imports System.Windows
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Ribbon
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
|
||||||
|
Public Class ucDiseñadorInformes
|
||||||
|
'Private _irs As DevExpress.Xpf.Reports.UserDesigner.IReportStorage
|
||||||
|
'Private _xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
'Private _id As Integer
|
||||||
|
' Public Delegate Sub Guardar(ms As IO.Stream, idPlantilla As Integer)
|
||||||
|
' Public Delegate Sub Guardar(b() As Byte, idPlantilla As Integer)
|
||||||
|
' Private _DelegadoGuardar As Guardar
|
||||||
|
Private _idPlantilla As Integer
|
||||||
|
Private Sub ucDiseñadorInformes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
' Me.tsrd.ReportStorage = _irs
|
||||||
|
' Me.tsrd.OpenDocument(_xr)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(xr As DevExpress.XtraReports.UI.XtraReport, idPlantilla As Integer, DelegadoGuardar As IRS.Guardar)
|
||||||
|
Try
|
||||||
|
Dim irs = New IRS(idPlantilla, DelegadoGuardar)
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
DXSplashScreen.Show(Of tsWPF.SplashScreenTecnosis)()
|
||||||
|
DXSplashScreen.SetState("Cargando Diseñador de Plantillas ...")
|
||||||
|
InitializeComponent()
|
||||||
|
DXSplashScreen.SetState("Cargando Plantilla ...")
|
||||||
|
Me.tsrd.ReportStorage = irs
|
||||||
|
Me.tsrd.OpenDocument(xr)
|
||||||
|
_idPlantilla = idPlantilla
|
||||||
|
Catch ex As Exception
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
' _xr = xr
|
||||||
|
' _DelegadoGuardar = DelegadoGuardar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' DXSplashScreen.Close()
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Private Sub tsrd_DocumentSaved(sender As Object, e As ReportDesignerDocumentEventArgs)
|
||||||
|
' Dim report As XtraReport = e.Document.Report
|
||||||
|
' Dim ms As New MemoryStream
|
||||||
|
' report.SaveLayout(ms)
|
||||||
|
' _DelegadoGuardar(ms.ToArray, _idPlantilla)
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub tsrd_Loaded(sender As Object, e As RoutedEventArgs) Handles tsrd.Loaded
|
||||||
|
Try
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
Dim rd As RibbonControl = CType(LayoutHelper.FindElementByType(tsrd, GetType(RibbonControl)), RibbonControl)
|
||||||
|
If rd IsNot Nothing Then
|
||||||
|
Dim categorias = rd.Categories
|
||||||
|
For Each c In rd.Categories
|
||||||
|
For Each p In c.Pages
|
||||||
|
For Each g In p.Groups
|
||||||
|
For Each item In g.Items
|
||||||
|
If TypeOf item Is DevExpress.Xpf.Bars.BarButtonItem Then
|
||||||
|
Dim it = TryCast(item, DevExpress.Xpf.Bars.BarButtonItem)
|
||||||
|
If it IsNot Nothing AndAlso it.Content IsNot Nothing Then
|
||||||
|
Debug.Write(it.Content)
|
||||||
|
Select Case it.Content.ToString.ToLower
|
||||||
|
'Case "new report", "open...", "save as..."
|
||||||
|
' it.IsVisible = False
|
||||||
|
Case "new report"
|
||||||
|
it.IsVisible = False
|
||||||
|
Case "open..."
|
||||||
|
it.Content = "Abrir..."
|
||||||
|
' it.IsVisible = True
|
||||||
|
Case "save as..."
|
||||||
|
it.Content = "Guardar como..."
|
||||||
|
Case "save"
|
||||||
|
it.Content = "Guardar"
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message & vbCrLf & ex.StackTrace, "Error en tsrd_Loaded")
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
' tsrdv.ActiveDocument.Close()
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
Public Class IRS
|
||||||
|
|
||||||
|
Implements IReportStorage
|
||||||
|
|
||||||
|
Public Delegate Sub Guardar(b() As Byte, idPlantilla As Integer)
|
||||||
|
' Private _xr As DevExpress.XtraReports.UI.XtraReport
|
||||||
|
Private _idPlantilla As Integer
|
||||||
|
Private _DelegadoGuardar As Guardar
|
||||||
|
|
||||||
|
Public Function CanCreateNew() As Boolean Implements IReportStorage.CanCreateNew
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function CanOpen() As Boolean Implements IReportStorage.CanOpen
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function CreateNew() As XtraReport Implements IReportStorage.CreateNew
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function CreateNewSubreport() As XtraReport Implements IReportStorage.CreateNewSubreport
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetErrorMessage(exception As Exception) As String Implements IReportStorage.GetErrorMessage
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Function GetBuffer(ByVal report As XtraReport) As Byte()
|
||||||
|
Using stream As New MemoryStream()
|
||||||
|
report.SaveLayout(stream)
|
||||||
|
Return stream.ToArray()
|
||||||
|
End Using
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function Load(reportID As String, designerReportSerializer As IReportSerializer) As XtraReport Implements IReportStorage.Load
|
||||||
|
Return XtraReport.FromFile(reportID, True)
|
||||||
|
' Return XtraReport.FromStream(MS, True)
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function Open(designer As IReportDesignerUI) As String Implements IReportStorage.Open
|
||||||
|
Dim fb As New OpenFileDialog
|
||||||
|
fb.Filter = "Archivo repx|*.repx"
|
||||||
|
fb.DefaultExt = ".repx"
|
||||||
|
|
||||||
|
If fb.ShowDialog Then
|
||||||
|
Return fb.FileName
|
||||||
|
Else
|
||||||
|
Return ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function Save(reportID As String, reportProvider As IReportProvider, saveAs As Boolean, reportTitle As String, designer As IReportDesignerUI) As String Implements IReportStorage.Save
|
||||||
|
Dim report As XtraReport = reportProvider.GetReport()
|
||||||
|
|
||||||
|
If saveAs Then
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = report.Name & ".repx"
|
||||||
|
sfd.Filter = "Archivo repx|*.repx"
|
||||||
|
sfd.DefaultExt = ".repx"
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Dim fs As New IO.FileStream(sfd.FileName, FileMode.Create)
|
||||||
|
report.SaveLayout(fs)
|
||||||
|
fs.Close()
|
||||||
|
End If
|
||||||
|
Return ""
|
||||||
|
Else
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
report.SaveLayout(ms)
|
||||||
|
_DelegadoGuardar(ms.ToArray, _idPlantilla)
|
||||||
|
Return ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Sub New(idPlantilla As Integer, DelegadoGuardar As Guardar)
|
||||||
|
_DelegadoGuardar = DelegadoGuardar
|
||||||
|
_idPlantilla = idPlantilla
|
||||||
|
' _xr = xr
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
1597
Informes/ucExcelViewer.xaml
Normal file
12
Informes/ucExcelViewer.xaml.vb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
Public Class ucExcelViewer
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub New(st As IO.Stream, formato As DevExpress.Spreadsheet.DocumentFormat)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.SpreadsheetControl.LoadDocument(st, formato)
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
32
Informes/ucPDFViewer.xaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<UserControl
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" x:Class="ucPDFViewer"
|
||||||
|
xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf"
|
||||||
|
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
xmlns:local="clr-namespace:tsWPF"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1000" d:DesignWidth="1000">
|
||||||
|
<Grid>
|
||||||
|
<dxpdf:PdfViewerControl CommandBarStyle="Bars" x:FieldModifier="Public" x:Name="VisorPDF">
|
||||||
|
<dxpdf:PdfViewerControl.CommandProvider>
|
||||||
|
<dxpdf:PdfCommandProvider>
|
||||||
|
<dxpdf:PdfCommandProvider.Actions>
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Close}"/>
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Open}"/>
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.OpenFromWeb}"/>
|
||||||
|
<dxb:RemoveAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.OpenSplit}"/>
|
||||||
|
</dxpdf:PdfCommandProvider.Actions>
|
||||||
|
|
||||||
|
</dxpdf:PdfCommandProvider>
|
||||||
|
</dxpdf:PdfViewerControl.CommandProvider>
|
||||||
|
</dxpdf:PdfViewerControl>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
</UserControl>
|
||||||
|
|
||||||
43
Informes/ucPDFViewer.xaml.vb
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
|
||||||
|
Public Class ucPDFViewer
|
||||||
|
Public Sub New(st As IO.Stream)
|
||||||
|
|
||||||
|
' Esta llamada es exigida por el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
If st IsNot Nothing Then Me.VisorPDF.DocumentSource = st
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(st As IO.Stream, grd As DocumentGroup, id As String)
|
||||||
|
|
||||||
|
' Esta llamada es exigida por el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
If st IsNot Nothing Then Me.VisorPDF.DocumentSource = st
|
||||||
|
Dim cmdp = Me.VisorPDF.CommandProvider
|
||||||
|
|
||||||
|
|
||||||
|
Dim dc = Comun.dm.DockController
|
||||||
|
|
||||||
|
Dim docpanel As DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
Dim d = (From p In grd.Items Where p.Tag = id)
|
||||||
|
If d.Count > 0 Then
|
||||||
|
docpanel = d.First
|
||||||
|
Else
|
||||||
|
docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
docpanel.Caption = id
|
||||||
|
docpanel.Content = Me
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
docpanel.Tag = id
|
||||||
|
grd.Items.Add(docpanel)
|
||||||
|
End If
|
||||||
|
dc.Activate(docpanel)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
44
Informes/ucVisualizadorInformes.xaml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<UserControl
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" x:Class="ucVisualizadorInformes"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
|
||||||
|
xmlns:local="clr-namespace:tsWPF"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1000" d:DesignWidth="1000">
|
||||||
|
<Grid >
|
||||||
|
|
||||||
|
<local:tsDocumentPreviewControl x:Name="Visualizador" x:FieldModifier="public" CommandBarStyle="Ribbon" >
|
||||||
|
</local:tsDocumentPreviewControl>
|
||||||
|
</Grid>
|
||||||
|
<UserControl.Resources>
|
||||||
|
<DataTemplate x:Key="pageFooterTemplate">
|
||||||
|
<dxe:TextEdit dxp:ExportSettings.TargetType="PageNumber"
|
||||||
|
dxp:PageNumberExportSettings.Kind="NumberOfTotal"
|
||||||
|
dxp:PageNumberExportSettings.Format="{}Página {0} / {1}"
|
||||||
|
FontSize="12"
|
||||||
|
FontFamily="Arial"
|
||||||
|
IsPrintingMode="True"
|
||||||
|
HorizontalContentAlignment="Right"
|
||||||
|
Width="{Binding UsablePageWidth}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="pageHeaderTemplate">
|
||||||
|
<Grid Margin="0,10,0,10" Width="{Binding UsablePageWidth}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<dxe:TextEdit IsPrintingMode="True"
|
||||||
|
FontSize="18" FontFamily="Arial" FontWeight="Bold"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
EditValue="{Binding Path=Content.CabeceraImpresion}"/>
|
||||||
|
<dxe:TextEdit IsPrintingMode="True" Grid.Column="1"
|
||||||
|
EditValue="{Binding Path=Content.ReportDate, Mode=OneWay}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</DataTemplate>
|
||||||
|
</UserControl.Resources>
|
||||||
|
</UserControl>
|
||||||
25
Informes/ucVisualizadorInformes.xaml.vb
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Class ucVisualizadorInformes
|
||||||
|
|
||||||
|
Private Sub ucVisualizadorInformes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
Try
|
||||||
|
DirectCast(Me.Parent, DocumentPanel).Tag = "visualizadorinformes"
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ucVisualizadorInformes_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
'Try
|
||||||
|
' Dim modelo As tsXtraReportPreviewModel = Me.Visualizador.Model
|
||||||
|
' modelo.Report.Dispose()
|
||||||
|
' modelo.Dispose()
|
||||||
|
'Catch ex As Exception
|
||||||
|
'End Try
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
15
Informes/ucVisualizadorInformesa.xaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<UserControl
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" x:Class="ucVisualizadorInformesa"
|
||||||
|
|
||||||
|
mc:Ignorable="d" >
|
||||||
|
<Grid>
|
||||||
|
<dxp:DocumentPreview x:Name="Visualizador" x:FieldModifier="public" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
50
Informes/ucVisualizadorInformesa.xaml.vb
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Class ucVisualizadorInformesa
|
||||||
|
|
||||||
|
Private Sub ucVisualizadorInformes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
Try
|
||||||
|
DirectCast(Me.Parent, DocumentPanel).Tag = "visualizadorinformes"
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ucVisualizadorInformes_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
'Try
|
||||||
|
' Dim modelo As tsXtraReportPreviewModel = Me.Visualizador.Model
|
||||||
|
' modelo.Report.Dispose()
|
||||||
|
' modelo.Dispose()
|
||||||
|
'Catch ex As Exception
|
||||||
|
'End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Private Sub Visualizador_Loaded(sender As Object, e As RoutedEventArgs) Handles Visualizador.Loaded
|
||||||
|
' Debug.Print(Me.Visualizador.DocumentViewer.ToString)
|
||||||
|
'End Sub
|
||||||
|
End Class
|
||||||
|
'Public Class tsXtraReportPreviewModel
|
||||||
|
' Inherits XtraReportPreviewModel
|
||||||
|
|
||||||
|
' Public Sub New(ByVal report As DevExpress.XtraReports.UI.XtraReport)
|
||||||
|
' MyBase.New(report)
|
||||||
|
' End Sub
|
||||||
|
' Protected Overrides Sub Save(parameter As Object)
|
||||||
|
' 'MyBase.Save(parameter)
|
||||||
|
|
||||||
|
' Dim sfd As New SaveFileDialog
|
||||||
|
' sfd.FileName = PrintingSystem.ExportOptions.PrintPreview.DefaultFileName
|
||||||
|
' sfd.Filter = "Archivo pdf|*.pdf"
|
||||||
|
' sfd.DefaultExt = ".pdf"
|
||||||
|
' If sfd.ShowDialog Then
|
||||||
|
' PrintingSystem.ExportToPdf(sfd.FileName)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' End Sub
|
||||||
|
'End Class
|
||||||
443
InicioServicioYClientes/Rutinas.vb
Normal file
@@ -0,0 +1,443 @@
|
|||||||
|
Imports System.Runtime.Remoting
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Xml
|
||||||
|
Imports System.Xml.Serialization
|
||||||
|
Imports System.Windows.Forms
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports tsl5.Enumeraciones
|
||||||
|
Imports tsl5
|
||||||
|
Imports System.Data
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
|
||||||
|
Public Class Rutinas
|
||||||
|
Shared Sub IniciaServicioNR(Puerto As Integer, Nombre As String, tipo As Type)
|
||||||
|
Dim ht As New Hashtable
|
||||||
|
ht("port") = Puerto
|
||||||
|
ht("name") = Nombre
|
||||||
|
Dim serverProvTcp As New System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider
|
||||||
|
serverProvTcp.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
|
||||||
|
Dim clientProvTcp As New System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider
|
||||||
|
Dim tc As System.Runtime.Remoting.Channels.Tcp.TcpChannel = New System.Runtime.Remoting.Channels.Tcp.TcpChannel(ht, clientProvTcp, serverProvTcp)
|
||||||
|
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType(tipo, Nombre & ".soap", WellKnownObjectMode.Singleton)
|
||||||
|
End Sub
|
||||||
|
Shared Function ObtieneObjetoServicioNR(Servidor As String, Puerto As Integer, Nombre As String) As tsl5.Interfaces.IServicioNR
|
||||||
|
Dim sr As tsl5.Interfaces.IServicioNR
|
||||||
|
Dim sPuertoNR As String = Puerto
|
||||||
|
sr = System.Activator.GetObject(GetType(tsl5.Interfaces.IServicioNR), "tcp://" & Servidor & ":" & sPuertoNR & "/" & Nombre & ".soap")
|
||||||
|
Return sr
|
||||||
|
|
||||||
|
End Function
|
||||||
|
'Shared Function ObtieneActualizaciones(VersionServidor As Datos.Actualizacion, ByRef VersionAComparar As Datos.Actualizacion) As Enumeraciones.tipoActualizacionEnum
|
||||||
|
' Dim TipoActualizacion As Enumeraciones.tipoActualizacionEnum = Enumeraciones.tipoActualizacionEnum.No_Actualizar
|
||||||
|
' Dim NuevosElementos As New List(Of Datos.ElementoActualizable)
|
||||||
|
' For Each fichero In VersionServidor.Elementos 'VersionAComparar.Elementos
|
||||||
|
' Dim sNombreFichero As String = fichero.NombreFichero
|
||||||
|
' Dim sRutaFichero As String = fichero.RutaFichero
|
||||||
|
' Dim TipoFichero As TipoFicheroActualizableEnum = fichero.tipoFichero
|
||||||
|
' Dim fs = From f In VersionAComparar.Elementos Where f.NombreFichero = sNombreFichero And f.tipoFichero = TipoFichero And f.RutaFichero = sRutaFichero Select f
|
||||||
|
' If fs.Count = 0 Then
|
||||||
|
' Dim NuevoFich As New Datos.ElementoActualizable
|
||||||
|
' NuevoFich = fichero
|
||||||
|
' NuevoFich.Comparacion = Enumeraciones.ComparacionEnum.Nuevo
|
||||||
|
' NuevosElementos.Add(NuevoFich)
|
||||||
|
' If NuevoFich.tipoFichero = Enumeraciones.tipoFicheroActualizableEnum.Datos Then
|
||||||
|
' If TipoActualizacion = Enumeraciones.tipoActualizacionEnum.No_Actualizar Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Sin_Reinicio
|
||||||
|
' ElseIf TipoActualizacion = TipoActualizacionEnum.Actualizacion_Con_Reinicio Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Mixta
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' If TipoActualizacion = Enumeraciones.tipoActualizacionEnum.No_Actualizar Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Con_Reinicio
|
||||||
|
' Else
|
||||||
|
' If TipoActualizacion = TipoActualizacionEnum.Actualizacion_Sin_Reinicio Then TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Mixta
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' If fs(0).FechaModificacion <> fichero.FechaModificacion Then
|
||||||
|
' If fichero.tipoFichero = Enumeraciones.tipoFicheroActualizableEnum.Datos Then
|
||||||
|
' If TipoActualizacion = Enumeraciones.tipoActualizacionEnum.No_Actualizar Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Sin_Reinicio
|
||||||
|
' ElseIf TipoActualizacion = TipoActualizacionEnum.Actualizacion_Con_Reinicio Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Mixta
|
||||||
|
' End If
|
||||||
|
' Else
|
||||||
|
' If TipoActualizacion = Enumeraciones.tipoActualizacionEnum.No_Actualizar Then
|
||||||
|
' TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Con_Reinicio
|
||||||
|
' Else
|
||||||
|
' If TipoActualizacion = TipoActualizacionEnum.Actualizacion_Sin_Reinicio Then TipoActualizacion = Enumeraciones.tipoActualizacionEnum.Actualizacion_Mixta
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' fs(0).Comparacion = Enumeraciones.ComparacionEnum.Diferente
|
||||||
|
' fs(0).FechaModificacion = fichero.FechaModificacion
|
||||||
|
' Else
|
||||||
|
' fs(0).Comparacion = Enumeraciones.ComparacionEnum.Sin_Cambios
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' For Each fichero In VersionAComparar.Elementos
|
||||||
|
' Dim sNombreFichero As String = fichero.NombreFichero
|
||||||
|
' Dim sRutaFichero As String = fichero.RutaFichero
|
||||||
|
' Dim TipoFichero As TipoFicheroActualizableEnum = fichero.tipoFichero
|
||||||
|
' Dim fs = From f In VersionServidor.Elementos Where f.NombreFichero = sNombreFichero And f.tipoFichero = TipoFichero And f.RutaFichero = sRutaFichero Select f
|
||||||
|
' 'Dim fs = From f In VersionServidor.Elementos Where f.NombreFichero = sNombreFichero Select f
|
||||||
|
' If fs.Count = 0 Then
|
||||||
|
' fichero.Comparacion = Enumeraciones.ComparacionEnum.Inexistente
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' For Each fichero In NuevosElementos
|
||||||
|
' VersionAComparar.Elementos.Add(fichero)
|
||||||
|
' Next
|
||||||
|
' Return TipoActualizacion
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'Public Shared Function ObtieneVersionFicherosRecursivo(NombreActualizacion As String, RutaDatos As String) As Datos.Actualizacion
|
||||||
|
' Dim Actualizacion As New Datos.Actualizacion
|
||||||
|
' ObtieneVersion(Actualizacion, RutaDatos, RutaDatos, Enumeraciones.TipoFicheroActualizableEnum.Datos)
|
||||||
|
' Actualizacion.Nombre = NombreActualizacion
|
||||||
|
' Return Actualizacion
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'Public Shared Sub ObtieneVersion(ByRef Version As Datos.Actualizacion, Ruta As String, RutaInicial As String, TipoFichero As Enumeraciones.tipoFicheroActualizableEnum)
|
||||||
|
' Dim iBarra As Integer = 1
|
||||||
|
' If Ruta.EndsWith("\") Then iBarra = 0
|
||||||
|
' Dim sDirectorios() As String = IO.Directory.GetDirectories(Ruta)
|
||||||
|
' For Each sdirectorio In sDirectorios
|
||||||
|
' ObtieneVersion(Version, sdirectorio, RutaInicial, TipoFichero)
|
||||||
|
' Next
|
||||||
|
' Dim sFicheros() As String = IO.Directory.GetFiles(Ruta)
|
||||||
|
' Dim sfichero As String
|
||||||
|
' Dim ea As Datos.ElementoActualizable
|
||||||
|
' Dim fi As FileInfo
|
||||||
|
' For Each sfichero In sFicheros
|
||||||
|
' ea = New Datos.ElementoActualizable
|
||||||
|
' ea.NombreFichero = sfichero.Substring(Ruta.Length + iBarra)
|
||||||
|
' fi = New FileInfo(sfichero)
|
||||||
|
' ea.FechaModificacion = fi.LastWriteTimeUtc
|
||||||
|
' ea.tipoFichero = TipoFichero
|
||||||
|
' ea.RutaFichero = ""
|
||||||
|
' If Ruta <> RutaInicial Then ea.RutaFichero = Ruta.Substring(RutaInicial.Length).trimStart("\") & "\"
|
||||||
|
' Version.Elementos.Add(ea)
|
||||||
|
' Next
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
' Shared Function GeneraDatosActualizacion(NombreActualizacion As String, RutaDatos As String) As Datos.Actualizacion
|
||||||
|
' Dim act As New Datos.Actualizacion
|
||||||
|
' act = ObtieneVersionFicherosRecursivo(NombreActualizacion, RutaDatos)
|
||||||
|
' Return act
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'Shared Sub InicioServicios(ByRef Configuracion As Datos.DatosConfiguracionServicio, ByRef VersionesFicherosCliente() As Datos.Actualizacion, ServicioNetRemoting As Type)
|
||||||
|
' 'ReDim VersionesFicherosCliente(Configuracion.OtrosActualizadores.Count - 1)
|
||||||
|
' 'Dim da As New Datos.Actualizacion
|
||||||
|
' 'For i = 0 To Configuracion.OtrosActualizadores.Count - 1
|
||||||
|
' ' da = ObtieneVersionFicherosRecursivo(Configuracion.OtrosActualizadores(i).Nombre, Configuracion.OtrosActualizadores(i).RutaDatos)
|
||||||
|
' ' VersionesFicherosCliente(i) = da
|
||||||
|
' 'Next
|
||||||
|
' Call tsl5.Rutinas.IniciaServicioNR(Configuracion.PuertoNR, Configuracion.NombreServicio, ServicioNetRemoting)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function ObtieneDatConexClienteSinServicio(FicheroConf As String, Peticion As tsl5.Datos.DatosConfiguracionCliente, idGrupoBD As Integer) As tsl5.Datos.DatosConexionCliente
|
||||||
|
Try
|
||||||
|
|
||||||
|
Return tsWPF.Rutinas.ObtieneDatosConexionCliente(FicheroConf, Peticion.ConstantesCliente.NombreServicio, Peticion.ServidorActivo.Localizacion, idGrupoBD, "")
|
||||||
|
Catch exc As Exception
|
||||||
|
Throw New Exception(exc.Message, exc)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Shared Function ObtieneDatosConexionClienteSinServicio(FicheroConfiguracion As String, NombreServicio As String, Localizacion As Enumeraciones.LocalizacionesEnum, idGrupoBD As Integer, dllProcesos As String) As tsl5.Datos.DatosConexionCliente
|
||||||
|
Try
|
||||||
|
Dim configuracionservidor As New tsl5.Datos.DatosConfiguracionServicio
|
||||||
|
configuracionservidor = Datos.DatosConfiguracionServicio.CargaConfiguracion(FicheroConfiguracion, dllProcesos)
|
||||||
|
|
||||||
|
Dim bd As New MySql.Data.MySqlClient.MySqlConnection(bbdd.GeneraConnectionStringMySQL(configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Servidor, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).DataBase, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Usuario, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Password, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Puerto, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SegundosTimeout, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Pooling, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SSL, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).FicheroCertificado, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).PasswordCertificado))
|
||||||
|
'Dim bd As New MySql.Data.MySqlClient.MySqlConnection(bbdd.GeneraConnectionStringMySQL(configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Servidor, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).DataBase, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Usuario, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Password, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Puerto))
|
||||||
|
' ''Dim drUsuario As DataRow = bbdd.ObtienePrimeraFilaMysql(bd, "Select * From Usuarios where Usuario=? and SHA1passwd=?", {Peticion.Usuario, Peticion.Password})
|
||||||
|
' ''If drUsuario Is Nothing Then Throw New Exception("Usuario no válido")
|
||||||
|
Dim dtBBDD As DataTable = bbdd.ObtieneTablaMysql(bd, "SELECT * FROM conexionesbd inner join grupobd on grupobd.idgrupobd=conexionesbd.idgrupobd where grupobd.idgrupobd=?", {idGrupoBD})
|
||||||
|
Dim dcc As New tsl5.Datos.DatosConexionCliente
|
||||||
|
For Each dr In dtBBDD.Rows
|
||||||
|
Dim bbdd As New tsl5.Datos.BBDD
|
||||||
|
bbdd.Usuario = dr("Usuario")
|
||||||
|
bbdd.Password = dr("Password")
|
||||||
|
bbdd.DataBase = dr("Esquema")
|
||||||
|
If Localizacion = Enumeraciones.LocalizacionesEnum.Local Then
|
||||||
|
bbdd.Servidor = dr("ServidorLocal")
|
||||||
|
bbdd.Puerto = dr("PuertoLocal")
|
||||||
|
Else
|
||||||
|
bbdd.Servidor = dr("ServidorRemoto")
|
||||||
|
bbdd.Puerto = dr("PuertoRemoto")
|
||||||
|
End If
|
||||||
|
dcc.BasesDatos.Add(bbdd)
|
||||||
|
Next
|
||||||
|
dcc.NumeroBDConfiguracion = configuracionservidor.NumeroBDConfiguracion
|
||||||
|
'Dim act = From a In configuracionservidor.OtrosActualizadores Where a.Nombre = NombreServicio Select a
|
||||||
|
'If Localizacion = Enumeraciones.LocalizacionesEnum.Local Then
|
||||||
|
' dcc.ServidorActualizador = act(0).ServidorLocal
|
||||||
|
'Else
|
||||||
|
' dcc.ServidorActualizador = act(0).ServidorRemoto
|
||||||
|
'End If
|
||||||
|
Return dcc
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Shared Function ObtieneDatosConexionCliente(FicheroConfiguracion As String, NombreServicio As String, Localizacion As Enumeraciones.LocalizacionesEnum, idGrupoBD As Integer, dllProcesos As String) As tsl5.Datos.DatosConexionCliente
|
||||||
|
Try
|
||||||
|
Dim configuracionservidor As New tsl5.Datos.DatosConfiguracionServicio
|
||||||
|
configuracionservidor = Datos.DatosConfiguracionServicio.CargaConfiguracion(FicheroConfiguracion, dllProcesos)
|
||||||
|
Dim bd As New MySql.Data.MySqlClient.MySqlConnection(bbdd.GeneraConnectionStringMySQL(configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Servidor, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).DataBase, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Usuario, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Password, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Puerto, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SegundosTimeout, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Pooling, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SSL, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).FicheroCertificado, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).PasswordCertificado))
|
||||||
|
' ''Dim drUsuario As DataRow = bbdd.ObtienePrimeraFilaMysql(bd, "Select * From Usuarios where Usuario=? and SHA1passwd=?", {Peticion.Usuario, Peticion.Password})
|
||||||
|
' ''If drUsuario Is Nothing Then Throw New Exception("Usuario no válido")
|
||||||
|
Dim dtBBDD As DataTable = bbdd.ObtieneTablaMysql(bd, "SELECT * FROM conexionesbd inner join grupobd on grupobd.idgrupobd=conexionesbd.idgrupobd where grupobd.idgrupobd=?", {idGrupoBD})
|
||||||
|
Dim dcc As New tsl5.Datos.DatosConexionCliente
|
||||||
|
For Each dr In dtBBDD.Rows
|
||||||
|
Dim bbdd As New tsl5.Datos.BBDD
|
||||||
|
bbdd.Usuario = dr("Usuario")
|
||||||
|
bbdd.Password = dr("Password")
|
||||||
|
bbdd.DataBase = dr("Esquema")
|
||||||
|
If Localizacion = Enumeraciones.LocalizacionesEnum.Local Then
|
||||||
|
bbdd.Servidor = dr("ServidorLocal")
|
||||||
|
bbdd.Puerto = dr("PuertoLocal")
|
||||||
|
Else
|
||||||
|
bbdd.Servidor = dr("ServidorRemoto")
|
||||||
|
bbdd.Puerto = dr("PuertoRemoto")
|
||||||
|
End If
|
||||||
|
dcc.BasesDatos.Add(bbdd)
|
||||||
|
Next
|
||||||
|
|
||||||
|
'Dim act = From a In configuracionservidor.OtrosActualizadores Where a.Nombre = NombreServicio Select a
|
||||||
|
'If Localizacion = Enumeraciones.LocalizacionesEnum.Local Then
|
||||||
|
' dcc.ServidorActualizador = act(0).ServidorLocal
|
||||||
|
'Else
|
||||||
|
' dcc.ServidorActualizador = act(0).ServidorRemoto
|
||||||
|
'End If
|
||||||
|
Return dcc
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
Shared Function IniciaSesion(sr As tsl5.Interfaces.IServicioNR, Usuario As String, Contraseña As String, idGrupoBD As Integer) As Datos.DatosSesionCliente
|
||||||
|
Dim e As Exception = Nothing
|
||||||
|
Dim dsc As Datos.DatosSesionCliente
|
||||||
|
dsc = sr.IniciaSesion(Usuario, Contraseña, idGrupoBD, e)
|
||||||
|
If Not e Is Nothing Then Throw e
|
||||||
|
Return dsc
|
||||||
|
End Function
|
||||||
|
|
||||||
|
'Public Shared Function IniciaSesionSinServicio(Usuario As String, Contraseña As String, ByRef idGrupoBD As Integer, Aplicacion As String, ByRef ex As System.Exception) As tsl5.Datos.DatosSesionCliente
|
||||||
|
' Try
|
||||||
|
' ex = Nothing
|
||||||
|
' Dim sSHA1passwd As String = crypt.SHA1("M3Soft." & Contraseña)
|
||||||
|
' Dim sFicheroConf As String = ObtieneFicheroConfiguracionGenerico(Aplicacion)
|
||||||
|
' Return IniciarSesion(sFicheroConf, Usuario, sSHA1passwd, idGrupoBD, "")
|
||||||
|
' Catch exc As Exception
|
||||||
|
' ex = exc
|
||||||
|
' Return Nothing
|
||||||
|
' End Try
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
Shared Function ObtieneFicheroConfiguracionGenerico(Aplicacion) As String
|
||||||
|
Dim sRutaConfiguraciones As String
|
||||||
|
sRutaConfiguraciones = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "\Depuracion\" & Aplicacion & "\Servidor\ServidorConfig.xml"
|
||||||
|
If Not IO.File.Exists(sRutaConfiguraciones) Then
|
||||||
|
sRutaConfiguraciones = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "\" & Aplicacion & "\Servidor\ServidorConfig.xml"
|
||||||
|
End If
|
||||||
|
Return sRutaConfiguraciones
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Shared Function ObtieneDatConexCliente(Dcc As Datos.DatosConfiguracionCliente, ByRef sr As tsl5.Interfaces.IServicioNR, idGrupoBD As Integer) As Datos.DatosConexionCliente
|
||||||
|
Dim e As Exception = Nothing
|
||||||
|
Dim dc As Datos.DatosConexionCliente
|
||||||
|
sr = tsWPF.Rutinas.ObtieneObjetoServicioNR(Dcc.ServidorActivo.Servidor, Dcc.ServidorActivo.Puerto, Dcc.ConstantesCliente.NombreServicio)
|
||||||
|
'dc = sr.IniciaSesion(Dcc, e)
|
||||||
|
dc = sr.ObtieneDatosConexionCliente(Dcc, idGrupoBD, e)
|
||||||
|
If Not e Is Nothing Then Throw e
|
||||||
|
Return dc
|
||||||
|
End Function
|
||||||
|
|
||||||
|
'Shared Sub ActualizaCliente(DatConfCli As Datos.DatosConfiguracionCliente, ByRef DatConexCli As Datos.DatosConexionCliente, sr As tsl5.Interfaces.IServicioNR)
|
||||||
|
' Try
|
||||||
|
' If Not Windows.Forms.Application.StartupPath.ToLower.StartsWith("c:\tecnosis.tfs\") Then
|
||||||
|
' Dim da As New Datos.Actualizacion
|
||||||
|
' Dim e As Exception = Nothing
|
||||||
|
' da = tsl5.Rutinas.GeneraDatosActualizacion(DatConfCli.ConstantesCliente.NombreServicio, DatConfCli.ConstantesCliente.RutaDatos)
|
||||||
|
' Dim ap As Enumeraciones.tipoActualizacionEnum = sr.CompruebaActualizacionesCliente(DatConfCli.ConstantesCliente.NombreServicio, da, e)
|
||||||
|
' If Not e Is Nothing Then Throw e
|
||||||
|
' Select Case ap
|
||||||
|
' Case Enumeraciones.tipoActualizacionEnum.Actualizacion_Mixta
|
||||||
|
' Actualiza(da, DatConfCli, DatConexCli, TipoFicheroActualizableEnum.Datos)
|
||||||
|
' LlamaActualizadorAuxiliar(da, DatConfCli, DatConexCli)
|
||||||
|
' Case Enumeraciones.tipoActualizacionEnum.Actualizacion_Sin_Reinicio
|
||||||
|
' Actualiza(da, DatConfCli, DatConexCli, TipoFicheroActualizableEnum.Datos)
|
||||||
|
' Case TipoActualizacionEnum.Actualizacion_Con_Reinicio
|
||||||
|
' LlamaActualizadorAuxiliar(da, DatConfCli, DatConexCli)
|
||||||
|
' End Select
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Throw ex
|
||||||
|
' End Try
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Public Shared Sub Actualiza(DatosActualizacion As Datos.Actualizacion, DatConfCli As Datos.DatosConfiguracionCliente, DatConexCli As Datos.DatosConexionCliente, FicherosAActualizar As TipoFicheroActualizableEnum)
|
||||||
|
' Try
|
||||||
|
' If IO.Directory.Exists(DatConfCli.ConstantesCliente.RutaTmp) Then IO.Directory.Delete(DatConfCli.ConstantesCliente.RutaTmp, True)
|
||||||
|
' IO.Directory.CreateDirectory(DatConfCli.ConstantesCliente.RutaTmp)
|
||||||
|
' Dim fActualizador As New frmActualizador
|
||||||
|
' fActualizador.tipoActualizacion = FicherosAActualizar
|
||||||
|
' fActualizador.DatosActualizacion = DatosActualizacion
|
||||||
|
' fActualizador.DatConfCli = DatConfCli
|
||||||
|
' fActualizador.DatConexCli = DatConexCli
|
||||||
|
' fActualizador.ShowDialog()
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Throw ex
|
||||||
|
' End Try
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Private Shared Sub DescargaElementoFTP(servidorActualizacion As Datos.ServidorActualizacion, NombreFichero As String, RutaDescarga As String)
|
||||||
|
' Dim ftp As New Dart.PowerTCP.SecureFtp.Ftp
|
||||||
|
' ftp.Server = servidorActualizacion.Servidor
|
||||||
|
' ftp.Username = servidorActualizacion.Usuario
|
||||||
|
' ftp.Password = servidorActualizacion.Contraseña
|
||||||
|
' ftp.Passive = servidorActualizacion.Pasivo
|
||||||
|
' ftp.ServerPort = servidorActualizacion.Puerto
|
||||||
|
' If servidorActualizacion.SSL Then
|
||||||
|
' ftp.Security = Dart.PowerTCP.SecureFtp.Security.Implicit
|
||||||
|
' Else
|
||||||
|
' ftp.Security = Dart.PowerTCP.SecureFtp.Security.None
|
||||||
|
' End If
|
||||||
|
' ftp.Get(servidorActualizacion.Directorio & NombreFichero, RutaDescarga & NombreFichero)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Private Shared Sub DescargaElementoSamba(servidorActualizacion As Datos.ServidorActualizacion, NombreFichero As String, RutaDescarga As String)
|
||||||
|
' IO.File.Copy(servidorActualizacion.Directorio & "\" & NombreFichero, RutaDescarga & NombreFichero, True)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Private Shared Sub LlamaActualizadorAuxiliar(da As Datos.Actualizacion, DatConfCli As Datos.DatosConfiguracionCliente, DatConexCli As Datos.DatosConexionCliente)
|
||||||
|
' Dim DatosActAux As New Datos.DatosActualizadorAuxiliar
|
||||||
|
' DatosActAux.Actualizacion = da
|
||||||
|
' DatosActAux.ConfiguracionCliente = DatConfCli
|
||||||
|
' DatosActAux.ConexionCliente = DatConexCli
|
||||||
|
' DatosActAux.RutaEjecutable = Windows.Forms.Application.StartupPath & "\" & Process.GetCurrentProcess.ProcessName & ".exe"
|
||||||
|
' Dim sFicDatosAct As String
|
||||||
|
' sFicDatosAct = DatConfCli.ConstantesCliente.RutaDatos & "\ActualizadorAuxiliar\DatosActAux.xml"
|
||||||
|
' Utilidades.serializar(DatosActAux, sFicDatosAct)
|
||||||
|
' If Not IO.File.Exists(DatConfCli.ConstantesCliente.RutaDatos & "\ActualizadorAuxiliar\ActualizadorAuxiliar.exe") Then
|
||||||
|
' MsgBox("No existe el programa actualizador", MsgBoxStyle.Critical, "Error")
|
||||||
|
' Else
|
||||||
|
' Process.Start(DatConfCli.ConstantesCliente.RutaDatos & "\ActualizadorAuxiliar\ActualizadorAuxiliar.exe", sFicDatosAct)
|
||||||
|
' 'MsgBox("El programa se tiene que actualizar.")
|
||||||
|
' 'Windows.Forms.Application.Exit()
|
||||||
|
' Environment.Exit(0)
|
||||||
|
|
||||||
|
' End If
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
<System.Diagnostics.DebuggerStepThrough()> Public Shared Function Ttagi(ByVal sValortag As String, ByVal sToken As String, Optional Separador As String = "|") As String
|
||||||
|
'Public Shared Function Ttagi(ByVal sValortag As String, ByVal sToken As String) As String
|
||||||
|
'Ttagi = ""
|
||||||
|
'Try
|
||||||
|
' sValortag = "|" & sValortag & "|"
|
||||||
|
' If InStr(1, "|" & sValortag & "|", "|" & sToken & "=", vbTextCompare) > 0 Then
|
||||||
|
' Ttagi = Mid(sValortag, (InStr(1, sValortag, "|" & sToken & "=") + Len(sToken) + 2), InStr(1, Mid(sValortag, InStr(1, sValortag, "|" & sToken & "=") + Len(sToken) + 2), "|") - 1)
|
||||||
|
' End If
|
||||||
|
'Catch ex As Exception
|
||||||
|
' Throw ex
|
||||||
|
'End Try
|
||||||
|
sValortag = Separador & sValortag & Separador
|
||||||
|
Dim atags = sValortag.Split(Separador)
|
||||||
|
If atags.Any(Function(x) x.StartsWith(sToken & "=")) Then
|
||||||
|
Ttagi = atags.First(Function(X) X.StartsWith(sToken & "=")).Split("=")(1)
|
||||||
|
Else
|
||||||
|
Ttagi = ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Public Shared Function FindType(ByVal name As String) As Type
|
||||||
|
Dim base As Type
|
||||||
|
|
||||||
|
base = Reflection.Assembly.GetEntryAssembly.GetType(name, False, True)
|
||||||
|
If base IsNot Nothing Then Return base
|
||||||
|
|
||||||
|
base = Reflection.Assembly.GetExecutingAssembly.GetType(name, False, True)
|
||||||
|
If base IsNot Nothing Then Return base
|
||||||
|
|
||||||
|
For Each assembly As Reflection.Assembly In _
|
||||||
|
AppDomain.CurrentDomain.GetAssemblies
|
||||||
|
base = assembly.GetType(name, False, True)
|
||||||
|
If base IsNot Nothing Then Return base
|
||||||
|
Next
|
||||||
|
Throw New Exception("Clase no encontrada")
|
||||||
|
End Function
|
||||||
|
'Shared Sub GeneraMenus(BarraMenu As DevExpress.Xpf.Bars.Bar, datconexcli As Datos.DatosConexionCliente, datsesioncli As Datos.DatosSesionCliente, Evento As DevExpress.Xpf.Bars.ItemClickEventHandler)
|
||||||
|
|
||||||
|
' 'Dim bd As tsl5.tsl5Model.Entities = bbdd.ConectarEntity(datconexcli.BasesDatos(Me.NumeroBD).Servidor, datconexcli.BasesDatos(Me.NumeroBD).DataBase, datconexcli.BasesDatos(Me.NumeroBD).Puerto, datconexcli.BasesDatos(Me.NumeroBD).Usuario, datconexcli.BasesDatos(Me.NumeroBD).Password, "tsl5Model")
|
||||||
|
' Dim bd As tsl5.tsl5Model.tsl5Entities = Nothing
|
||||||
|
' Select Case datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Tipo
|
||||||
|
' Case TipoBD.LOCALDB
|
||||||
|
' bd = bbdd.ConectarTsl5EntityLocalDB(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Fichero, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, "tsl5Model")
|
||||||
|
' Case TipoBD.MYSQL
|
||||||
|
' bd = bbdd.ConectarTsl5EntityMySQL(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Puerto, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Usuario, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Password, "tsl5Model", datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Pooling, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).SSL, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).FicheroCertificado, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).PasswordCertificado)
|
||||||
|
' Case TipoBD.SQLSERVER
|
||||||
|
' bd = bbdd.ConectarTsl5EntitySQLServer(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Usuario, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Password, "tsl5Model")
|
||||||
|
' Case Else
|
||||||
|
' Throw New Exception("Tipo de base de datos no soportado. " & datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Tipo.ToString)
|
||||||
|
' End Select
|
||||||
|
|
||||||
|
' Dim menuiniciales = (From m In bd.menus Where m.idGrupoMenu = datsesioncli.idGrupoMenu Order By m.Orden Select m).ToList
|
||||||
|
' Dim bsi As DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' For Each mi In menuiniciales
|
||||||
|
' bsi = New DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' bsi.Content = mi.Texto.Replace("&", "_")
|
||||||
|
' Call generamenurecursivo(bd, bsi, mi, Evento)
|
||||||
|
' BarraMenu.ItemLinks.Add(bsi)
|
||||||
|
' Next
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Private Shared Sub generamenurecursivo(bd As tsl5.tsl5Model.tsl5Entities, ByRef bsi As DevExpress.Xpf.Bars.BarSubItem, mi As tsl5.tsl5Model.menus, Evento As DevExpress.Xpf.Bars.ItemClickEventHandler)
|
||||||
|
' Dim bsih As DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' Dim bbi As DevExpress.Xpf.Bars.BarButtonItem
|
||||||
|
' Dim submenus = (From m In bd.menus Where m.idMenuPadre = mi.idMenus Order By m.Orden Select m).ToList
|
||||||
|
' For Each sm In submenus
|
||||||
|
' If sm.Accion.Trim <> "" Then
|
||||||
|
' bbi = New DevExpress.Xpf.Bars.BarButtonItem
|
||||||
|
' bbi.Content = sm.Texto.Replace("&", "_")
|
||||||
|
' bbi.Tag = sm.Accion
|
||||||
|
' ' If sm.Accion.ToLower.Contains("enti") Then bbi.KeyGesture = New KeyGesture(Key.LeftAlt + Key.E)
|
||||||
|
' AddHandler bbi.ItemClick, Evento
|
||||||
|
' bsi.ItemLinks.Add(bbi)
|
||||||
|
' Else
|
||||||
|
' bsih = New DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' bsih.Content = sm.Texto.Replace("&", "_")
|
||||||
|
' Call generamenurecursivo(bd, bsih, sm, Evento)
|
||||||
|
' bsi.ItemLinks.Add(bsih)
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Shared Function IniciarSesion(FicheroConfiguracion As String, Usuario As String, SHA1passwd As String, ByRef idGrupoBD As Integer, dllProcesos As String) As tsl5.Datos.DatosSesionCliente
|
||||||
|
' Try
|
||||||
|
' Dim configuracionservidor As New tsl5.Datos.DatosConfiguracionServicio
|
||||||
|
' configuracionservidor = Datos.DatosConfiguracionServicio.CargaConfiguracion(FicheroConfiguracion, dllProcesos)
|
||||||
|
' Dim bd As New MySql.Data.MySqlClient.MySqlConnection(bbdd.GeneraConnectionStringMySQL(configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Servidor, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).DataBase, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Usuario, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Password, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Puerto, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SegundosTimeout, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).Pooling, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).SSL, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).FicheroCertificado, configuracionservidor.BasesDatos(configuracionservidor.NumeroBDConfiguracion).PasswordCertificado))
|
||||||
|
' Dim drUsuario As DataRow = bbdd.ObtienePrimeraFilaMysql(bd, "Select * From Usuarios where Usuario=? and SHA1passwd=?", {Usuario, SHA1passwd})
|
||||||
|
' If drUsuario Is Nothing Then Throw New Exception("Usuario no válido")
|
||||||
|
' Dim drGrupo As DataRow = bbdd.ObtienePrimeraFilaMysql(bd, "Select * From GruposUsuarios where idGrupo=?", {drUsuario("idGrupo")})
|
||||||
|
' Dim ds As New tsl5.Datos.DatosSesionCliente
|
||||||
|
' ds.IdSesion = 1 'TODO: leer de constante
|
||||||
|
' ds.idUsuario = drUsuario("idUsuario")
|
||||||
|
' ds.idGrupoMenu = drGrupo("idGrupoMenu")
|
||||||
|
' idGrupoBD = drUsuario("idGrupobd")
|
||||||
|
' Return ds
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Throw ex
|
||||||
|
' End Try
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
19
InicioServicioYClientes/dxwIdentificacion.xaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
Title="Identificación" Height="210" Width="415" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" Topmost="True" >
|
||||||
|
|
||||||
|
<Grid x:Name="gc" >
|
||||||
|
<dxe:TextEdit Margin="99,14,22,0" Name="teUsuario" VerticalAlignment="Top" 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 Margin="97,56,22,0" Name="pbeContrasenna" VerticalAlignment="Top" TabIndex="1" x:FieldModifier="Public" ShowPasswordButtonVisibility="Always" />
|
||||||
|
<Button Content="Aceptar" Height="23" HorizontalAlignment="Left" Margin="95,95,0,0" Name="Button1" VerticalAlignment="Top" Width="125" />
|
||||||
|
<Button Content="Cancelar" Height="23" HorizontalAlignment="Right" Margin="0,95,22,0" Name="Button2" VerticalAlignment="Top" Width="125" />
|
||||||
|
<Label x:Name="lVersion" Content="Versión:" FontSize="9" Height="24" HorizontalAlignment="Left" Margin="10,140,0,0" VerticalAlignment="Top" Width="176" />
|
||||||
|
<dxe:HyperlinkEdit HorizontalContentAlignment="Right" Height="23" Margin="204,140,22,0" VerticalAlignment="Top" Text="¿Ha Olvidado Su Contraseña?" x:Name="hlRestablecerPass" RequestNavigation="hlRestablecerPass_RequestNavigation" Visibility="Hidden" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||
75
InicioServicioYClientes/dxwIdentificacion.xaml.vb
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
Imports System.Reflection
|
||||||
|
|
||||||
|
Public Class dxwIdentificacion
|
||||||
|
Public Version As String
|
||||||
|
Public Cancelar As Boolean
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
' Esta llamada es exigida por el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Public Sub New(EnlaceRestablecer As String)
|
||||||
|
|
||||||
|
|
||||||
|
' Esta llamada es exigida por el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
hlRestablecerPass.NavigationUrl = EnlaceRestablecer
|
||||||
|
hlRestablecerPass.Visibility = Visibility.Visible
|
||||||
|
' 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
|
||||||
|
'FocusManager.SetFocusedElement(Me, teUsuario)
|
||||||
|
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)
|
||||||
|
'BeginInvoke(New Action(Function() sigo.Focus()), Windows.Threading.DispatcherPriority.ContextIdle)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub dxwIdentificacion_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
||||||
|
'FocusManager.SetFocusedElement(Me, teUsuario)
|
||||||
|
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 = Version '"Versión " + My.Application.Info.Version.ToString
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub hlRestablecerPass_RequestNavigation(sender As Object, e As HyperlinkEditRequestNavigationEventArgs)
|
||||||
|
Process.Start(e.NavigationUrl)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
1311
InicioServicioYClientes/ucBarraGenerica.resx
Normal file
342
InicioServicioYClientes/ucBarraGenerica.vb
Normal file
@@ -0,0 +1,342 @@
|
|||||||
|
|
||||||
|
Public Class ucBarraGenerica
|
||||||
|
Inherits System.Windows.Forms.UserControl
|
||||||
|
Public Event ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.toolBarButtonClickEventArgs)
|
||||||
|
|
||||||
|
#Region " C<>digo generado por el Dise<73>ador de Windows Forms "
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
MyBase.New()
|
||||||
|
|
||||||
|
'El Dise<73>ador de Windows Forms requiere esta llamada.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
'Agregar cualquier inicializaci<63>n despu<70>s de la llamada a InitializeComponent()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'UserControl reemplaza a Dispose para limpiar la lista de componentes.
|
||||||
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
If disposing Then
|
||||||
|
If Not (components Is Nothing) Then
|
||||||
|
components.Dispose()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
MyBase.Dispose(disposing)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Requerido por el Dise<73>ador de Windows Forms
|
||||||
|
Private components As System.ComponentModel.IContainer
|
||||||
|
|
||||||
|
'NOTA: el Dise<73>ador de Windows Forms requiere el siguiente procedimiento
|
||||||
|
'Puede modificarse utilizando el Dise<73>ador de Windows Forms.
|
||||||
|
'No lo modifique con el editor de c<>digo.
|
||||||
|
Friend WithEvents Botones As System.Windows.Forms.ImageList
|
||||||
|
Public WithEvents tlbSiguiente As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents TlbCrearPdf As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbVisualizarPDF As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbLimpiarPantalla As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbAlmacenar As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbEliminaFicha As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbAyuda As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbEnviar As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbRecibir As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbCancelar As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbGrabar As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbCopiar As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tlbSalir As System.Windows.Forms.toolBarButton
|
||||||
|
Public WithEvents tbGenerico As System.Windows.Forms.toolBar
|
||||||
|
Public WithEvents tlbRecibirdeDisco As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbSolicitarCertificado As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbVerCertificado As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbCambiarPIN As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbExportarCertificado As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbRestaurarCopia As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbImprimir As System.Windows.Forms.toolBarButton
|
||||||
|
Friend WithEvents tlbRevocarCertificado As System.Windows.Forms.toolBarButton
|
||||||
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||||
|
Me.components = New System.ComponentModel.Container()
|
||||||
|
Dim tlbAnterior As System.Windows.Forms.toolBarButton
|
||||||
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ucBarraGenerica))
|
||||||
|
Me.tbGenerico = New System.Windows.Forms.toolBar()
|
||||||
|
Me.tlbSiguiente = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbCrearPdf = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbVisualizarPDF = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbAlmacenar = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbLimpiarPantalla = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbEliminaFicha = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbEnviar = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbGrabar = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbCopiar = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbRecibir = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbRecibirdeDisco = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbCancelar = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbAyuda = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbSolicitarCertificado = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbVerCertificado = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbCambiarPIN = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbExportarCertificado = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbRevocarCertificado = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbRestaurarCopia = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbImprimir = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.tlbSalir = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.Botones = New System.Windows.Forms.ImageList(Me.components)
|
||||||
|
tlbAnterior = New System.Windows.Forms.toolBarButton()
|
||||||
|
Me.SuspendLayout()
|
||||||
|
'
|
||||||
|
'tlbAnterior
|
||||||
|
'
|
||||||
|
tlbAnterior.Enabled = False
|
||||||
|
tlbAnterior.ImageIndex = 2
|
||||||
|
tlbAnterior.Name = "tlbAnterior"
|
||||||
|
tlbAnterior.tag = "NOM:ANTERIOR"
|
||||||
|
tlbAnterior.toolTipText = "Anterior (F4)"
|
||||||
|
tlbAnterior.Visible = False
|
||||||
|
'
|
||||||
|
'tbGenerico
|
||||||
|
'
|
||||||
|
Me.tbGenerico.AutoSize = False
|
||||||
|
Me.tbGenerico.Buttons.AddRange(New System.Windows.Forms.toolBarButton() {tlbAnterior, Me.tlbSiguiente, Me.tlbCrearPdf, Me.tlbVisualizarPDF, Me.tlbAlmacenar, Me.tlbLimpiarPantalla, Me.tlbEliminaFicha, Me.tlbEnviar, Me.tlbGrabar, Me.tlbCopiar, Me.tlbRecibir, Me.tlbRecibirdeDisco, Me.tlbCancelar, Me.tlbAyuda, Me.tlbSolicitarCertificado, Me.tlbVerCertificado, Me.tlbCambiarPIN, Me.tlbExportarCertificado, Me.tlbRevocarCertificado, Me.tlbRestaurarCopia, Me.tlbImprimir, Me.tlbSalir})
|
||||||
|
Me.tbGenerico.Dock = System.Windows.Forms.DockStyle.None
|
||||||
|
Me.tbGenerico.DropDownArrows = True
|
||||||
|
Me.tbGenerico.ImageList = Me.Botones
|
||||||
|
Me.tbGenerico.Location = New System.Drawing.Point(0, 0)
|
||||||
|
Me.tbGenerico.Name = "tbGenerico"
|
||||||
|
Me.tbGenerico.ShowToolTips = True
|
||||||
|
Me.tbGenerico.Size = New System.Drawing.Size(765, 44)
|
||||||
|
Me.tbGenerico.tabIndex = 46
|
||||||
|
Me.tbGenerico.tag = "FUN:S"
|
||||||
|
'
|
||||||
|
'tlbSiguiente
|
||||||
|
'
|
||||||
|
Me.tlbSiguiente.Enabled = False
|
||||||
|
Me.tlbSiguiente.ImageIndex = 0
|
||||||
|
Me.tlbSiguiente.Name = "tlbSiguiente"
|
||||||
|
Me.tlbSiguiente.tag = "NOM:SIGUIENTE|FUN:5"
|
||||||
|
Me.tlbSiguiente.toolTipText = "Siguiente (F5)"
|
||||||
|
Me.tlbSiguiente.Visible = False
|
||||||
|
'
|
||||||
|
'TlbCrearPdf
|
||||||
|
'
|
||||||
|
Me.tlbCrearPdf.Enabled = False
|
||||||
|
Me.tlbCrearPdf.ImageIndex = 4
|
||||||
|
Me.tlbCrearPdf.Name = "TlbCrearPdf"
|
||||||
|
Me.tlbCrearPdf.tag = "NOM:CREARPDF"
|
||||||
|
Me.tlbCrearPdf.toolTipText = "Crear PDF"
|
||||||
|
Me.tlbCrearPdf.Visible = False
|
||||||
|
'
|
||||||
|
'tlbVisualizarPDF
|
||||||
|
'
|
||||||
|
Me.tlbVisualizarPDF.Enabled = False
|
||||||
|
Me.tlbVisualizarPDF.ImageIndex = 7
|
||||||
|
Me.tlbVisualizarPDF.Name = "tlbVisualizarPDF"
|
||||||
|
Me.tlbVisualizarPDF.tag = "NOM:VISUALIZARPDF"
|
||||||
|
Me.tlbVisualizarPDF.toolTipText = "Visualizar PDF"
|
||||||
|
Me.tlbVisualizarPDF.Visible = False
|
||||||
|
'
|
||||||
|
'tlbAlmacenar
|
||||||
|
'
|
||||||
|
Me.tlbAlmacenar.Enabled = False
|
||||||
|
Me.tlbAlmacenar.ImageIndex = 5
|
||||||
|
Me.tlbAlmacenar.Name = "tlbAlmacenar"
|
||||||
|
Me.tlbAlmacenar.tag = "NOM:ALMCENAR|FUN:1|IMGN:26|IMGA:5"
|
||||||
|
Me.tlbAlmacenar.toolTipText = "Almacenar (F1)"
|
||||||
|
'
|
||||||
|
'tlbLimpiarPantalla
|
||||||
|
'
|
||||||
|
Me.tlbLimpiarPantalla.Enabled = False
|
||||||
|
Me.tlbLimpiarPantalla.ImageIndex = 13
|
||||||
|
Me.tlbLimpiarPantalla.Name = "tlbLimpiarPantalla"
|
||||||
|
Me.tlbLimpiarPantalla.tag = "NOM:LIMPIARPANTALLA|FUN:6"
|
||||||
|
Me.tlbLimpiarPantalla.toolTipText = "Limpiar Pantalla (F6)"
|
||||||
|
'
|
||||||
|
'tlbEliminaFicha
|
||||||
|
'
|
||||||
|
Me.tlbEliminaFicha.Enabled = False
|
||||||
|
Me.tlbEliminaFicha.ImageIndex = 11
|
||||||
|
Me.tlbEliminaFicha.Name = "tlbEliminaFicha"
|
||||||
|
Me.tlbEliminaFicha.tag = "NOM:ELIMINAFICHA|FUN:7"
|
||||||
|
Me.tlbEliminaFicha.toolTipText = "Elimina Ficha (F7)"
|
||||||
|
'
|
||||||
|
'tlbEnviar
|
||||||
|
'
|
||||||
|
Me.tlbEnviar.Enabled = False
|
||||||
|
Me.tlbEnviar.ImageIndex = 19
|
||||||
|
Me.tlbEnviar.Name = "tlbEnviar"
|
||||||
|
Me.tlbEnviar.tag = "NOM:ENVIAR"
|
||||||
|
Me.tlbEnviar.toolTipText = "Enviar por internet"
|
||||||
|
Me.tlbEnviar.Visible = False
|
||||||
|
'
|
||||||
|
'tlbGrabar
|
||||||
|
'
|
||||||
|
Me.tlbGrabar.Enabled = False
|
||||||
|
Me.tlbGrabar.ImageIndex = 16
|
||||||
|
Me.tlbGrabar.Name = "tlbGrabar"
|
||||||
|
Me.tlbGrabar.tag = "NOM:GRABAR"
|
||||||
|
Me.tlbGrabar.toolTipText = "Grabar en CD / DVD"
|
||||||
|
Me.tlbGrabar.Visible = False
|
||||||
|
'
|
||||||
|
'tlbCopiar
|
||||||
|
'
|
||||||
|
Me.tlbCopiar.Enabled = False
|
||||||
|
Me.tlbCopiar.ImageIndex = 17
|
||||||
|
Me.tlbCopiar.Name = "tlbCopiar"
|
||||||
|
Me.tlbCopiar.tag = "NOM:COPIAR|FUN:4"
|
||||||
|
Me.tlbCopiar.toolTipText = "Copiar (F4)"
|
||||||
|
Me.tlbCopiar.Visible = False
|
||||||
|
'
|
||||||
|
'tlbRecibir
|
||||||
|
'
|
||||||
|
Me.tlbRecibir.Enabled = False
|
||||||
|
Me.tlbRecibir.ImageIndex = 20
|
||||||
|
Me.tlbRecibir.Name = "tlbRecibir"
|
||||||
|
Me.tlbRecibir.tag = "NOM:RECIBIR"
|
||||||
|
Me.tlbRecibir.toolTipText = "Recibir de Internet"
|
||||||
|
Me.tlbRecibir.Visible = False
|
||||||
|
'
|
||||||
|
'tlbRecibirdeDisco
|
||||||
|
'
|
||||||
|
Me.tlbRecibirdeDisco.Enabled = False
|
||||||
|
Me.tlbRecibirdeDisco.ImageIndex = 18
|
||||||
|
Me.tlbRecibirdeDisco.Name = "tlbRecibirdeDisco"
|
||||||
|
Me.tlbRecibirdeDisco.tag = "NOM:RECIBIRDEDISCO"
|
||||||
|
Me.tlbRecibirdeDisco.toolTipText = "Incorporar datos desde disco"
|
||||||
|
Me.tlbRecibirdeDisco.Visible = False
|
||||||
|
'
|
||||||
|
'tlbCancelar
|
||||||
|
'
|
||||||
|
Me.tlbCancelar.Enabled = False
|
||||||
|
Me.tlbCancelar.ImageIndex = 6
|
||||||
|
Me.tlbCancelar.Name = "tlbCancelar"
|
||||||
|
Me.tlbCancelar.tag = "NOM:CANCELAR"
|
||||||
|
Me.tlbCancelar.toolTipText = "Cancelar"
|
||||||
|
Me.tlbCancelar.Visible = False
|
||||||
|
'
|
||||||
|
'tlbAyuda
|
||||||
|
'
|
||||||
|
Me.tlbAyuda.Enabled = False
|
||||||
|
Me.tlbAyuda.ImageIndex = 8
|
||||||
|
Me.tlbAyuda.Name = "tlbAyuda"
|
||||||
|
Me.tlbAyuda.tag = "NOM:AYUDA"
|
||||||
|
Me.tlbAyuda.toolTipText = "Ayuda"
|
||||||
|
Me.tlbAyuda.Visible = False
|
||||||
|
'
|
||||||
|
'tlbSolicitarCertificado
|
||||||
|
'
|
||||||
|
Me.tlbSolicitarCertificado.ImageIndex = 24
|
||||||
|
Me.tlbSolicitarCertificado.Name = "tlbSolicitarCertificado"
|
||||||
|
Me.tlbSolicitarCertificado.tag = "NOM:SolicitarCertificado|FUN:SOLICITARCERTIFICADO|VCO:S"
|
||||||
|
Me.tlbSolicitarCertificado.toolTipText = "Importar un certificado"
|
||||||
|
Me.tlbSolicitarCertificado.Visible = False
|
||||||
|
'
|
||||||
|
'tlbVerCertificado
|
||||||
|
'
|
||||||
|
Me.tlbVerCertificado.ImageIndex = 25
|
||||||
|
Me.tlbVerCertificado.Name = "tlbVerCertificado"
|
||||||
|
Me.tlbVerCertificado.tag = "NOM:VerCertificado"
|
||||||
|
Me.tlbVerCertificado.toolTipText = "Ver Certificado"
|
||||||
|
Me.tlbVerCertificado.Visible = False
|
||||||
|
'
|
||||||
|
'tlbCambiarPIN
|
||||||
|
'
|
||||||
|
Me.tlbCambiarPIN.ImageIndex = 21
|
||||||
|
Me.tlbCambiarPIN.Name = "tlbCambiarPIN"
|
||||||
|
Me.tlbCambiarPIN.tag = "NOM:CambiarPIN"
|
||||||
|
Me.tlbCambiarPIN.toolTipText = "Cambiar PIN del certificado"
|
||||||
|
Me.tlbCambiarPIN.Visible = False
|
||||||
|
'
|
||||||
|
'tlbExportarCertificado
|
||||||
|
'
|
||||||
|
Me.tlbExportarCertificado.ImageIndex = 22
|
||||||
|
Me.tlbExportarCertificado.Name = "tlbExportarCertificado"
|
||||||
|
Me.tlbExportarCertificado.tag = "NOM:ExportarCertificado"
|
||||||
|
Me.tlbExportarCertificado.toolTipText = "Exportar el certificado"
|
||||||
|
Me.tlbExportarCertificado.Visible = False
|
||||||
|
'
|
||||||
|
'tlbRevocarCertificado
|
||||||
|
'
|
||||||
|
Me.tlbRevocarCertificado.ImageIndex = 23
|
||||||
|
Me.tlbRevocarCertificado.Name = "tlbRevocarCertificado"
|
||||||
|
Me.tlbRevocarCertificado.tag = "NOM:RevocarCertificado"
|
||||||
|
Me.tlbRevocarCertificado.toolTipText = "Revocar el certificado"
|
||||||
|
Me.tlbRevocarCertificado.Visible = False
|
||||||
|
'
|
||||||
|
'tlbRestaurarCopia
|
||||||
|
'
|
||||||
|
Me.tlbRestaurarCopia.ImageIndex = 28
|
||||||
|
Me.tlbRestaurarCopia.Name = "tlbRestaurarCopia"
|
||||||
|
Me.tlbRestaurarCopia.tag = "NOM:RestaurarCopia"
|
||||||
|
Me.tlbRestaurarCopia.toolTipText = "Restaurar copia de seguridad"
|
||||||
|
Me.tlbRestaurarCopia.Visible = False
|
||||||
|
'
|
||||||
|
'tlbImprimir
|
||||||
|
'
|
||||||
|
Me.tlbImprimir.ImageIndex = 29
|
||||||
|
Me.tlbImprimir.Name = "tlbImprimir"
|
||||||
|
Me.tlbImprimir.tag = "NOM:IMPRIMIR|FUN:9"
|
||||||
|
Me.tlbImprimir.toolTipText = "Imprimir (F9)"
|
||||||
|
Me.tlbImprimir.Visible = False
|
||||||
|
'
|
||||||
|
'tlbSalir
|
||||||
|
'
|
||||||
|
Me.tlbSalir.Enabled = False
|
||||||
|
Me.tlbSalir.ImageIndex = 3
|
||||||
|
Me.tlbSalir.Name = "tlbSalir"
|
||||||
|
Me.tlbSalir.tag = "NOM:SALIR|FUN:8"
|
||||||
|
Me.tlbSalir.toolTipText = "Salir (F8)"
|
||||||
|
'
|
||||||
|
'Botones
|
||||||
|
'
|
||||||
|
Me.Botones.ImageStream = CType(resources.GetObject("Botones.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||||
|
Me.Botones.transparentColor = System.Drawing.Color.Blue
|
||||||
|
Me.Botones.Images.SetKeyName(0, "")
|
||||||
|
Me.Botones.Images.SetKeyName(1, "")
|
||||||
|
Me.Botones.Images.SetKeyName(2, "")
|
||||||
|
Me.Botones.Images.SetKeyName(3, "")
|
||||||
|
Me.Botones.Images.SetKeyName(4, "")
|
||||||
|
Me.Botones.Images.SetKeyName(5, "")
|
||||||
|
Me.Botones.Images.SetKeyName(6, "")
|
||||||
|
Me.Botones.Images.SetKeyName(7, "")
|
||||||
|
Me.Botones.Images.SetKeyName(8, "")
|
||||||
|
Me.Botones.Images.SetKeyName(9, "")
|
||||||
|
Me.Botones.Images.SetKeyName(10, "")
|
||||||
|
Me.Botones.Images.SetKeyName(11, "")
|
||||||
|
Me.Botones.Images.SetKeyName(12, "")
|
||||||
|
Me.Botones.Images.SetKeyName(13, "")
|
||||||
|
Me.Botones.Images.SetKeyName(14, "")
|
||||||
|
Me.Botones.Images.SetKeyName(15, "")
|
||||||
|
Me.Botones.Images.SetKeyName(16, "")
|
||||||
|
Me.Botones.Images.SetKeyName(17, "")
|
||||||
|
Me.Botones.Images.SetKeyName(18, "")
|
||||||
|
Me.Botones.Images.SetKeyName(19, "")
|
||||||
|
Me.Botones.Images.SetKeyName(20, "")
|
||||||
|
Me.Botones.Images.SetKeyName(21, "")
|
||||||
|
Me.Botones.Images.SetKeyName(22, "")
|
||||||
|
Me.Botones.Images.SetKeyName(23, "")
|
||||||
|
Me.Botones.Images.SetKeyName(24, "")
|
||||||
|
Me.Botones.Images.SetKeyName(25, "")
|
||||||
|
Me.Botones.Images.SetKeyName(26, "")
|
||||||
|
Me.Botones.Images.SetKeyName(27, "folder_time.png")
|
||||||
|
Me.Botones.Images.SetKeyName(28, "data_time.png")
|
||||||
|
Me.Botones.Images.SetKeyName(29, "printer.png")
|
||||||
|
'
|
||||||
|
'ucBarraGenerica
|
||||||
|
'
|
||||||
|
Me.BackColor = System.Drawing.SystemColors.Control
|
||||||
|
Me.Controls.Add(Me.tbGenerico)
|
||||||
|
Me.Name = "ucBarraGenerica"
|
||||||
|
Me.Size = New System.Drawing.Size(768, 48)
|
||||||
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
Private Sub tbGenerico_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.toolBarButtonClickEventArgs) Handles tbGenerico.ButtonClick
|
||||||
|
Try
|
||||||
|
RaiseEvent ButtonClick(sender, e)
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error tbGenerico_ButtonClick")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
5
ItsObjectContext.vb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Public Interface ItsObjectContext
|
||||||
|
Function GuardarCambios() As Integer
|
||||||
|
|
||||||
|
|
||||||
|
End Interface
|
||||||
45
Menus.vb
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports tsl5
|
||||||
|
Imports Enumeraciones
|
||||||
|
|
||||||
|
Public Class Menus
|
||||||
|
'Shared Sub GeneraMenus(BarraMenu As DevExpress.Xpf.Bars.Bar, datconexcli As Datos.DatosConexionCliente, datsesioncli As Datos.DatosSesionCliente, Evento As DevExpress.Xpf.Bars.ItemClickEventHandler)
|
||||||
|
' Dim bd As tsl5.tsl5Model.tsl5Entities
|
||||||
|
' Select Case datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Tipo
|
||||||
|
' Case TipoBD.MYSQL
|
||||||
|
' bd = bbdd.ConectarTsl5EntityMySQL(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Puerto, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Usuario, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Password, "tsl5Model", datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Pooling, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).SSL, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).FicheroCertificado, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).PasswordCertificado)
|
||||||
|
' Case TipoBD.SQLSERVER
|
||||||
|
' bd = bbdd.ConectarTsl5EntitySQLServer(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Usuario, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Password, "tsl5Model")
|
||||||
|
' Case TipoBD.LOCALDB
|
||||||
|
' bd = bbdd.ConectarTsl5EntityLocalDB(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Fichero, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, "tsl5Model")
|
||||||
|
' Case Else
|
||||||
|
' Throw New Exception("Tipo de bd no soportado")
|
||||||
|
' End Select
|
||||||
|
|
||||||
|
' Dim menuiniciales = (From m In bd.menus Where m.idGrupoMenu = datsesioncli.idGrupoMenu Order By m.Orden Select m).ToList
|
||||||
|
' Dim bsi As DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' For Each mi In menuiniciales
|
||||||
|
' bsi = New DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' bsi.Content = mi.Texto
|
||||||
|
' Call generamenurecursivo(bd, bsi, mi, Evento)
|
||||||
|
' BarraMenu.ItemLinks.Add(bsi)
|
||||||
|
' Next
|
||||||
|
'End Sub
|
||||||
|
'Private Shared Sub generamenurecursivo(bd As tsl5.tsl5Model.tsl5Entities, ByRef bsi As DevExpress.Xpf.Bars.BarSubItem, mi As tsl5.tsl5Model.menus, Evento As DevExpress.Xpf.Bars.ItemClickEventHandler)
|
||||||
|
' Dim bsih As DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' Dim bbi As DevExpress.Xpf.Bars.BarButtonItem
|
||||||
|
' Dim submenus = (From m In bd.menus Where m.idMenuPadre = mi.idMenus Order By m.Orden Select m).ToList
|
||||||
|
' For Each sm In submenus
|
||||||
|
' If sm.Accion.Trim = "" Then
|
||||||
|
' bbi = New DevExpress.Xpf.Bars.BarButtonItem
|
||||||
|
' bbi.Content = sm.Texto
|
||||||
|
' AddHandler bbi.ItemClick, Evento
|
||||||
|
' Else
|
||||||
|
' bsih = New DevExpress.Xpf.Bars.BarSubItem
|
||||||
|
' bsih.Content = sm.Texto
|
||||||
|
' Call generamenurecursivo(bd, bsih, mi, Evento)
|
||||||
|
' bsi.ItemLinks.Add(bsih)
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
'End Sub
|
||||||
|
End Class
|
||||||
65
My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
Imports System
|
||||||
|
Imports System.Reflection
|
||||||
|
Imports System.Runtime.InteropServices
|
||||||
|
Imports System.Globalization
|
||||||
|
Imports System.Resources
|
||||||
|
Imports System.Windows
|
||||||
|
|
||||||
|
' La información general sobre un ensamblado se controla mediante el siguiente
|
||||||
|
' conjunto de atributos. Cambie estos atributos para modificar la información
|
||||||
|
' asociada con un ensamblado.
|
||||||
|
|
||||||
|
' Revisar los valores de los atributos del ensamblado
|
||||||
|
|
||||||
|
<Assembly: AssemblyTitle("tsWPF")>
|
||||||
|
<Assembly: AssemblyDescription("")>
|
||||||
|
<Assembly: AssemblyCompany("")>
|
||||||
|
<Assembly: AssemblyProduct("tsWPF")>
|
||||||
|
<Assembly: AssemblyCopyright("Copyright @ 2013")>
|
||||||
|
<Assembly: AssemblyTrademark("")>
|
||||||
|
<Assembly: ComVisible(false)>
|
||||||
|
|
||||||
|
'Para comenzar a generar aplicaciones que se puedan traducir, establezca
|
||||||
|
'<UICulture>CultureYouAreCodingWith</UICulture> en el archivo .vbproj
|
||||||
|
'dentro de <PropertyGroup>. Por ejemplo, si utiliza inglés de EE.UU. en
|
||||||
|
'sus archivos de código fuente, establezca <UICulture> en "en-US". Después, quite los comentarios del
|
||||||
|
'atributo NeutralResourceLanguage incluido a continuación. Actualice "en-US" en la línea
|
||||||
|
'siguiente de forma que coincida con el valor de UICulture en el archivo del proyecto.
|
||||||
|
|
||||||
|
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
|
||||||
|
|
||||||
|
|
||||||
|
'El atributo ThemeInfo describe dónde se encuentran los diccionarios de recursos genéricos y específicos de un tema.
|
||||||
|
'Primer parámetro: lugar en el que se encuentran los diccionarios de recursos específicos de un tema
|
||||||
|
'(se utiliza si no se encuentra ningún recurso en la página,
|
||||||
|
' ni diccionarios de recursos de la aplicación)
|
||||||
|
|
||||||
|
'Segundo parámetro: lugar en el que se encuentra el diccionario de recursos genérico
|
||||||
|
'(se utiliza si no se encuentra ningún recurso en la página,
|
||||||
|
'aplicación ni diccionarios de recursos específicos de un tema)
|
||||||
|
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM
|
||||||
|
<Assembly: Guid("813769cc-b7cc-462c-a0f5-e850cc1bd75b")>
|
||||||
|
|
||||||
|
' La información de versión de un ensamblado consta de los cuatro valores siguientes:
|
||||||
|
'
|
||||||
|
' Versión principal
|
||||||
|
' Versión secundaria
|
||||||
|
' Número de compilación
|
||||||
|
' Revisión
|
||||||
|
'
|
||||||
|
' Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
|
||||||
|
' mediante el asterisco ('*'), como se muestra a continuación:
|
||||||
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
|
<Assembly: AssemblyVersion("5.0.0.0")>
|
||||||
|
<Assembly: AssemblyFileVersion("5.0.0.0")>
|
||||||
|
|
||||||
|
|
||||||
|
' Cambios en la versión 4.0.0.4
|
||||||
|
|
||||||
|
' 20/10/2025 Se añade propiedad de configuracion OcultarBotonEliminarSinPermisos
|
||||||
|
|
||||||
63
My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
'------------------------------------------------------------------------------
|
||||||
|
' <auto-generated>
|
||||||
|
' Este código fue generado por una herramienta.
|
||||||
|
' Versión de runtime:4.0.30319.42000
|
||||||
|
'
|
||||||
|
' Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
|
||||||
|
' se vuelve a generar el código.
|
||||||
|
' </auto-generated>
|
||||||
|
'------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Option Strict On
|
||||||
|
Option Explicit On
|
||||||
|
|
||||||
|
Imports System
|
||||||
|
|
||||||
|
Namespace My.Resources
|
||||||
|
|
||||||
|
'StronglyTypedResourceBuilder generó automáticamente esta clase
|
||||||
|
'a través de una herramienta como ResGen o Visual Studio.
|
||||||
|
'Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
|
||||||
|
'con la opción /str o recompile su proyecto de VS.
|
||||||
|
'''<summary>
|
||||||
|
''' Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
|
||||||
|
'''</summary>
|
||||||
|
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
|
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||||
|
Friend Module Resources
|
||||||
|
|
||||||
|
Private resourceMan As Global.System.Resources.ResourceManager
|
||||||
|
|
||||||
|
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
|
||||||
|
'''</summary>
|
||||||
|
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
|
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||||
|
Get
|
||||||
|
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||||
|
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("tsWPF.Resources", GetType(Resources).Assembly)
|
||||||
|
resourceMan = temp
|
||||||
|
End If
|
||||||
|
Return resourceMan
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las
|
||||||
|
''' búsquedas de recursos mediante esta clase de recurso fuertemente tipado.
|
||||||
|
'''</summary>
|
||||||
|
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
|
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||||
|
Get
|
||||||
|
Return resourceCulture
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
resourceCulture = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
End Module
|
||||||
|
End Namespace
|
||||||
120
My Project/Resources.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
73
My Project/Settings.Designer.vb
generated
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
'------------------------------------------------------------------------------
|
||||||
|
' <auto-generated>
|
||||||
|
' Este código fue generado por una herramienta.
|
||||||
|
' Versión de runtime:4.0.30319.42000
|
||||||
|
'
|
||||||
|
' Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
|
||||||
|
' se vuelve a generar el código.
|
||||||
|
' </auto-generated>
|
||||||
|
'------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Option Strict On
|
||||||
|
Option Explicit On
|
||||||
|
|
||||||
|
|
||||||
|
Namespace My
|
||||||
|
|
||||||
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||||
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
|
Partial Friend NotInheritable Class MySettings
|
||||||
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
|
|
||||||
|
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||||
|
|
||||||
|
#Region "Funcionalidad para autoguardar My.Settings"
|
||||||
|
#If _MyType = "WindowsForms" Then
|
||||||
|
Private Shared addedHandler As Boolean
|
||||||
|
|
||||||
|
Private Shared addedHandlerLockObject As New Object
|
||||||
|
|
||||||
|
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
|
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||||
|
If My.Application.SaveMySettingsOnExit Then
|
||||||
|
My.Settings.Save()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
#End If
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
Public Shared ReadOnly Property [Default]() As MySettings
|
||||||
|
Get
|
||||||
|
|
||||||
|
#If _MyType = "WindowsForms" Then
|
||||||
|
If Not addedHandler Then
|
||||||
|
SyncLock addedHandlerLockObject
|
||||||
|
If Not addedHandler Then
|
||||||
|
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||||
|
addedHandler = True
|
||||||
|
End If
|
||||||
|
End SyncLock
|
||||||
|
End If
|
||||||
|
#End If
|
||||||
|
Return defaultInstance
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
|
|
||||||
|
Namespace My
|
||||||
|
|
||||||
|
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||||
|
Friend Module MySettingsProperty
|
||||||
|
|
||||||
|
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||||
|
Friend ReadOnly Property Settings() As Global.tsWPF.My.MySettings
|
||||||
|
Get
|
||||||
|
Return Global.tsWPF.My.MySettings.Default
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
End Module
|
||||||
|
End Namespace
|
||||||
5
My Project/Settings.settings
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||||
|
<Profiles />
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
0
My Project/licenses.licx
Normal file
17
My Project/licenses.licx.bak
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
DevExpress.Patch.InMemoryPatch, DevExpress.Patch.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7fc7bfca2443de66
|
||||||
|
DevExpress.Xpf.Editors.CheckEdit, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.LayoutControl.LayoutGroup, DevExpress.Xpf.LayoutControl.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Editors.TextEdit, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Editors.ComboBoxEdit, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.LayoutControl.LayoutControl, DevExpress.Xpf.LayoutControl.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.NavBar.NavBarControl, DevExpress.Xpf.NavBar.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.RichEdit.RichEditControl, DevExpress.Xpf.RichEdit.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Grid.GridControl, DevExpress.Xpf.Grid.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Grid.TreeListControl, DevExpress.Xpf.Grid.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Core.DXTabControl, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Editors.DateEdit, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.LayoutControl.LayoutItem, DevExpress.Xpf.LayoutControl.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Bars.BarManager, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Editors.PasswordBoxEdit, DevExpress.Xpf.Core.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Ribbon.RibbonControl, DevExpress.Xpf.Ribbon.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
|
DevExpress.Xpf.Docking.DockLayoutManager, DevExpress.Xpf.Docking.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
14
ObjetoSeleccionable.vb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
Public Class ObjetoSeleccionable
|
||||||
|
Friend Objeto As New Object
|
||||||
|
Friend TabIndex As Integer
|
||||||
|
Friend Clave As Integer
|
||||||
|
Friend PropiedadesTS As PropiedadesTS
|
||||||
|
|
||||||
|
Sub New(objeto As Object, tabindex As Integer, PropiedadesTS As PropiedadesTS)
|
||||||
|
Me.Objeto = objeto
|
||||||
|
Me.TabIndex = tabindex
|
||||||
|
Me.Clave = PropiedadesTS.NumeroObjeto
|
||||||
|
Me.PropiedadesTS = PropiedadesTS
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
2136
Obsoleto/ApCabLin.vb
Normal file
557
Obsoleto/ApLineas.vb
Normal file
@@ -0,0 +1,557 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports System.Data.Objects
|
||||||
|
Imports System.Data.Objects.DataClasses
|
||||||
|
Imports System.Data.Metadata.Edm
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.Collections.Specialized
|
||||||
|
Imports tsl5
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports System.Data.EntityClient
|
||||||
|
Imports System.Data.Common
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
'Imports System.Data.Entity.Core.Objects
|
||||||
|
'Imports System.Data.Entity.Infrastructure
|
||||||
|
Imports DevExpress.Mvvm
|
||||||
|
Imports DevExpress.Xpf.Editors.Settings
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports tsWPF.Controles
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
|
||||||
|
Public Interface IApLineas
|
||||||
|
'Function ConfiguraApLineas(dcfg As Datos.DatosConfiguracionCliente, dcn As Datos.DatosConexionCliente, dsc As Datos.DatosSesionCliente, OtrosParametros As String) As ApLineas
|
||||||
|
Function ObtieneRejilla() As tsGridControl
|
||||||
|
ReadOnly Property Titulo As String
|
||||||
|
' ReadOnly Property CampoIndice As String
|
||||||
|
ReadOnly Property NombreTablaBase As String
|
||||||
|
Function ObtieneContexto(dcn As tsl5.Datos.DatosConexionCliente) As System.Data.Objects.ObjectContext
|
||||||
|
Function ObtieneCampoIndice() As String
|
||||||
|
Sub EstableceDataContext(ByRef DataContext As Object, Optional Background As Boolean = False)
|
||||||
|
Sub EstableceApLin(ApLin As ApLineas)
|
||||||
|
' Sub Editar(Celda As EditGridCellData, Defecto As Boolean)
|
||||||
|
Sub Nuevo()
|
||||||
|
Function ObtienePermisos() As Permisos
|
||||||
|
|
||||||
|
|
||||||
|
End Interface
|
||||||
|
<TypeConverterAttribute(GetType(System.ComponentModel.ExpandableObjectConverter))>
|
||||||
|
Public Class ApLineas
|
||||||
|
' Public WithEvents dm As DockLayoutManager
|
||||||
|
' Public Shared WithEvents tv As TableView
|
||||||
|
Public dcfg As Datos.DatosConfiguracionCliente
|
||||||
|
Public dcn As Datos.DatosConexionCliente
|
||||||
|
Public dsc As Datos.DatosSesionCliente
|
||||||
|
Public OtrosParametros As String
|
||||||
|
Public Titulo As String
|
||||||
|
Public CampoIndice As String
|
||||||
|
Friend DatosCambiados As Boolean
|
||||||
|
Public uc As UserControl
|
||||||
|
Public Rejilla As tsGridControl
|
||||||
|
Public IApLin As IApLineas
|
||||||
|
Public WithEvents Contexto As System.Data.Objects.ObjectContext
|
||||||
|
Public Property Refrescar As Boolean = True
|
||||||
|
Public PermisosConcedidos As Permisos
|
||||||
|
Public Event Cargado()
|
||||||
|
|
||||||
|
Event Enlazar(Celda As EditGridCellData, Defecto As Boolean)
|
||||||
|
|
||||||
|
Event ImprimirPlantilla(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idPlantilla As Integer)
|
||||||
|
|
||||||
|
Event EjecutarAccion(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idAccion As Integer)
|
||||||
|
|
||||||
|
Event SeleccionMultipleHabilitadoCambiado(Habilitar As Boolean)
|
||||||
|
|
||||||
|
Event InvertirSeleccion()
|
||||||
|
|
||||||
|
Event ValidarSeleccionar()
|
||||||
|
|
||||||
|
Public Event AntesMensajeEliminar(ByRef Cancelar As Boolean, ByRef EliminacionCorrecta As Boolean)
|
||||||
|
Public Event AntesEliminar(Fila As Object, ByRef Cancelar As Boolean)
|
||||||
|
|
||||||
|
' Public Property ErroresValidacion As ErroresValidacion
|
||||||
|
' Public Recargando As Boolean = False
|
||||||
|
|
||||||
|
Property ContenedorL As ContenedorLineas
|
||||||
|
'Private selectionHelper As New SelectionHelper(Of Guid)()
|
||||||
|
Public ElementosSeleccionados As New SelectionHelper(Of Integer)
|
||||||
|
|
||||||
|
|
||||||
|
Public GrupoDocumentos As DocumentGroup
|
||||||
|
Public DocPanel As DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
|
||||||
|
Public Property RefrescoSolicitado As Boolean = False
|
||||||
|
Public Property DeshabilitarRefresco As Boolean = False
|
||||||
|
Public Property DeshabilitarRefrescarOtrasPestañas = False
|
||||||
|
Public Delegate Sub Ayuda(Codigo As String)
|
||||||
|
' Public Delegate Function Diseño(bd As ObjectContext, Operacion As OperacionDiseñoEnum, apl As ApLineas, ByRef Descripcion As String, ByRef TodosUsuarios As Boolean, DiseñoRejillas As Byte()) As Byte()
|
||||||
|
Public Delegate Sub ErrorNoControlado(Aplicacion As ApLineas, ex As Exception)
|
||||||
|
Public Delegate Sub DelegadoCargado(Aplicacion As ApLineas)
|
||||||
|
Friend Property DelegadoAyuda As Ayuda
|
||||||
|
Friend Property DelegadoDiseño As ApCabLin.Diseño
|
||||||
|
Friend Property DelegadoErrorNoControlado As ErrorNoControlado
|
||||||
|
Friend Property dlgCargado As DelegadoCargado
|
||||||
|
Friend DiseñoOriginal As Byte()
|
||||||
|
Friend Property AperturaAutomatica As Boolean
|
||||||
|
Private DiseñoCargado As Boolean
|
||||||
|
Public ApCargado As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' Public Event Cargado()
|
||||||
|
'Public Event Editar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
'Public Event Nuevo(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
'Sub LanzaEventoCargado()
|
||||||
|
' RaiseEvent Cargado()
|
||||||
|
'End Sub
|
||||||
|
'Sub LanzaEditar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
' RaiseEvent Editar(sender, e)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Public Overloads Shared Sub AbrirUcL(uc As IApLineas, DocumentGroup As DocumentGroup, dcfg As Datos.DatosConfiguracionCliente, dcn As Datos.DatosConexionCliente, dsc As Datos.DatosSesionCliente, OtrosParametros As String, Optional EditarEnDobleClick As Boolean = True, Optional FuncionAyuda As Ayuda = Nothing, Optional FuncionDiseño As ApCabLin.Diseño = Nothing, Optional FuncionErrorNoControlado As ErrorNoControlado = Nothing, Optional FuncionCargado As DelegadoCargado = Nothing)
|
||||||
|
AbrirUcL(uc, DocumentGroup, dcfg, dcn, 0, dsc, OtrosParametros, EditarEnDobleClick, FuncionAyuda, FuncionDiseño, FuncionErrorNoControlado, FuncionCargado)
|
||||||
|
End Sub
|
||||||
|
Public Overloads Shared Sub AbrirUcL(uc As IApLineas, DocumentGroup As DocumentGroup, dcfg As Datos.DatosConfiguracionCliente, dcn As Datos.DatosConexionCliente, NumeroBD As Integer, dsc As Datos.DatosSesionCliente, OtrosParametros As String, Optional EditarEnDobleClick As Boolean = True, Optional FuncionAyuda As Ayuda = Nothing, Optional FuncionDiseño As ApCabLin.Diseño = Nothing, Optional FuncionErrorNoControlado As ErrorNoControlado = Nothing, Optional FuncionCargado As DelegadoCargado = Nothing)
|
||||||
|
|
||||||
|
Dim apl As ApLineas
|
||||||
|
Try
|
||||||
|
|
||||||
|
|
||||||
|
Dim bNuevoPanel As Boolean = True
|
||||||
|
|
||||||
|
apl = New tsWPF.ApLineas(uc, uc, dcfg, dcn, dsc, OtrosParametros)
|
||||||
|
Dim usctrl = DirectCast(uc, UserControl)
|
||||||
|
|
||||||
|
Dim docpanel As DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
|
||||||
|
|
||||||
|
Dim dc = (From p In DocumentGroup.Items Where p.Tag = OtrosParametros)
|
||||||
|
If dc.Count > 0 Then
|
||||||
|
docpanel = dc.First
|
||||||
|
bNuevoPanel = False
|
||||||
|
Else
|
||||||
|
If tsWPF.Configuracion.MostrarBotonCerrarEnPestaña Then DocumentGroup.ClosePageButtonShowMode = ClosePageButtonShowMode.InAllTabPageHeaders
|
||||||
|
If Not DXSplashScreen.IsActive Then
|
||||||
|
DXSplashScreen.Show(Of SplashScreenTecnosis)()
|
||||||
|
DXSplashScreen.SetState("Cargando ...")
|
||||||
|
End If
|
||||||
|
docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
'docpanel.Tag = apl.uc.GetType.Name
|
||||||
|
docpanel.Tag = OtrosParametros
|
||||||
|
End If
|
||||||
|
|
||||||
|
uc.EstableceApLin(apl)
|
||||||
|
apl.Titulo = apl.IApLin.Titulo
|
||||||
|
apl.GrupoDocumentos = DocumentGroup
|
||||||
|
|
||||||
|
apl.Contexto = uc.ObtieneContexto(dcn)
|
||||||
|
If apl.Contexto IsNot Nothing AndAlso apl.Contexto.Connection.State = ConnectionState.Closed Then apl.AperturaAutomatica = True
|
||||||
|
apl.CampoIndice = uc.ObtieneCampoIndice
|
||||||
|
apl.DocPanel = docpanel
|
||||||
|
apl.PermisosConcedidos = uc.ObtienePermisos
|
||||||
|
If Not apl.PermisosConcedidos.Consultar Then Throw New Exception("No tiene permiso para abrir esta aplicación (" & uc.Titulo & ")")
|
||||||
|
apl.Rejilla = uc.ObtieneRejilla
|
||||||
|
apl.Rejilla.PropiedadesTSGC.PermisosDefecto = apl.PermisosConcedidos
|
||||||
|
Dim tv As TableView = apl.Rejilla.View
|
||||||
|
|
||||||
|
apl.Rejilla.View.ShowSearchPanelCloseButton = False
|
||||||
|
apl.Rejilla = uc.ObtieneRejilla
|
||||||
|
apl.Rejilla.View.AllowEditing = True
|
||||||
|
apl.Rejilla.View.SearchPanelFindMode = FindMode.Always
|
||||||
|
|
||||||
|
apl.Rejilla.View.ShowSearchPanel(True)
|
||||||
|
|
||||||
|
For Each c In apl.Rejilla.Columns
|
||||||
|
'c.AllowEditing = DevExpress.Utils.DefaultBoolean.False
|
||||||
|
If c.CellTemplate Is Nothing Then
|
||||||
|
c.ReadOnly = True
|
||||||
|
Else
|
||||||
|
c.AllowEditing = DevExpress.Utils.DefaultBoolean.False
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
Dim es As New CheckEditSettings
|
||||||
|
es.IsThreeState = False
|
||||||
|
|
||||||
|
Dim dt As New DataTemplate
|
||||||
|
dt.VisualTree = New FrameworkElementFactory(GetType(CheckEdit))
|
||||||
|
dt.VisualTree.SetBinding(CheckEdit.IsCheckedProperty, New Binding("Data.tswpf_seleccionar"))
|
||||||
|
dt.VisualTree.SetValue(CheckEdit.HorizontalAlignmentProperty, HorizontalAlignment.Center)
|
||||||
|
|
||||||
|
If Not apl.Rejilla.Columns.Any(Function(x) x.FieldName = "tswpf_seleccionar") Then
|
||||||
|
Dim gcseleccionar As New GridColumn With {
|
||||||
|
.FieldName = "tswpf_seleccionar",
|
||||||
|
.UnboundType = DevExpress.Data.UnboundColumnType.Boolean,
|
||||||
|
.Width = 80,
|
||||||
|
.IsSmart = True,
|
||||||
|
.Visible = False,
|
||||||
|
.VisibleIndex = 0,
|
||||||
|
.EditSettings = es,
|
||||||
|
.AllowEditing = DevExpress.Utils.DefaultBoolean.True,
|
||||||
|
.Header = "Seleccionar",
|
||||||
|
.HorizontalHeaderContentAlignment = HorizontalAlignment.Center,
|
||||||
|
.CellTemplate = dt
|
||||||
|
}
|
||||||
|
apl.Rejilla.Columns.Insert(0, gcseleccionar)
|
||||||
|
End If
|
||||||
|
|
||||||
|
AddHandler apl.Rejilla.CustomUnboundColumnData, AddressOf apl.CustomUnboudColumnData
|
||||||
|
|
||||||
|
If EditarEnDobleClick Then AddHandler apl.Rejilla.MouseDoubleClick, AddressOf apl.RejillaDobleClick
|
||||||
|
Dim ap As New tsWPF.ContenedorLineas(apl, uc)
|
||||||
|
ap.btNuevo.IsEnabled = apl.PermisosConcedidos.Nuevos
|
||||||
|
ap.btEliminar.IsEnabled = False 'apl.PermisosConcedidos.Eliminar and ElementosSeleccionados.GetSelectionCount >0 and apl.ContenedorL.btSeleccionar.IsChecked=True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If bNuevoPanel Then
|
||||||
|
apl.DelegadoAyuda = FuncionAyuda
|
||||||
|
apl.DelegadoDiseño = FuncionDiseño
|
||||||
|
apl.DelegadoErrorNoControlado = FuncionErrorNoControlado
|
||||||
|
apl.dlgCargado = FuncionCargado
|
||||||
|
docpanel.Caption = uc.Titulo
|
||||||
|
docpanel.Content = ap
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
DocumentGroup.Items.Add(docpanel)
|
||||||
|
If Comun.dm Is Nothing Then Comun.dm = DocumentGroup.GetDockLayoutManager
|
||||||
|
apl.ContenedorL.btAyuda.IsVisible = (Not FuncionAyuda Is Nothing)
|
||||||
|
apl.ContenedorL.MenuDiseño.IsVisible = (Not FuncionDiseño Is Nothing)
|
||||||
|
apl.ContenedorL.MenuExportar.IsEnabled = apl.PermisosConcedidos.Exportar
|
||||||
|
'Try
|
||||||
|
' If apl.DelegadoDiseño IsNot Nothing Then
|
||||||
|
' Try
|
||||||
|
' Dim b As Byte() = Nothing
|
||||||
|
|
||||||
|
' b = apl.DelegadoDiseño.Invoke(apl.Contexto, OperacionDiseñoEnum.ABRIR, apl.uc.GetType.ToString, "", True, Nothing)
|
||||||
|
' If b IsNot Nothing Then
|
||||||
|
' apl.DiseñoOriginal = apl.ContenedorL.ObtieneDiseñoActual
|
||||||
|
' Dim ld As New DiseñoRejillas
|
||||||
|
' ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||||
|
' Dim i As Integer
|
||||||
|
' Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
' tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(ap.contenido, lg)
|
||||||
|
' For Each l In lg
|
||||||
|
' i += 1
|
||||||
|
' If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
' Try
|
||||||
|
' If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
' Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
' l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' If apl.DelegadoErrorNoControlado IsNot Nothing Then apl.DelegadoErrorNoControlado.Invoke(apl, ex)
|
||||||
|
' DXMessageBox.Show(ex.Message, "Error btDiseño_Itemclick")
|
||||||
|
' 'Debug.Write("Error DelegadoDiseño Rejilla")
|
||||||
|
' End Try
|
||||||
|
' Next
|
||||||
|
' ' Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' If apl.DelegadoErrorNoControlado IsNot Nothing Then apl.DelegadoErrorNoControlado.Invoke(apl, ex)
|
||||||
|
|
||||||
|
' DXMessageBox.Show(ex.Message, "Error AbrirUclL - Diseño")
|
||||||
|
' 'Debug.Write("Error DelegadoDiseño AbrirUCCL")
|
||||||
|
' End Try
|
||||||
|
' End If
|
||||||
|
'Catch ex As Exception
|
||||||
|
' If apl.DelegadoErrorNoControlado IsNot Nothing Then apl.DelegadoErrorNoControlado.Invoke(apl, ex)
|
||||||
|
' DXMessageBox.Show(ex.Message, "Error AbrirUclL - Diseño")
|
||||||
|
'End Try
|
||||||
|
End If
|
||||||
|
Comun.dm.DockController.Activate(docpanel)
|
||||||
|
Catch ex As Exception
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||||
|
If FuncionErrorNoControlado IsNot Nothing Then FuncionErrorNoControlado.Invoke(apl, ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Sub LanzaEventoCargado()
|
||||||
|
' RaiseEvent Cargado()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Sub LanzaNuevo(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
' RaiseEvent Nuevo(sender, e)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub RejillaDobleClick(sender As Object, e As MouseButtonEventArgs)
|
||||||
|
Try
|
||||||
|
RaiseEvent Enlazar(Nothing, True)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(IApLIN As IApLineas, UC As UserControl, dcfg As tsl5.Datos.DatosConfiguracionCliente, dcn As tsl5.Datos.DatosConexionCliente, dsc As tsl5.Datos.DatosSesionCliente, OtrosParametros As String)
|
||||||
|
Me.uc = UC
|
||||||
|
Me.IApLin = IApLIN
|
||||||
|
Me.dcfg = dcfg
|
||||||
|
Me.dcn = dcn
|
||||||
|
Me.dsc = dsc
|
||||||
|
Me.OtrosParametros = OtrosParametros
|
||||||
|
' Me.Contexto = IApLIN.ObtieneContexto(dcn)
|
||||||
|
AddHandler UC.PreviewKeyDown, AddressOf ApLin_PreviewKeyDown
|
||||||
|
AddHandler UC.Loaded, AddressOf usctrl_Cargado
|
||||||
|
|
||||||
|
|
||||||
|
'Me.IApLin.ObtieneRejilla.DelegadoComando = New DelegateCommand(Of Object)(AddressOf Seleccionar)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub usctrl_Cargado(sender As Object, e As RoutedEventArgs)
|
||||||
|
Try
|
||||||
|
If Me.DelegadoDiseño IsNot Nothing And Not DiseñoCargado Then
|
||||||
|
Try
|
||||||
|
DiseñoCargado = True
|
||||||
|
Dim b As Byte() = Nothing
|
||||||
|
Me.DiseñoOriginal = Me.ContenedorL.ObtieneDiseñoActual
|
||||||
|
b = Me.DelegadoDiseño.Invoke(Me.Contexto, OperacionDiseñoEnum.ABRIR, Me.uc.GetType.ToString, "", True, Nothing)
|
||||||
|
If b IsNot Nothing Then
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(sender, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.DelegadoErrorNoControlado IsNot Nothing Then Me.DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseño_Itemclick")
|
||||||
|
'Debug.Write("Error DelegadoDiseño Rejilla")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
' Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.DelegadoErrorNoControlado IsNot Nothing Then Me.DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
|
||||||
|
DXMessageBox.Show(ex.Message, "Error AbrirUclL - Diseño")
|
||||||
|
'Debug.Write("Error DelegadoDiseño AbrirUCCL")
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.DelegadoErrorNoControlado IsNot Nothing Then Me.DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error AbrirUclL - Diseño")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ApLin_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
||||||
|
If e.Key = Key.Space Or e.Key = Key.Enter Then
|
||||||
|
Try
|
||||||
|
If Keyboard.FocusedElement.GetType = GetType(DevExpress.Xpf.Grid.RowIndicator) Or Keyboard.FocusedElement.GetType = GetType(DevExpress.Xpf.Editors.InplaceBaseEdit) Then
|
||||||
|
Dim cellData = DirectCast(DirectCast(sender, FrameworkElement).DataContext, EditGridCellData)
|
||||||
|
If cellData.Value IsNot Nothing AndAlso cellData.Value.ToString <> "" Then RaiseEvent Enlazar(cellData, True)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Sub LanzaEliminar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
' Throw New NotImplementedException
|
||||||
|
'End Sub
|
||||||
|
Sub Guardar()
|
||||||
|
Try
|
||||||
|
If Me.Contexto.GetType.GetInterfaces.Contains(GetType(ItsObjectContext)) Then
|
||||||
|
DirectCast(Me.Contexto, ItsObjectContext).GuardarCambios()
|
||||||
|
Else
|
||||||
|
Me.Contexto.SaveChanges()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
If DelegadoErrorNoControlado IsNot Nothing Then DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error Guardando")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub Eliminar()
|
||||||
|
Try
|
||||||
|
Me.Rejilla.View.CommitEditing()
|
||||||
|
Dim bCancelar As Boolean = False
|
||||||
|
Dim bEliminacionCorrecta As Boolean = False
|
||||||
|
RaiseEvent AntesMensajeEliminar(bCancelar, bEliminacionCorrecta)
|
||||||
|
If Not bCancelar Then
|
||||||
|
If DXMessageBox.Show("¿Está seguro de querer eliminar los " & ElementosSeleccionados.GetSelectionCount.ToString & " registros seleccionados?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.Yes Then
|
||||||
|
|
||||||
|
'For Each k In ElementosSeleccionados.GetSelectedKeys
|
||||||
|
' Me.IApLin.ObtieneContexto(Me.dcn).ExecuteStoreCommand("DELETE FROM " & Me.IApLin.NombreTablaBase & " WHERE " & Me.CampoIndice & "={0}", k)
|
||||||
|
'Next
|
||||||
|
|
||||||
|
|
||||||
|
For Each elemento In ElementosSeleccionados.GetSelectedrwh
|
||||||
|
' RaiseEvent AntesEliminar(Rejilla.GetRowByListIndex(elemento))
|
||||||
|
bCancelar = False
|
||||||
|
RaiseEvent AntesEliminar(Rejilla.GetRow(elemento), bCancelar)
|
||||||
|
If Not bCancelar Then
|
||||||
|
Contexto.DeleteObject(Rejilla.GetRow(elemento))
|
||||||
|
If Contexto.GetType.GetInterfaces.Contains(GetType(ItsObjectContext)) Then
|
||||||
|
DirectCast(Contexto, ItsObjectContext).GuardarCambios()
|
||||||
|
Else
|
||||||
|
Contexto.SaveChanges()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
' RaiseEvent DespuesEliminar(elemento)
|
||||||
|
Next
|
||||||
|
ElementosSeleccionados = New SelectionHelper(Of Integer)
|
||||||
|
If AperturaAutomatica Then Me.Contexto.Connection.Open()
|
||||||
|
Try
|
||||||
|
Me.IApLin.EstableceDataContext(Me.uc.DataContext)
|
||||||
|
Catch ex As Exception
|
||||||
|
Try
|
||||||
|
If AperturaAutomatica Then Me.Contexto.Connection.Close()
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If bEliminacionCorrecta Then
|
||||||
|
ElementosSeleccionados = New SelectionHelper(Of Integer)
|
||||||
|
If AperturaAutomatica Then Me.Contexto.Connection.Open()
|
||||||
|
Try
|
||||||
|
Me.IApLin.EstableceDataContext(Me.uc.DataContext)
|
||||||
|
Catch ex As Exception
|
||||||
|
Try
|
||||||
|
If AperturaAutomatica Then Me.Contexto.Connection.Close()
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
If DelegadoErrorNoControlado IsNot Nothing Then DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error Eliminando")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub dm_DockItemActivated(sender As Object, ea As Base.DockItemActivatedEventArgs) Handles dm.DockItemActivated
|
||||||
|
' If Refrescar Then Call RefrescaUC()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Public Sub Seleccionar(Celda As EditGridCellData)
|
||||||
|
If Celda.Value IsNot Nothing AndAlso Celda.ToString <> "" Then RaiseEvent Enlazar(Celda, False)
|
||||||
|
End Sub
|
||||||
|
Public Sub SeleccionarIncluirNulosOVacios(Celda As EditGridCellData)
|
||||||
|
RaiseEvent Enlazar(Celda, False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Sub LanzaEventoCargado()
|
||||||
|
Dim gc As tsGridControl = Me.Rejilla.View.DataControl
|
||||||
|
If gc.PropiedadesTSGC.EnlazarNulosOVacios Then
|
||||||
|
gc.ComandoDelegado = New DelegateCommand(Of Object)(AddressOf SeleccionarIncluirNulosOVacios)
|
||||||
|
Else
|
||||||
|
gc.ComandoDelegado = New DelegateCommand(Of Object)(AddressOf Seleccionar)
|
||||||
|
End If
|
||||||
|
RaiseEvent Cargado()
|
||||||
|
Me.ApCargado = True
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub SeleccionarHabilitadoCambiado(Habilitar As Boolean)
|
||||||
|
Me.ContenedorL.Barsm.IsEnabled = Habilitar
|
||||||
|
Me.Rejilla.Columns("tswpf_seleccionar").Visible = Habilitar
|
||||||
|
Me.Rejilla.Columns("tswpf_seleccionar").VisibleIndex = 0
|
||||||
|
Me.ContenedorL.btEliminar.IsEnabled = Me.PermisosConcedidos.Eliminar And ElementosSeleccionados.GetSelectionCount > 0 And Habilitar
|
||||||
|
Me.ContenedorL.btInvertir.IsEnabled = Habilitar
|
||||||
|
RaiseEvent SeleccionMultipleHabilitadoCambiado(Habilitar)
|
||||||
|
' Me.ContenedorL.btImprimirPlantilla.IsEnabled = Habilitar
|
||||||
|
' Me.ContenedorL.bePlantilla.IsEnabled = Habilitar
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CustomUnboudColumnData(sender As Object, e As GridColumnDataEventArgs)
|
||||||
|
If e.Column.FieldName = "tswpf_seleccionar" Then
|
||||||
|
Dim key As Integer = CType(e.GetListSourceFieldValue(Me.CampoIndice), Integer)
|
||||||
|
If e.IsGetData Then
|
||||||
|
e.Value = ElementosSeleccionados.GetIsSelected(key)
|
||||||
|
End If
|
||||||
|
If e.IsSetData Then
|
||||||
|
' ElementosSeleccionados.SetIsSelected(e.Source.GetRowHandleByListIndex(e.ListSourceRowIndex), key, CBool(e.Value))
|
||||||
|
ElementosSeleccionados.SetIsSelected(e.Source.GetRowHandleByListIndex(e.ListSourceRowIndex), key, CBool(e.Value))
|
||||||
|
Me.ContenedorL.btEliminar.IsEnabled = Me.PermisosConcedidos.Eliminar And ElementosSeleccionados.GetSelectionCount > 0 And Me.ContenedorL.btSeleccionar.IsChecked = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub LanzaImprimirPlantilla(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idPlantilla As Integer)
|
||||||
|
Me.Rejilla.View.CommitEditing()
|
||||||
|
RaiseEvent ImprimirPlantilla(sender, e, idPlantilla)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub LanzaEjecutarAccion(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs, idAccion As Integer)
|
||||||
|
Me.Rejilla.View.CommitEditing()
|
||||||
|
RaiseEvent EjecutarAccion(sender, e, idAccion)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub RefrescaUC(Optional BackGround As Boolean = False, Optional IniciaContexto As Boolean = True)
|
||||||
|
|
||||||
|
If IniciaContexto Then
|
||||||
|
Try
|
||||||
|
Me.Contexto = Me.IApLin.ObtieneContexto(Me.dcn)
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw
|
||||||
|
Finally
|
||||||
|
Try
|
||||||
|
If Me.Contexto IsNot Nothing AndAlso AperturaAutomatica AndAlso Me.Contexto.Connection.State <> ConnectionState.Closed Then Me.Contexto.Connection.Close()
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
'If Not a.DeshabilitarRefresco Then
|
||||||
|
' Me.ContenedorL.t = Task.Run(New Action(Sub() Me.IApLin.EstableceDataContext(Me.uc.DataContext, BackGround)))
|
||||||
|
' If Not BackGround Then Me.ContenedorL.t.Wait()
|
||||||
|
'End If
|
||||||
|
Try
|
||||||
|
' Dim InicializaFilterPopupMode = (Me.Rejilla.ItemsSource Is Nothing)
|
||||||
|
Me.IApLin.EstableceDataContext(Me.uc.DataContext, BackGround)
|
||||||
|
tsGridControl.EstableceFilterPopupModePredeterminados(Me.Rejilla)
|
||||||
|
If Me.ContenedorL.cbPlantillaAImprimir.ItemsSource Is Nothing OrElse Me.ContenedorL.cbPlantillaAImprimir.ItemsSource.Count = 0 OrElse Me.PermisosConcedidos.Impresion = False Then
|
||||||
|
Me.ContenedorL.bePlantilla.IsVisible = False
|
||||||
|
Me.ContenedorL.btImprimirPlantilla.IsVisible = False
|
||||||
|
End If
|
||||||
|
If Me.ContenedorL.cbAcciones.ItemsSource Is Nothing OrElse Me.ContenedorL.cbAcciones.ItemsSource.Count = 0 Then
|
||||||
|
Me.ContenedorL.beAcciones.IsVisible = False
|
||||||
|
Me.ContenedorL.btAcciones.IsVisible = False
|
||||||
|
End If
|
||||||
|
ElementosSeleccionados = New SelectionHelper(Of Integer)
|
||||||
|
'Refrescar = False
|
||||||
|
If Me.dlgCargado IsNot Nothing Then Me.dlgCargado.Invoke(Me)
|
||||||
|
Catch ex As Exception
|
||||||
|
If DelegadoErrorNoControlado IsNot Nothing Then DelegadoErrorNoControlado.Invoke(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error Refrescando")
|
||||||
|
End Try
|
||||||
|
RefrescoSolicitado = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub LanzaEventoInvertirSeleccion()
|
||||||
|
RaiseEvent InvertirSeleccion()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Private Sub LanzaSeleccionarCambiado(sender As Object, e As EditorEventArgs)
|
||||||
|
' RaiseEvent SeleccionMultipleHabilitadoCambiado(True)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Private Sub LanzaSeleccionarCambiado(sender As Object, e As CellValueChangedEventArgs)
|
||||||
|
' RaiseEvent SeleccionMultipleHabilitadoCambiado(True)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub Contexto_SavingChanges(sender As Object, e As EventArgs) Handles Contexto.SavingChanges
|
||||||
|
If Me.DeshabilitarRefrescarOtrasPestañas = False Then Comun.RefrescaAplicaciones(Me.GrupoDocumentos.Parent, Nothing, Me.DocPanel.Tag)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
||||||
140
Obsoleto/ContenedorCabLin.xaml
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<UserControl x:Class="ContenedorCabLin"
|
||||||
|
x:ClassModifier="Public"
|
||||||
|
x:Name="ContenedorCabLin"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:my="clr-namespace:tsWPF"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:local="clr-namespace:tsWPF"
|
||||||
|
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
mc:Ignorable="d" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" d:DesignHeight="497" d:DesignWidth="1280" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<Style TargetType="dxdo:LayoutPanel" x:Key="estilomensaje">
|
||||||
|
<Setter Property="Appearance">
|
||||||
|
<Setter.Value>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
|
||||||
|
<dxdo:Appearance.Active>
|
||||||
|
<dxdo:AppearanceObject Background="LightCoral" Foreground="White" />
|
||||||
|
</dxdo:Appearance.Active>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<dxb:BarManager Name="BarraBotones" x:FieldModifier="public" ShowScreenTips="true" AllowCustomization="False" AllowQuickCustomization="False">
|
||||||
|
<dxb:BarManager.Items>
|
||||||
|
<dxb:BarButtonItem Name="btGuardar" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Save/Save_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar" />
|
||||||
|
<dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Actions/Refresh_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" ItemClick="btActualizar_ItemClick" Hint="Cargar datos de nuevo" />
|
||||||
|
<dxb:BarSubItem Name="MenuExportar" Glyph="{dx:DXImageGrayscale Image=ExportFile_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Exportar/Imprimir">
|
||||||
|
<dxb:BarButtonItem Name="btExportar" Glyph="{dx:DXImageGrayscale Image=ExportToXLSX_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Exportar A Excel" ItemClick="BtExportar_ItemClick"/>
|
||||||
|
<dxb:BarButtonItem Name="btCapturar" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/capture.png" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem Name="btNuevo" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Actions/AddItem_32x32.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo" />
|
||||||
|
<dxb:BarButtonItem Name="btEliminar" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/papelera.png" x:FieldModifier="public" Focusable="False" Hint="Eliminar Registro" />
|
||||||
|
<!--<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=Fixed_Column_Width_32x32.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btDiseño_ItemClick" />-->
|
||||||
|
|
||||||
|
<dxb:BarSubItem Name="MenuDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Diseño Columnas">
|
||||||
|
<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Guardar Diseño Columnas" ItemClick="btDiseño_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btRestaurarDiseño" Glyph="{dx:DXImageGrayscale Image=Columns_16x16.png}" Content="Restaurar Diseño Columnas" ItemClick="btRestaurarDiseño_ItemClick" />
|
||||||
|
<dxb:BarItemSeparator />
|
||||||
|
<dxb:BarButtonItem Name="btAbrirDiseñoGuardado" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/GuardarGrid.png" Content="Guardar Diseño Como ..." ItemClick="btGuardarDiseñoComo_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem Name="btAyuda" Glyph="{dx:DXImageGrayscale Image=Index_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btAyuda_ItemClick" />
|
||||||
|
<dxb:BarStaticItem Name="siEstado" x:FieldModifier="public" Content="Operación Actual:" />
|
||||||
|
<dxb:BarEditItem Name="bePlantilla" x:FieldModifier="public" Focusable="True" IsEnabled="True" Hint="Modelo a Imprimir" ForceCursor="True"
|
||||||
|
EditWidth="300" EditValueChanged="bePlantilla_EditValueChanged">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbPlantillaAImprimir" x:FieldModifier="Public" ValueMember="idPlantilla" DisplayMember="Descripcion" Focusable="True" ForceCursor="True" >
|
||||||
|
</dxe:ComboBoxEditSettings>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btImprimirPlantilla" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Print/Print_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btImprimirPlantilla_ItemClick" Hint="Imprimir" ForceCursor="True" />
|
||||||
|
<dxb:BarEditItem Name="beAcciones" x:FieldModifier="public" Focusable="True" IsEnabled="True" Hint="Accion a Ejecutar" EditWidth="390" EditValueChanged="beAcciones_EditValueChanged" ForceCursor="True">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbAcciones" x:FieldModifier="Public" ValueMember="idAccion" DisplayMember="Descripcion" Focusable="True" ForceCursor="True"/>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btAcciones" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Arrows/Next_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btAcciones_ItemClick" Hint="Ejecutar Acción" ForceCursor="True" />
|
||||||
|
<dxb:BarStaticItem Name="siMensaje" ShowBorder="False" >
|
||||||
|
<dxb:BarStaticItem.ContentTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Name="tbMensaje" FontWeight="ExtraBold" />
|
||||||
|
</DataTemplate>
|
||||||
|
</dxb:BarStaticItem.ContentTemplate>
|
||||||
|
</dxb:BarStaticItem>
|
||||||
|
</dxb:BarManager.Items>
|
||||||
|
<dxb:BarManager.Bars>
|
||||||
|
<dxb:Bar AllowDrop="False" AllowHide="False" x:Name="bar1" x:FieldModifier="public" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" ShowSizeGrip="False" AllowCollapse="False" >
|
||||||
|
<dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarDockInfo ContainerType="Top" />
|
||||||
|
</dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btGuardar" x:Name="ilGuardar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btActualizar" x:Name="ilActualizar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuExportar" x:FieldModifier="Public" x:Name="ilExportar" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btNuevo" x:Name="ilNuevo" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btEliminar" x:Name="ilEliminar" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuDiseño" x:Name="ilDiseño" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAyuda" x:Name="ilAyuda" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="bePlantilla" x:FieldModifier="Public" x:Name="ilPlantilla" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btImprimirPlantilla" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="beAcciones" x:FieldModifier="Public" x:Name="ilAcciones" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAcciones" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siEstado" x:FieldModifier="Public" x:Name="ilEstado" />
|
||||||
|
<dxb:BarStaticItemLink BarItemName="siMensaje" x:FieldModifier="Public" x:Name="ilMensaje" />
|
||||||
|
</dxb:Bar>
|
||||||
|
</dxb:BarManager.Bars>
|
||||||
|
<dxdo:DockLayoutManager Name="dockManager" ClosedPanelsBarVisibility="Manual">
|
||||||
|
<dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:AutoHideGroup DockType="Bottom">
|
||||||
|
<dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Collapsed" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160" Style="{StaticResource estilomensaje}">
|
||||||
|
<!--<dxdo:LayoutPanel.Appearance>
|
||||||
|
<dxdo:Appearance>
|
||||||
|
<dxdo:Appearance.Normal>
|
||||||
|
<dxdo:AppearanceObject Background="Red" />
|
||||||
|
</dxdo:Appearance.Normal>
|
||||||
|
</dxdo:Appearance>
|
||||||
|
</dxdo:LayoutPanel.Appearance>-->
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
|
||||||
|
<Grid>
|
||||||
|
<my:tsGridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||||
|
<my:tsGridControl.Columns>
|
||||||
|
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" SortOrder="Ascending" SortIndex="0" />
|
||||||
|
</my:tsGridControl.Columns>
|
||||||
|
<my:tsGridControl.View>
|
||||||
|
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||||
|
</my:tsGridControl.View>
|
||||||
|
</my:tsGridControl>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:AutoHideGroup>
|
||||||
|
</dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:LayoutGroup x:Name="RootGroup" Orientation="Horizontal">
|
||||||
|
<dxdo:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxdo:LayoutPanel AllowFloat="False" AllowHide="False" AllowMove="False" ShowCloseButton="False" Name="lpContenido" ShowCaption="False">
|
||||||
|
<Grid Name="contenido" />
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:DockLayoutManager>
|
||||||
|
|
||||||
|
</dxb:BarManager>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
549
Obsoleto/ContenedorCabLin.xaml.vb
Normal file
@@ -0,0 +1,549 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Docking
|
||||||
|
Imports System.Windows.Media.Animation
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports System.IO
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
Imports tsl5.Extensiones
|
||||||
|
Imports DevExpress.Spreadsheet
|
||||||
|
Imports System.Data.Entity.ModelConfiguration.Conventions
|
||||||
|
|
||||||
|
Public Class ContenedorCabLin
|
||||||
|
' Public bd As System.Data.Objects.ObjectContext
|
||||||
|
Public Aplicacion As ApCabLin
|
||||||
|
Public dp As DocumentPanel
|
||||||
|
Dim _DescripcionDiseño As String
|
||||||
|
Dim _TodosUsuariosDiseño As Boolean
|
||||||
|
|
||||||
|
' Private VentanaError As VentanaErr
|
||||||
|
Public Event CargaAplicacion(sender As System.Object, e As System.Windows.RoutedEventArgs)
|
||||||
|
Public Event AntesDeGuardar(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Public Event DespuesDeGuardar(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
'Public Shared ReadOnly EventoLanzaMensaje As RoutedEvent = EventManager.RegisterRoutedEvent("LanzaMensaje", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(ContenedorCabLin))
|
||||||
|
'Public Custom Event LanzaMensaje As RoutedEventHandler
|
||||||
|
' AddHandler(value As RoutedEventHandler)
|
||||||
|
' Me.AddHandler(EventoLanzaMensaje, value)
|
||||||
|
' End AddHandler
|
||||||
|
|
||||||
|
' RemoveHandler(value As RoutedEventHandler)
|
||||||
|
' Me.RemoveHandler(EventoLanzaMensaje, value)
|
||||||
|
' End RemoveHandler
|
||||||
|
|
||||||
|
' RaiseEvent(sender As Object, e As RoutedEventArgs)
|
||||||
|
' Me.RaiseEvent(e)
|
||||||
|
' End RaiseEvent
|
||||||
|
'End Event
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub Cargado(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
||||||
|
|
||||||
|
Me.siMensaje.Content = ""
|
||||||
|
RaiseEvent CargaAplicacion(sender, e)
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
' Me.Aplicacion.ValidarControles = True
|
||||||
|
End Sub
|
||||||
|
Private Sub Guardar(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btGuardar.ItemClick
|
||||||
|
'Dispatcher.BeginInvoke(New Action(Function() ucexpedientes.Estado = EstadosCablin.Nuevo), Windows.Threading.DispatcherPriority.Loaded)
|
||||||
|
'Dispatcher.BeginInvoke(New Action(Sub() Aplicacion.Guardar(sender, e)), Windows.Threading.DispatcherPriority.ContextIdle)
|
||||||
|
Dim Guardado As Boolean
|
||||||
|
Try
|
||||||
|
btGuardar.IsEnabled = False
|
||||||
|
Guardado = Not Aplicacion.Guardar(sender, e)
|
||||||
|
If Me.Aplicacion.Estado = EstadosCablin.AplicacionSinIndice Then btGuardar.IsEnabled = True
|
||||||
|
Finally
|
||||||
|
If Guardado Then
|
||||||
|
Select Case Aplicacion.Estado
|
||||||
|
Case EstadosCablin.ModificandoRegistro
|
||||||
|
btGuardar.IsEnabled = Aplicacion.PermisosConcedidos.Modificar
|
||||||
|
Case EstadosCablin.Nuevo
|
||||||
|
btGuardar.IsEnabled = Aplicacion.PermisosConcedidos.Nuevos
|
||||||
|
End Select
|
||||||
|
Else
|
||||||
|
btGuardar.IsEnabled = True
|
||||||
|
End If
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Public Sub New()
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
'Public Sub New(Contenido As ApCabLin, TablaBase As String, Registros As ListCollectionView, Busqueda As DevExpress.Xpf.LayoutControl.LayoutGroup, GridBusqueda As DevExpress.Xpf.Grid.GridControl)
|
||||||
|
' If Not (System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me)) Then
|
||||||
|
|
||||||
|
|
||||||
|
' ' Llamada necesaria para el diseñador.
|
||||||
|
' InitializeComponent()
|
||||||
|
' Aplicacion = Contenido
|
||||||
|
' ' Aplicacion.Contexto = Contexto
|
||||||
|
' Contenido.ContenedorCL = Me
|
||||||
|
' Contenido.Registros = Registros
|
||||||
|
' ' Contenido.ObjetoEntidad = ModeloEntidad
|
||||||
|
' Contenido.NombreTablaBase = TablaBase
|
||||||
|
' Contenido.Busqueda = Busqueda
|
||||||
|
' Contenido.GridBusqueda = GridBusqueda
|
||||||
|
' Me.contenido.Children.Add(Contenido)
|
||||||
|
' AddHandler Me.PreviewKeyDown, AddressOf Aplicacion.ApCabLin_PreviewKeyDown
|
||||||
|
' End If
|
||||||
|
' '' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Public Sub New(Contenido As ApCabLin)
|
||||||
|
' If Not (System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me)) Then
|
||||||
|
|
||||||
|
|
||||||
|
' ' Llamada necesaria para el diseñador.
|
||||||
|
' InitializeComponent()
|
||||||
|
' Aplicacion = Contenido
|
||||||
|
' Contenido.ContenedorCL = Me
|
||||||
|
' Me.contenido.Children.Add(Contenido.Aplicacion)
|
||||||
|
|
||||||
|
' AddHandler Me.PreviewKeyDown, AddressOf Aplicacion.ApCabLin_PreviewKeyDown
|
||||||
|
|
||||||
|
' End If
|
||||||
|
'End Sub
|
||||||
|
Private sbDesvanecer As Storyboard = Nothing
|
||||||
|
Public Sub New(Aplicacion As ApCabLin, uc As UserControl, dp As DocumentPanel)
|
||||||
|
If Not (System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me)) Then
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.contenido.Children.Add(uc)
|
||||||
|
Me.Aplicacion = Aplicacion
|
||||||
|
Me.dp = dp
|
||||||
|
Aplicacion.ContenedorCL = Me
|
||||||
|
Dim da As New DoubleAnimation
|
||||||
|
With da
|
||||||
|
.From = 1
|
||||||
|
.To = 0
|
||||||
|
.Duration = New Duration(TimeSpan.FromSeconds(2))
|
||||||
|
.AutoReverse = False
|
||||||
|
End With
|
||||||
|
Storyboard.SetTargetProperty(da, New PropertyPath(OpacityProperty))
|
||||||
|
sbDesvanecer = New Storyboard
|
||||||
|
sbDesvanecer.Children.Add(da)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' Private Sub mv_CurrentChanged(sender As Object, e As System.EventArgs) Handles mv.CurrentChanged
|
||||||
|
' cabecera = Me.mv.CurrentEditItem
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub Nuevo(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btNuevo.ItemClick
|
||||||
|
Me.Aplicacion.ValidarControles = False
|
||||||
|
Me.Aplicacion.DocPanel.Tag = Me.Aplicacion.GetType.Name & "." & Me.Aplicacion.Titulo & ".NUEVO"
|
||||||
|
Aplicacion.Estado = EstadosCablin.Nuevo
|
||||||
|
Me.Aplicacion.ValidarControles = True
|
||||||
|
'Busqueda.Visibility = Windows.Visibility.Collapsed
|
||||||
|
'Busqueda.Visibility = Windows.Visibility.Hidden
|
||||||
|
'btBuscar.IsChecked = False
|
||||||
|
'Cabecera.AddNew()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btEliminar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btEliminar.ItemClick
|
||||||
|
Aplicacion.Eliminar(sender, e)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Friend Sub IniciaAnimacion(Mensaje As String, Color As Color)
|
||||||
|
Try
|
||||||
|
Me.siMensaje.Content = Mensaje
|
||||||
|
Dim tbm As TextBlock = LayoutHelper.FindElementByName(Me.BarraBotones, "tbMensaje")
|
||||||
|
tbm.Foreground = New SolidColorBrush(Color)
|
||||||
|
Storyboard.SetTarget(sbDesvanecer, tbm)
|
||||||
|
BeginStoryboard(sbDesvanecer)
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btImprimirPlantilla_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Dim oa = Me.Aplicacion.ObjetoActual
|
||||||
|
Dim be As BaseEdit = Nothing
|
||||||
|
Try
|
||||||
|
be = LayoutHelper.FindParentObject(Of BaseEdit)(oa)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
If Not be Is Nothing Then
|
||||||
|
Select Case be.GetType
|
||||||
|
Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
If Configuracion.ComportamientoValidacion = Validation.InvalidValueBehavior.AllowLeaveEditor Then
|
||||||
|
be.DoValidate()
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
Else
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
be.DoValidate()
|
||||||
|
End If
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'Dim be As BaseEdit = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
|
||||||
|
'If Not be Is Nothing Then
|
||||||
|
' Select Case be.GetType
|
||||||
|
' Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
' Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
' If Not expression Is Nothing Then expression.UpdateSource()
|
||||||
|
' be.DoValidate()
|
||||||
|
' Case GetType(CheckEdit)
|
||||||
|
' End Select
|
||||||
|
'End If
|
||||||
|
Dim idPlantilla As Integer = bePlantilla.EditValue
|
||||||
|
Me.Aplicacion.LanzaImprimirPlantilla(sender, e, idPlantilla)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Private Function FindVisualChild(Of childItem As DependencyObject)(ByVal obj As DependencyObject) As childItem
|
||||||
|
' For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(obj) - 1
|
||||||
|
' Dim child As DependencyObject = VisualTreeHelper.GetChild(obj, i)
|
||||||
|
' If child IsNot Nothing AndAlso TypeOf child Is childItem Then
|
||||||
|
' Return CType(child, childItem)
|
||||||
|
' Else
|
||||||
|
' Dim childOfChild As childItem = FindVisualChild(Of childItem)(child)
|
||||||
|
' If childOfChild IsNot Nothing Then
|
||||||
|
' Return childOfChild
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' Next i
|
||||||
|
' Return Nothing
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' Private Sub htIniciaAnimacion(Mensaje As String, Color As Color)
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btAcciones_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Dim oa = Me.Aplicacion.ObjetoActual
|
||||||
|
Dim be As BaseEdit = Nothing
|
||||||
|
Try
|
||||||
|
be = LayoutHelper.FindParentObject(Of BaseEdit)(oa)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
If Not be Is Nothing Then
|
||||||
|
Select Case be.GetType
|
||||||
|
Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
If Configuracion.ComportamientoValidacion = Validation.InvalidValueBehavior.AllowLeaveEditor Then
|
||||||
|
be.DoValidate()
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
Else
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
be.DoValidate()
|
||||||
|
End If
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
'Dim be As BaseEdit = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
|
||||||
|
'If Not be Is Nothing Then
|
||||||
|
' Select Case be.GetType
|
||||||
|
' Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
' Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
' If Not expression Is Nothing Then expression.UpdateSource()
|
||||||
|
' be.DoValidate()
|
||||||
|
' Case GetType(CheckEdit)
|
||||||
|
' End Select
|
||||||
|
'End If
|
||||||
|
Dim idAccion As Integer = beAcciones.EditValue
|
||||||
|
Me.Aplicacion.LanzaEjecutaAccion(sender, e, idAccion)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btActualizar_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
Me.Aplicacion.RefrescaUC(True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub beAcciones_EditValueChanged(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim idAccion As Integer = beAcciones.EditValue
|
||||||
|
Dim acs As List(Of Accion) = Me.cbAcciones.ItemsSource
|
||||||
|
Dim ac As Accion = (From a In acs Where a.idAccion = idAccion).First
|
||||||
|
Me.btAcciones.Hint = ac.Descripcion
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub bePlantilla_EditValueChanged(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim idPlantilla As Integer = bePlantilla.EditValue
|
||||||
|
Dim plantillas As List(Of tsWPF.Plantilla) = Me.cbPlantillaAImprimir.ItemsSource
|
||||||
|
Dim pl As Plantilla = (From p In plantillas Where p.idPlantilla = idPlantilla).First
|
||||||
|
Me.btImprimirPlantilla.Hint = "Imprimir " & pl.Descripcion
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorCabLin_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
Try
|
||||||
|
If Aplicacion IsNot Nothing Then
|
||||||
|
If Aplicacion.bdEntidad.Connection.State <> System.Data.ConnectionState.Closed Then Aplicacion.bdEntidad.Connection.Close()
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAyuda_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Me.Aplicacion.DelegadoAyuda.Invoke(Me.Aplicacion.uc.GetType.ToString)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
Me.Aplicacion.DelegadoDiseño.Invoke(Me.Aplicacion.bdEntidad, OperacionDiseñoEnum.GUARDAR, Me.Aplicacion.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then Me.Aplicacion.DelegadoErrorNoControlado.Invoke(Me.Aplicacion, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function ObtieneDiseñoActual() As Byte()
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
Dim i As Integer
|
||||||
|
For Each l In Aplicacion.Lineas
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Dim dr As New DiseñoRejilla
|
||||||
|
dr.Nombre = l.Name
|
||||||
|
dr.Version = "1"
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
l.SaveLayoutToStream(ms)
|
||||||
|
dr.Diseño = ms.ToArray
|
||||||
|
ld.Rejillas.Add(dr)
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.Serializar(ld))
|
||||||
|
Return drs
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btRestaurarDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
If Aplicacion.DiseñoOriginal IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(Aplicacion.DiseñoOriginal), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
For Each l In Aplicacion.Lineas
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then Me.Aplicacion.DelegadoErrorNoControlado.Invoke(Me.Aplicacion, ex)
|
||||||
|
' Debug.Write("Error DelegadoDiseño Rejilla")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.Serializar(ld))
|
||||||
|
Me.Aplicacion.DelegadoDiseño.Invoke(Me.Aplicacion.bdEntidad, OperacionDiseñoEnum.RESTAURAR_ORIGINAL, Me.Aplicacion.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then Me.Aplicacion.DelegadoErrorNoControlado.Invoke(Me.Aplicacion, ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btGuardarDiseñoComo_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
Me.Aplicacion.DelegadoDiseño.Invoke(Me.Aplicacion.bdEntidad, OperacionDiseñoEnum.GUARDAR_COMO, Me.Aplicacion.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then Me.Aplicacion.DelegadoErrorNoControlado.Invoke(Me.Aplicacion, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseñoComo_Itemclick")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAbrirDiseñoGuardado_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim b = Me.Aplicacion.DelegadoDiseño.Invoke(Me.Aplicacion.bdEntidad, OperacionDiseñoEnum.ABRIR_DISEÑO_GUARDADO, Me.Aplicacion.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, Nothing)
|
||||||
|
If b IsNot Nothing Then
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(Me, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.Aplicacion.DelegadoErrorNoControlado IsNot Nothing Then Me.Aplicacion.DelegadoErrorNoControlado.Invoke(Me.Aplicacion, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseñoGuardado_Itemclick")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtCapturar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim sficherojpg = tsl5.Utilidades.ObtieneFicheroAleatorio("jpg")
|
||||||
|
IO.File.WriteAllBytes(sficherojpg, Me.Aplicacion.uc.ObtieneImagen(1, 100))
|
||||||
|
Process.Start(sficherojpg)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtExportar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = "Exportacion.xlsx"
|
||||||
|
sfd.Filter = "Fichero Excel (*.xls, *.xlsx|*.xls;*.xlsx"
|
||||||
|
sfd.DefaultExt = ".xlsx"
|
||||||
|
Dim ms As New List(Of Stream)
|
||||||
|
Dim formato As DevExpress.Spreadsheet.DocumentFormat
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Dim i As Integer = 0
|
||||||
|
Dim ngc As New tsGridControl
|
||||||
|
For Each oc In Me.Aplicacion.ControlesTS
|
||||||
|
Try
|
||||||
|
Dim gc As New tsGridColumn()
|
||||||
|
gc.FieldName = oc.PropiedadesTS.NombreCampo
|
||||||
|
gc.Header = oc.Label.ToString.TrimEnd(":")
|
||||||
|
gc.Width = oc.Width
|
||||||
|
ngc.Columns.Add(gc)
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
ngc.ItemsSource = Me.Aplicacion.DataContext
|
||||||
|
Dim ls = New MemoryStream
|
||||||
|
ngc.View.ExportToXlsx(ls)
|
||||||
|
ms.Add(ls)
|
||||||
|
For Each l In Me.Aplicacion.Lineas
|
||||||
|
Try
|
||||||
|
ls = New MemoryStream
|
||||||
|
ms.Add(ls)
|
||||||
|
Dim vista As TableView = l.View
|
||||||
|
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||||
|
Case ".xls"
|
||||||
|
vista.ExportToXls(ls)
|
||||||
|
formato = DevExpress.Spreadsheet.DocumentFormat.Xls
|
||||||
|
Case ".xlsx"
|
||||||
|
vista.ExportToXlsx(ls)
|
||||||
|
formato = DevExpress.Spreadsheet.DocumentFormat.Xlsx
|
||||||
|
End Select
|
||||||
|
i += 1
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
Dim wb As New Workbook
|
||||||
|
For i = 0 To ms.Count - 1
|
||||||
|
Try
|
||||||
|
Dim wbc As New Workbook
|
||||||
|
ms(i).Position = 0
|
||||||
|
wbc.LoadDocument(ms(i), formato)
|
||||||
|
wb.Worksheets(i).CopyFrom(wbc.Worksheets(0))
|
||||||
|
If i = 0 Then
|
||||||
|
wb.Worksheets(i).Name = Me.Aplicacion.Titulo
|
||||||
|
Else
|
||||||
|
If wb.Worksheets.Any(Function(x) x.Name = Me.Aplicacion.Lineas(i - 1).NombreTablaBase) Then
|
||||||
|
wb.Worksheets(i).Name = (i - 1).ToString
|
||||||
|
Else
|
||||||
|
wb.Worksheets(i).Name = Me.Aplicacion.Lineas(i - 1).NombreTablaBase
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If i < ms.Count - 1 Then wb.Worksheets.Add()
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
Dim nc As Integer = 0
|
||||||
|
For Each c In Me.Aplicacion.ControlesTS
|
||||||
|
Try
|
||||||
|
Select Case c.Content.GetType
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
Dim Ce As CheckEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(If(Ce.IsChecked, "SI", "NO"))
|
||||||
|
|
||||||
|
Case GetType(ButtonEdit)
|
||||||
|
Dim te As ButtonEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(te.EditValue)
|
||||||
|
Case GetType(TextEdit)
|
||||||
|
Dim te As TextEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(te.EditValue)
|
||||||
|
Case GetType(DateEdit)
|
||||||
|
Dim de As DateEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(de.EditValue)
|
||||||
|
Case GetType(ComboBoxEdit)
|
||||||
|
Dim cbe As ComboBoxEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(cbe.DisplayText)
|
||||||
|
Case GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim le As DevExpress.Xpf.Grid.LookUp.LookUpEdit = c.Content
|
||||||
|
wb.Worksheets(0).Cells(1, nc).SetValue(le.EditValue)
|
||||||
|
End Select
|
||||||
|
nc += 1
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
|
||||||
|
wb.SaveDocument(sfd.FileName, formato)
|
||||||
|
Process.Start(sfd.FileName)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub bePlantilla_GotFocus(sender As Object, e As RoutedEventArgs) Handles bePlantilla.GotFocus
|
||||||
|
Dim oa = Me.Aplicacion.ObjetoActual
|
||||||
|
Dim be As BaseEdit = Nothing
|
||||||
|
Try
|
||||||
|
be = LayoutHelper.FindParentObject(Of BaseEdit)(oa)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
If Not be Is Nothing Then
|
||||||
|
Select Case be.GetType
|
||||||
|
Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
If Configuracion.ComportamientoValidacion = Validation.InvalidValueBehavior.AllowLeaveEditor Then
|
||||||
|
be.DoValidate()
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
Else
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
be.DoValidate()
|
||||||
|
End If
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub beAcciones_GotFocus(sender As Object, e As RoutedEventArgs) Handles beAcciones.GotFocus
|
||||||
|
Dim oa = Me.Aplicacion.ObjetoActual
|
||||||
|
Dim be As BaseEdit = Nothing
|
||||||
|
Try
|
||||||
|
be = LayoutHelper.FindParentObject(Of BaseEdit)(oa)
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
If Not be Is Nothing Then
|
||||||
|
Select Case be.GetType
|
||||||
|
Case GetType(TextEdit), GetType(PasswordBoxEdit), GetType(ButtonEdit), GetType(DateEdit), GetType(ComboBoxEdit), GetType(DevExpress.Xpf.Grid.LookUp.LookUpEdit)
|
||||||
|
Dim expression = be.GetBindingExpression(BaseEdit.EditValueProperty)
|
||||||
|
If Configuracion.ComportamientoValidacion = Validation.InvalidValueBehavior.AllowLeaveEditor Then
|
||||||
|
be.DoValidate()
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
Else
|
||||||
|
If Not expression Is Nothing AndAlso expression.IsDirty Then expression.UpdateSource()
|
||||||
|
be.DoValidate()
|
||||||
|
End If
|
||||||
|
Case GetType(CheckEdit)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Serializable>
|
||||||
|
Public Class DiseñoRejillas
|
||||||
|
Property Rejillas As New List(Of DiseñoRejilla)
|
||||||
|
Property Version As String
|
||||||
|
End Class
|
||||||
|
<Serializable>
|
||||||
|
Public Class DiseñoRejilla
|
||||||
|
Public Diseño() As Byte
|
||||||
|
Public Version As String
|
||||||
|
Public Nombre As String
|
||||||
|
End Class
|
||||||
110
Obsoleto/ContenedorLineas.xaml
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<UserControl x:Class="ContenedorLineas"
|
||||||
|
x:ClassModifier="Public"
|
||||||
|
x:Name="ApLineas"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:my="clr-namespace:tsWPF"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
mc:Ignorable="d" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" d:DesignHeight="497" d:DesignWidth="971" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar">
|
||||||
|
<Grid>
|
||||||
|
<dxb:BarManager Name="BarraBotones" ShowScreenTips="true" x:FieldModifier="Public" AllowCustomization="False" AllowQuickCustomization="False">
|
||||||
|
<dxb:BarManager.Items>
|
||||||
|
<dxb:BarButtonItem Name="btNuevo" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Actions/AddItem_16x16.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo" />
|
||||||
|
<dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Actions/Refresh_16x16.png" x:FieldModifier="public" Focusable="true" ForceCursor="True" IsVisible="True" ItemClick="btActualizar_ItemClick" Hint="Cargar datos de nuevo" />
|
||||||
|
<!--<dxb:BarButtonItem Name="btImprimirListado" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Print/Preview_16x16.png" x:FieldModifier="public" Focusable="True" ItemClick="btImprimirListado_ItemClick" Hint="Imprimir Listado / Exportar a Excel" />-->
|
||||||
|
|
||||||
|
<dxb:BarSubItem Name="MenuExportar" Glyph="{dx:DXImageGrayscale Image=ExportFile_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Exportar/Imprimir">
|
||||||
|
<dxb:BarButtonItem Name="btExportar" Glyph="{dx:DXImageGrayscale Image=ExportToXLSX_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Exportar A Excel" ItemClick="BtExportar_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btImprimir" Glyph="{dx:DXImageGrayscale Image=Preview_16x16.png}" Content="Vista Preliminar" ItemClick="btImprimirListado_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btCapturar" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/capture.png" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" />
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dxb:BarEditItem Name="beAcciones" x:FieldModifier="public" Focusable="True" IsEnabled="True" Hint="Accion a Ejecutar" EditWidth="390">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbAcciones" x:FieldModifier="Public" ValueMember="idAccion" DisplayMember="Descripcion" />
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btAcciones" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Arrows/Next_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btAcciones_ItemClick" Hint="Ejecutar Acción" />
|
||||||
|
<dxb:BarCheckItem Name="btSeleccionar" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/checklist-25.png" x:FieldModifier="public" Focusable="False" CheckedChanged="btSeleccionar_CheckedChanged" Hint="Selección múltiple" />
|
||||||
|
<dxb:BarButtonItem Name="btInvertir" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/Invertir-25.png" x:FieldModifier="public" Focusable="False" ItemClick="btInvertir_ItemClick" IsEnabled="False" Hint="Invertir Selección" />
|
||||||
|
<dxb:BarSubItem Name="MenuDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Diseño Columnas">
|
||||||
|
<dxb:BarButtonItem Name="btDiseño" Glyph="{dx:DXImageGrayscale Image=CustomizeGrid_16x16.png}" x:FieldModifier="public" Focusable="False" Content="Guardar Diseño Columnas" ItemClick="btDiseño_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btRestaurarDiseño" Glyph="{dx:DXImageGrayscale Image=Columns_16x16.png}" Content="Restaurar Diseño Columnas" ItemClick="btRestaurarDiseño_ItemClick" />
|
||||||
|
<dxb:BarItemSeparator />
|
||||||
|
<dxb:BarButtonItem Name="btAbrirDiseñoGuardado" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/GuardarGrid.png" Content="Guardar Diseño Como ..." ItemClick="btGuardarDiseñoComo_ItemClick" />
|
||||||
|
|
||||||
|
</dxb:BarSubItem>
|
||||||
|
<dxb:BarButtonItem Name="btAyuda" Glyph="{dx:DXImageGrayscale Image=Index_16x16.png}" x:FieldModifier="public" Focusable="False" Hint="Ayuda" ItemClick="btAyuda_ItemClick" />
|
||||||
|
<dxb:BarButtonItem Name="btEliminar" Glyph="pack://application:,,/tsWPF;Component/Images/Icons/papelera.png" x:FieldModifier="public" Focusable="False" Hint="Elimina Registros Seleccionados" />
|
||||||
|
<dxb:BarEditItem Name="bePlantilla" x:FieldModifier="public" Focusable="True" IsEnabled="True" Hint="Modelo a Imprimir" EditWidth="300">
|
||||||
|
<dxb:BarEditItem.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbPlantillaAImprimir" x:FieldModifier="Public" ValueMember="idPlantilla" DisplayMember="Descripcion">
|
||||||
|
</dxe:ComboBoxEditSettings>
|
||||||
|
</dxb:BarEditItem.EditSettings>
|
||||||
|
</dxb:BarEditItem>
|
||||||
|
<dxb:BarButtonItem Name="btImprimirPlantilla" Hint="Imprimir" Glyph="pack://application:,,,/DevExpress.Images.v23.2;component/GrayScaleImages/Print/Print_16x16.png" x:FieldModifier="public" IsEnabled="True" Focusable="True" ItemClick="btImprimirPlantilla_ItemClick" />
|
||||||
|
</dxb:BarManager.Items>
|
||||||
|
<dxb:BarManager.Bars>
|
||||||
|
<dxb:Bar x:Name="Barra1" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" AllowCollapse="False" AllowHide="False">
|
||||||
|
<dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarDockInfo ContainerType="Top" />
|
||||||
|
</dxb:Bar.DockInfo>
|
||||||
|
<!--<dxb:BarButtonItemLink BarItemName="btGuardar" x:FieldModifier="Public" x:Name="ilGuardar" />-->
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btNuevo" x:FieldModifier="Public" x:Name="ilNuevo" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btActualizar" x:FieldModifier="Public" x:Name="ilActualizar" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<!--<dxb:BarButtonItemLink BarItemName="btImprimirListado" x:FieldModifier="Public" x:Name="ilImprimirListado" />-->
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuExportar" x:FieldModifier="Public" x:Name="ilExportar" />
|
||||||
|
<dxb:BarCheckItemLink BarItemName="btSeleccionar" x:FieldModifier="Public" x:Name="ilSeleccionar" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btInvertir" x:FieldModifier="Public" x:Name="ilInvertir" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btEliminar" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarSubItemLink BarItemName="MenuDiseño" x:Name="ilDiseño" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAyuda" x:Name="ilAyuda" x:FieldModifier="Public" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="bePlantilla" x:FieldModifier="Public" x:Name="ilPlantilla" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btImprimirPlantilla" />
|
||||||
|
<dxb:BarItemLinkSeparator></dxb:BarItemLinkSeparator>
|
||||||
|
<dxb:BarEditItemLink BarItemName="beAcciones" x:FieldModifier="Public" x:Name="ilAcciones" />
|
||||||
|
<dxb:BarButtonItemLink BarItemName="btAcciones" />
|
||||||
|
|
||||||
|
|
||||||
|
<!--<dxb:BarButtonItemLink BarItemName="btEliminar" x:FieldModifier="Public" x:Name="ilEliminar" />-->
|
||||||
|
</dxb:Bar>
|
||||||
|
<dxb:Bar Name="Barsm" AllowCustomizationMenu="False" AllowQuickCustomization="False" ShowDragWidget="False" AllowCollapse="False" AllowHide="False">
|
||||||
|
<dxb:Bar.DockInfo>
|
||||||
|
<dxb:BarDockInfo ContainerType="Top" />
|
||||||
|
</dxb:Bar.DockInfo>
|
||||||
|
|
||||||
|
|
||||||
|
</dxb:Bar>
|
||||||
|
</dxb:BarManager.Bars>
|
||||||
|
<Grid>
|
||||||
|
<dxdo:DockLayoutManager Name="dockManager" ClosedPanelsBarVisibility="Manual">
|
||||||
|
<dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:AutoHideGroup DockType="Bottom">
|
||||||
|
<dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Collapsed" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160">
|
||||||
|
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:AutoHideGroup>
|
||||||
|
</dxdo:DockLayoutManager.AutoHideGroups>
|
||||||
|
<dxdo:LayoutGroup x:Name="RootGroup" Orientation="Horizontal">
|
||||||
|
<dxdo:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxdo:LayoutPanel AllowFloat="False" AllowHide="False" AllowMove="False" ShowCloseButton="False" Name="lpContenido" ShowCaption="False">
|
||||||
|
<Grid Name="contenido" />
|
||||||
|
</dxdo:LayoutPanel>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:LayoutGroup>
|
||||||
|
</dxdo:DockLayoutManager>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
</dxb:BarManager>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
409
Obsoleto/ContenedorLineas.xaml.vb
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports DevExpress.Xpf.Printing
|
||||||
|
Imports DevExpress.Utils
|
||||||
|
Imports tsWPF.Controles
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports Microsoft.Win32
|
||||||
|
Imports tsl5.Extensiones
|
||||||
|
|
||||||
|
Public Class ContenedorLineas
|
||||||
|
Public apLinea As ApLineas
|
||||||
|
Dim _DescripcionDiseño As String
|
||||||
|
Dim _TodosUsuariosDiseño As Boolean
|
||||||
|
Public Property t As Task
|
||||||
|
|
||||||
|
|
||||||
|
Public Event CargaAplicacion(sender As System.Object, e As System.Windows.RoutedEventArgs)
|
||||||
|
Public Event AntesDeGuardar(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Public Event DespuesDeGuardar(sender As System.Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(apLinea As ApLineas, uc As UserControl)
|
||||||
|
If Not (System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me)) Then
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.contenido.Children.Add(uc)
|
||||||
|
Me.apLinea = apLinea
|
||||||
|
apLinea.ContenedorL = Me
|
||||||
|
apLinea.LanzaEventoCargado()
|
||||||
|
If apLinea.PermisosConcedidos.Exportar Then
|
||||||
|
Dim cm As New ContextMenu
|
||||||
|
|
||||||
|
Dim mie As New MenuItem()
|
||||||
|
mie.Tag = "MI_EXPORTAR_EXCEL"
|
||||||
|
mie.Header = "Exportar a Excel"
|
||||||
|
AddHandler mie.Click, AddressOf _ExportarExcel
|
||||||
|
cm.Items.Add(mie)
|
||||||
|
|
||||||
|
|
||||||
|
Dim mi As New MenuItem()
|
||||||
|
mi.Tag = "MI_EXPORTAR"
|
||||||
|
mi.Header = "Exportar Otros Formatos"
|
||||||
|
AddHandler mi.Click, AddressOf _Exportar
|
||||||
|
cm.Items.Add(mi)
|
||||||
|
Me.apLinea.Rejilla.ContextMenu = cm
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub _ExportarExcel(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim mi As MenuItem = sender
|
||||||
|
Dim cm As ContextMenu = mi.Parent
|
||||||
|
Dim tsgc As tsGridControl = cm.PlacementTarget
|
||||||
|
Dim vista As TableView = tsgc.View
|
||||||
|
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = IO.Path.GetDirectoryName("Exportacion") & (tsgc.NombreTablaBase.NothingAVacio & " Exportacion.xlsx").Trim
|
||||||
|
sfd.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
|
||||||
|
sfd.DefaultExt = ".xlsx"
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||||
|
Case ".xls"
|
||||||
|
vista.ExportToXls(sfd.FileName)
|
||||||
|
Case ".xlsx"
|
||||||
|
vista.ExportToXlsx(sfd.FileName)
|
||||||
|
Case ".csv"
|
||||||
|
vista.ExportToCsv(sfd.FileName)
|
||||||
|
End Select
|
||||||
|
Process.Start(sfd.FileName)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub _Exportar(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim mi As MenuItem = sender
|
||||||
|
Dim cm As ContextMenu = mi.Parent
|
||||||
|
Dim tsgc As tsGridControl = cm.PlacementTarget
|
||||||
|
Dim vista As TableView = tsgc.View
|
||||||
|
Try
|
||||||
|
|
||||||
|
|
||||||
|
'Dim link As New PrintableControlLink(CType(vista, TableView))
|
||||||
|
'link.CreateDocument()
|
||||||
|
'Dim vi As New tsWPF.ucVisualizadorInformes()
|
||||||
|
'vi.Visualizador.DocumentSource = link
|
||||||
|
'Dim docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
'Dim tabHeaderPrintInfoControl As New TabHeaderPrintInfoControl() With {.TabName = "Exportación " & tsgc.PropiedadesTSGC.Descripcion}
|
||||||
|
'docpanel.Caption = tabHeaderPrintInfoControl
|
||||||
|
'docpanel.Content = vi
|
||||||
|
'docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
'Me.apLinea.GrupoDocumentos.Add(docpanel)
|
||||||
|
'Comun.dm.DockController.Activate(docpanel)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim preview As New DocumentPreview()
|
||||||
|
Dim model As LinkPreviewModel = CreateLinkPreviewModel(TryCast(vista, IPrintableControl))
|
||||||
|
model.Link.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated
|
||||||
|
preview.Model = model
|
||||||
|
Dim tabHeaderPrintInfoControl As New TabHeaderPrintInfoControl() With {.TabName = "Exportación " & tsgc.PropiedadesTSGC.Descripcion, .LinkPreviewModel = model}
|
||||||
|
Dim docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
docpanel.Caption = tabHeaderPrintInfoControl
|
||||||
|
docpanel.Content = preview
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
Me.apLinea.GrupoDocumentos.Add(docpanel)
|
||||||
|
Comun.dm.DockController.Activate(docpanel)
|
||||||
|
model.Link.CreateDocument(True)
|
||||||
|
Catch ex As Exception
|
||||||
|
Console.WriteLine(ex.Message)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
'Public Shared Function CreateLinkPreviewModel(ByVal printableControl As IPrintableControl) As LinkPreviewModel
|
||||||
|
' Dim link As New PrintableControlLink(TryCast(printableControl, IPrintableControl))
|
||||||
|
' Return New LinkPreviewModel(link)
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub BotonEditar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btEditar.ItemClick
|
||||||
|
' If Not apLinea.Rejilla.CurrentItem Is Nothing Then
|
||||||
|
' apLinea.IApLin.Editar()
|
||||||
|
' End If
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
Private Sub BotonNuevo(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btNuevo.ItemClick
|
||||||
|
apLinea.IApLin.Nuevo()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BotonEliminar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btEliminar.ItemClick
|
||||||
|
'apLinea.IApLin.Eliminar()
|
||||||
|
apLinea.Eliminar()
|
||||||
|
End Sub
|
||||||
|
'Private Sub BotonGuardar(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs) Handles btGuardar.ItemClick
|
||||||
|
' apLinea.Guardar()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub ContenedorLineas_GotFocus(sender As Object, e As RoutedEventArgs) Handles Me.GotFocus
|
||||||
|
' Debug.WriteLine("contenedorlin.gotfocus")
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub btSeleccionar_CheckedChanged(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
apLinea.SeleccionarHabilitadoCambiado(btSeleccionar.IsChecked)
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub btInvertir_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
'Dim enti As System.Data.Objects.DataClasses.EntityObject = Nothing
|
||||||
|
|
||||||
|
'For i = 0 To Me.apLinea.Rejilla.VisibleRowCount - 1
|
||||||
|
' enti = Me.apLinea.Rejilla.GetRow(i)
|
||||||
|
' Dim key As Integer
|
||||||
|
' If Not enti Is Nothing Then
|
||||||
|
' Dim rowHandle As Integer = Me.apLinea.Rejilla.GetRowHandleByVisibleIndex(i)
|
||||||
|
' key = enti.GetType.GetProperty(Me.apLinea.CampoIndice).GetValue(enti, Nothing)
|
||||||
|
' Dim newIsSelected As Boolean = Not Me.apLinea.ElementosSeleccionados.GetIsSelected(key)
|
||||||
|
' Me.apLinea.Rejilla.SetCellValue(rowHandle, "tswpf_seleccionar", newIsSelected)
|
||||||
|
' End If
|
||||||
|
'Next
|
||||||
|
'Me.apLinea.Rejilla.RefreshData()
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim iq As IQueryable(Of System.Data.Objects.DataClasses.EntityObject)
|
||||||
|
Dim li As List(Of System.Data.Objects.DataClasses.EntityObject) = Nothing
|
||||||
|
Dim key As Integer
|
||||||
|
|
||||||
|
Try
|
||||||
|
'iq = Me.apLinea.Rejilla.DataContext
|
||||||
|
iq = Me.apLinea.Rejilla.ItemsSource
|
||||||
|
li = iq.ToList
|
||||||
|
Catch ex As InvalidCastException
|
||||||
|
'Catch ex As Exception
|
||||||
|
Try
|
||||||
|
li = Me.apLinea.Rejilla.ItemsSource
|
||||||
|
Catch ex2 As Exception
|
||||||
|
Dim ob = Me.apLinea.Rejilla.ItemsSource
|
||||||
|
For i = 0 To ob.Count - 1
|
||||||
|
key = ob(i).GetType.GetProperty(Me.apLinea.CampoIndice).GetValue(ob(i), Nothing)
|
||||||
|
Dim newIsSelected As Boolean = Not Me.apLinea.ElementosSeleccionados.GetIsSelected(key)
|
||||||
|
Dim rowHandle As Integer = Me.apLinea.Rejilla.GetRowHandleByListIndex(i)
|
||||||
|
If Me.apLinea.Rejilla.IsGroupRowExpanded(rowHandle) Or Me.apLinea.Rejilla.GetRowLevelByRowHandle(rowHandle) = 0 Then
|
||||||
|
Me.apLinea.Rejilla.SetCellValue(rowHandle, "tswpf_seleccionar", newIsSelected)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End Try
|
||||||
|
End Try
|
||||||
|
If li IsNot Nothing Then
|
||||||
|
For i = 0 To li.Count - 1
|
||||||
|
key = li(i).GetType.GetProperty(Me.apLinea.CampoIndice).GetValue(li(i), Nothing)
|
||||||
|
Dim newIsSelected As Boolean = Not Me.apLinea.ElementosSeleccionados.GetIsSelected(key)
|
||||||
|
Dim rowHandle As Integer = Me.apLinea.Rejilla.GetRowHandleByListIndex(i)
|
||||||
|
If Me.apLinea.Rejilla.IsGroupRowExpanded(rowHandle) Or Me.apLinea.Rejilla.GetRowLevelByRowHandle(rowHandle) = 0 Then
|
||||||
|
Me.apLinea.Rejilla.SetCellValue(rowHandle, "tswpf_seleccionar", newIsSelected)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Me.apLinea.Rejilla.RefreshData()
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write(ex.Message)
|
||||||
|
End Try
|
||||||
|
Me.apLinea.LanzaEventoInvertirSeleccion()
|
||||||
|
|
||||||
|
|
||||||
|
'Dim key As Integer
|
||||||
|
'Dim enti As System.Data.Objects.DataClasses.EntityObject = Nothing
|
||||||
|
'For i As Integer = 0 To Me.apLinea.Rejilla.DataContext.Count - 1
|
||||||
|
' enti = Me.apLinea.Rejilla.DataContext.GetType(i)
|
||||||
|
' key = enti.GetType.GetProperty(Me.apLinea.CampoIndice).GetValue(enti, Nothing)
|
||||||
|
' Dim newIsSelected As Boolean = Not Me.apLinea.ElementosSeleccionados.GetIsSelected(key)
|
||||||
|
' Dim rowHandle As Integer = Grid.GetRowHandleByListIndex(i)
|
||||||
|
' Grid.SetCellValue(rowHandle, "Selected", newIsSelected)
|
||||||
|
'Next i
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btImprimirListado_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Dim preview As New DocumentPreview()
|
||||||
|
Dim model As LinkPreviewModel = CreateLinkPreviewModel(TryCast(Me.apLinea.Rejilla.View, IPrintableControl))
|
||||||
|
preview.Model = model
|
||||||
|
|
||||||
|
Dim tabHeaderPrintInfoControl As New TabHeaderPrintInfoControl() With {.TabName = "Listado de " & Me.apLinea.Titulo, .LinkPreviewModel = model}
|
||||||
|
Dim docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||||
|
docpanel.Caption = tabHeaderPrintInfoControl
|
||||||
|
docpanel.Content = preview
|
||||||
|
docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||||
|
Me.apLinea.GrupoDocumentos.Add(docpanel)
|
||||||
|
Comun.dm.DockController.Activate(docpanel)
|
||||||
|
model.Link.CreateDocument(True)
|
||||||
|
End Sub
|
||||||
|
Public Shared Function CreateLinkPreviewModel(ByVal printableControl As IPrintableControl) As LinkPreviewModel
|
||||||
|
Dim link As New PrintableControlLink(TryCast(printableControl, IPrintableControl))
|
||||||
|
Return New LinkPreviewModel(link)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub btImprimirPlantilla_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Dim idPlantilla As Integer = bePlantilla.EditValue
|
||||||
|
Me.apLinea.LanzaImprimirPlantilla(sender, e, idPlantilla)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAcciones_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim idAccion As Integer = beAcciones.EditValue
|
||||||
|
Me.apLinea.LanzaEjecutarAccion(sender, e, idAccion)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btActualizar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Me.apLinea.RefrescaUC()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorLineas_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ContenedorLineas_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
Try
|
||||||
|
If apLinea.Contexto IsNot Nothing Then
|
||||||
|
If apLinea.Contexto.Connection.State <> System.Data.ConnectionState.Closed Then apLinea.Contexto.Connection.Close()
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Private Sub btAyuda_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Me.apLinea.DelegadoAyuda.Invoke(Me.apLinea.uc.GetType.ToString)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
Me.apLinea.DelegadoDiseño.Invoke(Me.apLinea.Contexto, OperacionDiseñoEnum.GUARDAR, Me.apLinea.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.apLinea.DelegadoErrorNoControlado IsNot Nothing Then Me.apLinea.DelegadoErrorNoControlado.Invoke(Me.apLinea, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseño_Itemclick")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function ObtieneDiseñoActual() As Byte()
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(ApLineas, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Dim dr As New DiseñoRejilla
|
||||||
|
dr.Nombre = l.Name
|
||||||
|
dr.Version = "1"
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
'Dim ms As New FileStream("c:\tmp\diseño1.xml", FileMode.CreateNew)
|
||||||
|
l.SaveLayoutToStream(ms)
|
||||||
|
' l.SaveLayoutToXml("c:\tmp\diseño2.xml")
|
||||||
|
'ms.Close()
|
||||||
|
dr.Diseño = ms.ToArray
|
||||||
|
ld.Rejillas.Add(dr)
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
Return drs
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub btRestaurarDiseño_ItemClick(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
If apLinea.DiseñoOriginal IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(apLinea.DiseñoOriginal), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(ApLineas, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Debug.Write("Error DelegadoDiseño Rejilla")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
Dim drs = System.Text.Encoding.Unicode.GetBytes(tsl5.Utilidades.serializar(ld))
|
||||||
|
Me.apLinea.DelegadoDiseño.Invoke(Me.apLinea.Contexto, OperacionDiseñoEnum.RESTAURAR_ORIGINAL, Me.apLinea.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.apLinea.DelegadoErrorNoControlado IsNot Nothing Then Me.apLinea.DelegadoErrorNoControlado.Invoke(Me.apLinea, ex)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btGuardarDiseñoComo_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim drs = ObtieneDiseñoActual()
|
||||||
|
Me.apLinea.DelegadoDiseño.Invoke(Me.apLinea.Contexto, OperacionDiseñoEnum.GUARDAR_COMO, Me.apLinea.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, drs)
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.apLinea.DelegadoErrorNoControlado IsNot Nothing Then Me.apLinea.DelegadoErrorNoControlado.Invoke(Me.apLinea, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseño_Itemclick")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btAbrirDiseñoGuardado_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim b = Me.apLinea.DelegadoDiseño.Invoke(Me.apLinea.Contexto, OperacionDiseñoEnum.ABRIR_DISEÑO_GUARDADO, Me.apLinea.uc.GetType.ToString, _DescripcionDiseño, _TodosUsuariosDiseño, Nothing)
|
||||||
|
If b IsNot Nothing Then
|
||||||
|
Dim ld As New DiseñoRejillas
|
||||||
|
ld = tsl5.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||||
|
Dim i As Integer
|
||||||
|
Dim lg As List(Of tsGridControl) = Nothing
|
||||||
|
tsWPF.ObtieneHijosDeTipo(Of tsGridControl)(Me, lg)
|
||||||
|
For Each l In lg
|
||||||
|
i += 1
|
||||||
|
If l.Name = "" Then l.Name = "tsRejilla-" & i.ToString
|
||||||
|
Try
|
||||||
|
If ld.Rejillas.Any(Function(x) x.Nombre = l.Name) Then
|
||||||
|
Dim dr As DiseñoRejilla = ld.Rejillas.Where(Function(x) x.Nombre = l.Name).First
|
||||||
|
l.RestoreLayoutFromStream(New System.IO.MemoryStream(dr.Diseño))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
If Me.apLinea.DelegadoErrorNoControlado IsNot Nothing Then Me.apLinea.DelegadoErrorNoControlado.Invoke(Me.apLinea, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error btDiseño_Itemclick")
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BtExportar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
|
||||||
|
Dim vista As TableView = Me.apLinea.Rejilla.View
|
||||||
|
|
||||||
|
Dim sfd As New SaveFileDialog
|
||||||
|
sfd.FileName = IO.Path.GetDirectoryName("Exportacion") & (Me.apLinea.Rejilla.NombreTablaBase.NothingAVacio & " Exportacion.xlsx").Trim
|
||||||
|
sfd.Filter = "Fichero Excel (*.xls, *.xlsx, *.csv)|*.xls;*.xlsx;*.csv"
|
||||||
|
sfd.DefaultExt = ".xlsx"
|
||||||
|
If sfd.ShowDialog Then
|
||||||
|
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||||
|
Case ".xls"
|
||||||
|
vista.ExportToXls(sfd.FileName)
|
||||||
|
Case ".xlsx"
|
||||||
|
vista.ExportToXlsx(sfd.FileName)
|
||||||
|
Case ".csv"
|
||||||
|
vista.ExportToCsv(sfd.FileName)
|
||||||
|
End Select
|
||||||
|
Process.Start(sfd.FileName)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub BtCapturar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Dim sficherojpg = tsl5.Utilidades.ObtieneFicheroAleatorio(System.IO.Path.GetTempPath, "jpg")
|
||||||
|
IO.File.WriteAllBytes(sficherojpg, Me.apLinea.uc.ObtieneImagen(1, 100))
|
||||||
|
Process.Start(sficherojpg)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
119
Plantillas.vb
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports DevExpress.Mvvm.UI.Interactivity
|
||||||
|
Namespace Plantillas
|
||||||
|
Public Class SendEmailButton
|
||||||
|
Inherits Button
|
||||||
|
Public Sub New()
|
||||||
|
Me.SetDefaultStyleKey(GetType(SendEmailButton))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SetDefaultStyleKey(type As Type)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
Public Class Comun
|
||||||
|
' Public Shared ColorFondo As SolidColorBrush = New SolidColorBrush(Colors.DarkGray)
|
||||||
|
Public Shared ColorTexto As SolidColorBrush = New SolidColorBrush(Colors.DarkGray)
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class Impar
|
||||||
|
Implements IValueConverter
|
||||||
|
|
||||||
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||||
|
Dim rh As DevExpress.Xpf.Data.RowHandle = value
|
||||||
|
Dim valor As Integer = If(rh Is Nothing, 0, rh.Value)
|
||||||
|
Return (valor Mod 2 > 0)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||||
|
Return value
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
|
Public Class DateTimeToTimeSpanConverter
|
||||||
|
Implements IValueConverter
|
||||||
|
|
||||||
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||||
|
If value Is Nothing Then
|
||||||
|
Return Nothing
|
||||||
|
Else
|
||||||
|
Dim ts As TimeSpan = value
|
||||||
|
Dim ahora As DateTime = Now
|
||||||
|
Return New DateTime(ahora.Year, ahora.Month, ahora.Day, ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||||
|
If value Is Nothing Then
|
||||||
|
Return Nothing
|
||||||
|
Else
|
||||||
|
Dim dt As DateTime = value
|
||||||
|
Return dt.TimeOfDay
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
|
Public Class TimeSpanConverter
|
||||||
|
Implements IValueConverter
|
||||||
|
|
||||||
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||||
|
' Try
|
||||||
|
Dim Valor As TimeSpan? = value
|
||||||
|
If Valor.HasValue Then
|
||||||
|
Dim Valors As String = Fix(Math.Abs(Valor.Value.TotalHours)).ToString.PadLeft(2, "0") & ":" & Math.Abs(CInt(Valor.Value.Minutes)).ToString.PadLeft(2, "0")
|
||||||
|
If Valor.Value.Ticks < 0 Then
|
||||||
|
Valors = "-" & Valors
|
||||||
|
End If
|
||||||
|
Return Valors
|
||||||
|
Else
|
||||||
|
Return Nothing
|
||||||
|
End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
'Return "error"
|
||||||
|
' End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
||||||
|
Try
|
||||||
|
If value Is Nothing Then
|
||||||
|
Return Nothing
|
||||||
|
Else
|
||||||
|
Dim Valor As String = value
|
||||||
|
If Valor = "" Then
|
||||||
|
Return Nothing
|
||||||
|
Else
|
||||||
|
If Valor.StartsWith("-") Then
|
||||||
|
Dim tsn = New TimeSpan(Math.Abs(CInt(Valor.Split(":")(0))), CInt(Valor.Split(":")(1)), 0)
|
||||||
|
Return -tsn
|
||||||
|
Else
|
||||||
|
Return New TimeSpan(CInt(Valor.Split(":")(0)), CInt(Valor.Split(":")(1)), 0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return DependencyProperty.UnsetValue ' Return New TimeSpan(0)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
|
Public Class TrimTextOnLostFocusBehavior
|
||||||
|
Inherits Behavior(Of TextEdit)
|
||||||
|
|
||||||
|
Protected Overrides Sub OnAttached()
|
||||||
|
MyBase.OnAttached()
|
||||||
|
AddHandler AssociatedObject.IsKeyboardFocusWithinChanged, AddressOf AssociatedObject_IsKeyboardFocusWithinChanged
|
||||||
|
' AssociatedObject.IsKeyboardFocusWithinChanged += AddressOf AssociatedObject_IsKeyboardFocusWithinChanged
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Overrides Sub OnDetaching()
|
||||||
|
MyBase.OnDetaching()
|
||||||
|
RemoveHandler AssociatedObject.IsKeyboardFocusWithinChanged, AddressOf AssociatedObject_IsKeyboardFocusWithinChanged
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AssociatedObject_IsKeyboardFocusWithinChanged(ByVal sender As Object, ByVal e As DependencyPropertyChangedEventArgs)
|
||||||
|
Dim currentValue As String = TryCast(AssociatedObject.EditValue, String)
|
||||||
|
|
||||||
|
If Not CBool(e.NewValue) AndAlso currentValue IsNot Nothing Then
|
||||||
|
AssociatedObject.EditValue = currentValue.Trim()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
487
Plantillas.xaml
Normal file
@@ -0,0 +1,487 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
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:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
|
||||||
|
xmlns:dxspch="http://schemas.devexpress.com/winfx/2008/xaml/spellchecker"
|
||||||
|
xmlns:local="clr-namespace:tsWPF.Plantillas" >
|
||||||
|
|
||||||
|
|
||||||
|
<dx:FormatStringConverter x:Key="FormatStringConverter" FormatString="D" />
|
||||||
|
<dx:ImageDataConverter x:Key="ImageDataConverter" />
|
||||||
|
<local:DateTimeToTimeSpanConverter x:Key="DateTimeToTimeSpanConverter" />
|
||||||
|
<local:TimeSpanConverter x:Key="TimeSpanConverter" />
|
||||||
|
<local:Impar x:Key="Impar" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Style x:Key="tsStyle" TargetType="{x:Type dxe:TextEdit}" >
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsReadOnly" Value="true">
|
||||||
|
<Setter Property="Foreground" Value="DimGray" />
|
||||||
|
<Setter Property="FontStyle" Value="Italic" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
<Setter Property="dxmvvm:Interaction.BehaviorsTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<DataTemplate>
|
||||||
|
<ContentControl>
|
||||||
|
<local:TrimTextOnLostFocusBehavior/>
|
||||||
|
</ContentControl>
|
||||||
|
</DataTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<Setter Property="BorderTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ContentControl}">
|
||||||
|
<Border Name="border" BorderThickness="1.75" Background="White" BorderBrush="Gray">
|
||||||
|
<ContentPresenter />
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<!--<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<Storyboard Storyboard.TargetName="border" TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
|
||||||
|
<ColorAnimation From="OrangeRed" To="LightGray" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>-->
|
||||||
|
<Setter Property="Background" Value="White" TargetName="border" />
|
||||||
|
<Setter Property="BorderBrush" Value="Blue" TargetName="border" />
|
||||||
|
<Setter Property="BorderThickness" Value="1.75" TargetName="border" />
|
||||||
|
<Setter Property="CornerRadius" Value="3" TargetName="border" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!--<ControlTemplate x:Key="tsBorde" TargetType="{x:Type ContentControl}">
|
||||||
|
<Border Name="border" BorderThickness="1" Background="White" BorderBrush="Gray">
|
||||||
|
<ContentPresenter />
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<Storyboard Storyboard.TargetName="border" TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
|
||||||
|
<ColorAnimation From="Red" To="Green" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>
|
||||||
|
<Setter Property="Background" Value="White" TargetName="border" />
|
||||||
|
<Setter Property="BorderBrush" Value="Blue" TargetName="border" />
|
||||||
|
<Setter Property="BorderThickness" Value="1.2" TargetName="border" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>-->
|
||||||
|
<Style x:Key="tsStylecbe" TargetType="{x:Type dxe:ComboBoxEdit}">
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsReadOnly" Value="True">
|
||||||
|
<Setter Property="Opacity" Value="1" />
|
||||||
|
<Setter Property="Foreground" Value="DimGray" />
|
||||||
|
<Setter Property="FontStyle" Value="Italic" />
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
<Setter Property="BorderTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ContentControl}">
|
||||||
|
<Border Name="border" BorderThickness="1.75" Background="White" BorderBrush="Gray">
|
||||||
|
<ContentPresenter />
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<!--<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<Storyboard Storyboard.TargetName="border" TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
|
||||||
|
<ColorAnimation From="OrangeRed" To="LightGray" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>-->
|
||||||
|
<Setter Property="Background" Value="White" TargetName="border" />
|
||||||
|
<Setter Property="BorderBrush" Value="blue" TargetName="border" />
|
||||||
|
<Setter Property="BorderThickness" Value="1.75" TargetName="border" />
|
||||||
|
<Setter Property="CornerRadius" Value="3" TargetName="border" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="tsStylebe" TargetType="{x:Type dxe:ButtonEdit }">
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsReadOnly" Value="true">
|
||||||
|
<Setter Property="Foreground" Value="Black" />
|
||||||
|
<Setter Property="FontStyle" Value="Italic" />
|
||||||
|
<Setter Property="FontWeight" Value="SemiBold" />
|
||||||
|
<Setter Property="Opacity" Value="1" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
<Setter Property="BorderTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ContentControl}">
|
||||||
|
<Border Name="border" BorderThickness="1.75" Background="White" BorderBrush="Gray">
|
||||||
|
<ContentPresenter />
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<!--<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<Storyboard Storyboard.TargetName="border" TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
|
||||||
|
<ColorAnimation From="OrangeRed" To="LightGray" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" />
|
||||||
|
</Storyboard>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>-->
|
||||||
|
<Setter Property="Background" Value="White" TargetName="border" />
|
||||||
|
<Setter Property="BorderBrush" Value="Blue" TargetName="border" />
|
||||||
|
<Setter Property="BorderThickness" Value="1.75" TargetName="border" />
|
||||||
|
<Setter Property="CornerRadius" Value="3" TargetName="border" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="VerDetalleTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent" >
|
||||||
|
<dxe:TextEdit Name="PART_Editor" TextDecorations="Underline" >
|
||||||
|
<dxe:TextEdit.Style >
|
||||||
|
<Style TargetType="{x:Type dxe:TextEdit}" >
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</dxe:TextEdit.Style>
|
||||||
|
</dxe:TextEdit>
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="VerDetalleNullTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent" >
|
||||||
|
<dxe:TextEdit Name="PART_Editor" TextDecorations="Underline" NullText="« NO ASIGNADO »" >
|
||||||
|
<dxe:TextEdit.Style >
|
||||||
|
<Style TargetType="{x:Type dxe:TextEdit}" >
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" />
|
||||||
|
</Trigger>
|
||||||
|
|
||||||
|
</Style.Triggers>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</dxe:TextEdit.Style>
|
||||||
|
</dxe:TextEdit>
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="VerDetalleFechaTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent" >
|
||||||
|
<dxe:DateEdit Name="PART_Editor" TextDecorations="Underline" DisplayFormatString="d" >
|
||||||
|
<dxe:TextEdit.Style >
|
||||||
|
<Style TargetType="{x:Type dxe:DateEdit}" >
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</dxe:TextEdit.Style>
|
||||||
|
</dxe:DateEdit>
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="VerDetalleHoraTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent" >
|
||||||
|
<dxe:DateEdit Name="PART_Editor" TextDecorations="Underline" DisplayFormatString="HH:mm" >
|
||||||
|
<dxe:TextEdit.Style >
|
||||||
|
<Style TargetType="{x:Type dxe:DateEdit}" >
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</dxe:TextEdit.Style>
|
||||||
|
</dxe:DateEdit>
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="VerDetalleCentradoTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent" >
|
||||||
|
<dxe:TextEdit HorizontalAlignment="Center" Name="PART_Editor" TextDecorations="Underline" >
|
||||||
|
<dxe:TextEdit.Style >
|
||||||
|
<Style TargetType="{x:Type dxe:TextEdit}" >
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" />
|
||||||
|
</Trigger>
|
||||||
|
|
||||||
|
</Style.Triggers>
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</dxe:TextEdit.Style>
|
||||||
|
</dxe:TextEdit>
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ImprimirTemplate">
|
||||||
|
<Button Margin="4,0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Cursor="Hand" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
<Button.Content>
|
||||||
|
<Grid Background="Transparent">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="19" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<dxe:TextEdit Name="PART_Editor" Grid.Column="0"/>
|
||||||
|
<Image Source="/tsWPF;component/Images/Icons/print-16x16.png" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="16" Height="16" Grid.Column="1" />
|
||||||
|
</Grid>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="FicheroTemplate">
|
||||||
|
<local:SendEmailButton Margin="4,0" VerticalAlignment="Center" Cursor="Hand" Content="{Binding Value}" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<local:SendEmailButton.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<Grid Background="Transparent">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="19" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Name="text" Margin="0,0,0,1" Text="{TemplateBinding Content}" VerticalAlignment="Center" Grid.Column="0" />
|
||||||
|
<Button Width="16" Height="16" Grid.Column="1" />
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding Path=RowData.IsFocused}" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" TargetName="text" />
|
||||||
|
<!--<Setter Property="Fill" Value="#FF2A6DBD" TargetName="path" />-->
|
||||||
|
</DataTrigger>
|
||||||
|
<MultiDataTrigger>
|
||||||
|
<MultiDataTrigger.Conditions>
|
||||||
|
<Condition Binding="{Binding Path=RowData.IsFocused}" Value="False" />
|
||||||
|
<Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True" />
|
||||||
|
</MultiDataTrigger.Conditions>
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" TargetName="text" />
|
||||||
|
<!--<Setter Property="Fill" Value="#FF5E9AE2" TargetName="path" />-->
|
||||||
|
</MultiDataTrigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</local:SendEmailButton.Template>
|
||||||
|
</local:SendEmailButton>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="eMailTemplate">
|
||||||
|
<local:SendEmailButton Margin="4,0" VerticalAlignment="Center" Cursor="Hand" Content="{Binding Value}" Command="{Binding View.DataControl.ComandoDelegado}" CommandParameter="{Binding}" ClickMode="Press" >
|
||||||
|
<local:SendEmailButton.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<Grid Background="Transparent">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="19" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Name="text" Margin="0,0,0,1" Text="{TemplateBinding Content}" VerticalAlignment="Center" />
|
||||||
|
<!--<Path x:Name="path" Stretch="Fill" Fill="{TemplateBinding Foreground}" Data="F1 M 648,462L 644,466L 643,465L 646,462L 643,459L 644,458L 648,462 Z M 652,462L 648,466L 647,465L 650,462L 647,459L 648,458L 652,462 Z " HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="8" Height="7" Grid.Column="1" />-->
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding Path=RowData.IsFocused}" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="#FF2A6DBD" TargetName="text" />
|
||||||
|
<!--<Setter Property="Fill" Value="#FF2A6DBD" TargetName="path" />-->
|
||||||
|
</DataTrigger>
|
||||||
|
<MultiDataTrigger>
|
||||||
|
<MultiDataTrigger.Conditions>
|
||||||
|
<Condition Binding="{Binding Path=RowData.IsFocused}" Value="False" />
|
||||||
|
<Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True" />
|
||||||
|
</MultiDataTrigger.Conditions>
|
||||||
|
<Setter Property="Foreground" Value="#FF5E9AE2" TargetName="text" />
|
||||||
|
<!--<Setter Property="Fill" Value="#FF5E9AE2" TargetName="path" />-->
|
||||||
|
</MultiDataTrigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</local:SendEmailButton.Template>
|
||||||
|
</local:SendEmailButton>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="DetailCoreTemplate">
|
||||||
|
<dx:MeasurePixelSnapper>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="12" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<dxe:ImageEdit MaxWidth="150" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding Path=Row.Photo, Converter={StaticResource ImageDataConverter}}" Grid.Column="0" Width="{Binding Path=CellData[0].Column.ActualDataWidth}" ShowMenu="False" />
|
||||||
|
<Grid Grid.Column="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="12" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="0" Text="Name:" />
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="1" Text="Position:" />
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="2" Text="Hire Date:" />
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="3" Text="About:" />
|
||||||
|
<TextBlock Grid.Column="0" Grid.Row="4" Text="Address:" />
|
||||||
|
<TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding Row.FirstName}" />
|
||||||
|
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding Row.Title}" />
|
||||||
|
<TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding Row.HireDate, Converter={StaticResource FormatStringConverter}}" />
|
||||||
|
<TextBlock Grid.Column="2" Grid.Row="3" HorizontalAlignment="Left" Text="{Binding Row.Notes}" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Grid.Column="2" Grid.Row="4" Text="{Binding Row.Address}" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</dx:MeasurePixelSnapper>
|
||||||
|
</DataTemplate>
|
||||||
|
<ControlTemplate x:Key="detailContainerTemplate" TargetType="{x:Type ContentControl}">
|
||||||
|
<Border BorderThickness="0,1,0,0" BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="12,12,12,12" Background="{TemplateBinding Background}">
|
||||||
|
<ContentPresenter />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
<DataTemplate x:Key="rowDetailTemplate">
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
|
<dx:MeasurePixelSnapper>
|
||||||
|
<ContentPresenter x:Name="defaultRowPresenter" Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}" />
|
||||||
|
</dx:MeasurePixelSnapper>
|
||||||
|
<dxg:RowDetailContainerControl Template="{StaticResource detailContainerTemplate}" Content="{Binding}" ContentTemplate="{DynamicResource DetailCoreTemplate}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="expandableRowDetailTemplate">
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
|
<dx:MeasurePixelSnapper>
|
||||||
|
<ContentPresenter x:Name="defaultRowPresenter" Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}" />
|
||||||
|
</dx:MeasurePixelSnapper>
|
||||||
|
<dx:DXExpander IsExpanded="{Binding Path=IsSelected}" HorizontalExpand="None" VerticalExpand="FromTopToBottom">
|
||||||
|
<dxg:RowDetailContainerControl Template="{StaticResource detailContainerTemplate}" Content="{Binding}" ContentTemplate="{DynamicResource DetailCoreTemplate}" />
|
||||||
|
</dx:DXExpander>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate x:Key="rowToolTipTemplate">
|
||||||
|
<ContentPresenter Content="{Binding}" ContentTemplate="{Binding View.DefaultDataRowTemplate}">
|
||||||
|
<ToolTipService.InitialShowDelay>10</ToolTipService.InitialShowDelay>
|
||||||
|
<ToolTipService.HasDropShadow>false</ToolTipService.HasDropShadow>
|
||||||
|
<ToolTipService.ToolTip>
|
||||||
|
<ContentControl Content="{Binding}" ContentTemplate="{DynamicResource DetailCoreTemplate}" Tag="Transparent" MaxWidth="600"/>
|
||||||
|
</ToolTipService.ToolTip>
|
||||||
|
</ContentPresenter>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
<Style x:Key="rejillaPijama" TargetType="{x:Type dxg:RowControl}" >
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding RowHandle, Converter={StaticResource Impar}}" Value="True">
|
||||||
|
<Setter Property="Background" Value="Gainsboro" />
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding IsSelected}" Value="True">
|
||||||
|
<Setter Property="Background" Value="LightBlue" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
|
||||||
|
<dxspch:DXSpellChecker x:Key="CorrectorOrtografico"
|
||||||
|
UnderlineColor="#FFAA3A37"
|
||||||
|
IgnoreEmails="True"
|
||||||
|
Culture="es-ES"
|
||||||
|
ShowSpellCheckMenu="True"
|
||||||
|
CheckAsYouType="True"
|
||||||
|
SpellingFormType="Word">
|
||||||
|
<dxspch:DXSpellChecker.Dictionaries>
|
||||||
|
<dxspch:SpellCheckerOpenOfficeDictionary AlphabetUri="pack://siteoforigin:,,,/Diccionarios/Spanish.txt"
|
||||||
|
Culture="es-ES"
|
||||||
|
DictionaryUri="pack://siteoforigin:,,,/Diccionarios/Spanish.dic"
|
||||||
|
GrammarUri="pack://siteoforigin:,,,/Diccionarios/Spanish.aff"/>
|
||||||
|
</dxspch:DXSpellChecker.Dictionaries>
|
||||||
|
<!--endregion #DXSpellChecker-->
|
||||||
|
</dxspch:DXSpellChecker>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
|
|
||||||
1
Properties/Licenses.licx
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DevExpress.Xpf.RichEdit.RichEditControl, DevExpress.Xpf.RichEdit.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
48
SelectionHelper.vb
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports System.Text
|
||||||
|
|
||||||
|
Public Class SelectionHelper(Of KeyType)
|
||||||
|
Dim selectedValues As Dictionary(Of KeyType, Boolean) = New Dictionary(Of KeyType, Boolean)
|
||||||
|
Dim RwHdlSeleccionados As Dictionary(Of KeyType, Boolean) = New Dictionary(Of KeyType, Boolean)
|
||||||
|
Public Function GetIsSelected(ByVal key As KeyType) As Boolean
|
||||||
|
Dim isSelected As Boolean
|
||||||
|
If selectedValues.TryGetValue(key, isSelected) Then
|
||||||
|
Return isSelected
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
Public Sub SetIsSelected(rwh As KeyType, ByVal key As KeyType, ByVal value As Boolean)
|
||||||
|
If value Then
|
||||||
|
selectedValues(key) = value
|
||||||
|
RwHdlSeleccionados(rwh) = value
|
||||||
|
Else
|
||||||
|
selectedValues.Remove(key)
|
||||||
|
RwHdlSeleccionados.Remove(rwh)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Public Function GetSelectedKeys() As List(Of KeyType)
|
||||||
|
Dim list As New List(Of KeyType)()
|
||||||
|
For Each key As KeyType In selectedValues.Keys
|
||||||
|
list.Add(key)
|
||||||
|
Next key
|
||||||
|
Return list
|
||||||
|
End Function
|
||||||
|
Public Function GetSelectedrwh() As List(Of KeyType)
|
||||||
|
Dim list As New List(Of KeyType)()
|
||||||
|
For Each key As KeyType In RwHdlSeleccionados.Keys
|
||||||
|
list.Add(key)
|
||||||
|
Next key
|
||||||
|
Return list
|
||||||
|
End Function
|
||||||
|
Public Function GetSelectedKeysAsString() As String
|
||||||
|
Dim list As List(Of KeyType) = GetSelectedKeys()
|
||||||
|
Dim str As New StringBuilder()
|
||||||
|
For i As Integer = 0 To list.Count - 1
|
||||||
|
str.AppendLine(list(i).ToString())
|
||||||
|
Next i
|
||||||
|
Return str.ToString()
|
||||||
|
End Function
|
||||||
|
Public Function GetSelectionCount() As Integer
|
||||||
|
Return selectedValues.Count
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
376
Utilidades/Docx.vb
Normal file
@@ -0,0 +1,376 @@
|
|||||||
|
Imports System.Data.OleDb
|
||||||
|
|
||||||
|
Imports DevExpress.Office.Services
|
||||||
|
'Imports DevExpress.Web
|
||||||
|
Imports DevExpress.XtraPrinting
|
||||||
|
Imports DevExpress.XtraRichEdit
|
||||||
|
Imports DevExpress.XtraRichEdit.Native
|
||||||
|
Imports DevExpress.XtraRichEdit.Model
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports System.Data
|
||||||
|
|
||||||
|
Namespace Utilidades
|
||||||
|
Public Class Docx
|
||||||
|
Public Shared Function CombinaDocx(tabla As DataTable, Plantilla() As Byte, FormatoPDF As Boolean) As IO.MemoryStream
|
||||||
|
Try
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
'Dim fs As New IO.FileStream("c:\tmp\pruebamerge.docx", IO.FileMode.Create)
|
||||||
|
Utilidades.Docx.Combinar(New IO.MemoryStream(Plantilla), tabla, ms, 0, tabla.Rows.Count, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
ms.Seek(0, IO.SeekOrigin.Begin)
|
||||||
|
'Dim fs As New IO.FileStream("c:\tmp\ms.docx", IO.FileMode.Create)
|
||||||
|
'ms.WriteTo(fs)
|
||||||
|
'fs.Close()
|
||||||
|
If FormatoPDF Then
|
||||||
|
Return Utilidades.Docx.ExportarApdf(ms)
|
||||||
|
Else
|
||||||
|
Return ms
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
Public Shared Function CombinaDocx(tabla As DataTable, Plantilla() As Byte, FormatoPDF As Boolean, Optional NumRegBloque As Integer = 1000) As Byte()
|
||||||
|
Try
|
||||||
|
|
||||||
|
If FormatoPDF Then
|
||||||
|
' Throw New Exception("Exportación a pdf aún no soportada")
|
||||||
|
Dim iNumBloques As Integer = (Int((tabla.Rows.Count - 1) / NumRegBloque)) - 1
|
||||||
|
If tabla.Rows.Count Mod NumRegBloque > 1 Then iNumBloques += 1
|
||||||
|
Dim sp(iNumBloques) As String
|
||||||
|
Dim sd(iNumBloques) As String
|
||||||
|
Dim p As New IO.MemoryStream(Plantilla)
|
||||||
|
Dim iRegIni As Integer
|
||||||
|
Dim iRegFin As Integer
|
||||||
|
For i = 0 To iNumBloques
|
||||||
|
sd(i) = tsl5.Utilidades.ObtieneFicheroAleatorio("docx")
|
||||||
|
sp(i) = tsl5.Utilidades.ObtieneFicheroAleatorio("pdf")
|
||||||
|
Dim fs As New IO.FileStream(sd(i), IO.FileMode.CreateNew, IO.FileAccess.Write)
|
||||||
|
iRegIni = i * NumRegBloque
|
||||||
|
iRegFin = Math.Min((i * NumRegBloque) + NumRegBloque - 1, tabla.Rows.Count - 1)
|
||||||
|
Debug.WriteLine(Now.ToString & " Bloque " & i.ToString & " " & iRegIni & "-" & iRegFin)
|
||||||
|
p = New IO.MemoryStream(Plantilla)
|
||||||
|
Utilidades.Docx.Combinar(p, tabla, fs, iRegIni, iRegFin, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
fs.Close()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Debug.WriteLine(Now.ToString & " Bloque " & i.ToString & " " & iRegIni & "-" & iRegFin & " a pdf")
|
||||||
|
Utilidades.Docx.ExportarApdf(sd(i), sp(i))
|
||||||
|
Debug.WriteLine(Now.ToString & " Fin Bloque " & i.ToString & " " & iRegIni & "-" & iRegFin & " a pdf")
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
' fs.Close()
|
||||||
|
Next
|
||||||
|
Dim msPdfUnidos As New IO.MemoryStream
|
||||||
|
TSpdfUtils.pdf.UnePdfs(sp, msPdfUnidos)
|
||||||
|
msPdfUnidos.Seek(0, 0)
|
||||||
|
Return msPdfUnidos.ToArray
|
||||||
|
Else
|
||||||
|
Dim sdocx As String
|
||||||
|
Do
|
||||||
|
sdocx = tsl5.Utilidades.ObtieneFicheroAleatorio("docx")
|
||||||
|
Loop Until Not IO.File.Exists(sdocx)
|
||||||
|
|
||||||
|
Dim fs As New IO.FileStream(sdocx, IO.FileMode.CreateNew, IO.FileAccess.Write)
|
||||||
|
|
||||||
|
Utilidades.Docx.Combinar(New IO.MemoryStream(Plantilla), tabla, fs, 0, tabla.Rows.Count, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
fs.Close()
|
||||||
|
Return IO.File.ReadAllBytes(sdocx) ' tsl5.Ficheros.FicheroAArrayBytes(sdocx)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Sub Combinar(Plantilla As IO.Stream, Datos As Object, Destino As IO.Stream, PrimerRegistro As Integer, UltimoRegistro As Integer, Formato As DevExpress.XtraRichEdit.DocumentFormat)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(Plantilla, Formato)
|
||||||
|
Dim options = docServer.CreateMailMergeOptions()
|
||||||
|
options.FirstRecordIndex = PrimerRegistro
|
||||||
|
options.LastRecordIndex = UltimoRegistro
|
||||||
|
options.MergeMode = API.Native.MergeMode.NewSection
|
||||||
|
docServer.Options.MailMerge.DataSource = Datos
|
||||||
|
docServer.Options.MailMerge.ViewMergedData = True
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
docServer.Options.MailMerge.ActiveRecord = 0
|
||||||
|
docServer.MailMerge(options, Destino, Formato)
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub ExportarApdf(FicheroOrigen As String, FicheroDestino As String)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(FicheroOrigen, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
'Dim po As New PdfExportOptions
|
||||||
|
'po.Compressed = True
|
||||||
|
'po.PageRange = "1-10"
|
||||||
|
Dim fs As New IO.FileStream(FicheroDestino, IO.FileMode.Create, IO.FileAccess.Write)
|
||||||
|
docServer.ExportToPdf(fs)
|
||||||
|
fs.Close()
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Sub ExportarApdf(Documento As IO.Stream, Destino As IO.Stream)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(Documento, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
'po.PageRange = "1-10"
|
||||||
|
|
||||||
|
docServer.ExportToPdf(Destino, po)
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function UneDocx(ByVal FicheroCabeceraYPie As Byte(), ByVal FicherosAUnir As List(Of Byte()), FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat, FormaUnion As ModoUnion) As IO.MemoryStream
|
||||||
|
Dim ds As New RichEditDocumentServer()
|
||||||
|
ds.LoadDocument(New IO.MemoryStream(FicheroCabeceraYPie), DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
For i = 0 To FicherosAUnir.Count - 1
|
||||||
|
ds.Document.AppendDocumentContent(New IO.MemoryStream(FicherosAUnir(i)))
|
||||||
|
Next
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
ds.SaveDocument(ms, DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
If ms.CanSeek Then ms.Seek(0, 0)
|
||||||
|
Return ms
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function UneDocx(ByVal FicherosAUnir As List(Of Byte()), FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat, FormaUnion As ModoUnion) As IO.MemoryStream
|
||||||
|
Dim targetServer = UneDocx(FicherosAUnir, FormaUnion)
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
targetServer.SaveDocument(ms, FormatoDestino)
|
||||||
|
If ms.CanSeek Then ms.Seek(0, 0)
|
||||||
|
Return ms
|
||||||
|
'If FicherosAUnir.Count = 1 Then
|
||||||
|
' Return New IO.MemoryStream(FicherosAUnir.First)
|
||||||
|
'Else
|
||||||
|
' Dim ds As New RichEditDocumentServer()
|
||||||
|
' ds.LoadDocument(New IO.MemoryStream(FicherosAUnir.First), DocumentFormat.OpenXml)
|
||||||
|
' For i = 1 To FicherosAUnir.Count - 1
|
||||||
|
' ds.Document.AppendDocumentContent(New IO.MemoryStream(FicherosAUnir(i)))
|
||||||
|
' Next
|
||||||
|
' Dim ms As New IO.MemoryStream
|
||||||
|
' ds.SaveDocument(ms, DocumentFormat.OpenXml)
|
||||||
|
' ms.Seek(0, 0)
|
||||||
|
' Return ms
|
||||||
|
'End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Sub UneDocx(ByVal FicherosAUnir As List(Of String), FicheroDestino As String, FormatoDestino As DevExpress.XtraRichEdit.DocumentFormat, FormaUnion As ModoUnion)
|
||||||
|
Dim targetServer = UneDocx(FicherosAUnir, FormaUnion)
|
||||||
|
targetServer.SaveDocument(FicheroDestino, FormatoDestino)
|
||||||
|
End Sub
|
||||||
|
Public Shared Function UneDocx(ByVal Ficheros As List(Of String), FormaUnion As ModoUnion) As DevExpress.XtraRichEdit.API.Native.Document
|
||||||
|
Dim targetServer As New RichEditDocumentServer()
|
||||||
|
Dim sourceServer As New RichEditDocumentServer()
|
||||||
|
Dim targetDoc As DevExpress.XtraRichEdit.API.Native.Document = targetServer.Document
|
||||||
|
Dim sourceDoc As DevExpress.XtraRichEdit.API.Native.Document = sourceServer.Document
|
||||||
|
|
||||||
|
For i As Integer = 0 To Ficheros.Count - 1
|
||||||
|
sourceServer.LoadDocument(Ficheros(i))
|
||||||
|
|
||||||
|
targetDoc.Sections(targetDoc.Sections.Count - 1).UnlinkHeaderFromPrevious()
|
||||||
|
targetDoc.Sections(targetDoc.Sections.Count - 1).UnlinkFooterFromPrevious()
|
||||||
|
|
||||||
|
Append(sourceDoc, targetDoc, (i = 0 And FormaUnion = ModoUnion.CABECERA_Y_PIE_SOLO_PRIMER_FICHERO Or FormaUnion = ModoUnion.CABECERA_Y_PIE_EN_TODOS_LOS_FICHEROS))
|
||||||
|
|
||||||
|
If i = Ficheros.Count - 1 Then
|
||||||
|
Return targetDoc
|
||||||
|
End If
|
||||||
|
|
||||||
|
targetDoc.AppendSection()
|
||||||
|
Next i
|
||||||
|
|
||||||
|
Return targetDoc
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Enum ModoUnion As Integer
|
||||||
|
CABECERA_Y_PIE_EN_TODOS_LOS_FICHEROS = 0
|
||||||
|
CABECERA_Y_PIE_SOLO_PRIMER_FICHERO = 1
|
||||||
|
SIN_CABECERA_NI_PIE = 2
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Public Shared Function UneDocx(ByVal Ficheros As List(Of Byte()), FormaUnion As ModoUnion) As DevExpress.XtraRichEdit.API.Native.Document
|
||||||
|
Dim targetServer As New RichEditDocumentServer()
|
||||||
|
Dim sourceServer As New RichEditDocumentServer()
|
||||||
|
Dim targetDoc As DevExpress.XtraRichEdit.API.Native.Document = targetServer.Document
|
||||||
|
Dim sourceDoc As DevExpress.XtraRichEdit.API.Native.Document = sourceServer.Document
|
||||||
|
|
||||||
|
For i As Integer = 0 To Ficheros.Count - 1
|
||||||
|
sourceServer.LoadDocument(New IO.MemoryStream(Ficheros(i)))
|
||||||
|
|
||||||
|
targetDoc.Sections(targetDoc.Sections.Count - 1).UnlinkHeaderFromPrevious()
|
||||||
|
targetDoc.Sections(targetDoc.Sections.Count - 1).UnlinkFooterFromPrevious()
|
||||||
|
|
||||||
|
Append(sourceDoc, targetDoc, (i = 0 And FormaUnion = ModoUnion.CABECERA_Y_PIE_SOLO_PRIMER_FICHERO Or FormaUnion = ModoUnion.CABECERA_Y_PIE_EN_TODOS_LOS_FICHEROS))
|
||||||
|
|
||||||
|
If i = Ficheros.Count - 1 Then
|
||||||
|
Return targetDoc
|
||||||
|
End If
|
||||||
|
|
||||||
|
targetDoc.AppendSection()
|
||||||
|
Next i
|
||||||
|
|
||||||
|
Return targetDoc
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Shared Sub Append(ByVal source As DevExpress.XtraRichEdit.API.Native.Document, ByVal target As DevExpress.XtraRichEdit.API.Native.Document, AñadirCabecerasYPies As Boolean)
|
||||||
|
Dim lastSectionIndexBeforeAppending As Integer = target.Sections.Count - 1
|
||||||
|
Dim sourceSectionCount As Integer = source.Sections.Count
|
||||||
|
|
||||||
|
'target.AppendRtfText(source.RtfText)
|
||||||
|
|
||||||
|
Dim posicion = target.CreatePosition(target.Range.End.ToInt - 1)
|
||||||
|
|
||||||
|
' Dim posicion = target.CreatePosition(target.Paragraphs.Last.)
|
||||||
|
'target.InsertRtfText(posicion, source.RtfText)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
target.DifferentOddAndEvenPages = source.DifferentOddAndEvenPages
|
||||||
|
If AñadirCabecerasYPies Then
|
||||||
|
For i As Integer = 0 To sourceSectionCount - 1
|
||||||
|
Dim sourceSection As DevExpress.XtraRichEdit.API.Native.Section = source.Sections(i)
|
||||||
|
Dim targetSection As DevExpress.XtraRichEdit.API.Native.Section = target.Sections(lastSectionIndexBeforeAppending + i)
|
||||||
|
|
||||||
|
' Copy header/footer
|
||||||
|
AppendHeader(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.Odd)
|
||||||
|
AppendFooter(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.Odd)
|
||||||
|
AppendHeader(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.Even)
|
||||||
|
AppendFooter(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.Even)
|
||||||
|
AppendHeader(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.First)
|
||||||
|
AppendFooter(sourceSection, targetSection, DevExpress.XtraRichEdit.API.Native.HeaderFooterType.First)
|
||||||
|
Next i
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Shared Sub AppendHeader(ByVal sourceSection As DevExpress.XtraRichEdit.API.Native.Section, ByVal targetSection As DevExpress.XtraRichEdit.API.Native.Section, ByVal headerFooterType As DevExpress.XtraRichEdit.API.Native.HeaderFooterType)
|
||||||
|
If Not sourceSection.HasHeader(headerFooterType) Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim source As DevExpress.XtraRichEdit.API.Native.SubDocument = sourceSection.BeginUpdateHeader(headerFooterType)
|
||||||
|
Dim target As DevExpress.XtraRichEdit.API.Native.SubDocument = targetSection.BeginUpdateHeader(headerFooterType)
|
||||||
|
target.Delete(target.Range)
|
||||||
|
target.InsertDocumentContent(target.Range.Start, source.Range, DevExpress.XtraRichEdit.API.Native.InsertOptions.KeepSourceFormatting)
|
||||||
|
|
||||||
|
' Delete empty paragraphs
|
||||||
|
Dim emptyParagraph As DevExpress.XtraRichEdit.API.Native.DocumentRange = target.CreateRange(target.Range.End.ToInt() - 1, 1)
|
||||||
|
target.Delete(emptyParagraph)
|
||||||
|
|
||||||
|
sourceSection.EndUpdateHeader(source)
|
||||||
|
targetSection.EndUpdateHeader(target)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Shared Sub AppendFooter(ByVal sourceSection As DevExpress.XtraRichEdit.API.Native.Section, ByVal targetSection As DevExpress.XtraRichEdit.API.Native.Section, ByVal headerFooterType As DevExpress.XtraRichEdit.API.Native.HeaderFooterType)
|
||||||
|
If Not sourceSection.HasFooter(headerFooterType) Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim source As DevExpress.XtraRichEdit.API.Native.SubDocument = sourceSection.BeginUpdateFooter(headerFooterType)
|
||||||
|
Dim target As DevExpress.XtraRichEdit.API.Native.SubDocument = targetSection.BeginUpdateFooter(headerFooterType)
|
||||||
|
target.Delete(target.Range)
|
||||||
|
target.InsertDocumentContent(target.Range.Start, source.Range, DevExpress.XtraRichEdit.API.Native.InsertOptions.KeepSourceFormatting)
|
||||||
|
|
||||||
|
' Delete empty paragraphs
|
||||||
|
Dim emptyParagraph As DevExpress.XtraRichEdit.API.Native.DocumentRange = target.CreateRange(target.Range.End.ToInt() - 1, 1)
|
||||||
|
target.Delete(emptyParagraph)
|
||||||
|
|
||||||
|
sourceSection.EndUpdateFooter(source)
|
||||||
|
targetSection.EndUpdateFooter(target)
|
||||||
|
End Sub
|
||||||
|
Public Shared Function CombinaDocxStream(Datos As Object, Plantilla() As Byte, PrimerRegistro As Integer, UltimoRegistro As Integer, FormatoPDF As Boolean) As IO.Stream
|
||||||
|
Try
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
'Dim fs As New IO.FileStream("c:\tmp\pruebamerge.docx", IO.FileMode.Create)
|
||||||
|
Utilidades.Docx.Combinar(New IO.MemoryStream(Plantilla), Datos, ms, PrimerRegistro, UltimoRegistro, Global.DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
If ms.CanSeek Then ms.Seek(0, IO.SeekOrigin.Begin)
|
||||||
|
'Dim fs As New IO.FileStream("c:\tmp\ms.docx", IO.FileMode.Create)
|
||||||
|
'ms.WriteTo(fs)
|
||||||
|
'fs.Close()
|
||||||
|
If FormatoPDF Then
|
||||||
|
Return Utilidades.Docx.ExportarApdf(ms)
|
||||||
|
Else
|
||||||
|
Return ms
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
Public Shared Function ExportarApdf(Docx As IO.Stream) As IO.MemoryStream
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(Docx, Global.DevExpress.XtraRichEdit.DocumentFormat.OpenXml)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
docServer.ExportToPdf(ms)
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
'Dim fs As New IO.FileStream("c:\tmp\pruebaexportada.pdf", IO.FileMode.Create)
|
||||||
|
'docServer.ExportToPdf(fs, po)
|
||||||
|
' fs.Close()
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Return ms
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
|
Public Class Pdf
|
||||||
|
Public Shared Sub DocumentoApdf(DocumentoOrigen As String, TipoDocumentoOrigen As DevExpress.XtraRichEdit.DocumentFormat, PdfDestino As String)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
Dim fsOrigen As New IO.FileStream(DocumentoOrigen, IO.FileMode.Open, IO.FileAccess.Read)
|
||||||
|
Dim fsDestino As New IO.FileStream(PdfDestino, IO.FileMode.Create, IO.FileAccess.ReadWrite)
|
||||||
|
DocumentoApdf(fsOrigen, TipoDocumentoOrigen, fsDestino)
|
||||||
|
fsDestino.Close()
|
||||||
|
fsOrigen.Close()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Public Shared Sub DocumentoApdf(DocumentoOrigen As IO.Stream, TipoDocumentoOrigen As DevExpress.XtraRichEdit.DocumentFormat, PdfDestino As IO.Stream)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(DocumentoOrigen, TipoDocumentoOrigen)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
|
||||||
|
docServer.ExportToPdf(PdfDestino, po)
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
308
Utilidades/Utilidades.vb
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
Imports DevExpress.Xpf.LayoutControl
|
||||||
|
Imports System.Data
|
||||||
|
Imports System.Globalization
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Reflection
|
||||||
|
|
||||||
|
Namespace Utilidades
|
||||||
|
Public Class Varias
|
||||||
|
|
||||||
|
Public Shared Function DatatableAListaDeHahstable(Tabla As DataTable) As List(Of Hashtable)
|
||||||
|
Dim lht As New List(Of Hashtable)
|
||||||
|
For i = 0 To Tabla.Rows.Count - 1
|
||||||
|
Dim ht As New Hashtable
|
||||||
|
For j = 0 To Tabla.Columns.Count - 1
|
||||||
|
ht.Add(Tabla.Columns(j).ColumnName, Tabla.Rows(i)(j).ToString)
|
||||||
|
Next
|
||||||
|
lht.Add(ht)
|
||||||
|
Next
|
||||||
|
Return lht
|
||||||
|
End Function
|
||||||
|
Public Shared Sub EstableceSoloLecturaRecursivo(Objeto As Object, SoloLectura As Boolean)
|
||||||
|
For Each hijo In Objeto.Children
|
||||||
|
If hijo.GetType Is GetType(Control) Then
|
||||||
|
hijo.isEnabled = Not SoloLectura
|
||||||
|
ElseIf hijo.GetType Is GetType(LayoutGroup) Or hijo.GetType Is GetType(Grid) Then
|
||||||
|
EstableceSoloLecturaRecursivo(hijo, SoloLectura)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Function ByteArraytoBitmapImage(byteArray As [Byte]()) As BitmapImage
|
||||||
|
Dim stream As New MemoryStream(byteArray)
|
||||||
|
Dim bitmapImage As New BitmapImage()
|
||||||
|
bitmapImage.StreamSource = stream
|
||||||
|
Return bitmapImage
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function StreamToBitmapImage(st As Stream) As BitmapImage
|
||||||
|
Dim bitmapImage As New BitmapImage()
|
||||||
|
bitmapImage.StreamSource = st
|
||||||
|
Return bitmapImage
|
||||||
|
End Function
|
||||||
|
Public Shared Function PrevInstance() As Boolean
|
||||||
|
Try
|
||||||
|
If UBound(Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function GeneraExpresionBusquedaNoNulos(TextoAbuscar As String, CamposBusquedaNumericos() As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaAlfabeticosPorIgualdad() As String, Optional CamposBusquedaAlfabeticosPorComienzo() As String = Nothing, Optional TipoBusqueda As String = "and") As String
|
||||||
|
Dim Expresion As String = ""
|
||||||
|
If TipoBusqueda = "and" Then
|
||||||
|
TipoBusqueda = "&&"
|
||||||
|
Else
|
||||||
|
TipoBusqueda = "||"
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Palabras = TextoAbuscar.Trim.Split(" ").Where(Function(x) x.Trim <> "")
|
||||||
|
If CamposBusquedaNumericos IsNot Nothing Then
|
||||||
|
For Each palabra In Palabras
|
||||||
|
Dim Numero = palabra.Replace(",", ".")
|
||||||
|
If CamposBusquedaNumericos.Count > 0 AndAlso Double.TryParse(Numero, Nothing) Then
|
||||||
|
For Each c In CamposBusquedaNumericos
|
||||||
|
Expresion &= " || " & "(" & c & " !=null && " & c & "=" & Numero.TrimEnd(".") & ")"
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticos IsNot Nothing Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticos
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
palabra = palabra.Replace(Chr(34), """" & """")
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & "(" & c & " != null && " & c & ".Contains(" & Chr(34) & palabra & Chr(34) & "))"
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(2 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " || " & ExpresionParcial
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorIgualdad
|
||||||
|
ExpresionParcial &= " || " & "(" & c & " != null && " & c & "=" & Chr(34) & palabra & Chr(34) & ")"
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(2 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " || " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorComienzo
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & "(" & c & " != null && " & c & ".StartsWith(" & Chr(34) & palabra & Chr(34) & "))"
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(2 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " || " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If Expresion <> "" Then
|
||||||
|
Return Expresion.Substring(4)
|
||||||
|
Else
|
||||||
|
Return ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Public Shared Function GeneraExpresionBusqueda(TextoAbuscar As String, CamposBusquedaNumericos() As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaAlfabeticosPorIgualdad() As String, Optional CamposBusquedaAlfabeticosPorComienzo() As String = Nothing, Optional TipoBusqueda As String = "and") As String
|
||||||
|
Dim Expresion As String = ""
|
||||||
|
Dim Palabras = TextoAbuscar.Trim.Split(" ").Where(Function(x) x.Trim <> "")
|
||||||
|
If CamposBusquedaNumericos IsNot Nothing Then
|
||||||
|
For Each palabra In Palabras
|
||||||
|
Dim Numero = palabra.Replace(",", ".")
|
||||||
|
If CamposBusquedaNumericos.Count > 0 AndAlso Double.TryParse(Numero, Nothing) Then
|
||||||
|
For Each c In CamposBusquedaNumericos
|
||||||
|
Expresion &= " or " & c & "=" & Numero.TrimEnd(".")
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticos IsNot Nothing Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticos
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
palabra = palabra.Replace(Chr(34), """" & """")
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & c & ".Contains(" & Chr(34) & palabra & Chr(34) & ")"
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(2 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorIgualdad
|
||||||
|
ExpresionParcial &= " or " & c & "=" & Chr(34) & palabra & Chr(34)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(4) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorComienzo
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & c & ".StartsWith(" & Chr(34) & palabra & Chr(34) & ")"
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(1 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If Expresion <> "" Then
|
||||||
|
Return Expresion.Substring(4)
|
||||||
|
Else
|
||||||
|
Return ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function GeneraExpresionBusqueda(TextoAbuscar As String, CamposBusquedaIntegers() As String, CamposBusquedaDoubles() As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaAlfabeticosPorIgualdad() As String, ByRef Parametros() As Object, Optional CamposBusquedaAlfabeticosPorComienzo() As String = Nothing, Optional TipoBusqueda As String = "and") As String
|
||||||
|
Dim Expresion As String = ""
|
||||||
|
Dim Palabras = TextoAbuscar.Trim.Split(" ").Where(Function(x) x.Trim <> "")
|
||||||
|
Dim ContNum As Integer = 0
|
||||||
|
If CamposBusquedaIntegers IsNot Nothing Then
|
||||||
|
For Each palabra In Palabras
|
||||||
|
Dim Numero = palabra.Replace(",", ".")
|
||||||
|
If Numero.Contains(".") = False AndAlso CamposBusquedaIntegers.Count > 0 AndAlso Integer.TryParse(Numero, Nothing) Then
|
||||||
|
For Each c In CamposBusquedaIntegers
|
||||||
|
Expresion &= " or " & c & "=@" & ContNum.ToString
|
||||||
|
ReDim Preserve Parametros(ContNum)
|
||||||
|
Parametros(ContNum) = Integer.Parse(Numero, CultureInfo.InvariantCulture)
|
||||||
|
ContNum += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CamposBusquedaDoubles IsNot Nothing Then
|
||||||
|
For Each palabra In Palabras
|
||||||
|
Dim Numero = palabra.Replace(",", ".")
|
||||||
|
If CamposBusquedaDoubles.Count > 0 AndAlso Double.TryParse(Numero, Nothing) Then
|
||||||
|
For Each c In CamposBusquedaDoubles
|
||||||
|
Expresion &= " or " & c & "=@" & ContNum.ToString
|
||||||
|
ReDim Preserve Parametros(ContNum)
|
||||||
|
Parametros(ContNum) = Double.Parse(Numero, CultureInfo.InvariantCulture)
|
||||||
|
ContNum += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticos IsNot Nothing Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticos
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
palabra = palabra.Replace(Chr(34), "")
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & c & ".Contains(" & "@" & ContNum.ToString & ")"
|
||||||
|
ReDim Preserve Parametros(ContNum)
|
||||||
|
Parametros(ContNum) = palabra
|
||||||
|
ContNum += 1
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(2 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorIgualdad.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorIgualdad
|
||||||
|
ExpresionParcial &= " or " & c & "=" & "@" & ContNum.ToString
|
||||||
|
ReDim Preserve Parametros(ContNum)
|
||||||
|
Parametros(ContNum) = palabra
|
||||||
|
ContNum += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(4) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo IsNot Nothing Then
|
||||||
|
Dim ExpresionParcial As String = ""
|
||||||
|
For Each palabra In Palabras
|
||||||
|
If CamposBusquedaAlfabeticosPorComienzo.Count > 0 Then
|
||||||
|
For Each c In CamposBusquedaAlfabeticosPorComienzo
|
||||||
|
ExpresionParcial &= " " & TipoBusqueda & " " & c & ".StartsWith(" & "@" & ContNum.ToString & ")"
|
||||||
|
ReDim Preserve Parametros(ContNum)
|
||||||
|
Parametros(ContNum) = palabra
|
||||||
|
ContNum += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ExpresionParcial = "(" & ExpresionParcial.Substring(1 + TipoBusqueda.Length) & ")"
|
||||||
|
Expresion &= " or " & ExpresionParcial
|
||||||
|
End If
|
||||||
|
If Expresion <> "" Then
|
||||||
|
Return Expresion.Substring(4)
|
||||||
|
Else
|
||||||
|
Return ""
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function IEnumerableAExcelAgrupado(Of t)(Datos As List(Of t)) As Byte()
|
||||||
|
Dim ngc As New tsGridControl
|
||||||
|
ngc.View = New tsTableView()
|
||||||
|
DirectCast(ngc.View, tsTableView).AutoWidth = True
|
||||||
|
Dim lc = Datos.GetType.GetProperties.ToList
|
||||||
|
For Each oc In lc
|
||||||
|
Dim gc As New tsGridColumn()
|
||||||
|
gc.FieldName = oc.Name
|
||||||
|
gc.Header = oc.Name
|
||||||
|
ngc.Columns.Add(gc)
|
||||||
|
Next
|
||||||
|
ngc.ItemsSource = Datos
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
ngc.View.ExportToXlsx(ms)
|
||||||
|
ms.Position = 0
|
||||||
|
Return ms.ToArray
|
||||||
|
End Function
|
||||||
|
Public Shared Sub IEnumerableAExcel(Of t)(Datos As IEnumerable(Of t), Fichero As String)
|
||||||
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
|
wb.AddWorksheet(dt)
|
||||||
|
wb.SaveAs(Fichero)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Sub IEnumerableAExcel(Of t)(Datos As List(Of t), Fichero As String)
|
||||||
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
|
wb.AddWorksheet(dt)
|
||||||
|
wb.SaveAs(Fichero)
|
||||||
|
End Sub
|
||||||
|
Public Shared Function IEnumerableAExcel(Of t)(Datos As List(Of t)) As Byte()
|
||||||
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(Datos)
|
||||||
|
wb.AddWorksheet(dt)
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
wb.SaveAs(ms)
|
||||||
|
ms.Position = 0
|
||||||
|
Return ms.ToArray
|
||||||
|
End Function
|
||||||
|
Public Shared Function ListaIEnumerableAExcel(Of t)(Datos As List(Of List(Of t)), NombreTablas As List(Of String)) As Byte()
|
||||||
|
Dim wb As New ClosedXML.Excel.XLWorkbook
|
||||||
|
For i = 0 To Datos.Count - 1
|
||||||
|
Dim tabla = Datos(i)
|
||||||
|
Dim dt = tsl5.Extensiones.IEnumerableExtensions.CopyToDataTable(Of t)(tabla)
|
||||||
|
wb.AddWorksheet(dt, NombreTablas(i))
|
||||||
|
Next
|
||||||
|
Dim ms As New MemoryStream
|
||||||
|
wb.SaveAs(ms)
|
||||||
|
ms.Position = 0
|
||||||
|
Return ms.ToArray
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
94
Utilidades/odt.vb
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
Imports System.Data.OleDb
|
||||||
|
Imports MySql.Data.MySqlClient
|
||||||
|
Imports DevExpress.Office.Services
|
||||||
|
'Imports DevExpress.Web
|
||||||
|
Imports DevExpress.XtraPrinting
|
||||||
|
Imports DevExpress.XtraRichEdit
|
||||||
|
Imports DevExpress.XtraRichEdit.Native
|
||||||
|
Imports DevExpress.XtraRichEdit.Model
|
||||||
|
Imports DevExpress.XtraReports.UI
|
||||||
|
Imports System.Data
|
||||||
|
|
||||||
|
Namespace Utilidades
|
||||||
|
Public Class odt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Sub ExportarApdf(FicheroOrigen As String, FicheroDestino As String)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(FicheroOrigen, DevExpress.XtraRichEdit.DocumentFormat.OpenDocument)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim fs As New IO.FileStream(FicheroDestino, IO.FileMode.Create, IO.FileAccess.Write)
|
||||||
|
docServer.ExportToPdf(fs)
|
||||||
|
fs.Close()
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Public Shared Function ExportarApdf(FicheroOrigen As String) As Byte()
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(FicheroOrigen, DevExpress.XtraRichEdit.DocumentFormat.OpenDocument)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
docServer.ExportToPdf(ms, po)
|
||||||
|
If ms.CanSeek Then ms.Seek(0, 0)
|
||||||
|
Dim b = ms.ToArray
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Return b
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
Public Shared Sub ExportarApdf(Documento As IO.Stream, Destino As IO.Stream)
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(Documento, DevExpress.XtraRichEdit.DocumentFormat.OpenDocument)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
'po.PageRange = "1-10"
|
||||||
|
|
||||||
|
docServer.ExportToPdf(Destino, po)
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Public Shared Function ExportarApdf(Documento As IO.Stream) As Byte()
|
||||||
|
Try
|
||||||
|
Dim docServer As New RichEditDocumentServer
|
||||||
|
docServer.LoadDocument(Documento, DevExpress.XtraRichEdit.DocumentFormat.OpenDocument)
|
||||||
|
docServer.Options.Export.Html.EmbedImages = True
|
||||||
|
|
||||||
|
Dim po As New PdfExportOptions
|
||||||
|
po.Compressed = True
|
||||||
|
'po.PageRange = "1-10"
|
||||||
|
|
||||||
|
Dim ms As New IO.MemoryStream
|
||||||
|
docServer.ExportToPdf(ms, po)
|
||||||
|
docServer.Dispose()
|
||||||
|
GC.Collect()
|
||||||
|
GC.WaitForPendingFinalizers()
|
||||||
|
Return ms.ToArray
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
|
End Namespace
|
||||||
82
VentanaErrores.xaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<Window
|
||||||
|
x:Class="VentanaErr"
|
||||||
|
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:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:my="clr-namespace:tsWPF"
|
||||||
|
Title="Errores" Width="705" SizeToContent="Height"
|
||||||
|
WindowStyle="None" AllowsTransparency="True" Background="Transparent" d:DesignHeight="181" ShowInTaskbar="False" Topmost="True" IsTabStop="False" ShowActivated="False">
|
||||||
|
<Window.Resources>
|
||||||
|
<Storyboard x:Key="Ocultar">
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
<Storyboard x:Key="Mostrar">
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
<Storyboard x:Key="MostrarYOcultar">
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:10" Value="1"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid RenderTransformOrigin="0,1" >
|
||||||
|
<!-- Notification area -->
|
||||||
|
<Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
|
||||||
|
<Grid>
|
||||||
|
<my:tsGridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||||
|
<my:tsGridControl.Columns>
|
||||||
|
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores"/>
|
||||||
|
</my:tsGridControl.Columns>
|
||||||
|
<!--<my:tsGridControl.Columns>
|
||||||
|
<dxg:GridColumn Name="GridColumn1" FieldName="ErrorContent"/>
|
||||||
|
</my:tsGridControl.Columns>-->
|
||||||
|
<my:tsGridControl.View>
|
||||||
|
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||||
|
</my:tsGridControl.View>
|
||||||
|
</my:tsGridControl>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<!-- Animation -->
|
||||||
|
<Grid.Triggers>
|
||||||
|
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:5" Value="1"/>
|
||||||
|
<SplineDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</Grid.Triggers>
|
||||||
|
|
||||||
|
<Grid.RenderTransform>
|
||||||
|
<ScaleTransform ScaleY="1" />
|
||||||
|
</Grid.RenderTransform>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
34
VentanaErrores.xaml.vb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
Imports System.Windows.Media.Animation
|
||||||
|
|
||||||
|
Public Class VentanaErr
|
||||||
|
Friend propietario As ContenedorCabLin
|
||||||
|
|
||||||
|
Public Sub MostrarVentana()
|
||||||
|
RellenaDatos()
|
||||||
|
Dim st As Storyboard = DirectCast(FindResource("Mostrar"), Storyboard)
|
||||||
|
st.Begin(Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub OcultarVentana()
|
||||||
|
Dim st As Storyboard = DirectCast(FindResource("Ocultar"), Storyboard)
|
||||||
|
st.Begin(Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub MostrarYOcultarVentana()
|
||||||
|
RellenaDatos()
|
||||||
|
Dim st As Storyboard = DirectCast(FindResource("MostrarYOcultar"), Storyboard)
|
||||||
|
st.Begin(Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RellenaDatos()
|
||||||
|
Dim ecvs As New CollectionViewSource
|
||||||
|
Dim le = (From er In propietario.Aplicacion.ErroresValidacion.Errores Select er.ErrorContent).ToList
|
||||||
|
Me.DataContext = le
|
||||||
|
Dim w = Window.GetWindow(propietario)
|
||||||
|
Me.Left = w.ActualWidth - Me.ActualWidth + w.Left - 30
|
||||||
|
Me.Top = w.ActualHeight - Me.ActualHeight + w.Top - 70
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
16
VentanaMensajes.xaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<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:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
|
||||||
|
x:Class="VentanaMensajes"
|
||||||
|
Height="700" Width="900"
|
||||||
|
WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen"
|
||||||
|
>
|
||||||
|
<Grid x:Name="Grid_Content">
|
||||||
|
<Label x:FieldModifier="public" x:Name="Titulo" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,20,0,0" FontWeight="Bold" Height="Auto" RenderTransformOrigin="0.4,3" >
|
||||||
|
</Label>
|
||||||
|
<dxre:RichEditControl x:FieldModifier="public" x:Name="Texto" Margin="10,68,10,0" ActiveViewType="Simple" FontFamily="Courier New" ReadOnly="True"/>
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||
3
VentanaMensajes.xaml.vb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Public Class VentanaMensajes
|
||||||
|
|
||||||
|
End Class
|
||||||
58
VentanaProgreso.xaml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<dx:DXWindow
|
||||||
|
x:Class="VentanaProgreso"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
ContentRendered="Window_ContentRendered"
|
||||||
|
Title="Progreso" Height="209" Width="833" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow">
|
||||||
|
<Window.Resources>
|
||||||
|
<dx:FormatStringConverter x:Key="FormatStringConverter" FormatString="0" />
|
||||||
|
<ControlTemplate x:Key="InplaceProgressBarTemplate" TargetType="{x:Type ProgressBar}">
|
||||||
|
<Grid>
|
||||||
|
<Border Name="PART_Track">
|
||||||
|
<Border Name="PART_Indicator" HorizontalAlignment="Left" Background="#FFBA4F8C" Opacity="0.5" />
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="#1F000000" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FFFFFFFF" CornerRadius="2,2,2,2">
|
||||||
|
<TextBlock TextAlignment="Center" TextWrapping="NoWrap" Margin="5,-2,5,-2" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource FormatStringConverter}}" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
<DataTemplate x:Key="progressTemplate">
|
||||||
|
<ProgressBar Margin="2,1,2,1" Minimum="0" Maximum="100" DataContext="{Binding Path=Data, ConverterParameter=AnimationElement}" Value="{Binding Path=Progreso}" Template="{StaticResource InplaceProgressBarTemplate}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="4" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<dxg:GridControl x:Name="gc" Grid.Row="0" >
|
||||||
|
<dxg:GridControl.Columns>
|
||||||
|
<dxg:GridColumn FieldName="FechaInicio" Header="Hora Inicio" >
|
||||||
|
<dxg:GridColumn.EditSettings>
|
||||||
|
<dxe:TextEditSettings MaskType="DateTime" Mask="dd-MMMM-yyyy HH:mm:ss"/>
|
||||||
|
</dxg:GridColumn.EditSettings>
|
||||||
|
</dxg:GridColumn>
|
||||||
|
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" IsSmart="True" Width="530"/>
|
||||||
|
<dxg:GridColumn FieldName="Progreso" Width="100" CellTemplate="{StaticResource progressTemplate}" />
|
||||||
|
</dxg:GridControl.Columns>
|
||||||
|
<dxg:GridControl.View>
|
||||||
|
<dxg:TableView x:Name="tv" ShowTotalSummary="False" ShowGroupPanel="False" AllowFilterEditor="False" AllowEditing="False" AllowColumnFiltering="False" />
|
||||||
|
</dxg:GridControl.View>
|
||||||
|
</dxg:GridControl>
|
||||||
|
<Grid Grid.Row="2" Height="20">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0"><Run Text="Progreso:"/></TextBlock>
|
||||||
|
<dxe:ProgressBarEdit x:FieldModifier="Public" x:Name="ProgresoGeneral" Minimum="0" Maximum="100" EditValue="0" ContentDisplayMode="Value" Grid.Column="1">
|
||||||
|
</dxe:ProgressBarEdit>
|
||||||
|
<Button x:Name="btCancelar" x:FieldModifier="Public" Grid.Column="2" Padding="10,0,10,0" Content="Cancelar" Click="btCancelar_Click" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||
142
VentanaProgreso.xaml.vb
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
Imports System.ComponentModel
|
||||||
|
Imports System.Threading
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
|
||||||
|
Public Class VentanaProgreso
|
||||||
|
Public IVentana As IVentanaProgreso
|
||||||
|
Private AutoResetEvent As New AutoResetEvent(False)
|
||||||
|
Dim worker As New BackgroundWorker
|
||||||
|
Public Cancelar As Boolean
|
||||||
|
Dim TareasProgreso As New List(Of TareaProgreso)
|
||||||
|
Public MensajeError As String
|
||||||
|
'Private _UltimaLinea As TareaProgreso
|
||||||
|
'Property UltimaLinea As TareaProgreso
|
||||||
|
' Get
|
||||||
|
' Return _UltimaLinea
|
||||||
|
' End Get
|
||||||
|
' Set(value As TareaProgreso)
|
||||||
|
' _UltimaLinea = value
|
||||||
|
' RaisePropertyChanged("UltimaLinea")
|
||||||
|
' End Set
|
||||||
|
'End Property
|
||||||
|
|
||||||
|
|
||||||
|
'Public PropertyChanged As PropertyChangedEventHandler
|
||||||
|
|
||||||
|
'Protected Overloads Sub RaisePropertyChanged(propertyName As String)
|
||||||
|
' Dim handler As PropertyChangedEventHandler = Me.PropertyChanged
|
||||||
|
' If handler IsNot Nothing Then
|
||||||
|
' Dim e = New PropertyChangedEventArgs(propertyName)
|
||||||
|
' handler(Me, e)
|
||||||
|
' End If
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub Window_ContentRendered(sender As Object, e As EventArgs)
|
||||||
|
' DevExpress.Xpf.Core.DXGridDataController.DisableThreadingProblemsDetection = True
|
||||||
|
worker.WorkerReportsProgress = True
|
||||||
|
worker.WorkerSupportsCancellation = True
|
||||||
|
AddHandler worker.DoWork, AddressOf worker_dowork
|
||||||
|
AddHandler worker.ProgressChanged, AddressOf worker_ProgressChanged
|
||||||
|
AddHandler worker.RunWorkerCompleted, AddressOf worker_RunWorkerCompleted
|
||||||
|
worker.RunWorkerAsync()
|
||||||
|
'AutoResetEvent.WaitOne()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub worker_dowork(sender As Object, e As DoWorkEventArgs)
|
||||||
|
Try
|
||||||
|
IVentana.IniciarTareas(sender)
|
||||||
|
Me.AutoResetEvent.Set()
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
' DXMessageBox.Show(ex.Message, "Atención")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub worker_ProgressChanged(sender As Object, e As ProgressChangedEventArgs)
|
||||||
|
Select Case e.UserState.GetType
|
||||||
|
Case GetType(TareaProgreso)
|
||||||
|
Me.ProgresoGeneral.EditValue = e.ProgressPercentage
|
||||||
|
Dim tp As TareaProgreso = e.UserState
|
||||||
|
Select Case tp.Tipo
|
||||||
|
Case TiposTareaProgresoEnum.LIMPIAR_FILAS
|
||||||
|
TareasProgreso.Clear()
|
||||||
|
Me.gc.RefreshData()
|
||||||
|
Case TiposTareaProgresoEnum.NUEVA_FILA
|
||||||
|
Dim tpe = TareasProgreso.Where(Function(t) t.id = tp.id)
|
||||||
|
If tpe.Count = 0 Then
|
||||||
|
Dim ntp As New TareaProgreso With {
|
||||||
|
.id = tp.id,
|
||||||
|
.Descripcion = tp.Descripcion,
|
||||||
|
.FechaInicio = tp.FechaInicio,
|
||||||
|
.Progreso = tp.Progreso}
|
||||||
|
tv.ScrollIntoView(gc.GetRowByListIndex(gc.VisibleRowCount - 1))
|
||||||
|
TareasProgreso.Add(ntp)
|
||||||
|
Else
|
||||||
|
tpe.First.Progreso = tp.Progreso
|
||||||
|
tpe.First.Descripcion = tp.Descripcion
|
||||||
|
End If
|
||||||
|
Me.gc.RefreshData()
|
||||||
|
Case TiposTareaProgresoEnum.CAMBIO_TITULO
|
||||||
|
Me.Title = tp.Descripcion
|
||||||
|
Case TiposTareaProgresoEnum.EXCEPCION
|
||||||
|
If Not Cancelar Then
|
||||||
|
Me.MensajeError = tp.Descripcion
|
||||||
|
Cancelar = True
|
||||||
|
Me.worker.CancelAsync()
|
||||||
|
Me.AutoResetEvent.WaitOne()
|
||||||
|
End If
|
||||||
|
Case TiposTareaProgresoEnum.FINALIZAR
|
||||||
|
Cancelar = False
|
||||||
|
End Select
|
||||||
|
Case GetType([Delegate])
|
||||||
|
Dim proceso As [Delegate] = e.UserState
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
Cancelar = IVentana.Cancelar 'true
|
||||||
|
If Cancelar Then
|
||||||
|
Me.worker.CancelAsync()
|
||||||
|
Me.AutoResetEvent.WaitOne()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub worker_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs)
|
||||||
|
'Me.DialogResult = Not (Cancelar)
|
||||||
|
' DirectCast(sender, BackgroundWorker).Dispose()
|
||||||
|
Me.Close()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub VentanaProgreso_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
Me.gc.ItemsSource = TareasProgreso
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
Cancelar = False
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
Public Class TareaProgreso
|
||||||
|
Property id As Integer
|
||||||
|
Property Tipo As TiposTareaProgresoEnum
|
||||||
|
Property FechaInicio As DateTime
|
||||||
|
Property Descripcion As String
|
||||||
|
Property Progreso As Integer
|
||||||
|
|
||||||
|
End Class
|
||||||
|
Public Enum TiposTareaProgresoEnum
|
||||||
|
LIMPIAR_FILAS
|
||||||
|
NUEVA_FILA
|
||||||
|
CAMBIO_TITULO
|
||||||
|
EXCEPCION
|
||||||
|
FINALIZAR
|
||||||
|
End Enum
|
||||||
1594
VentanaVisorExcel.xaml
Normal file
30
VentanaVisorExcel.xaml.vb
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
|
||||||
|
Public Class VentanaVisorExcel
|
||||||
|
Public Sub New(Excel As Stream, Formato As DevExpress.Spreadsheet.DocumentFormat)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
If Excel IsNot Nothing Then
|
||||||
|
Dim wb = SpreadsheetControl.Document
|
||||||
|
wb.LoadDocument(Excel, Formato)
|
||||||
|
End If
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub biFileSave_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Me.DialogResult = True
|
||||||
|
Me.Close()
|
||||||
|
Catch ex As Exception
|
||||||
|
Me.Close()
|
||||||
|
MessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
40
VentanaVisorPDF.xaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<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: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:tsWPF;assembly=tsWPF"
|
||||||
|
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxpdf="http://schemas.devexpress.com/winfx/2008/xaml/pdf" x:Class="VentanaVisorPDF"
|
||||||
|
ShowInTaskbar="True"
|
||||||
|
ShowIcon="False" Title="Visualizador PDF" WindowStyle="SingleBorderWindow" ResizeMode="CanResize" WindowState="Maximized" WindowStartupLocation="CenterScreen" Topmost="True" Width="600" Height="500" >
|
||||||
|
<dx:DXWindow.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</dx:DXWindow.Resources>
|
||||||
|
|
||||||
|
<dxpdf:PdfViewerControl CommandBarStyle="Bars" x:FieldModifier="Public" x:Name="VisorPDF">
|
||||||
|
<dxpdf:PdfViewerControl.CommandProvider>
|
||||||
|
<dxpdf:PdfCommandProvider>
|
||||||
|
<dxpdf:PdfCommandProvider.Actions>
|
||||||
|
<dxb:ReplaceAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.Close}">
|
||||||
|
<dxb:BarButtonItem Hint="Guardar Como" Glyph="{dx:DXImage Image=SaveAs_16x16.png}" LargeGlyph="{dx:DXImage Image=Save_32x32.png}" ItemClick="GuardarPDFComo" />
|
||||||
|
</dxb:ReplaceAction>
|
||||||
|
<dxb:ReplaceAction ElementName="{x:Static dxpdf:DefaultPdfBarManagerItemNames.SaveAs}">
|
||||||
|
<dxb:BarButtonItem Hint="Guardar" Glyph="{dx:DXImage Image=Save_16x16.png}" LargeGlyph="{dx:DXImage Image=Save_32x32.png}" ItemClick="GuardarPDF" />
|
||||||
|
</dxb:ReplaceAction>
|
||||||
|
</dxpdf:PdfCommandProvider.Actions>
|
||||||
|
</dxpdf:PdfCommandProvider>
|
||||||
|
</dxpdf:PdfViewerControl.CommandProvider>
|
||||||
|
</dxpdf:PdfViewerControl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dx:DXWindow>
|
||||||
|
|
||||||
66
VentanaVisorPDF.xaml.vb
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports DevExpress.Xpf.Core.Native
|
||||||
|
|
||||||
|
Public Class VentanaVisorPDF
|
||||||
|
' Private Property DlgGuardar As Guardar
|
||||||
|
' Public st As New MemoryStream
|
||||||
|
' Public Delegate Sub Guardar(PDF As Stream)
|
||||||
|
'Public Sub New(pdf As Stream, DelegadoGuardar As Guardar)
|
||||||
|
Public Sub New(pdf As Stream)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
If pdf IsNot Nothing Then Me.VisorPDF.DocumentSource = pdf
|
||||||
|
' DlgGuardar = DelegadoGuardar
|
||||||
|
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Private Sub VentanaVisorPDF_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
'Try
|
||||||
|
' Dim bm As BarManager = TryCast(LayoutHelper.FindElement(VisorPDF, Function(n) TypeOf n Is BarManager), BarManager)
|
||||||
|
' ' If bm Is Nothing Then MsgBox("no funciona")
|
||||||
|
' Dim bbi As New BarButtonItem()
|
||||||
|
' Dim bbil As New BarButtonItemLink()
|
||||||
|
' bbi.Name = "Save"
|
||||||
|
' bbi.Content = "Save"
|
||||||
|
' bbil.BarItemName = "Save"
|
||||||
|
' AddHandler bbi.ItemClick, AddressOf GuardarPDF
|
||||||
|
' bm.Items.Add(bbi)
|
||||||
|
' bm.Bars(0).ItemLinks.Insert(0, bbil)
|
||||||
|
'Catch ex As Exception
|
||||||
|
' MsgBox(ex.Message)
|
||||||
|
'End Try
|
||||||
|
' End Sub
|
||||||
|
Private Sub GuardarPDF(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
' VisorPDF.SaveDocument(st)
|
||||||
|
Me.DialogResult = True
|
||||||
|
Me.Close()
|
||||||
|
'Dim ms As New System.IO.MemoryStream
|
||||||
|
'VisorPDF.SaveDocument(ms)
|
||||||
|
'DlgGuardar.Invoke(ms)
|
||||||
|
Catch ex As Exception
|
||||||
|
Me.Close()
|
||||||
|
MessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Private Sub GuardarPDFComo(sender As Object, e As ItemClickEventArgs)
|
||||||
|
Try
|
||||||
|
Dim sfd As New Microsoft.Win32.SaveFileDialog
|
||||||
|
sfd.FileName = ""
|
||||||
|
sfd.Filter = "Archivo pdf|*.pdf"
|
||||||
|
sfd.DefaultExt = ".pdf"
|
||||||
|
If sfd.ShowDialog() Then
|
||||||
|
VisorPDF.SaveDocument(sfd.FileName)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
41
dxwCalculadoraFecha.xaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<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:tsWPF"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
x:Class="dxwCalculadoraFecha"
|
||||||
|
Title="Introduzca Intervalo de Fechas" HorizontalAlignment="Center" Height="240" Width="310" ShowInTaskbar="True" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ShowIcon="False" ResizeMode="NoResize" >
|
||||||
|
<Grid>
|
||||||
|
<dxlc:LayoutControl Header="Header" Orientation="Vertical" View="GroupBox" >
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" >
|
||||||
|
<tsWPF:tsLayoutItem Label="Fecha Inicial:" FontWeight="Bold" TabIndex="1" >
|
||||||
|
<dxe:DateEdit x:Name="deFechaInicial" AllowNullInput="False" />
|
||||||
|
</tsWPF:tsLayoutItem>
|
||||||
|
<dxlc:LayoutGroup Orientation="Horizontal" >
|
||||||
|
<tsWPF:tsLayoutItem Label="Dias Naturales:" FontWeight="Bold" TabIndex="1" >
|
||||||
|
<dxe:TextEdit x:Name="DiasNaturales" Mask="n0" MaskType="Numeric" MaskUseAsDisplayFormat="True" AllowNullInput="False" />
|
||||||
|
</tsWPF:tsLayoutItem>
|
||||||
|
<Button x:Name="btDiasNaturales" Click="btDiasNaturales_Click" Width="60" Height="20">Calcular</Button>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Horizontal" >
|
||||||
|
<tsWPF:tsLayoutItem Label="Dias Hábiles:" FontWeight="Bold" TabIndex="1" >
|
||||||
|
<dxe:TextEdit x:Name="DiasHabiles" Mask="n0" MaskType="Numeric" MaskUseAsDisplayFormat="True" AllowNullInput="False" />
|
||||||
|
</tsWPF:tsLayoutItem>
|
||||||
|
<Button x:Name="btDiasHabiles" Click="btDiasHabiles_Click" Width="60" Height="20" >Calcular</Button>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<tsWPF:tsLayoutItem Label="Fecha Calculada:" FontWeight="Bold" HorizontalAlignment="Stretch" >
|
||||||
|
<dxe:DateEdit x:Name="deFechaCalculada" IsReadOnly="True" AllowDefaultButton="False" />
|
||||||
|
</tsWPF:tsLayoutItem>
|
||||||
|
</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="60,0,0,0" Width="100">Cancelar</Button>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||
59
dxwCalculadoraFecha.xaml.vb
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
|
||||||
|
Public Class dxwCalculadoraFecha
|
||||||
|
Public NombreFichero As String
|
||||||
|
Public FechaCalculada As Date
|
||||||
|
Private _Fiestas As List(Of Date)
|
||||||
|
Public Sub New(FechaInicio As Date, Optional Fiestas As List(Of Date) = Nothing, Optional Titulo As String = "Introduzca Datos")
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
Me.Title = Titulo
|
||||||
|
Me.deFechaInicial.EditValue = FechaInicio
|
||||||
|
Me.deFechaCalculada.EditValue = FechaInicio
|
||||||
|
Me.DiasNaturales.EditValue = 0
|
||||||
|
Me.DiasHabiles.EditValue = 0
|
||||||
|
_Fiestas = Fiestas
|
||||||
|
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
' 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 Me.deFechaCalculada.EditValue Is Nothing Then Throw New Exception("La fecha calculada no es válida")
|
||||||
|
Me.FechaCalculada = Me.deFechaCalculada.EditValue
|
||||||
|
Me.DialogResult = True
|
||||||
|
Me.Close()
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btDiasNaturales_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim FechaInicial As Date = Me.deFechaInicial.EditValue
|
||||||
|
deFechaCalculada.EditValue = FechaInicial.AddDays(DiasNaturales.EditValue)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btDiasHabiles_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim FechaInicial As Date = Me.deFechaInicial.EditValue
|
||||||
|
Dim ndias As Integer = DiasHabiles.EditValue
|
||||||
|
Dim FechaCalculada As Date = FechaInicial
|
||||||
|
Dim Incremento As Integer = If(ndias > 0, 1, -1)
|
||||||
|
Do Until ndias = 0
|
||||||
|
If Not (FechaCalculada.DayOfWeek = DayOfWeek.Sunday OrElse FechaCalculada.DayOfWeek = DayOfWeek.Saturday OrElse (_Fiestas IsNot Nothing AndAlso _Fiestas.Contains(FechaCalculada))) Then ndias -= Incremento
|
||||||
|
FechaCalculada = FechaCalculada.AddDays(Incremento)
|
||||||
|
Loop
|
||||||
|
deFechaCalculada.EditValue = FechaCalculada
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
14
dxwContrasenna.xaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<dx:DXWindow x:Name="text" ShowIcon="False" ResizeMode="NoResize" WindowStyle="SingleBorderWindow"
|
||||||
|
x:Class="dxwContrasenna"
|
||||||
|
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"
|
||||||
|
Title="" Height="150.445" Width="357" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" Topmost="True" >
|
||||||
|
|
||||||
|
<Grid x:Name="gc" >
|
||||||
|
<Label Content="Contraseña:" Height="23" HorizontalAlignment="Left" Margin="21,22,0,0" Name="Label2" VerticalAlignment="Top" Width="79" />
|
||||||
|
<dxe:PasswordBoxEdit HorizontalAlignment="Left" Margin="106,23,0,0" Name="pbeContrasenna" VerticalAlignment="Top" Width="215" TabIndex="0" x:FieldModifier="Public"/>
|
||||||
|
<Button Content="Aceptar" Height="23" HorizontalAlignment="Left" Margin="21,69,0,0" Name="Button1" VerticalAlignment="Top" Width="121" IsDefault="True" />
|
||||||
|
<Button Content="Cancelar" Height="23" HorizontalAlignment="Right" Margin="0,69,30,0" Name="Button2" VerticalAlignment="Top" Width="121" IsCancel="True" />
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||
16
dxwContrasenna.xaml.vb
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Public Class dxwContrasenna
|
||||||
|
|
||||||
|
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
|
||||||
|
Me.DialogResult = True
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
|
||||||
|
Me.DialogResult = False
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub dxwContrasenna_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
Me.pbeContrasenna.Focus()
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
64
dxwDiseñoColumnas.xaml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<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: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:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControlv23.2" x:Class="dxwDiseñoColumnas"
|
||||||
|
ShowInTaskbar="True"
|
||||||
|
ShowIcon="False" Title="Diseño columnas" WindowStyle="ToolWindow" WindowState="Normal" WindowStartupLocation="CenterScreen" Topmost="True" Width="1024" Height="600">
|
||||||
|
<dx:DXWindow.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</dx:DXWindow.Resources>
|
||||||
|
<Grid x:Name="grid">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="45" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<dxlc:LayoutControl Orientation="Vertical">
|
||||||
|
<dxg:GridControl x:Name="gc" Grid.Row="0">
|
||||||
|
<dxg:GridControl.View>
|
||||||
|
<dxg:TableView x:Name="tv" ShowSearchPanelMode="Always" ShowCheckBoxSelectorColumn="True" AllowEditing="False" ShowTotalSummary="True" />
|
||||||
|
</dxg:GridControl.View>
|
||||||
|
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="800" AllowEditing="False">
|
||||||
|
<dxg:GridColumn.EditSettings>
|
||||||
|
<dxe:TextEditSettings MaxLength="100" />
|
||||||
|
</dxg:GridColumn.EditSettings>
|
||||||
|
</dxg:GridColumn>
|
||||||
|
<dxg:GridColumn FieldName="TodosLosUsuarios" Header="Todos Los Usuarios" AllowEditing="False" IsSmart="True" x:FieldModifier="public" x:Name="gcTodosUsuarios" />
|
||||||
|
</dxg:GridControl>
|
||||||
|
<dxlc:LayoutGroup x:Name="lgOpcionesGuardado">
|
||||||
|
<dxlc:LayoutItem Label="Descripción:">
|
||||||
|
<dxe:TextEdit x:Name="teDescripcion" />
|
||||||
|
|
||||||
|
</dxlc:LayoutItem>
|
||||||
|
<dxlc:LayoutItem Label="Guardar Diseño para todos los usuarios:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" TabIndex="1" x:FieldModifier="public" x:Name="liGuardarParaTodos">
|
||||||
|
<dxe:CheckEdit x:Name="cbTodosUsuarios" />
|
||||||
|
</dxlc:LayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="10" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="10" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50" />
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
<ColumnDefinition Width="50" />
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="120" IsDefault="True" Click="btAceptar_Click" TabIndex="0" Content="Guardar Diseño" />
|
||||||
|
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="120" IsCancel="True" Click="btCancelar_Click" TabIndex="1" Content="Cancelar" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
</dx:DXWindow>
|
||||||
64
dxwDiseñoColumnas.xaml.bak
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<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: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:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v19.2" x:Class="dxwDiseñoColumnas"
|
||||||
|
ShowInTaskbar="True"
|
||||||
|
ShowIcon="False" Title="Diseño columnas" WindowStyle="ToolWindow" WindowState="Normal" WindowStartupLocation="CenterScreen" Topmost="True" Width="1024" Height="600">
|
||||||
|
<dx:DXWindow.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/tsWPF;component/Plantillas.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</dx:DXWindow.Resources>
|
||||||
|
<Grid x:Name="grid">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="45" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<dxlc:LayoutControl Orientation="Vertical">
|
||||||
|
<dxg:GridControl x:Name="gc" Grid.Row="0">
|
||||||
|
<dxg:GridControl.View>
|
||||||
|
<dxg:TableView x:Name="tv" ShowSearchPanelMode="Always" ShowCheckBoxSelectorColumn="True" AllowEditing="False" ShowTotalSummary="True" />
|
||||||
|
</dxg:GridControl.View>
|
||||||
|
<dxg:GridColumn FieldName="Descripcion" Header="Descripción" Width="800" AllowEditing="False">
|
||||||
|
<dxg:GridColumn.EditSettings>
|
||||||
|
<dxe:TextEditSettings MaxLength="100" />
|
||||||
|
</dxg:GridColumn.EditSettings>
|
||||||
|
</dxg:GridColumn>
|
||||||
|
<dxg:GridColumn FieldName="TodosLosUsuarios" Header="Todos Los Usuarios" AllowEditing="False" IsSmart="True" x:FieldModifier="public" x:Name="gcTodosUsuarios" />
|
||||||
|
</dxg:GridControl>
|
||||||
|
<dxlc:LayoutGroup x:Name="lgOpcionesGuardado">
|
||||||
|
<dxlc:LayoutItem Label="Descripción:">
|
||||||
|
<dxe:TextEdit x:Name="teDescripcion" />
|
||||||
|
|
||||||
|
</dxlc:LayoutItem>
|
||||||
|
<dxlc:LayoutItem Label="Guardar Diseño para todos los usuarios:" HorizontalAlignment="Left" HorizontalContentAlignment="Left" TabIndex="1" x:FieldModifier="public" x:Name="liGuardarParaTodos">
|
||||||
|
<dxe:CheckEdit x:Name="cbTodosUsuarios" />
|
||||||
|
</dxlc:LayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="10" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="10" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50" />
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
<ColumnDefinition Width="50" />
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="120" IsDefault="True" Click="btAceptar_Click" TabIndex="0" Content="Guardar Diseño" />
|
||||||
|
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="120" IsCancel="True" Click="btCancelar_Click" TabIndex="1" Content="Cancelar" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
</dx:DXWindow>
|
||||||
153
dxwDiseñoColumnas.xaml.vb
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
|
||||||
|
Imports System.Data.Entity
|
||||||
|
Imports DevExpress.Xpf.Core.ServerMode
|
||||||
|
'Imports bdGestionFidas
|
||||||
|
Imports DevExpress.Mvvm
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports tsWPF
|
||||||
|
Imports tsl5.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.Data
|
||||||
|
|
||||||
|
Public Class dxwDiseñoColumnas
|
||||||
|
|
||||||
|
' Private bd As bdGestionFidas.cacoaentities
|
||||||
|
|
||||||
|
Private _Codigo As String
|
||||||
|
Private _Abrir As String
|
||||||
|
Public _Descripcion As String
|
||||||
|
Public _TodosLosUsuarios As String
|
||||||
|
Public _IdDiseño As Integer?
|
||||||
|
Dim _ld As List(Of DiseñoGuardado)
|
||||||
|
Public Delegate Sub EliminarDiseño(idDiseño As Integer)
|
||||||
|
|
||||||
|
Private _DelegadoEliminarDiseño As EliminarDiseño
|
||||||
|
Private Sub dxwAgregar_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
Try
|
||||||
|
'bd = bdGestionFidas.FIDASEntities.NuevoContexto
|
||||||
|
'Dim lc = (From fc In bd.ficherosconfiguracion Where fc.Descripcion IsNot Nothing AndAlso fc.Descripcion <> "" And fc.Codigo = _Codigo And (fc.idUsuario.HasValue = False OrElse fc.idUsuario = bdGestionFidas.Utilidades.dsc.idUsuario) Select New DiseñoGuardado With {.Descripcion = fc.Descripcion, .TodosLosUsuarios = (fc.idUsuario.HasValue = False)}).ToList
|
||||||
|
'Me.gc.ItemsSource = lc
|
||||||
|
Me.teDescripcion.EditValue = _Descripcion
|
||||||
|
Me.cbTodosUsuarios.IsChecked = _TodosLosUsuarios
|
||||||
|
Me.gc.ItemsSource = _ld
|
||||||
|
If _Descripcion <> "" AndAlso _ld.Any(Function(x) x.Descripcion = _Descripcion And x.TodosLosUsuarios = _TodosLosUsuarios) Then
|
||||||
|
Me.gc.CurrentItem = _ld.First(Function(x) x.Descripcion = _Descripcion And x.TodosLosUsuarios = _TodosLosUsuarios)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
Finally
|
||||||
|
Try
|
||||||
|
DXSplashScreen.Close()
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
'Private Sub Aceptar_Click(sender As Object, e As DevExpress.Xpf.Bars.ItemClickEventArgs)
|
||||||
|
|
||||||
|
Public Sub New(Codigo As String, Descripcion As String, TodosUsuarios As Boolean, Abrir As Boolean, ld As List(Of DiseñoGuardado), FuncionEliminarDiseño As EliminarDiseño)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
|
||||||
|
|
||||||
|
InitializeComponent()
|
||||||
|
If Abrir Then
|
||||||
|
Me.lgOpcionesGuardado.Visibility = System.Windows.Visibility.Hidden
|
||||||
|
Me.btAceptar.Content = "Abrir Diseño"
|
||||||
|
End If
|
||||||
|
|
||||||
|
_Abrir = Abrir
|
||||||
|
_Codigo = Codigo
|
||||||
|
_Descripcion = Descripcion
|
||||||
|
_TodosLosUsuarios = TodosUsuarios
|
||||||
|
_ld = ld
|
||||||
|
_DelegadoEliminarDiseño = FuncionEliminarDiseño
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim cm As New ContextMenu
|
||||||
|
Dim mi As New MenuItem()
|
||||||
|
mi.Tag = "MI_ELIMINAR_DISEÑO"
|
||||||
|
mi.Header = "Eliminar Diseño"
|
||||||
|
AddHandler mi.Click, AddressOf _EliminarDiseño
|
||||||
|
cm.Items.Add(mi)
|
||||||
|
Me.gc.ContextMenu = cm
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
Try
|
||||||
|
Dim bcancelar As Boolean
|
||||||
|
If _Abrir Then
|
||||||
|
Dim dg = DirectCast(Me.gc.CurrentItem, DiseñoGuardado)
|
||||||
|
_Descripcion = dg.Descripcion
|
||||||
|
_TodosLosUsuarios = dg.TodosLosUsuarios
|
||||||
|
_IdDiseño = dg.idDiseño
|
||||||
|
Else
|
||||||
|
_Descripcion = teDescripcion.EditValue
|
||||||
|
If _Descripcion = "" Then Throw New Exception("La descripción es obligatoria")
|
||||||
|
Dim ld = DirectCast(Me.gc.ItemsSource, List(Of DiseñoGuardado))
|
||||||
|
If ld.Any(Function(x) x.Descripcion = _Descripcion And x.TodosLosUsuarios = cbTodosUsuarios.IsChecked.Value) Then
|
||||||
|
bcancelar = (DXMessageBox.Show("¿Desea sobreescribir el diseño de " & _Descripcion & "?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.No)
|
||||||
|
If Not bcancelar Then _IdDiseño = ld.First(Function(x) x.Descripcion = _Descripcion And x.TodosLosUsuarios = cbTodosUsuarios.IsChecked.Value).idDiseño
|
||||||
|
Else
|
||||||
|
If cbTodosUsuarios.IsChecked.Value Then
|
||||||
|
If ld.Any(Function(x) x.Descripcion = _Descripcion) Then
|
||||||
|
bcancelar = (DXMessageBox.Show("¿Desea sobreescribir el diseño de " & _Descripcion & " y establecerlo como público para todos los usuarios?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.No)
|
||||||
|
If Not bcancelar Then _IdDiseño = ld.First(Function(x) x.Descripcion = _Descripcion).idDiseño
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If ld.Any(Function(x) x.Descripcion = _Descripcion) Then
|
||||||
|
bcancelar = (DXMessageBox.Show("¿Desea sobreescribir el diseño de " & _Descripcion & " y establecerlo como privado para este usuario?", "Atención", MessageBoxButton.YesNo) = MessageBoxResult.No)
|
||||||
|
If Not bcancelar Then _IdDiseño = ld.First(Function(x) x.Descripcion = _Descripcion).idDiseño
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
_TodosLosUsuarios = cbTodosUsuarios.IsChecked
|
||||||
|
End If
|
||||||
|
If Not bcancelar Then
|
||||||
|
Me.DialogResult = True
|
||||||
|
Me.Close()
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
DXMessageBox.Show(ex.Message, "Atención")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
Me.DialogResult = False
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub dxwDiseñoColumnas_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
' bd.Connection.Close()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub gc_CurrentItemChanged(sender As Object, e As CurrentItemChangedEventArgs) Handles gc.CurrentItemChanged
|
||||||
|
Dim dg = DirectCast(Me.gc.CurrentItem, DiseñoGuardado)
|
||||||
|
If dg IsNot Nothing Then
|
||||||
|
Me.teDescripcion.EditValue = dg.Descripcion
|
||||||
|
Me.cbTodosUsuarios.IsChecked = dg.TodosLosUsuarios
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub _EliminarDiseño(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim dg = DirectCast(Me.gc.CurrentItem, DiseñoGuardado)
|
||||||
|
_DelegadoEliminarDiseño.Invoke(dg.idDiseño)
|
||||||
|
tv.DeleteRow(Me.tv.FocusedRowHandle)
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
Public Class DiseñoGuardado
|
||||||
|
Public Property idDiseño As Integer?
|
||||||
|
Property Descripcion As String
|
||||||
|
Property TodosLosUsuarios As Boolean
|
||||||
|
End Class
|
||||||
26
dxwFecha.xaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<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:tsWPF"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
x:Class="dxwFecha"
|
||||||
|
Title="Introduzca Intervalo de Fechas" HorizontalAlignment="Center" Height="220" Width="310" ShowInTaskbar="True" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" ShowIcon="False" ResizeMode="NoResize" >
|
||||||
|
<Grid>
|
||||||
|
<dxlc:LayoutControl Header="Header" Orientation="Vertical" View="GroupBox" >
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" >
|
||||||
|
<tsWPF:tsLayoutItem Label="Fecha:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" >
|
||||||
|
<dxe:DateEdit x:Name="deFecha" Width="120" />
|
||||||
|
</tsWPF:tsLayoutItem>
|
||||||
|
</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="60,0,0,0" Width="100">Cancelar</Button>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</dx:DXWindow>
|
||||||