- Se traslada versión a git desde tfs
63
.gitattributes
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
363
.gitignore
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
11
AssemblyInfo.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
Imports System.Windows
|
||||
|
||||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
|
||||
'1st parameter: where theme specific resource dictionaries are located
|
||||
'(used if a resource is not found in the page,
|
||||
' OrElse application resource dictionaries)
|
||||
|
||||
'2nd parameter: where the generic resource dictionary is located
|
||||
'(used if a resource is not found in the page,
|
||||
'app, and any theme specific resource dictionaries)
|
||||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
|
||||
139
ClasesComunes.vb
Normal file
@@ -0,0 +1,139 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data.Entity.Core.Metadata.Edm
|
||||
Imports System.Data.Entity.Core.Objects
|
||||
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?
|
||||
Public Property EnlazarNulosOVacios As Boolean = False
|
||||
Public Property PermisosDefecto As tsUtilidades.Permisos
|
||||
Public Property CabeceraImpresion As String
|
||||
Public Property BusquedaAcentosInsensitivo As Boolean = False
|
||||
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 = True
|
||||
Public Shared ComportamientoValidacion As Validation.InvalidValueBehavior = DevExpress.Xpf.Editors.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
|
||||
End Class
|
||||
|
||||
|
||||
Public Class Comun
|
||||
Public Shared WithEvents dm As DockLayoutManager
|
||||
|
||||
Public Delegate Sub ErrorNoControlado(Aplicacion As String, ex As Exception)
|
||||
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
|
||||
Dim a = DirectCast(dc.Content, 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
|
||||
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
|
||||
|
||||
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
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.Write(ex.Message)
|
||||
End Try
|
||||
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
|
||||
Public Enum OperacionDiseñoEnum
|
||||
ABRIR
|
||||
ABRIR_DISEÑO_GUARDADO
|
||||
GUARDAR
|
||||
GUARDAR_COMO
|
||||
RESTAURAR_ORIGINAL
|
||||
End Enum
|
||||
151
ContenedorAplicacion.xaml
Normal file
@@ -0,0 +1,151 @@
|
||||
<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:ts="clr-namespace:tsWPFCore"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:My="clr-namespace:tsWPFCore"
|
||||
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="{dx:DXImageGrayscale Image=Save_16x16.png}" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar (F2)" />
|
||||
<dxb:BarButtonItem Name="btBuscar" Glyph="{dx:DXImage 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.v23.2;component/GrayScaleImages/Actions/AddItem_32x32.png" x:FieldModifier="public" Focusable="True" Hint="Nuevo (F4)" />
|
||||
<dxb:BarButtonItem Name="btActualizar" Glyph="pack://application:,,,/DevExpress.Images.v23.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" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" Glyph="pack://application:,,/tsWPFCore;Component/Images/Icons/capture.png" />
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem Name="btSeleccionar" Glyph="pack://application:,,/tsWPFCore;Component/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:,,/tsWPFCore;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:,,/tsWPFCore;Component/Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="pack://application:,,/tsWPFCore;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">
|
||||
</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" 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.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="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: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.AutoHideGroups>
|
||||
<dxdo:AutoHideGroup DockType="Bottom" >
|
||||
<dxdo:LayoutPanel x:Name="lpMensajes" Caption="Mensajes" AllowDockToDocumentGroup="False" AllowDrag="False" AllowFloat="False" AllowMove="False" Visibility="Hidden" AllowHide="True" IsHitTestVisible="True" AllowDock="True" AllowClose="False" ItemHeight="160" Style="{StaticResource estilomensaje}" >
|
||||
<Grid>
|
||||
<Border BorderThickness="1" Background="Beige" BorderBrush="Black" CornerRadius="10">
|
||||
<Grid>
|
||||
<dxg:GridControl x:Name="gcErrores" ItemsSource="{Binding}">
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</dxdo:LayoutPanel>
|
||||
</dxdo:AutoHideGroup>
|
||||
</dxdo:DockLayoutManager.AutoHideGroups>
|
||||
</dxdo:DockLayoutManager>
|
||||
</Grid>
|
||||
</dxb:BarManager>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
159
ContenedorAplicacion.xaml.bak
Normal file
@@ -0,0 +1,159 @@
|
||||
<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:ts="clr-namespace:tsWPFCore"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:My="clr-namespace:tsWPFCore"
|
||||
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="{dx:DXImageGrayscale Image=Save_16x16.png}" x:FieldModifier="public" Focusable="true" ForceCursor="True" Hint="Guardar (F2)" />
|
||||
<dxb:BarButtonItem Name="btBuscar" Glyph="{dx:DXImage 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" Content="Captura Pantalla" ItemClick="BtCapturar_ItemClick" Glyph="pack://application:,,/tsWPFCore;Component/Images/Icons/capture.png" />
|
||||
</dxb:BarSubItem>
|
||||
<dxb:BarCheckItem Name="btSeleccionar" Glyph="pack://application:,,/tsWPFCore;Component/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="pack://application:,,/tsWPFCore;Component/Images/Icons/AbrirGrid.png" Content="Abrir Diseño Guardado" ItemClick="btAbrirDiseñoGuardado_ItemClick" />
|
||||
<dxb:BarButtonItem Name="btGuardarDiseñoComo" Glyph="pack://application:,,/tsWPFCore;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">
|
||||
</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" ForceCursor="True" />
|
||||
<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" 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="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>
|
||||
<dxg:GridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores" />
|
||||
</dxg:GridControl.Columns>
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
</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>
|
||||
450
ContenedorAplicacion.xaml.vb
Normal file
@@ -0,0 +1,450 @@
|
||||
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 Microsoft.Win32
|
||||
Imports DevExpress.Spreadsheet
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports DevExpress.Mvvm.UI.Interactivity
|
||||
Imports tsUtilidades.Extensiones
|
||||
Imports System.Data.Entity.Core.Objects
|
||||
Imports tsUtilidades
|
||||
Imports System.Data.Entity.Core.Metadata.Edm
|
||||
|
||||
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 Async 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 = _Aplicacion.Contexto.HayModificaciones
|
||||
'If _Aplicacion.Contexto.GetType.BaseType Is GetType(ObjectContext) Then
|
||||
' Dim bd = DirectCast(_Aplicacion.Contexto, ObjectContext)
|
||||
' Preguntar = bd.ObjectStateManager.GetObjectStateEntries(System.Data.Entity.EntityState.Added + System.Data.Entity.EntityState.Deleted + System.Data.Entity.EntityState.Modified).Count > 0
|
||||
'Else
|
||||
' 'TODO: dbcontext
|
||||
'End If
|
||||
If Preguntar Then
|
||||
If Configuracion.NuevosRapido = False OrElse _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 = Me.FindResource("sbDesvanecer")
|
||||
Storyboard.SetTarget(sb, tbm)
|
||||
'sb.Begin
|
||||
BeginStoryboard(sb)
|
||||
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 = Me.FindResource("tsBlink")
|
||||
Storyboard.SetTarget(sb, tbm)
|
||||
'sb.Begin
|
||||
BeginStoryboard(sb)
|
||||
|
||||
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 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 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(tsUtilidades.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 = tsUtilidades.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(tsUtilidades.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 = tsUtilidades.Utilidades.deserializar(System.Text.Encoding.Unicode.GetString(b), ld.GetType)
|
||||
' Dim i As Integer
|
||||
' Dim lg As List(Of tsGridControl) = Nothing
|
||||
' tsWPFCore.ObtieneHijosDeTipo(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 OrElse _Aplicacion.Estado = EstadosAplicacion.SinDatos) Then btGuardar.IsEnabled = True
|
||||
End Sub
|
||||
Private Sub BtCapturar_ItemClick(sender As Object, e As ItemClickEventArgs)
|
||||
Dim sficherojpg = tsUtilidades.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 DevExpress.Spreadsheet.DocumentFormat
|
||||
Select Case IO.Path.GetExtension(sfd.FileName).ToLower
|
||||
Case ".xls"
|
||||
formato = DevExpress.Spreadsheet.DocumentFormat.Xls
|
||||
Case ".xlsx"
|
||||
formato = DevExpress.Spreadsheet.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 DevExpress.Spreadsheet.DocumentFormat.Xls
|
||||
vista.ExportToXls(ls)
|
||||
Case DevExpress.Spreadsheet.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
|
||||
|
||||
'Public Shared Function GetMaxlenght(oc As ObjectContext, Nombreentity As String, field As String) As Integer
|
||||
' If oc IsNot Nothing AndAlso Nombreentity <> "" AndAlso Not String.IsNullOrEmpty(field) Then
|
||||
' If Nombreentity.Contains(".") Then
|
||||
' Nombreentity = Nombreentity.Split(".").Last
|
||||
' End If
|
||||
' If field.Contains(".") Then
|
||||
' Nombreentity = field.Split(".")(field.Split(".").Count - 2)
|
||||
' field = field.Split(".").Last
|
||||
' End If
|
||||
' Dim container As EntityContainer = Nothing
|
||||
' If oc.MetadataWorkspace.TryGetEntityContainer(oc.DefaultContainerName, DataSpace.CSpace, container) Then
|
||||
' Dim entitySet As EntitySet = Nothing
|
||||
' If container.TryGetEntitySetByName(Nombreentity, False, entitySet) Then
|
||||
' Const mlenght As String = "MaxLength"
|
||||
' If entitySet.ElementType.Members.Contains(field) AndAlso entitySet.ElementType.Members(field).TypeUsage.Facets.Contains(mlenght) Then
|
||||
' Dim smaxlenght As Object = entitySet.ElementType.Members(field).TypeUsage.Facets(mlenght).Value
|
||||
|
||||
' If smaxlenght IsNot Nothing Then
|
||||
' Dim maxlenght As Integer
|
||||
' If Integer.TryParse(smaxlenght.ToString(), maxlenght) Then
|
||||
' Return maxlenght
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' Return -1
|
||||
'End Function
|
||||
|
||||
Private Sub ContenedorAplicacion_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
|
||||
If e.Key = Key.F1 OrElse e.Key = Key.F2 OrElse e.Key = Key.F3 OrElse e.Key = Key.F4 OrElse e.Key = Key.F5 OrElse e.Key = Key.F6 OrElse e.Key = Key.F7 OrElse e.Key = Key.F8 OrElse e.Key = Key.F9 OrElse e.Key = Key.F10 OrElse e.Key = Key.F11 OrElse e.Key = Key.F12 OrElse 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
|
||||
6898
Diccionarios/Spanish.aff
Normal file
67197
Diccionarios/Spanish.dic
Normal file
149
ErrorValidacion.vb
Normal file
@@ -0,0 +1,149 @@
|
||||
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)
|
||||
Try
|
||||
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
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
Public Sub EliminaError(id As String)
|
||||
Try
|
||||
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 AndAlso PanelErrores.Visibility <> Visibility.Hidden Then
|
||||
PanelErrores.GetDockLayoutManager.DockController.Hide(PanelErrores)
|
||||
PanelErrores.Visibility = Visibility.Hidden
|
||||
Else
|
||||
RellenaErrores()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub LimpiarErrores(Patron As String)
|
||||
Try
|
||||
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 AndAlso PanelErrores.Visibility <> Visibility.Hidden Then
|
||||
PanelErrores.GetDockLayoutManager.DockController.Hide(PanelErrores)
|
||||
PanelErrores.Visibility = Visibility.Hidden
|
||||
End If
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Friend Sub LimpiarErrores(Optional SoloCritical As Boolean = True)
|
||||
Try
|
||||
Dim i As Integer
|
||||
Dim ev As ErrorValidacion
|
||||
|
||||
For i = Errores.Count - 1 To 0 Step -1
|
||||
If Not SoloCritical OrElse 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
|
||||
If PanelErrores.Visibility <> Visibility.Hidden Then
|
||||
PanelErrores.GetDockLayoutManager.DockController.Hide(PanelErrores)
|
||||
PanelErrores.Visibility = Visibility.Hidden
|
||||
End If
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Sub MuestraErrores()
|
||||
Try
|
||||
RellenaErrores()
|
||||
Dim dm = PanelErrores.GetDockLayoutManager
|
||||
dm.DockController.Dock(PanelErrores)
|
||||
PanelErrores.Visibility = Visibility.Visible
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
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/PAPELERA.png
Normal file
|
After Width: | Height: | Size: 224 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/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 |
225
Informes/InformesGenerico.vb
Normal file
@@ -0,0 +1,225 @@
|
||||
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 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 tsWPFCore.tsXtraReportPreviewModel(xr)
|
||||
''modelo.IsParametersPanelVisible = MostrarPanelParametros
|
||||
''modelo.AutoShowParametersPanel = MostrarPanelParametros
|
||||
''xr.RequestParameters = MostrarPanelParametros
|
||||
''Dim vi As New tsWPFCore.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)
|
||||
|
||||
|
||||
|
||||
'Dim modelo As New tsWPFCore.tsXtraReportPreviewModel(xr)
|
||||
|
||||
'Dim link As New PrintableControlLink(modelo)
|
||||
'link.PaperKind = System.Drawing.Printing.PaperKind.A4
|
||||
'link.Landscape = True
|
||||
'link.Margins.Left = 0.5
|
||||
'link.Margins.Right = 0.5
|
||||
'link.Margins.Bottom = 0.5
|
||||
'link.Margins.Top = 0.5
|
||||
|
||||
'Dim vi As New ucVisualizadorInformes()
|
||||
'link.PageHeaderTemplate = DirectCast(vi.Resources("pageHeaderTemplate"), DataTemplate)
|
||||
'link.PageFooterTemplate = DirectCast(vi.Resources("pageFooterTemplate"), DataTemplate)
|
||||
|
||||
'link.CreateDocument()
|
||||
|
||||
'vi.Visualizador.DocumentSource = link
|
||||
'Dim docpanel = New DevExpress.Xpf.Docking.DocumentPanel
|
||||
'Dim tabHeaderPrintInfoControl As New TabHeaderPrintInfoControl() With {.TabName = Titulo}
|
||||
'docpanel.Caption = tabHeaderPrintInfoControl
|
||||
'docpanel.Content = vi
|
||||
'docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove
|
||||
'GrupoDocumentos.Add(docpanel)
|
||||
|
||||
'Comun.dm.DockController.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
|
||||
482
Informes/dxwEditor.xaml
Normal file
@@ -0,0 +1,482 @@
|
||||
<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"
|
||||
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=RichEditControl1}"/>
|
||||
<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=RichEditControl1}"/>
|
||||
</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"/>
|
||||
|
||||
</DockPanel>
|
||||
</dxb:BarManager>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
110
Informes/dxwEditor.xaml.vb
Normal file
@@ -0,0 +1,110 @@
|
||||
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, DelegadoGuardarYExportarHTML As GuardarYExportarHTML, 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, DelegadoGuardar As Guardar, Optional DelegadoGuardaryExportarHTML As GuardarYExportarHTML = Nothing, Optional DelegadoCargaMailMerge As CargarDatosMailMerge = Nothing)
|
||||
Try
|
||||
DXSplashScreen.Show(Of SplashScreenTecnosis)()
|
||||
DXSplashScreen.SetState("Cargando Documento ...")
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
DlGuardar = DelegadoGuardar
|
||||
If _SoloLectura 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
|
||||
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 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 xml|*.xml"
|
||||
fb.DefaultExt = ".xml"
|
||||
|
||||
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 & ".xml"
|
||||
sfd.Filter = "Archivo xml|*.xml"
|
||||
sfd.DefaultExt = ".xml"
|
||||
If sfd.ShowDialog Then
|
||||
Dim fs As New IO.FileStream(sfd.FileName, FileMode.Create)
|
||||
report.SaveLayoutToXml(fs)
|
||||
fs.Close()
|
||||
End If
|
||||
Return ""
|
||||
Else
|
||||
Dim ms As New MemoryStream
|
||||
report.SaveLayoutToXml(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
|
||||
17
Informes/ucPDFViewer.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<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:local="clr-namespace:tsWPFCore"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1000" d:DesignWidth="1000">
|
||||
<Grid>
|
||||
<dxpdf:PdfViewerControl CommandBarStyle="Bars" x:FieldModifier="Public" x:Name="VisorPDF"/>
|
||||
</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:tsWPFCore"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1000" d:DesignWidth="1000">
|
||||
<Grid >
|
||||
|
||||
<dxp:DocumentPreviewControl x:Name="Visualizador" x:FieldModifier="public" CommandBarStyle="Ribbon" >
|
||||
</dxp:DocumentPreviewControl>
|
||||
</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
|
||||
17
Informes/ucVisualizadorInformesa.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<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"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
|
||||
xmlns:local="clr-namespace:tsWPFCore"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1000" d:DesignWidth="1000">
|
||||
<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
|
||||
45
Menus.vb
Normal file
@@ -0,0 +1,45 @@
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports tsUtilidades
|
||||
Imports tsUtilidades.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 tsUtilidades.tsUtilidadesModel.tsUtilidadesEntities
|
||||
' Select Case datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Tipo
|
||||
' Case TipoBD.MYSQL
|
||||
' bd = bbdd.ConectartsUtilidadesEntityMySQL(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, "tsUtilidadesModel", 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.ConectartsUtilidadesEntitySQLServer(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Usuario, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Password, "tsUtilidadesModel")
|
||||
' Case TipoBD.LOCALDB
|
||||
' bd = bbdd.ConectartsUtilidadesEntityLocalDB(datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Servidor, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).Fichero, datconexcli.BasesDatos(datconexcli.NumeroBDConfiguracion).DataBase, "tsUtilidadesModel")
|
||||
' 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 tsUtilidades.tsUtilidadesModel.tsUtilidadesEntities, ByRef bsi As DevExpress.Xpf.Bars.BarSubItem, mi As tsUtilidades.tsUtilidadesModel.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
|
||||
10
My Project/Application.myapp
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>Form1</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
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("tsWPFCore.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
|
||||
110
My Project/Resources.resx
Normal file
@@ -0,0 +1,110 @@
|
||||
<?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">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" 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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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.11.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.tsWPFCore.My.MySettings
|
||||
Get
|
||||
Return Global.tsWPFCore.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
6
My Project/Settings.settings
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
</SettingsFile>
|
||||
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
|
||||
294
Plantillas.vb
Normal file
@@ -0,0 +1,294 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports DevExpress.Mvvm.UI.Interactivity
|
||||
Imports System.Globalization
|
||||
|
||||
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 DateTimeToDateConverter
|
||||
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 dtmp As DateTime = value
|
||||
Return New Date(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
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 dtmp As Date = value
|
||||
Return New DateTime(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Public Class DateOnlyToDateTimeConverter
|
||||
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 dtmp As DateOnly = value
|
||||
Return New DateTime(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
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 dtmp As DateTime = value
|
||||
Return New DateOnly(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class DateOnlyToDateConverter
|
||||
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 dtmp As DateOnly = value
|
||||
Return New Date(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
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 dtmp As Date = value
|
||||
Return New DateOnly(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Public Class DateTimeToDateOnlyConverter
|
||||
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 dtmp As DateTime = value
|
||||
Return New DateOnly(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
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 dtmp As DateOnly = value
|
||||
Return New DateTime(dtmp.Year, dtmp.Month, dtmp.Day)
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Public Class DoubleToTimeSpanConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim Valor As TimeSpan? = TimeSpan.FromTicks(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
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As 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 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
|
||||
|
||||
Public Class ExistenLineasConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
||||
Dim lineas As IEnumerable(Of Object) = value
|
||||
Return (lineas.Count > 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 DateTimeToDateTime
|
||||
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 dt As DateTime = value
|
||||
Dim ahora As DateTime = Now
|
||||
Return New DateTime(dt.Year, dt.Month, dt.Day)
|
||||
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 New DateTime(dt.Year, dt.Month, dt.Day)
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
508
Plantillas.xaml
Normal file
@@ -0,0 +1,508 @@
|
||||
<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:tsWPFCore.Plantillas" >
|
||||
|
||||
|
||||
<dx:FormatStringConverter x:Key="FormatStringConverter" FormatString="D" />
|
||||
<dx:ImageDataConverter x:Key="ImageDataConverter" />
|
||||
<local:DateTimeToTimeSpanConverter x:Key="DateTimeToTimeSpanConverter" />
|
||||
<local:DoubleToTimeSpanConverter x:Key="DoubleToTimeSpanConverter"/>
|
||||
<local:DateTimeToDateConverter x:Key="DateTimeToDateConverter" />
|
||||
<local:DateTimeToDateOnlyConverter x:Key="DateTimeToDateOnlyConverter" />
|
||||
<local:DateOnlyToDateTimeConverter x:Key="DateOnlyToDateTimeConverter" />
|
||||
<local:DateOnlyToDateConverter x:Key="DateOnlyToDateConverter" />
|
||||
<local:TimeSpanConverter x:Key="TimeSpanConverter"/>
|
||||
<local:DateTimeToDateTime x:Key="DateTimeToDateTime"/>
|
||||
<local:Impar x:Key="Impar"/>
|
||||
<!--<local:DateTimeToTimeSpanConverter x:Key="DateTimeToTimeSpanConverter" />-->
|
||||
<!--<local:TimeSpanConverter x:Key="TimeSpanConverter" />-->
|
||||
|
||||
|
||||
|
||||
|
||||
<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="Blue" 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="Blue" 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="Blue" 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}}" HorizontalAlignment="Center" 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="/tsWPFCore;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="Dictionaries/Spanish.txt"
|
||||
Culture="es-ES"
|
||||
DictionaryUri="pack://siteoforigin:,,,/Dictionaries/spanish.dic"
|
||||
GrammarUri="pack://siteoforigin:,,,/Dictionaries/spanish.aff"/>
|
||||
</dxspch:DXSpellChecker.Dictionaries>
|
||||
-->
|
||||
<!--endregion #DXSpellChecker-->
|
||||
<!--
|
||||
</dxspch:DXSpellChecker>-->
|
||||
|
||||
</ResourceDictionary>
|
||||
5
README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
tsUtilidades
|
||||
|
||||
2025-05-30 Versión 1.3.1
|
||||
- Se añade archivo README.md
|
||||
|
||||
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
|
||||
152
Utilidades/Docx.vb
Normal file
@@ -0,0 +1,152 @@
|
||||
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, 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) = tsUtilidades.Utilidades.ObtieneFicheroAleatorio("docx")
|
||||
' sp(i) = tsUtilidades.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
|
||||
' msPdfUnidos = tsUtilsPDF.pdf.UnePdfsITS(sp)
|
||||
' Return msPdfUnidos.ToArray
|
||||
' Else
|
||||
' Dim sdocx As String
|
||||
' Do
|
||||
' sdocx = tsUtilidades.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) ' tsUtilidades.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 DataTable, 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 fs As New IO.FileStream(FicheroDestino, IO.FileMode.Create, IO.FileAccess.Write)
|
||||
docServer.ExportToPdf(fs)
|
||||
fs.Close()
|
||||
docServer.Dispose()
|
||||
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
|
||||
|
||||
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
|
||||
218
Utilidades/Utilidades.vb
Normal file
@@ -0,0 +1,218 @@
|
||||
Imports DevExpress.Xpf.LayoutControl
|
||||
Imports System.Data
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports bdGestionAntifraude.db
|
||||
|
||||
Namespace Utilidades
|
||||
Public Class Varias
|
||||
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) OrElse 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 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 &= " OrElse " & 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 &= " OrElse " & 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 &= " OrElse " & c & "=" & Chr(34) & palabra & Chr(34)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
ExpresionParcial = "(" & ExpresionParcial.Substring(4) & ")"
|
||||
Expresion &= " OrElse " & 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 &= " OrElse " & ExpresionParcial
|
||||
End If
|
||||
If Expresion <> "" Then
|
||||
Return Expresion.Substring(8)
|
||||
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 &= " orelse " & 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 &= " orelse " & 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 &= " orelse " & 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 &= " orelse " & c & "=" & "@" & ContNum.ToString
|
||||
ReDim Preserve Parametros(ContNum)
|
||||
Parametros(ContNum) = palabra
|
||||
ContNum += 1
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
ExpresionParcial = "(" & ExpresionParcial.Substring(4) & ")"
|
||||
Expresion &= " orelse " & 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 &= " orelse " & ExpresionParcial
|
||||
End If
|
||||
If Expresion <> "" Then
|
||||
Return Expresion.Substring(8)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
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 = tsUtilidades.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 = tsUtilidades.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 = tsUtilidades.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 = tsUtilidades.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
|
||||
83
Utilidades/odt.vb
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
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 ms As New IO.MemoryStream
|
||||
docServer.Dispose()
|
||||
GC.Collect()
|
||||
GC.WaitForPendingFinalizers()
|
||||
Return ms.ToArray
|
||||
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
|
||||
109
Utilidades/tsXtraReports.vb
Normal file
@@ -0,0 +1,109 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Class tsXtraReport
|
||||
Public Shared Sub ExportarAPDF(Plantilla() As Byte, Datos As Object, FicheroPDF As String)
|
||||
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
|
||||
Try
|
||||
Dim pr As Global.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
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument()
|
||||
xr.ExportToPdf(FicheroPDF)
|
||||
End Sub
|
||||
|
||||
Public Shared Sub ExportarAxls(Plantilla() As Byte, Datos As Object, Ficheroxls As String)
|
||||
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
|
||||
Try
|
||||
Dim pr As Global.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
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument()
|
||||
xr.ExportToXls(Ficheroxls)
|
||||
|
||||
End Sub
|
||||
Public Shared Sub ExportarAxlsx(Plantilla() As Byte, Datos As Object, Ficheroxlsx As String)
|
||||
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
|
||||
Try
|
||||
Dim pr As Global.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
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument()
|
||||
xr.ExportToXlsx(Ficheroxlsx)
|
||||
|
||||
End Sub
|
||||
Public Shared Sub ExportarAcsv(Plantilla() As Byte, Datos As Object, Ficherocsv As String)
|
||||
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
|
||||
Try
|
||||
Dim pr As Global.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
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument()
|
||||
xr.ExportToCsv(Ficherocsv)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Shared Function ExportarAPDF(Plantilla() As Byte, Datos As Object) 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
|
||||
Try
|
||||
Dim pr As Global.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
|
||||
xr.DataSource = Datos
|
||||
xr.CreateDocument()
|
||||
Dim ms As New MemoryStream
|
||||
xr.ExportToPdf(ms)
|
||||
Return ms
|
||||
End Function
|
||||
End Class
|
||||
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:ts="clr-namespace:tsWPFCore"
|
||||
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>
|
||||
<dxg:GridControl x:Name="gcErrores" ItemsSource="{Binding}" AutoPopulateColumns="True">
|
||||
<dxg:GridControl.Columns>
|
||||
<dxg:GridColumn Name="GridColumn1" FieldName="Column" Header="Errores"/>
|
||||
</dxg:GridControl.Columns>
|
||||
<!--<my:tsGridControl.Columns>
|
||||
<dxg:GridColumn Name="GridColumn1" FieldName="ErrorContent"/>
|
||||
</my:tsGridControl.Columns>-->
|
||||
<dxg:GridControl.View>
|
||||
<dxg:TableView Name="TableView1" ShowTotalSummary="True" AllowGrouping="False" ShowGroupPanel="False" ShowIndicator="True" ShowSearchPanelCloseButton="True" ShowHorizontalLines="True" AutoWidth="True" AllowEditing="False" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
</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 ContenedorAplicacion
|
||||
|
||||
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"
|
||||
Title="VentanaMensajes" Height="700" Width="900"
|
||||
WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner"
|
||||
>
|
||||
<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>
|
||||
141
VentanaProgreso.xaml.vb
Normal file
@@ -0,0 +1,141 @@
|
||||
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
|
||||
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:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
|
||||
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 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:,,,/tsWPFCore;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
|
||||
12
Window1.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window x:Class="Window1"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:tsWPFCore"
|
||||
mc:Ignorable="d"
|
||||
Title="Window1" Height="450" Width="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
3
Window1.xaml.vb
Normal file
@@ -0,0 +1,3 @@
|
||||
Public Class Window1
|
||||
|
||||
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.LayoutControl.v23.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:,,,/tsWPFCore;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.v22.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:,,,/tsWPFCore;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 tsWPFCore
|
||||
Imports tsUtilidades.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
|
||||
12
dxwGenerica.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<dx:DXWindow x:Class="dxwGenerica"
|
||||
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" ShowInTaskbar="True"
|
||||
ShowIcon="False" Title="" WindowStyle="ToolWindow" WindowState="Maximized" WindowStartupLocation="CenterScreen" >
|
||||
</dx:DXWindow>
|
||||
3
dxwGenerica.xaml.vb
Normal file
@@ -0,0 +1,3 @@
|
||||
Public Class dxwGenerica
|
||||
|
||||
End Class
|
||||
18
dxwIdentificacion.xaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<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="200" Width="357" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowStartupLocation="CenterScreen" Topmost="True" >
|
||||
|
||||
<Grid x:Name="gc" >
|
||||
<dxe:TextEdit HorizontalAlignment="Left" Margin="99,14,0,0" Name="teUsuario" VerticalAlignment="Top" Width="212" TabIndex="0" x:FieldModifier="Public" />
|
||||
<Label Content="Usuario:" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="Label1" VerticalAlignment="Top" Width="88" />
|
||||
<Label Content="Contraseña:" Height="23" HorizontalAlignment="Left" Margin="12,55,0,0" Name="Label2" VerticalAlignment="Top" Width="79" />
|
||||
<dxe:PasswordBoxEdit HorizontalAlignment="Left" Margin="97,56,0,0" Name="pbeContrasenna" VerticalAlignment="Top" Width="215" TabIndex="1" x:FieldModifier="Public"/>
|
||||
<Button Content="Aceptar" Height="23" HorizontalAlignment="Left" Margin="21,95,0,0" Name="Button1" VerticalAlignment="Top" Width="121" />
|
||||
<Button Content="Cancelar" Height="23" HorizontalAlignment="Right" Margin="0,95,22,0" Name="Button2" VerticalAlignment="Top" Width="121" />
|
||||
<Label x:Name="lVersion" Content="Versión:" FontSize="9" Height="23" HorizontalAlignment="Left" Margin="11,139,0,0" VerticalAlignment="Top" Width="200" />
|
||||
|
||||
</Grid>
|
||||
</dx:DXWindow>
|
||||
62
dxwIdentificacion.xaml.vb
Normal file
@@ -0,0 +1,62 @@
|
||||
Imports DevExpress.Xpf.Editors
|
||||
Imports DevExpress.Xpf.Core.Native
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class dxwIdentificacion
|
||||
Private _Version As String
|
||||
Public Cancelar As Boolean
|
||||
|
||||
Public Sub New(Optional Version As String = "")
|
||||
|
||||
_Version = Version
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
InitializeComponent()
|
||||
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
|
||||
Cancelar = False
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
|
||||
Cancelar = True
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub Window_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles gc.PreviewKeyDown
|
||||
If e.Key = Key.Return Then
|
||||
If teUsuario.Text <> "" And Me.pbeContrasenna.Text <> "" Then
|
||||
Cancelar = False
|
||||
Me.Close()
|
||||
Else
|
||||
Dim te As BaseEdit = LayoutHelper.FindParentObject(Of BaseEdit)(Keyboard.FocusedElement)
|
||||
If te Is Nothing Then
|
||||
FocusManager.SetFocusedElement(Me, teUsuario)
|
||||
Else
|
||||
If te.Name.ToUpper = "TEUSUARIO" Then
|
||||
FocusManager.SetFocusedElement(Me, pbeContrasenna)
|
||||
Else
|
||||
FocusManager.SetFocusedElement(Me, teUsuario)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub dxwIdentificacion_Activated(sender As Object, e As EventArgs) Handles Me.Activated
|
||||
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() Me.Focus()), System.Windows.Threading.DispatcherPriority.Send)
|
||||
' Application.Current.Dispatcher.BeginInvoke(New Action(Function() teUsuario.Focus()), System.Windows.Threading.DispatcherPriority.Send)
|
||||
End Sub
|
||||
|
||||
Private Sub dxwIdentificacion_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
||||
'FocusManager.SetFocusedElement(Me, teUsuario)
|
||||
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
|
||||
End Sub
|
||||
End Class
|
||||
100
dxwInicioAplicacion.xaml
Normal file
@@ -0,0 +1,100 @@
|
||||
<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.v23.2" x:Class="dxwInicioAplicacion"
|
||||
ShowInTaskbar="True"
|
||||
ShowIcon="False" Title="Seleccione Acción" WindowStyle="ToolWindow" WindowState="Normal" WindowStartupLocation="CenterScreen" Topmost="True" Width="1000" Height="240">
|
||||
<dx:DXWindow.CommandBindings>
|
||||
<CommandBinding Command="Close" Executed="CommandBinding_Executed" />
|
||||
</dx:DXWindow.CommandBindings>
|
||||
<dx:DXWindow.InputBindings>
|
||||
<KeyBinding Command="Close" Key="Esc" />
|
||||
</dx:DXWindow.InputBindings>
|
||||
|
||||
<dx:DXWindow.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</dx:DXWindow.Resources>
|
||||
<Grid x:Name="grid">
|
||||
<dxlc:LayoutControl Orientation="Vertical">
|
||||
<dxlc:LayoutGroup View="GroupBox" Header="Búsqueda Rápida">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutItem Label="Búsqueda:" FontWeight="Bold">
|
||||
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
|
||||
</dxlc:LayoutItem>
|
||||
<dxlc:LayoutItem Label="Campos de búsqueda:">
|
||||
<Border BorderThickness="1" BorderBrush="Black">
|
||||
<TextBlock x:Name="tbCamposBusqueda"></TextBlock>
|
||||
</Border>
|
||||
</dxlc:LayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Otras Opciones" View="GroupBox" x:Name="lgOtrasOpciones">
|
||||
<dxlc:LayoutGroup>
|
||||
<TextBlock Height="25" x:Name="tbBusquedaAvanzada" HorizontalAlignment="Left">
|
||||
<Hyperlink x:Name="hlBusquedaAvanzada" Click="HlBusquedaAvanzada_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Búsqueda Avanzada" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Height="25" HorizontalAlignment="Left" Margin="70,0,0,0">
|
||||
<Hyperlink x:Name="hlNuevoRegistro" Click="HlNuevoRegistro_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Nuevo Registro" x:Name="tbNuevo" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Height="25" x:Name="tbcOtrasOpciones" Margin="70,0,0,0" Visibility="Hidden">
|
||||
<Hyperlink x:Name="hlOtrasOpciones" Click="HlOtrasOpciones_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Otras Opciones" x:Name="tbOtrasOpciones" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
|
||||
<!--<dxlc:LayoutGroup View="GroupBox" Header="Otras Opciones" x:Name="lgOtrasOpciones" Width="950" >
|
||||
<dxlc:LayoutGroup Orientation="Horizontal" >
|
||||
|
||||
<TextBlock Width="150" Height="25" x:Name="tbBusquedaAvanzada">
|
||||
<Hyperlink x:Name="hlBusquedaAvanzada" Click="HlBusquedaAvanzada_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Búsqueda Avanzada"/>
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Width="150" Height="25" >
|
||||
<Hyperlink x:Name="hlNuevoRegistro" Click="HlNuevoRegistro_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Nuevo Registro" x:Name="tbNuevo" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Width="150" Height="25" x:Name="tbcOtrasOpciones" Visibility="Hidden" >
|
||||
<Hyperlink x:Name="hlOtrasOpciones" Click="HlOtrasOpciones_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Otras Opciones" x:Name="tbOtrasOpciones" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>-->
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
|
||||
|
||||
</dx:DXWindow>
|
||||
100
dxwInicioAplicacion.xaml.bak
Normal file
@@ -0,0 +1,100 @@
|
||||
<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.v22.2" x:Class="dxwInicioAplicacion"
|
||||
ShowInTaskbar="True"
|
||||
ShowIcon="False" Title="Seleccione Acción" WindowStyle="ToolWindow" WindowState="Normal" WindowStartupLocation="CenterScreen" Topmost="True" Width="1000" Height="240">
|
||||
<dx:DXWindow.CommandBindings>
|
||||
<CommandBinding Command="Close" Executed="CommandBinding_Executed" />
|
||||
</dx:DXWindow.CommandBindings>
|
||||
<dx:DXWindow.InputBindings>
|
||||
<KeyBinding Command="Close" Key="Esc" />
|
||||
</dx:DXWindow.InputBindings>
|
||||
|
||||
<dx:DXWindow.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</dx:DXWindow.Resources>
|
||||
<Grid x:Name="grid">
|
||||
<dxlc:LayoutControl Orientation="Vertical">
|
||||
<dxlc:LayoutGroup View="GroupBox" Header="Búsqueda Rápida">
|
||||
<dxlc:LayoutGroup Orientation="Vertical">
|
||||
<dxlc:LayoutItem Label="Búsqueda:" FontWeight="Bold">
|
||||
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" x:FieldModifier="public" FontWeight="Normal" />
|
||||
</dxlc:LayoutItem>
|
||||
<dxlc:LayoutItem Label="Campos de búsqueda:">
|
||||
<Border BorderThickness="1" BorderBrush="Black">
|
||||
<TextBlock x:Name="tbCamposBusqueda"></TextBlock>
|
||||
</Border>
|
||||
</dxlc:LayoutItem>
|
||||
</dxlc:LayoutGroup>
|
||||
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup Header="Otras Opciones" View="GroupBox" x:Name="lgOtrasOpciones">
|
||||
<dxlc:LayoutGroup>
|
||||
<TextBlock Height="25" x:Name="tbBusquedaAvanzada" HorizontalAlignment="Left">
|
||||
<Hyperlink x:Name="hlBusquedaAvanzada" Click="HlBusquedaAvanzada_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Búsqueda Avanzada" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Height="25" HorizontalAlignment="Left" Margin="70,0,0,0">
|
||||
<Hyperlink x:Name="hlNuevoRegistro" Click="HlNuevoRegistro_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Nuevo Registro" x:Name="tbNuevo" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Height="25" x:Name="tbcOtrasOpciones" Margin="70,0,0,0" Visibility="Hidden">
|
||||
<Hyperlink x:Name="hlOtrasOpciones" Click="HlOtrasOpciones_Click">
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Otras Opciones" x:Name="tbOtrasOpciones" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>
|
||||
|
||||
|
||||
|
||||
<!--<dxlc:LayoutGroup View="GroupBox" Header="Otras Opciones" x:Name="lgOtrasOpciones" Width="950" >
|
||||
<dxlc:LayoutGroup Orientation="Horizontal" >
|
||||
|
||||
<TextBlock Width="150" Height="25" x:Name="tbBusquedaAvanzada">
|
||||
<Hyperlink x:Name="hlBusquedaAvanzada" Click="HlBusquedaAvanzada_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Búsqueda Avanzada"/>
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Width="150" Height="25" >
|
||||
<Hyperlink x:Name="hlNuevoRegistro" Click="HlNuevoRegistro_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Nuevo Registro" x:Name="tbNuevo" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Width="150" Height="25" x:Name="tbcOtrasOpciones" Visibility="Hidden" >
|
||||
<Hyperlink x:Name="hlOtrasOpciones" Click="HlOtrasOpciones_Click" >
|
||||
<InlineUIContainer>
|
||||
<TextBlock Text="Otras Opciones" x:Name="tbOtrasOpciones" />
|
||||
</InlineUIContainer>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutGroup>-->
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
|
||||
|
||||
</dx:DXWindow>
|
||||
92
dxwInicioAplicacion.xaml.vb
Normal file
@@ -0,0 +1,92 @@
|
||||
|
||||
|
||||
Public Class dxwInicioAplicacion
|
||||
Public Respuesta As RespuestaInicioAplicacion
|
||||
Public ExpresionBusqueda As String
|
||||
Private _CamposBusquedaAlfabeticos() As String
|
||||
Private _CamposBusquedaAlfabeticosPorIgualdad() As String
|
||||
Private _CamposBusquedaNumericos() As String
|
||||
Public Sub New(Titulo As String, TituloCamposBusqueda As String, CamposBusquedaAlfabeticos() As String, CamposBusquedaAlfabeticosPorIgualdad() As String, CamposBusquedaNumericos() As String, TextoABuscar As String, PermitirNuevos As Boolean, PermitirBusquedaAvanzada As Boolean, Optional TextoNuevos As String = "", Optional TextoOtrasOpciones As String = "")
|
||||
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
|
||||
InitializeComponent()
|
||||
Me.Title = Titulo
|
||||
_CamposBusquedaAlfabeticos = CamposBusquedaAlfabeticos
|
||||
_CamposBusquedaAlfabeticosPorIgualdad = CamposBusquedaAlfabeticosPorIgualdad
|
||||
_CamposBusquedaNumericos = CamposBusquedaNumericos
|
||||
tbCamposBusqueda.Text = TituloCamposBusqueda
|
||||
teBusqueda.Text = TextoABuscar
|
||||
If Not PermitirBusquedaAvanzada Then tbBusquedaAvanzada.Visibility = Visibility.Collapsed
|
||||
If Not PermitirNuevos Then tbNuevo.Visibility = Visibility.Collapsed
|
||||
If Not PermitirBusquedaAvanzada And Not PermitirNuevos Then lgOtrasOpciones.Visibility = Visibility.Collapsed
|
||||
If TextoNuevos <> "" Then tbNuevo.Text = TextoNuevos
|
||||
If TextoOtrasOpciones <> "" Then
|
||||
tbOtrasOpciones.Text = TextoOtrasOpciones
|
||||
tbcOtrasOpciones.Visibility = Visibility.Visible
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub HlBusquedaAvanzada_Click(sender As Object, e As RoutedEventArgs)
|
||||
DialogResult = True
|
||||
Respuesta = RespuestaInicioAplicacion.BUSQUEDA_AVANZADA
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub HlNuevoRegistro_Click(sender As Object, e As RoutedEventArgs)
|
||||
DialogResult = True
|
||||
Respuesta = RespuestaInicioAplicacion.NUEVO_REGISTRO
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
|
||||
If Me.teBusqueda.Text.Trim <> "" Then
|
||||
ExpresionBusqueda = Utilidades.Varias.GeneraExpresionBusqueda(Me.teBusqueda.Text.Trim, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Me._CamposBusquedaAlfabeticosPorIgualdad)
|
||||
Respuesta = RespuestaInicioAplicacion.BUSQUEDA_RAPIDA
|
||||
|
||||
Me.DialogResult = True
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CommandBinding_Executed(sender As Object, e As ExecutedRoutedEventArgs)
|
||||
Me.DialogResult = False
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub dxwInicioAplicacion_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
Me.teBusqueda.Focus()
|
||||
End Sub
|
||||
|
||||
Private Sub HlOtrasOpciones_Click(sender As Object, e As RoutedEventArgs)
|
||||
DialogResult = True
|
||||
Respuesta = RespuestaInicioAplicacion.OTRAS_OPCIONES
|
||||
Me.Close()
|
||||
End Sub
|
||||
'Public Shared Function GeneraExpresionBusqueda(TextoAbuscar As String, CamposBusquedaNumericos() As String, CamposBusquedaAlfabeticos() As String) As String
|
||||
' Dim Expresion As String = ""
|
||||
' Dim Palabras = TextoAbuscar.Trim.Split(" ")
|
||||
' 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 &= " OrElse " & c & "=" & Numero
|
||||
' Next
|
||||
' End If
|
||||
' For Each c In CamposBusquedaAlfabeticos
|
||||
' Expresion &= " OrElse " & c & ".Contains(" & Chr(34) & palabra & Chr(34) & ")"
|
||||
' Next
|
||||
' Next
|
||||
' Return Expresion.Substring(4)
|
||||
'End Function
|
||||
|
||||
|
||||
End Class
|
||||
Public Enum RespuestaInicioAplicacion
|
||||
BUSQUEDA_AVANZADA
|
||||
BUSQUEDA_RAPIDA
|
||||
NUEVO_REGISTRO
|
||||
OTRAS_OPCIONES
|
||||
End Enum
|
||||
29
dxwIntervaloFechas.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<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:kk="clr-namespace:tsWPFCore.Controles"
|
||||
xmlns:tsWPFCore="clr-namespace:tsWPFCore"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
x:Class="dxwIntervaloFechas"
|
||||
Title="Introduzca Intervalo de Fechas" HorizontalAlignment="Center" Height="260" 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" >
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Inicial:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" >
|
||||
<dxe:DateEdit x:Name="deFechaInicial" Width="120" />
|
||||
</tsWPFCore:tsLayoutItem>
|
||||
<tsWPFCore:tsLayoutItem Label="Fecha Final:" FontWeight="Bold" HorizontalAlignment="Stretch" TabIndex="1" Margin="0,10" >
|
||||
<dxe:DateEdit x:Name="deFechaFinal" Width="120" />
|
||||
</tsWPFCore: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>
|
||||
47
dxwIntervaloFechas.xaml.vb
Normal file
@@ -0,0 +1,47 @@
|
||||
Imports DevExpress.Xpf.Core
|
||||
|
||||
Public Class dxwIntervaloFechas
|
||||
Public NombreFichero As String
|
||||
Public FechaInicial As Date?
|
||||
Public FechaFinal As Date?
|
||||
Private _fiObligatoria As Boolean
|
||||
Private _ffObligatoria As Boolean
|
||||
Public Sub New(Optional FechaInicio As Date? = Nothing, Optional FechaFin As Date? = Nothing, Optional Titulo As String = "Introduzca intervalo de Fechas", Optional FechaInicioObligatoria As Boolean = False, Optional FechaFinObligatoria As Boolean = False)
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
Me.Title = Titulo
|
||||
Me.deFechaInicial.EditValue = FechaInicio
|
||||
Me.deFechaFinal.EditValue = FechaFin
|
||||
_fiObligatoria = FechaInicioObligatoria
|
||||
_ffObligatoria = FechaFinObligatoria
|
||||
|
||||
' 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.deFechaInicial.EditValue Is Nothing AndAlso _fiObligatoria Then Throw New Exception("La fecha inicial es obligatoria")
|
||||
If Me.deFechaFinal.EditValue Is Nothing AndAlso _ffObligatoria Then Throw New Exception("La fecha final es obligatoria")
|
||||
Me.FechaInicial = Me.deFechaInicial.EditValue
|
||||
Me.FechaFinal = Me.deFechaFinal.EditValue
|
||||
Me.DialogResult = True
|
||||
Me.Close()
|
||||
Catch ex As Exception
|
||||
DXMessageBox.Show(ex.Message, "Error")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
185
modExtensiones.vb
Normal file
@@ -0,0 +1,185 @@
|
||||
Imports System.Data.Objects.DataClasses
|
||||
Imports System.Data.Objects
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports System.Data.Entity
|
||||
Imports System.Data.Entity.Infrastructure
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Data.Entity.Core.Objects.DataClasses
|
||||
Imports System.Data.Entity.Core.Objects
|
||||
Imports System.Data.Entity.Core
|
||||
Imports tsWPFCore.tsControles
|
||||
Imports System.Data.Entity.Core.Common.Utils
|
||||
Imports Microsoft.EntityFrameworkCore
|
||||
|
||||
Public Module modExtensiones
|
||||
<System.Runtime.CompilerServices.Extension()>
|
||||
Public Function ObtieneHijoDeTipo(Of T As DependencyObject)(depObj As DependencyObject) As T
|
||||
If depObj Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(depObj) - 1
|
||||
Dim child = VisualTreeHelper.GetChild(depObj, i)
|
||||
|
||||
Dim result = If(TryCast(child, T), ObtieneHijoDeTipo(Of T)(child))
|
||||
If result IsNot Nothing Then
|
||||
Return result
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
<System.Runtime.CompilerServices.Extension()>
|
||||
Public Sub ObtieneHijosDeTipo(Of T As DependencyObject)(depObj As DependencyObject, ByRef lista As List(Of T))
|
||||
If depObj IsNot Nothing Then
|
||||
If lista Is Nothing Then lista = New List(Of T)
|
||||
For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(depObj) - 1
|
||||
Dim child = VisualTreeHelper.GetChild(depObj, i)
|
||||
Dim hijo = TryCast(child, T)
|
||||
If hijo IsNot Nothing Then
|
||||
lista.Add(hijo)
|
||||
Else
|
||||
ObtieneHijosDeTipo(Of T)(child, lista)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
<System.Runtime.CompilerServices.Extension()>
|
||||
Public Function ObtienePadreDeTipo(Of T As DependencyObject)(depObj As DependencyObject) As T
|
||||
If depObj Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
Dim parent As DependencyObject
|
||||
Do
|
||||
parent = VisualTreeHelper.GetParent(depObj)
|
||||
If Not parent Is Nothing Then
|
||||
Dim result = If(TryCast(parent, T), ObtienePadreDeTipo(Of T)(parent))
|
||||
If result IsNot Nothing Then
|
||||
Return result
|
||||
End If
|
||||
End If
|
||||
Loop Until parent Is Nothing
|
||||
Return Nothing
|
||||
End Function
|
||||
'<System.Runtime.CompilerServices.Extension()>
|
||||
'Public Function ObtieneContexto(Entidad As IEntityWithRelationships) As ObjectContext
|
||||
' If Entidad Is Nothing Then Throw New ArgumentNullException
|
||||
' Dim relationshipmanager = Entidad.RelationshipManager
|
||||
' Dim relatedend = relationshipmanager.GetAllRelatedEnds.FirstOrDefault
|
||||
' If relatedend Is Nothing Then Throw New Exception("No relationships found")
|
||||
' Dim query As ObjectQuery = relatedend.CreateSourceQuery
|
||||
' If query Is Nothing Then Throw New Exception("The Entity is Detached")
|
||||
' Return query.Context
|
||||
'End Function
|
||||
|
||||
|
||||
<System.Runtime.CompilerServices.Extension()>
|
||||
Public Function GetDataRowHandles(grid As GridControl) As List(Of Integer)
|
||||
Dim rowHandles As New List(Of Integer)()
|
||||
For i As Integer = 0 To grid.VisibleRowCount - 1
|
||||
Dim rowHandle As Integer = grid.GetRowHandleByVisibleIndex(i)
|
||||
If grid.IsGroupRowHandle(rowHandle) Then
|
||||
If Not grid.IsGroupRowExpanded(rowHandle) Then
|
||||
rowHandles.AddRange(GetDataRowHandlesInGroup(grid, rowHandle))
|
||||
End If
|
||||
Else
|
||||
rowHandles.Add(rowHandle)
|
||||
End If
|
||||
Next
|
||||
Return rowHandles
|
||||
End Function
|
||||
Private Function GetDataRowHandlesInGroup(grid As GridControl, groupRowHandle As Integer) As List(Of Integer)
|
||||
Dim rowHandles As New List(Of Integer)()
|
||||
For i As Integer = 0 To grid.GetChildRowCount(groupRowHandle) - 1
|
||||
Dim rowHandle As Integer = grid.GetChildRowHandle(groupRowHandle, i)
|
||||
If grid.IsGroupRowHandle(rowHandle) Then
|
||||
rowHandles.AddRange(GetDataRowHandlesInGroup(grid, rowHandle))
|
||||
Else
|
||||
rowHandles.Add(rowHandle)
|
||||
End If
|
||||
Next
|
||||
Return rowHandles
|
||||
End Function
|
||||
|
||||
Public Function ObtieneCampos(T As Type) As List(Of String)
|
||||
Dim lp As New List(Of String)
|
||||
Dim propiedades = T.GetProperties
|
||||
For Each propiedad In propiedades.Where(Function(x) Not (x.PropertyType.Name.Contains("EntityReference") OrElse x.PropertyType.Name.Contains("EntityCollection") OrElse x.PropertyType.Name.Contains("EntityState") OrElse x.PropertyType.Name.Contains("EntityKey") OrElse (x.PropertyType.BaseType Is Nothing OrElse x.PropertyType.BaseType.Name = "EntityObject")))
|
||||
lp.Add(propiedad.Name)
|
||||
Next
|
||||
Return lp
|
||||
End Function
|
||||
Public Sub AgregaTodosCampos(tsgrid As tsGridControl, T As Type, Visible As Boolean, Optional SoloLectura As Boolean = True)
|
||||
Try
|
||||
Dim lp = ObtieneCampos(T)
|
||||
For Each p In lp
|
||||
If Not tsgrid.Columns.Any(Function(x) x.FieldName = p) And p.ToLower <> "seleccionar" Then
|
||||
Dim gc As New tsGridColumn
|
||||
gc.FieldName = p
|
||||
gc.IsSmart = True
|
||||
gc.Visible = Visible
|
||||
gc.ReadOnly = SoloLectura
|
||||
tsgrid.Columns.Add(gc)
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Sub
|
||||
<System.Runtime.CompilerServices.Extension()>
|
||||
Public Function ObtieneImagen(ByVal source As UIElement, ByVal scale As Double, ByVal quality As Integer) As Byte()
|
||||
Dim actualHeight As Double = source.RenderSize.Height
|
||||
Dim actualWidth As Double = source.RenderSize.Width
|
||||
Dim renderHeight As Double = actualHeight * scale
|
||||
Dim renderWidth As Double = actualWidth * scale
|
||||
Dim renderTarget As RenderTargetBitmap = New RenderTargetBitmap(CInt(renderWidth), CInt(renderHeight), 96, 96, PixelFormats.Pbgra32)
|
||||
Dim sourceBrush As VisualBrush = New VisualBrush(source)
|
||||
Dim drawingVisual As DrawingVisual = New DrawingVisual()
|
||||
Dim drawingContext As DrawingContext = drawingVisual.RenderOpen()
|
||||
|
||||
Using drawingContext
|
||||
drawingContext.PushTransform(New ScaleTransform(scale, scale))
|
||||
drawingContext.DrawRectangle(Brushes.White, Nothing, New Rect(New Point(0, 0), New Point(actualWidth, actualHeight)))
|
||||
drawingContext.DrawRectangle(sourceBrush, Nothing, New Rect(New Point(0, 0), New Point(actualWidth, actualHeight)))
|
||||
End Using
|
||||
|
||||
renderTarget.Render(drawingVisual)
|
||||
Dim jpgEncoder As JpegBitmapEncoder = New JpegBitmapEncoder()
|
||||
jpgEncoder.QualityLevel = quality
|
||||
jpgEncoder.Frames.Add(BitmapFrame.Create(renderTarget))
|
||||
Dim _imageArray As Byte()
|
||||
|
||||
Using outputStream As MemoryStream = New MemoryStream()
|
||||
jpgEncoder.Save(outputStream)
|
||||
_imageArray = outputStream.ToArray()
|
||||
End Using
|
||||
|
||||
Return _imageArray
|
||||
End Function
|
||||
'#Region "dbContext"
|
||||
' <System.Runtime.CompilerServices.Extension()>
|
||||
' Public Function GetEntityKey(Of T As Class)(ByVal context As DbContext, ByVal entity As T) As EntityKey
|
||||
' Dim oc = (CType(context, IObjectContextAdapter)).ObjectContext
|
||||
' Dim ose As ObjectStateEntry = Nothing
|
||||
|
||||
' If entity IsNot Nothing AndAlso oc.ObjectStateManager.TryGetObjectStateEntry(entity, ose) Then
|
||||
' Return ose.EntityKey
|
||||
' End If
|
||||
|
||||
' Return Nothing
|
||||
' End Function
|
||||
' <System.Runtime.CompilerServices.Extension()>
|
||||
' Public Function GetEntityKey(Of T As Class)(ByVal context As DbContext, ByVal dbEntityEntry As DbEntityEntry(Of T)) As EntityKey
|
||||
' If dbEntityEntry IsNot Nothing Then
|
||||
' Return GetEntityKey(context, dbEntityEntry.Entity)
|
||||
' End If
|
||||
|
||||
' Return Nothing
|
||||
' End Function
|
||||
'#End Region
|
||||
End Module
|
||||
23
tsBloqueo.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Public Class tsBloqueo
|
||||
Public Enum TipoBloqueoEnum As Integer
|
||||
SIN_AVISOS = 0
|
||||
CON_AVISOS = 1
|
||||
SOLO_LECTURA_SI_EXISTEN_BLOQUEOS = 2
|
||||
End Enum
|
||||
|
||||
Public Enum AccionBloqueEnum As Integer
|
||||
BLOQUEAR = 0
|
||||
DESBLOQUEAR = 1
|
||||
COMPRUEBABLOQUEO = 2
|
||||
ACTUALIZAVERSION = 3
|
||||
End Enum
|
||||
Public Property Bloqueo As Object
|
||||
Public Property idSesion As Integer
|
||||
Public Property Usuario As String
|
||||
Public Property ip As String
|
||||
Public Property ExistenOtrosBloqueos As Boolean
|
||||
Public Property Tipobloqueo As TipoBloqueoEnum
|
||||
Public Property PermitirGuardarConCambios As Boolean
|
||||
Public Property Version As Integer
|
||||
|
||||
End Class
|
||||
472
tsGridControl.vb
Normal file
@@ -0,0 +1,472 @@
|
||||
Imports DevExpress.Xpf.Grid.Native
|
||||
Imports DevExpress.Xpf.Grid
|
||||
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.Shapes
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports DevExpress.Xpf.Bars
|
||||
|
||||
Imports DevExpress.Xpf.Printing
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections
|
||||
Imports DevExpress.Xpf.Core.Serialization
|
||||
Imports DevExpress.Data
|
||||
Imports tsUtilidades.Extensiones
|
||||
Imports System.Globalization
|
||||
|
||||
Public Class tsGridControl
|
||||
Inherits DevExpress.Xpf.Grid.GridControl
|
||||
Public ElementosSeleccionados As ObservableCollectionCore(Of Object)
|
||||
Public Property PopupFilterModeInicializado As Boolean
|
||||
|
||||
|
||||
|
||||
Public ReadOnly Property MySelectedItems() As IList
|
||||
Get
|
||||
Return ElementosSeleccionados
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private _NombreTablaBase As String
|
||||
|
||||
Public Property PropiedadesTS As New PropiedadesTS
|
||||
Public Property PropiedadesTSGC As New PropiedadesTSGC
|
||||
|
||||
Public Sub EstableceSoloLectura(Optional SoloLectura As Boolean = True)
|
||||
For Each c In Me.Columns
|
||||
If c.CellTemplate Is Nothing Then
|
||||
c.ReadOnly = SoloLectura
|
||||
Else
|
||||
c.AllowEditing = If(SoloLectura, DevExpress.Utils.DefaultBoolean.False, DevExpress.Utils.DefaultBoolean.True)
|
||||
End If
|
||||
Dim bes = TryCast(c.EditSettings, DevExpress.Xpf.Editors.Settings.ButtonEditSettings)
|
||||
If bes IsNot Nothing Then
|
||||
bes.AllowDefaultButton = Not SoloLectura
|
||||
For Each bt In bes.Buttons
|
||||
bt.IsEnabled = Not SoloLectura
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
If Not Me.ContextMenu Is Nothing AndAlso Me.ContextMenu.HasItems Then
|
||||
Dim mi As MenuItem = Me.ContextMenu.Items(0)
|
||||
mi.IsEnabled = Not SoloLectura
|
||||
End If
|
||||
End Sub
|
||||
Public Sub ReEstableceValoresDefectoSoloLectura()
|
||||
For Each c In Me.Columns
|
||||
If c.CellTemplate Is Nothing Then
|
||||
If c.GetType Is GetType(tsGridColumn) Then
|
||||
c.ReadOnly = DirectCast(c, tsGridColumn).SoloLectura
|
||||
Dim bes = TryCast(c.EditSettings, DevExpress.Xpf.Editors.Settings.ButtonEditSettings)
|
||||
If bes IsNot Nothing Then
|
||||
bes.AllowDefaultButton = Not c.ReadOnly
|
||||
For Each bt In bes.Buttons
|
||||
bt.IsEnabled = Not c.ReadOnly
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
c.ReadOnly = False
|
||||
End If
|
||||
Else
|
||||
If c.GetType Is GetType(tsGridColumn) Then
|
||||
If DirectCast(c, tsGridColumn).SoloLectura Then
|
||||
If c.CellTemplate Is Nothing Then
|
||||
c.ReadOnly = True
|
||||
Else
|
||||
c.AllowEditing = DevExpress.Utils.DefaultBoolean.False
|
||||
End If
|
||||
Dim bes = TryCast(c.EditSettings, DevExpress.Xpf.Editors.Settings.ButtonEditSettings)
|
||||
If bes IsNot Nothing Then
|
||||
bes.AllowDefaultButton = False
|
||||
For Each bt In bes.Buttons
|
||||
bt.IsEnabled = False
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
c.AllowEditing = DevExpress.Utils.DefaultBoolean.True
|
||||
Dim bes = TryCast(c.EditSettings, DevExpress.Xpf.Editors.Settings.ButtonEditSettings)
|
||||
If bes IsNot Nothing Then
|
||||
bes.AllowDefaultButton = True
|
||||
For Each bt In bes.Buttons
|
||||
bt.IsEnabled = True
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If c.CellTemplate Is Nothing Then
|
||||
c.ReadOnly = True
|
||||
Else
|
||||
c.AllowEditing = DevExpress.Utils.DefaultBoolean.False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Public Property NombreTablaBase As String
|
||||
Get
|
||||
Return _NombreTablaBase
|
||||
End Get
|
||||
Set(value As String)
|
||||
_NombreTablaBase = value
|
||||
End Set
|
||||
End Property
|
||||
Public Event AntesEliminar(ByVal gc As tsGridControl, ByRef Cancelar As Boolean)
|
||||
Public Event DespuesEliminar(ByVal gc As tsGridControl)
|
||||
Public Event EnterPulsado()
|
||||
Public Event SeleccionCambiada(ByVal gc As tsGridControl, e As GridSelectionChangedEventArgs)
|
||||
Public Event AntesExportar(ByVal gc As tsGridControl, ByRef Cancelar As Boolean)
|
||||
|
||||
Property ComandoDelegado As DevExpress.Mvvm.DelegateCommand(Of Object)
|
||||
|
||||
Friend Function LanzaAntesExportar(gc As tsGridControl) As Boolean
|
||||
Dim Cancelar As Boolean
|
||||
RaiseEvent AntesExportar(gc, Cancelar)
|
||||
Return Cancelar
|
||||
End Function
|
||||
Friend Function LanzaAntesEliminar(gc As tsGridControl) As Boolean
|
||||
Dim Cancelar As Boolean
|
||||
RaiseEvent AntesEliminar(gc, Cancelar)
|
||||
Return Cancelar
|
||||
End Function
|
||||
|
||||
Friend Function LanzaDespuesEliminar(gc As tsGridControl) As Boolean
|
||||
Dim Cancelar As Boolean
|
||||
RaiseEvent DespuesEliminar(gc)
|
||||
Return Cancelar
|
||||
End Function
|
||||
Friend Function LanzaEnterPulsado() As Boolean
|
||||
Dim Cancelar As Boolean
|
||||
RaiseEvent EnterPulsado()
|
||||
Return Cancelar
|
||||
End Function
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
Private NumeroColumnasAgrupadas As Integer
|
||||
Friend Sub MyGridControl_StartGrouping(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
updateLocker.Lock()
|
||||
End Sub
|
||||
Public Function ObtieneNumeroColumnasAgrupadas() As Integer
|
||||
Return Me.Columns.Where(Function(x) x.IsGrouped).Count
|
||||
End Function
|
||||
Friend Sub MyGridControl_EndGrouping(sender As Object, e As RoutedEventArgs)
|
||||
'Dim nca = ObtieneNumeroColumnasAgrupadas()
|
||||
'Dim bDesAgrupando As Boolean = NumeroColumnasAgrupadas > nca
|
||||
'NumeroColumnasAgrupadas = nca
|
||||
'If bDesAgrupando Then updateLocker.Unlock()
|
||||
BeginSelection()
|
||||
For Each index As Integer In OrderedSelection
|
||||
If CBool(selection(index)) Then
|
||||
SelectItem(GetRowHandleByListIndex(index))
|
||||
End If
|
||||
Next
|
||||
EndSelection()
|
||||
' If Not bDesAgrupando Then updateLocker.Unlock()
|
||||
updateLocker.Unlock()
|
||||
End Sub
|
||||
|
||||
Private selection As New Hashtable()
|
||||
Private ReadOnly Property OrderedSelection() As IEnumerable
|
||||
Get
|
||||
Return selection.Keys.Cast(Of Integer)().OrderBy(Function(x) x)
|
||||
End Get
|
||||
End Property
|
||||
Protected Overrides Sub OnItemsSourceChanged(oldValue As Object, newValue As Object)
|
||||
MyBase.OnItemsSourceChanged(oldValue, newValue)
|
||||
selection.Clear()
|
||||
Dim itemsSource As IEnumerable = TryCast(newValue, IEnumerable)
|
||||
If itemsSource Is Nothing Then
|
||||
Return
|
||||
End If
|
||||
Dim i As Integer = 0
|
||||
For Each item As Object In itemsSource
|
||||
selection(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)) = False
|
||||
Next
|
||||
End Sub
|
||||
Protected Overrides Sub OnInitialized(e As EventArgs)
|
||||
MyBase.OnInitialized(e)
|
||||
Try
|
||||
' If Me.SelectionMode = MultiSelectMode.MultipleRow Then
|
||||
AddHandler SelectionChanged, AddressOf MyGridControl_SelectionChanged
|
||||
ElementosSeleccionados = New ObservableCollectionCore(Of Object)()
|
||||
AddHandler Me.EndGrouping, AddressOf MyGridControl_EndGrouping
|
||||
AddHandler Me.StartGrouping, AddressOf MyGridControl_StartGrouping
|
||||
If Me.PropiedadesTSGC.BusquedaAcentosInsensitivo OrElse Configuracion.BusquedaAcentosInsensitivo Then AddHandler Me.CustomRowFilter, AddressOf MyGridControl_CustomRowFilter
|
||||
ConSeleccion = True
|
||||
'''' NumeroColumnasAgrupadas = ObtieneNumeroColumnasAgrupadas()
|
||||
' End If
|
||||
If Me.View IsNot Nothing Then
|
||||
If Me.View.GetType Is GetType(TableView) Then
|
||||
DirectCast(Me.View, TableView).AllowFixedColumnMenu = True
|
||||
'''' DirectCast(Me.View, TableView).UseLightweightTemplates = UseLightweightTemplates.None
|
||||
'''' DirectCast(Me.View, TableView).GroupSummaryContentStyle = DirectCast(Me.FindResource("tsGroupSummaryContentStyle"), Style)
|
||||
'''' DirectCast(Me.View, TableView).TotalSummaryContentStyle = DirectCast(Me.FindResource("tsTotalSummaryContentStyle"), Style)
|
||||
End If
|
||||
If Configuracion.ModoBusquedaAND Then
|
||||
' Me.View.SearchPanelCriteriaOperatorType = DevExpress.Xpf.Editors.CriteriaOperatorType.And
|
||||
Me.View.SearchPanelParseMode = DevExpress.Xpf.Editors.SearchPanelParseMode.And
|
||||
End If
|
||||
DirectCast(Me.View, GridViewBase).SearchPanelPosition = SearchPanelPosition.OverGroupPanel
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.Write(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub MyGridControl_CustomRowFilter(sender As Object, e As RowFilterEventArgs)
|
||||
Dim gc As GridControl = TryCast(sender, GridControl)
|
||||
If gc.ItemsSource IsNot Nothing Then
|
||||
If gc IsNot Nothing Then
|
||||
Dim filterStr As String = gc.View.SearchString.NothingAVacio
|
||||
If filterStr <> "" Then
|
||||
Dim Palabras = RemoveDiacriticsCustom(filterStr.ToLowerInvariant).Split(" ")
|
||||
e.Visible = False
|
||||
e.Handled = True
|
||||
For Each c As GridColumn In gc.Columns
|
||||
Dim value As String = RemoveDiacriticsCustom(gc.GetCellDisplayText(gc.GetRowHandleByListIndex(e.ListSourceRowIndex), c).ToLowerInvariant)
|
||||
If c.Visible Then
|
||||
For Each p In Palabras
|
||||
If value.Contains(p) Then
|
||||
e.Visible = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If e.Visible Then Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Shared Function RemoveDiacriticsCustom(ByVal text As String) As String
|
||||
Return String.Concat(text.Normalize(NormalizationForm.FormD).Where(Function(ch) CharUnicodeInfo.GetUnicodeCategory(ch) <> UnicodeCategory.NonSpacingMark)).Normalize(NormalizationForm.FormC)
|
||||
End Function
|
||||
|
||||
Public Sub DeshabilitaSeleccionMultiple()
|
||||
RemoveHandler SelectionChanged, AddressOf MyGridControl_SelectionChanged
|
||||
RemoveHandler Me.EndGrouping, AddressOf MyGridControl_EndGrouping
|
||||
RemoveHandler Me.StartGrouping, AddressOf MyGridControl_StartGrouping
|
||||
ConSeleccion = False
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Private updateLocker As New Locker()
|
||||
|
||||
'Public Sub SeleccionaTodo()
|
||||
' Me.SelectAll()
|
||||
' MyGridControl_SelectionChanged(Me, Nothing)
|
||||
'End Sub
|
||||
Friend Sub MyGridControl_SelectionChanged(sender As Object, e As GridSelectionChangedEventArgs)
|
||||
Try
|
||||
If ConSeleccion AndAlso Not updateLocker.IsLocked Then
|
||||
Dim drhws = GetDataRowHandles()
|
||||
|
||||
'For i As Integer = 0 To VisibleRowCount - 1
|
||||
For i As Integer = 0 To drhws.Count - 1
|
||||
'Dim rowHandle As Integer = GetRowHandleByVisibleIndex(i)
|
||||
Dim rowHandle As Integer = drhws(i)
|
||||
selection(GetListIndexByRowHandle(rowHandle)) = View.IsRowSelected(rowHandle)
|
||||
Next
|
||||
ElementosSeleccionados.BeginUpdate()
|
||||
ElementosSeleccionados.Clear()
|
||||
For Each index As Integer In OrderedSelection
|
||||
If CBool(selection(index)) Then
|
||||
ElementosSeleccionados.Add(GetRowByListIndex(index))
|
||||
End If
|
||||
Next
|
||||
ElementosSeleccionados.EndUpdate()
|
||||
RaiseEvent SeleccionCambiada(sender, e)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.Write(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
Protected Overrides Sub ApplyFilter(checkFilterEnabled As Boolean, Optional skipIfFilterEquals As Boolean = False)
|
||||
If ConSeleccion Then
|
||||
If DirectCast(Me.View, TableView).ShowCheckBoxSelectorColumn Then
|
||||
updateLocker.DoLockedAction(Sub()
|
||||
MyBase.ApplyFilter(checkFilterEnabled, skipIfFilterEquals)
|
||||
BeginSelection()
|
||||
For Each index As Integer In OrderedSelection
|
||||
If CBool(selection(index)) Then
|
||||
SelectItem(GetRowHandleByListIndex(index))
|
||||
End If
|
||||
Next
|
||||
EndSelection()
|
||||
|
||||
End Sub)
|
||||
Else
|
||||
MyBase.ApplyFilter(checkFilterEnabled, skipIfFilterEquals)
|
||||
End If
|
||||
Else
|
||||
MyBase.ApplyFilter(checkFilterEnabled, skipIfFilterEquals)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Function GetDataRowHandles() As List(Of Integer)
|
||||
Dim rowHandles As New List(Of Integer)()
|
||||
For i As Integer = 0 To Me.VisibleRowCount - 1
|
||||
Dim rowHandle As Integer = Me.GetRowHandleByVisibleIndex(i)
|
||||
If Me.IsGroupRowHandle(rowHandle) Then
|
||||
If Not Me.IsGroupRowExpanded(rowHandle) Then
|
||||
rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle))
|
||||
End If
|
||||
Else
|
||||
rowHandles.Add(rowHandle)
|
||||
End If
|
||||
Next
|
||||
Return rowHandles
|
||||
End Function
|
||||
Public Function GetDataRowHandlesInGroup(groupRowHandle As Integer) As List(Of Integer)
|
||||
Dim rowHandles As New List(Of Integer)()
|
||||
For i As Integer = 0 To Me.GetChildRowCount(groupRowHandle) - 1
|
||||
Dim rowHandle As Integer = Me.GetChildRowHandle(groupRowHandle, i)
|
||||
If Me.IsGroupRowHandle(rowHandle) Then
|
||||
rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle))
|
||||
Else
|
||||
rowHandles.Add(rowHandle)
|
||||
End If
|
||||
Next
|
||||
Return rowHandles
|
||||
End Function
|
||||
Public Sub New(dcoe As IDataControlOriginationElement)
|
||||
MyBase.New(dcoe)
|
||||
' MyBase.New()
|
||||
End Sub
|
||||
'Protected Overrides Sub OnPreviewKeyDown(e As KeyEventArgs)
|
||||
' Try
|
||||
' If e.Key = Key.Space AndAlso DirectCast(Me.View, TableView).ShowCheckBoxSelectorColumn Then
|
||||
' e.Handled = True
|
||||
' DirectCast(Me.View, TableView).SearchString &= " "
|
||||
' Debug.WriteLine("ESPACIO")
|
||||
' ' MyBase.OnPreviewKeyDown(e)
|
||||
' Else
|
||||
' MyBase.OnPreviewKeyDown(e)
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
' MyBase.OnPreviewKeyDown(e)
|
||||
' End Try
|
||||
|
||||
'End Sub
|
||||
' Private Cargado As Boolean = False
|
||||
Private ConSeleccion As Boolean = False
|
||||
'Private Sub tsGridControl_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' If Not ConSeleccion AndAlso DirectCast(Me.View, TableView).ShowCheckBoxSelectorColumn AndAlso Me.SelectionMode = MultiSelectMode.MultipleRow Then
|
||||
' AddHandler SelectionChanged, AddressOf MyGridControl_SelectionChanged
|
||||
' ElementosSeleccionados = New ObservableCollectionCore(Of Object)()
|
||||
' AddHandler Me.EndGrouping, AddressOf MyGridControl_EndGrouping
|
||||
' AddHandler Me.StartGrouping, AddressOf MyGridControl_StartGrouping
|
||||
' NumeroColumnasAgrupadas = ObtieneNumeroColumnasAgrupadas()
|
||||
' ConSeleccion = True
|
||||
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
Public Function GetColumnType(ByVal column As GridColumn) As Type
|
||||
Dim columnInfo As DataColumnInfo = DataProviderBase.Columns(column.FieldName)
|
||||
If columnInfo Is Nothing Then Return Nothing
|
||||
Return columnInfo.Type
|
||||
End Function
|
||||
Public Shared Sub EstableceFilterPopupModePredeterminados(gr As tsGridControl)
|
||||
If Not gr.PopupFilterModeInicializado AndAlso gr.ItemsSource IsNot Nothing Then
|
||||
gr.PopupFilterModeInicializado = True
|
||||
For Each cl In gr.Columns
|
||||
Dim tipo = gr.GetColumnType(cl)
|
||||
Select Case tipo
|
||||
Case GetType(String), GetType(Integer), GetType(Integer?), GetType(Double), GetType(Double?)
|
||||
cl.FilterPopupMode = FilterPopupMode.CheckedList
|
||||
Case GetType(Date), GetType(DateTime), GetType(Date?), GetType(DateTime?)
|
||||
cl.FilterPopupMode = FilterPopupMode.Excel
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub tsGridControl_ItemsSourceChanged(sender As Object, e As ItemsSourceChangedEventArgs) Handles Me.ItemsSourceChanged
|
||||
EstableceFilterPopupModePredeterminados(sender)
|
||||
ElementosSeleccionados = New ObservableCollectionCore(Of Object)()
|
||||
End Sub
|
||||
Private Property _SeleccionMultiple As Boolean
|
||||
Public Property SeleccionMultiple As Boolean
|
||||
Get
|
||||
Return _SeleccionMultiple
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
_SeleccionMultiple = value
|
||||
If value Then
|
||||
Me.SelectionMode = MultiSelectMode.MultipleRow
|
||||
Else
|
||||
Me.SelectionMode = MultiSelectMode.None
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub tsGridControl_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles Me.PreviewKeyDown
|
||||
Select Case e.Key
|
||||
Case Key.Add
|
||||
If _SeleccionMultiple Then
|
||||
Me.SelectAll()
|
||||
e.Handled = True
|
||||
End If
|
||||
Case Key.Subtract
|
||||
If _SeleccionMultiple Then
|
||||
Me.UnselectAll()
|
||||
e.Handled = True
|
||||
End If
|
||||
Case Key.N
|
||||
If e.KeyboardDevice.IsKeyDown(Key.LeftCtrl) Then
|
||||
Me.View.MoveNextRow()
|
||||
Me.CurrentColumn = Me.Columns(0)
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class tsGridColumn
|
||||
Inherits DevExpress.Xpf.Grid.GridColumn
|
||||
|
||||
Public Property SoloLectura As Boolean
|
||||
Public Property Imprimible As Boolean = True
|
||||
Property ValorMinimo As Nullable(Of Double)
|
||||
Property ValorMaximo As Nullable(Of Double)
|
||||
Public Property MayusculasMinusculas As CharacterCasing? = Nothing
|
||||
Public Property CapturarEnter As Boolean
|
||||
|
||||
Private Sub tsGridColumn_Validate(sender As Object, e As DevExpress.Xpf.Grid.GridCellValidationEventArgs) Handles Me.Validate
|
||||
If Not ValorMinimo Is Nothing Then
|
||||
If ValorMinimo > e.Value Then
|
||||
e.IsValid = False
|
||||
e.SetError("Valor Mínimo=" & ValorMinimo.ToString)
|
||||
End If
|
||||
End If
|
||||
If Not ValorMaximo Is Nothing Then
|
||||
If ValorMaximo < e.Value Then
|
||||
e.IsValid = False
|
||||
e.SetError("Valor Máximo=" & ValorMaximo.ToString)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Private Function IsColumnCheckBoxSelectorColumn(column As ColumnBase) As Boolean
|
||||
' Return column = DirectCast(Me.View, TableView).VisibleColumns.First()
|
||||
'End Function
|
||||
End Class
|
||||
46
tsInputBox.xaml
Normal file
@@ -0,0 +1,46 @@
|
||||
<dx:DXWindow x:Class="tsInputBOX"
|
||||
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:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
|
||||
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" ShowInTaskbar="True"
|
||||
ShowIcon="False" Title="Introduzca datos" WindowStyle="ToolWindow" ResizeMode="NoResize" WindowState="Normal" WindowStartupLocation="CenterScreen" Topmost="True" Width="600" Height="150" >
|
||||
<dx:DXWindow.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</dx:DXWindow.Resources>
|
||||
<Grid x:Name="grid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="45" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="10" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="50" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" x:Name="btAceptar" Grid.Row="1" Width="100" IsDefault="True" Click="btAceptar_Click" TabIndex="2">Aceptar</Button>
|
||||
<Button Grid.Column="3" x:Name="btCancelar" Grid.Row="1" Width="100" IsCancel="True" Click="btCancelar_Click" TabIndex="3">Cancelar</Button>
|
||||
</Grid>
|
||||
<dxlc:LayoutControl >
|
||||
<dxlc:LayoutItem Label="Rótulo" x:Name="liRotulo" AddColonToLabel="True" >
|
||||
<dxe:TextEdit x:Name="teValor" TabIndex="1" MaskUseAsDisplayFormat="True" />
|
||||
</dxlc:LayoutItem>
|
||||
</dxlc:LayoutControl>
|
||||
</Grid>
|
||||
</dx:DXWindow>
|
||||
44
tsInputBox.xaml.vb
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
Imports System.Data.Entity
|
||||
Imports DevExpress.Xpf.Core.ServerMode
|
||||
Imports DevExpress.Mvvm
|
||||
Imports DevExpress.Xpf.Grid
|
||||
Imports tsWPFCore
|
||||
Imports tsUtilidades.Extensiones
|
||||
Imports DevExpress.Xpf.Core
|
||||
Imports DevExpress.XtraReports.UI
|
||||
Imports System.IO
|
||||
Imports DevExpress.Xpf.Printing
|
||||
Imports Microsoft.Win32
|
||||
|
||||
Public Class tsInputBox
|
||||
Private Sub dxwAgregar_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
End Sub
|
||||
Public Property Valor As Object
|
||||
|
||||
Private Sub btAceptar_Click(sender As Object, e As RoutedEventArgs)
|
||||
Me.DialogResult = True
|
||||
Valor = Me.teValor.EditValue
|
||||
End Sub
|
||||
|
||||
Private Sub btCancelar_Click(sender As Object, e As RoutedEventArgs)
|
||||
Me.DialogResult = False
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Public Sub New(Rotulo As String, ValorDefecto As String, Optional LongitudMaxima As Integer = 0, Optional AnchoVentana As Integer = 0, Optional TipoNumerico As Boolean = False, Optional Mascara As String = "")
|
||||
|
||||
' Llamada necesaria para el diseñador.
|
||||
InitializeComponent()
|
||||
Me.liRotulo.Label = Rotulo
|
||||
Me.teValor.EditValue = ValorDefecto
|
||||
If LongitudMaxima > 0 Then Me.teValor.MaxLength = LongitudMaxima
|
||||
If AnchoVentana > 0 Then Me.Width = AnchoVentana
|
||||
If TipoNumerico Then Me.teValor.MaskType = DevExpress.Xpf.Editors.MaskType.Numeric
|
||||
Me.teValor.Mask = Mascara
|
||||
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
9
tsLayoutItem.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Imports DevExpress.Xpf.LayoutControl
|
||||
Imports System.ComponentModel
|
||||
Public Class tsLayoutItem
|
||||
Inherits LayoutItem
|
||||
'<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
|
||||
Public Property PropiedadesTS As New PropiedadesTS
|
||||
Public Event cargado()
|
||||
|
||||
End Class
|
||||
50
tsTableView.xaml
Normal file
@@ -0,0 +1,50 @@
|
||||
<dxg:TableView x:Class="tsTableView" CustomRowAppearance="TableView_CustomRowAppearance"
|
||||
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:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800" >
|
||||
<dxg:TableView.Resources>
|
||||
<Style x:Key="tsRowStyle" TargetType="dxg:RowControl">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="dxg:DataViewBase.IsFocusedRow" Value="True">
|
||||
<Setter Property="Background" Value="LightBlue"/>
|
||||
<Setter Property="Foreground" Value="{Binding Row.ColorFuenteFila}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="dxg:DataViewBase.IsFocusedRow" Value="False">
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="Foreground" Value="{Binding Row.ColorFuenteFila}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="tsCellStyle" TargetType="dxg:LightweightCellEditor">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="dxg:DataViewBase.IsFocusedCell" Value="True">
|
||||
<Setter Property="Background" Value="LightBlue"/>
|
||||
<Setter Property="Foreground" Value="{Binding Row.ColorFuenteFila}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</dxg:TableView.Resources>
|
||||
<dxg:TableView.FocusedCellBorderTemplate>
|
||||
<ControlTemplate>
|
||||
<Border CornerRadius="3" BorderThickness="1.75" BorderBrush="Blue"/>
|
||||
</ControlTemplate>
|
||||
</dxg:TableView.FocusedCellBorderTemplate>
|
||||
<dxg:TableView.GroupFooterSummaryContentStyle>
|
||||
<Style TargetType="dx:DataContentPresenter">
|
||||
<Setter Property="Control.FontWeight" Value="SemiBold" />
|
||||
<Setter Property="Control.Foreground" Value="Blue" />
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Right" />
|
||||
</Style>
|
||||
</dxg:TableView.GroupFooterSummaryContentStyle>
|
||||
<dxg:TableView.TotalSummaryContentStyle>
|
||||
<Style TargetType="dx:DataContentPresenter">
|
||||
<Setter Property="Control.FontWeight" Value="Bold" />
|
||||
<Setter Property="Control.Foreground" Value="Blue" />
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Right" />
|
||||
</Style>
|
||||
</dxg:TableView.TotalSummaryContentStyle>
|
||||
</dxg:TableView>
|
||||
61
tsTableView.xaml.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Imports DevExpress.Xpf.Grid
|
||||
|
||||
Public Class tsTableView
|
||||
Inherits DevExpress.Xpf.Grid.TableView
|
||||
Public Property ColorFuentePersonalizado As Boolean
|
||||
Public Sub New()
|
||||
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
MyBase.New
|
||||
InitializeComponent()
|
||||
AllowFixedColumnMenu = True
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
Public Sub New(masterRootNode As MasterNodeContainer, masterRootDataItem As MasterRowsContainer, detailDescriptor As DataControlDetailDescriptor)
|
||||
|
||||
' Esta llamada es exigida por el diseñador.
|
||||
MyBase.New(masterRootNode, masterRootDataItem, detailDescriptor)
|
||||
InitializeComponent()
|
||||
AllowFixedColumnMenu = True
|
||||
|
||||
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function ShadeBrush(ByVal brush As SolidColorBrush) As SolidColorBrush
|
||||
Dim originalColor As Color = brush.Color
|
||||
Dim coefficient As Single = 0.9F
|
||||
Dim a As Byte = originalColor.A
|
||||
If Not Grid.IsKeyboardFocusWithin Then a = CByte((originalColor.A / 2))
|
||||
Dim r As Byte = CByte((originalColor.R * coefficient))
|
||||
Dim g As Byte = CByte((originalColor.G * coefficient))
|
||||
Dim b As Byte = CByte((originalColor.B * coefficient))
|
||||
Return New SolidColorBrush(Color.FromArgb(a, r, g, b))
|
||||
End Function
|
||||
|
||||
Private Sub TableView_CustomRowAppearance(sender As Object, e As CustomRowAppearanceEventArgs)
|
||||
If e.RowSelectionState <> SelectionState.None Then
|
||||
Dim result As Object = e.ConditionalValue
|
||||
|
||||
If e.Property Is TextBlock.ForegroundProperty OrElse e.Property Is TextBlock.BackgroundProperty Then
|
||||
Dim original As SolidColorBrush = TryCast(e.OriginalValue, SolidColorBrush)
|
||||
Dim conditional As SolidColorBrush = TryCast(e.ConditionalValue, SolidColorBrush)
|
||||
If Me.ColorFuentePersonalizado AndAlso e.Property Is TextBlock.ForegroundProperty Then
|
||||
Dim row = Me.Grid.GetRow(e.RowHandle)
|
||||
conditional = TryCast(row.GetType.GetProperty("ColorFuenteFila").GetValue(row), SolidColorBrush)
|
||||
End If
|
||||
If conditional IsNot Nothing AndAlso (original Is Nothing OrElse original.Color <> conditional.Color) Then result = ShadeBrush(conditional)
|
||||
End If
|
||||
e.Result = result
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
Private Sub tsTableView_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
If ColorFuentePersonalizado Then
|
||||
Me.RowStyle = Me.FindResource("tsRowStyle")
|
||||
Me.CellStyle = Me.FindResource("tsCellStyle")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
2089
tsUserControl.vb
Normal file
25
tsWPFCore.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33213.308
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "tsWPFCore", "tsWPFCore.vbproj", "{18488C35-3FBF-40E5-9A49-6C87741720B7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{18488C35-3FBF-40E5-9A49-6C87741720B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{18488C35-3FBF-40E5-9A49-6C87741720B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{18488C35-3FBF-40E5-9A49-6C87741720B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{18488C35-3FBF-40E5-9A49-6C87741720B7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {89FF3751-4393-496C-8868-84F1BB7DEA63}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
140
tsWPFCore.vbproj
Normal file
@@ -0,0 +1,140 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>tsWPFCore</RootNamespace>
|
||||
<UseWPF>true</UseWPF>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>tsWPFCore</RootNamespace>
|
||||
<PackageId>tsWPFCore</PackageId>
|
||||
<PackageTags>net8.0-windows, libreria</PackageTags>
|
||||
<Version>1.3.1</Version>
|
||||
<Authors>Manuel</Authors>
|
||||
<Company>Tecnosis S.A</Company>
|
||||
<Description>Utilidades para aplicaciones WPF Entity Framework compatibles con EF Core 8.</Description>
|
||||
<PackageReleaseNotes>
|
||||
- Se traslada versión a git desde tfs
|
||||
</PackageReleaseNotes>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Images\Icons\PAPELERA.png" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||
<Import Include="System.Windows" />
|
||||
<Import Include="System.Windows.Controls" />
|
||||
<Import Include="System.Windows.Data" />
|
||||
<Import Include="System.Windows.Documents" />
|
||||
<Import Include="System.Windows.Input" />
|
||||
<Import Include="System.Windows.Media" />
|
||||
<Import Include="System.Windows.Media.Imaging" />
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
<Import Include="System.Windows.Shapes" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ClosedXML" Version="0.104.2" />
|
||||
<PackageReference Include="DevExpress.Document.Processor" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Document.Processor.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Images" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Images.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Spreadsheet.Core" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Spreadsheet.Core.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Core" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Core.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Docking" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Docking.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Grid.Core" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Grid.Core.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.LayoutControl" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.PdfViewer" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.PdfViewer.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Reporting" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Reporting.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.RichEdit" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.RichEdit.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Spreadsheet" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Spreadsheet.es" Version="23.2.3" />
|
||||
<PackageReference Include="DevExpress.Wpf.Themes.All" Version="23.2.3" />
|
||||
<PackageReference Include="tsUtilidades" Version="1.0.5" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\close-16x16.png" />
|
||||
<Resource Include="Images\Icons\copy-16x16.png" />
|
||||
<Resource Include="Images\Icons\cut-16x16.png" />
|
||||
<Resource Include="Images\Icons\find-16x16.png" />
|
||||
<Resource Include="Images\Icons\new-16x16.png" />
|
||||
<Resource Include="Images\Icons\open-16x16.png" />
|
||||
<Resource Include="Images\Icons\PAPELERA.png" />
|
||||
<Resource Include="Images\Icons\paste-16x16.png" />
|
||||
<Resource Include="Images\Icons\print-16x16.png" />
|
||||
<Resource Include="Images\Icons\redo-16x16.png" />
|
||||
<Resource Include="Images\Icons\save-16x16.png" />
|
||||
<Resource Include="Images\Icons\save-as-16x16.png" />
|
||||
<Resource Include="Images\Icons\undo-16x16.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\Select.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\Invertir-25.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\checklist-25.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{94E38DFF-614B-4CBD-B67C-F211BB35CE8B}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="DXSplashScreen\SplashScreenBackground.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\AbrirGrid.png" />
|
||||
<Resource Include="Images\Icons\GuardarGrid.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Icons\capture.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="My Project\Resources.Designer.vb">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="My Project\Settings.Designer.vb">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="My Project\Resources.resx">
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="My Project\Settings.settings">
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||