diff --git a/Asegasa.sln b/Asegasa.sln index a154f96..10fdf6e 100644 --- a/Asegasa.sln +++ b/Asegasa.sln @@ -1,17 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36414.22 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11505.172 d18.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSAsegasa", "WSAsegasa\WSAsegasa.csproj", "{C891F2E3-60D2-449F-962A-BF78F58C67D6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdAsegasa", "bdAsegasa\bdAsegasa.csproj", "{E42D668E-CB26-498B-89AF-8A205528C4EF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdfactu", "..\Tecnosis\tsFactu\bdFactu\bdfactu.csproj", "{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APIFicheros", "APIFicheros\APIFicheros.csproj", "{729F814F-BBAF-A079-B0A1-D5890DA11543}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tsVeriFactu", "..\..\Comunes\tsVeriFactu\tsVeriFactu.csproj", "{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GestionAsegasa", "GestionAsegasa\GestionAsegasa.vbproj", "{6995E4A5-BC07-42C2-8E8C-C09839886B7F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -27,18 +25,14 @@ Global {E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.Build.0 = Release|Any CPU - {56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.Build.0 = Release|Any CPU {729F814F-BBAF-A079-B0A1-D5890DA11543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {729F814F-BBAF-A079-B0A1-D5890DA11543}.Debug|Any CPU.Build.0 = Debug|Any CPU {729F814F-BBAF-A079-B0A1-D5890DA11543}.Release|Any CPU.ActiveCfg = Release|Any CPU {729F814F-BBAF-A079-B0A1-D5890DA11543}.Release|Any CPU.Build.0 = Release|Any CPU - {DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.Build.0 = Release|Any CPU + {6995E4A5-BC07-42C2-8E8C-C09839886B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6995E4A5-BC07-42C2-8E8C-C09839886B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6995E4A5-BC07-42C2-8E8C-C09839886B7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6995E4A5-BC07-42C2-8E8C-C09839886B7F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GestionAsegasa/Application.xaml b/GestionAsegasa/Application.xaml new file mode 100644 index 0000000..eab850f --- /dev/null +++ b/GestionAsegasa/Application.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/GestionAsegasa/Application.xaml.vb b/GestionAsegasa/Application.xaml.vb new file mode 100644 index 0000000..084cbe9 --- /dev/null +++ b/GestionAsegasa/Application.xaml.vb @@ -0,0 +1,6 @@ +Class Application + + ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException + ' can be handled in this file. + +End Class diff --git a/GestionAsegasa/AssemblyInfo.vb b/GestionAsegasa/AssemblyInfo.vb new file mode 100644 index 0000000..025ee72 --- /dev/null +++ b/GestionAsegasa/AssemblyInfo.vb @@ -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, +' or 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) + diff --git a/GestionAsegasa/Comun.vb b/GestionAsegasa/Comun.vb new file mode 100644 index 0000000..620d1df --- /dev/null +++ b/GestionAsegasa/Comun.vb @@ -0,0 +1,412 @@ +Imports bdAsegasa +Imports bdAsegasa.db +Imports bdAsegasa.db.Utilidades +Imports DevExpress.Xpf.Docking +Imports DevExpress.XtraReports.UI +Imports System.IO +Imports DevExpress.Xpf.Printing +Imports DevExpress.Xpf.Core +Imports tsWPFCore +Imports tsUtilidades +Imports System.Data.Entity + +Imports DevExpress.Xpf.Editors + +'TODO No permitir 2 facturas rápidas al mismo tiempo +'TODO Traspaso a otra caja +'TODO Seleccion cajas en conciliación bancaria + +Public Class Comun + + Friend Shared OtrosParametros As String = "" + Public Shared Property dwi As DXWindow + Public Shared Property dg As DocumentGroup + Public Shared Sub EscalaVentana(ByRef Ventana As Window, ByRef tr As Transform) + If UsuarioActual.Escala.HasValue AndAlso UsuarioActual.Escala Then + Ventana.Height = Math.Min(Comun.dwi.Height, Ventana.Height * UsuarioActual.Escala.Value) + Ventana.Width = Math.Min(Comun.dwi.Width, Ventana.Width * UsuarioActual.Escala.Value) + Dim scaler = TryCast(tr, ScaleTransform) + If scaler Is Nothing Then + scaler = New ScaleTransform(1.0, 1.0) + tr = scaler + End If + scaler.ScaleX = UsuarioActual.Escala.Value + scaler.ScaleY = UsuarioActual.Escala.Value + scaler.BeginAnimation(ScaleTransform.ScaleXProperty, Nothing) + scaler.BeginAnimation(ScaleTransform.ScaleYProperty, Nothing) + End If + End Sub + Public Shared Function ObtienePermisos(bd As tscgestionasegasa, Codigo As String, idUsuario As Integer) As tsUtilidades.Permisos + Dim per As New tsUtilidades.Permisos + If bd.usuarios.First(Function(x) x.idUsuario = bdAsegasa.db.Utilidades.idUsuario).idGrupoNavigation.Descripcion = "SUPERADMINISTRADORES" Then + per.Consultar = True + per.Eliminar = True + per.Nuevos = True + per.Otros = True + per.Modificar = True + per.Impresion = True + per.Exportar = True + Else + Dim au = (From a In bd.autorizacionesusuarios Select a Where a.idPermisoNavigation.CodigoPermiso = Codigo AndAlso a.idUsuario = bdAsegasa.db.Utilidades.idUsuario) + If au.Count = 0 Then + Dim idGrupo As Integer = (From u In bd.usuarios Select u Where u.idUsuario = bdAsegasa.db.Utilidades.idUsuario).First.idGrupo.Value + Dim ag = (From g In bd.autorizacionesgrupos Select g Where g.idPermisoNavigation.CodigoPermiso = Codigo AndAlso g.idGrupo = idGrupo) + If ag.Count = 0 Then + per.Consultar = False + per.Eliminar = False + per.Nuevos = False + per.Otros = False + per.Modificar = False + per.Impresion = False + per.Exportar = False + Else + per.Consultar = ag.First.PermitirConsultas + per.Eliminar = ag.First.PermitirEliminaciones + per.Nuevos = ag.First.PermitirNuevos + per.Otros = ag.First.OtrosPermisos + per.Modificar = ag.First.PermitirModificaciones + per.Impresion = ag.First.PermitirImpresiones + per.Exportar = ag.First.PermitirImpresiones + End If + Else + per.Consultar = au.First.PermitirConsultas + per.Eliminar = au.First.PermitirEliminaciones + per.Nuevos = au.First.PermitirNuevos + per.Otros = au.First.OtrosPermisos + per.Modificar = au.First.PermitirModificaciones + per.Impresion = au.First.PermitirImpresiones + per.Exportar = au.First.PermitirExportar + End If + End If + 'If Not bdga.DataBase.ToLower.Contains("GrupoSanchoToro") AndAlso Not bdga.DataBase.ToLower.Contains("desarrollo") AndAlso Not bdga.DataBase.ToLower.Contains("viernes") Then + ' per.Modificar = False + ' per.Nuevos = False + 'End If + + Return per + + End Function + + + Public Shared Function ObtienePermisos(bd As tscgestionasegasa, idPermiso As Nullable(Of Integer), idUsuario As Integer) As tsUtilidades.Permisos + Dim per As New tsUtilidades.Permisos + If bd.usuarios.First(Function(x) x.idUsuario = bdAsegasa.db.Utilidades.idUsuario).Usuario = "MANMOG" Then + per.Consultar = True + per.Eliminar = True + per.Nuevos = True + per.Otros = True + per.Modificar = True + per.Impresion = True + per.Exportar = True + Else + If idPermiso Is Nothing Then + per.Consultar = False + per.Eliminar = False + per.Nuevos = False + per.Otros = False + per.Modificar = False + per.Impresion = False + per.Exportar = False + Else + Dim au = (From a In bd.autorizacionesusuarios Select a Where a.idPermisoNavigation.idPermiso = idPermiso AndAlso a.idUsuario = bdAsegasa.db.Utilidades.idUsuario) + If au.Count = 0 Then + Dim idGrupo As Integer = (From u In bd.usuarios Select u Where u.idUsuario = bdAsegasa.db.Utilidades.idUsuario).First.idGrupo.Value + Dim ag = (From g In bd.autorizacionesgrupos Select g Where g.idPermisoNavigation.idPermiso = idPermiso AndAlso g.idGrupo = idGrupo) + If ag.Count = 0 Then + per.Consultar = False + per.Eliminar = False + per.Nuevos = False + per.Otros = False + per.Modificar = False + per.Impresion = False + per.Exportar = False + Else + per.Consultar = ag.First.PermitirConsultas + per.Eliminar = ag.First.PermitirEliminaciones + per.Nuevos = ag.First.PermitirNuevos + per.Otros = ag.First.OtrosPermisos + per.Modificar = ag.First.PermitirModificaciones + per.Impresion = ag.First.PermitirImpresiones + per.Exportar = ag.First.PermitirImpresiones 'ag.First.PermitirExportar + End If + Else + per.Consultar = au.First.PermitirConsultas + per.Eliminar = au.First.PermitirEliminaciones + per.Nuevos = au.First.PermitirNuevos + per.Otros = au.First.OtrosPermisos + per.Modificar = au.First.PermitirModificaciones + per.Impresion = au.First.PermitirImpresiones + per.Exportar = au.First.PermitirImpresiones + End If + End If + End If + Return per + End Function + Friend Shared Function ObtienePlantillas(bd As tscgestionasegasa, Grupo As String, Optional IncluirTipoListado As Boolean = True) As List(Of tsWPFCore.Plantilla) + Dim plas As IQueryable(Of plantillas) + 'If Not IncluirTipoListado Then + ' plas = (From p In bd.plantillas Where p.idEmpresa = EmpresaActual.idEmpresa AndAlso p.idGrupoNavigation.Codigo = Grupo AndAlso p.TipoListado = False Select p) + 'Else + ' plas = (From p In bd.plantillas Where p.idEmpresa = EmpresaActual.idEmpresa AndAlso p.idGrupoNavigation.Codigo = Grupo Select p) + 'End If + Dim plantillas As New List(Of tsWPFCore.Plantilla) + For Each p In plas + Dim pl As New tsWPFCore.Plantilla + pl.idPlantilla = p.idPlantilla + pl.Descripcion = p.Descripcion + plantillas.Add(pl) + Next + Return plantillas + End Function + Friend Shared Function ObtienePlantillas(bd As tscgestionasegasa, Grupos() As String, Optional IncluirTipoListado As Boolean = True) As List(Of tsWPFCore.Plantilla) + Dim plas As List(Of plantillas) + If Not IncluirTipoListado Then + 'plas = (From p In bd.plantillas Where p.TipoListado = False AndAlso p.Oculta = False Order By p.Orden Select p).ToList + plas = (From p In bd.plantillas Where p.TipoListado = False AndAlso p.Oculta = False Select p).ToList + Else + 'plas = (From p In bd.plantillas Where p.Oculta = False Order By p.Orden Select p).ToList + plas = (From p In bd.plantillas Where p.Oculta = False Select p).ToList + End If + Dim plantillas As New List(Of tsWPFCore.Plantilla) + For Each p In plas + If Grupos.Contains(p.idGrupoNavigation.Codigo) Then + If Not p.idPermiso.HasValue OrElse ObtienePermisos(bd, p.idPermisoNavigation.CodigoPermiso, idUsuario).Impresion Then + Dim pl As New tsWPFCore.Plantilla + pl.idPlantilla = p.idPlantilla + pl.Descripcion = p.Descripcion + plantillas.Add(pl) + End If + End If + Next + Return plantillas + End Function + Friend Shared Function ObtienePlantillasPorCodigos(bd As tscgestionasegasa, Codigos() As String, Optional IncluirTipoListado As Boolean = True) As List(Of tsWPFCore.Plantilla) + Dim plas As List(Of plantillas) + 'If Not IncluirTipoListado Then + ' plas = (From p In bd.plantillas Where p.idEmpresa = EmpresaActual.idEmpresa AndAlso p.TipoListado = False AndAlso p.Oculta = False Order By p.Orden Select p).ToList + 'Else + ' plas = (From p In bd.plantillas Where p.idEmpresa = EmpresaActual.idEmpresa AndAlso p.Oculta = False Order By p.Orden Select p).ToList + 'End If + Dim plantillas As New List(Of tsWPFCore.Plantilla) + plas = plas.Where(Function(x) Codigos.Contains(x.Codigo) AndAlso (x.idPermisoNavigation Is Nothing OrElse ObtienePermisos(bd, x.idPermisoNavigation.CodigoPermiso, idUsuario).Impresion)).ToList + For Each p In plas + Dim pl As New tsWPFCore.Plantilla + pl.idPlantilla = p.idPlantilla + pl.Descripcion = p.Descripcion + plantillas.Add(pl) + Next + Return plantillas + End Function + 'Friend Shared Sub MuestraImpresos(bd As tscgestionasegasa, idPlantilla As Integer, Datasource As Object, GrupoDocumentos As DocumentGroup, dc As DockController) + ' Try + + ' If idPlantilla = 0 Then Throw New Exception("Seleccione primero la plantilla a imprimir") + ' Dim xr As New XtraReport + + ' Dim qr As ObjectSet(Of plantillas) = bd.plantillas + ' ' qr.MergeOption = MergeOption.OverwriteChanges + + ' Dim pl = qr.Where(Function(x) x.idPlantilla = idPlantilla).First + + ' 'Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First + ' Dim s As String = System.Text.Encoding.UTF8.GetString(pl.idFicheroNavigation.Fichero) + ' Using sw As New StreamWriter(New MemoryStream()) + ' sw.Write(s) + ' sw.Flush() + ' xr = XtraReport.FromStream(sw.BaseStream, True) + ' End Using + ' 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 + + ' Select Case Datasource.GetType + ' 'Case GetType(personas), GetType(List(Of personas)) + ' ' If Datasource.GetType = GetType(personas) Then + ' ' Dim lp As New List(Of personas) + ' ' Dim per As personas = Datasource + ' ' lp.Add(per) + ' ' Datasource = lp + ' ' End If + ' ' If pl.enumeraciones.Codigo = "GRUPLA.TARJETAVERTICAL" Then + ' ' Dim ltvd As New List(Of TarjetaVerticalDiputado) + ' ' Dim iNumPer As Integer + ' ' Dim tvd As TarjetaVerticalDiputado = Nothing + + ' ' For Each p In DirectCast(Datasource, List(Of personas)) + ' ' iNumPer += 1 + ' ' If iNumPer Mod 2 = 1 Then + ' ' tvd = New TarjetaVerticalDiputado + ' ' With tvd + ' ' .Dni1 = p.NIF + ' ' If p.idFicheroFoto IsNot Nothing AndAlso p.idFicheroNavigation.Fichero IsNot Nothing AndAlso p.idFicheroNavigation.Fichero.Length > 0 Then + ' ' Dim original = System.Drawing.Image.FromStream(New IO.MemoryStream(p.idFicheroNavigation.Fichero)) + ' ' original.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone) + ' ' Dim memStream As IO.MemoryStream = New IO.MemoryStream() + ' ' original.Save(memStream, ImageFormat.Png) + ' ' .Foto1 = memStream.ToArray + ' ' End If + ' ' .Nombre1 = p.Nombre & " " & p.Apellidos + ' ' .PuestoEnTarjeta1 = p.PuestoTrabajoEnTarjeta + ' ' .Tratamiento1 = p.Tratamiento + ' ' End With + ' ' ltvd.Add(tvd) + ' ' Else + ' ' With tvd + ' ' .Dni2 = p.NIF + ' ' If p.idFicheroFoto IsNot Nothing AndAlso p.idFicheroNavigation.Fichero.Length > 0 Then + ' ' Dim original = System.Drawing.Image.FromStream(New IO.MemoryStream(p.idFicheroNavigation.Fichero)) + ' ' original.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone) + ' ' Dim memStream As IO.MemoryStream = New IO.MemoryStream() + ' ' original.Save(memStream, ImageFormat.Png) + ' ' .Foto2 = memStream.ToArray + ' ' End If + ' ' .Nombre2 = p.Nombre & " " & p.Apellidos + ' ' .PuestoEnTarjeta2 = p.PuestoTrabajoEnTarjeta + ' ' .Tratamiento2 = p.Tratamiento + ' ' End With + ' ' End If + ' ' Next + ' ' Datasource = ltvd + ' ' End If + ' End Select + + + ' xr.DataSource = Datasource + ' Dim modelo As New XtraReportPreviewModel(xr) + + ' Dim vi As New tsWPFCore.ucVisualizadorInformes + ' vi.Visualizador.Model = modelo + ' xr.CreateDocument(True) + + ' 'If pl.Codigo = "TARDIPVER" Then + + ' ' Dim original = System.Drawing.Image.FromStream(New IO.MemoryStream(Per.idFicheroNavigation.Fichero)) + ' ' original.RotateFlip(System.Drawing.RotateFlipType.Rotate270FlipNone) + ' ' Dim memStream As IO.MemoryStream = New IO.MemoryStream() + ' ' original.Save(memStream, ImageFormat.Png) + ' ' Per.idFicheroNavigation.Fichero = memStream.ToArray + ' 'End If + ' Dim docpanel As New DevExpress.Xpf.Docking.DocumentPanel + ' docpanel.Caption = pl.Descripcion + ' docpanel.Content = vi + ' docpanel.ClosingBehavior = DevExpress.Xpf.Docking.ClosingBehavior.ImmediatelyRemove + ' GrupoDocumentos.Items.Add(docpanel) + ' dc.Activate(docpanel) + + ' Catch ex As Exception + ' DXMessageBox.Show(ex.Message, "Atención", MessageBoxButton.OK, MessageBoxImage.Error) + ' End Try + 'End Sub + Shared Sub GeneraRegistroCorreoExcepcion(bd As tscgestionasegasa, ex As Exception, Rutina As String, Optional FicheroImagen As Byte() = Nothing) + Try + If bd Is Nothing Then bd = tscgestionasegasa.NuevoContexto + Dim sMensaje As String = "Usuario: " & bdAsegasa.db.Utilidades.Usuario & vbCrLf + Dim sStackTrace As String = "Tipo excepción: " & ex.ToString & vbCrLf + Dim exError As Exception = ex + Do + sStackTrace &= exError.StackTrace & vbCrLf + exError = exError.InnerException + Loop Until IsNothing(exError) + If sStackTrace <> "" Then sMensaje &= vbCrLf & "StackTrace: " & sStackTrace + Dim cuentaorigen As cuentascorreo = (From c In bd.cuentascorreo Select c Where c.Codigo = "M3SOFT").First + If FicheroImagen Is Nothing Then + correos.GeneraRegistroCorreon(bd, "Mensaje Automático. Error en " & Rutina, sMensaje, cuentaorigen, "manmog@gmail.com", "", "", , ,, "ERRORES") + Else + correos.GeneraRegistroCorreon(bd, "Mensaje Automático. Error en " & Rutina, sMensaje, cuentaorigen, "manmog@gmail.com", "", "", FicheroImagen, "captura.jpg",, "ERRORES") + End If + Catch ex2 As Exception + DXMessageBox.Show(ex2.Message & vbCrLf & ex2.StackTrace, "Error Generando Correo Excepcion") + End Try + End Sub + + 'Friend Shared Function ObtieneListaAlmacenes(bd As tscgestionasegasa) As List(Of almacenes) + ' Dim alms = bd.almacenes.Where(Function(x) x.FechaBaja.HasValue = False).ToList + ' Return alms + 'End Function +End Class + +Namespace Convertidores + + Public Class DoubleToDecimalConverter + 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 0 + Else + Return Decimal.Parse(value) + 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 0 + Else + Return Double.Parse(value) + End If + End Function + 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 ImagenConverter + Implements IValueConverter + + Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert + Try + If value Is Nothing Then + Return Nothing + Else + Dim ms As New IO.MemoryStream(DirectCast(value, Byte())) + Dim img As New BitmapImage + img.BeginInit() + img.StreamSource = ms + img.CacheOption = BitmapCacheOption.OnLoad + img.EndInit() + img.Freeze() + ms.Close() + ms.Dispose() + Return img + GC.Collect() + GC.WaitForPendingFinalizers() + GC.Collect() + End If + Catch ex As Exception + Return Nothing + ' Throw New Exception(ex.Message, ex) + 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 bm As BitmapImage = value + Dim ms As IO.MemoryStream = bm.StreamSource + Return ms.ToArray + End If + Catch ex As Exception + Throw New Exception(ex.Message, ex) + End Try + End Function + + End Class + +End Namespace diff --git a/GestionAsegasa/GestionAsegasa.vbproj b/GestionAsegasa/GestionAsegasa.vbproj new file mode 100644 index 0000000..6f4ff37 --- /dev/null +++ b/GestionAsegasa/GestionAsegasa.vbproj @@ -0,0 +1,54 @@ + + + + WinExe + net8.0-windows7.0 + GestionAsegasa + true + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GestionAsegasa/My Project/Application.myapp b/GestionAsegasa/My Project/Application.myapp new file mode 100644 index 0000000..c0f7fef --- /dev/null +++ b/GestionAsegasa/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/GestionAsegasa/VentanasEmergentes/dxwIdentificacion.xaml b/GestionAsegasa/VentanasEmergentes/dxwIdentificacion.xaml new file mode 100644 index 0000000..991f5c4 --- /dev/null +++ b/GestionAsegasa/VentanasEmergentes/dxwIdentificacion.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + +