Jelajahi Sumber

Actualizacion

ahernandez 6 tahun lalu
induk
melakukan
35c6cf297c

+ 10 - 0
ApplicationEvents.vb

@@ -0,0 +1,10 @@
+Namespace My
+    ' Los siguientes eventos están disponibles para MyApplication:
+    ' Inicio: Se genera cuando se inicia la aplicación, antes de que se cree el formulario de inicio.
+    ' Apagado: Se genera después de haberse cerrado todos los formularios de aplicación.  Este evento no se genera si la aplicación termina de forma anómala.
+    ' UnhandledException: Se genera si la aplicación encuentra una excepción no controlada.
+    ' StartupNextInstance: Se genera cuando se inicia una aplicación de instancia única y dicha aplicación está ya activa. 
+    ' NetworkAvailabilityChanged: Se genera cuando se conecta o desconecta la conexión de red.
+    Partial Friend Class MyApplication
+    End Class
+End Namespace

+ 35 - 0
ENTI/Operaciones.vb

@@ -1054,6 +1054,29 @@
         If (Decimal.TryParse(Dec, value)) Then Return value Else Return 0
     End Function
 
+    Function ConvertirBoolNum(ByVal Bool As String)
+        Dim value As Boolean = 0
+
+        If Bool Is Nothing Then
+            value = False
+        Else
+            Bool = Bool.ToString.Trim("%")
+            If String.IsNullOrEmpty(Bool) Then
+                value = False
+            Else
+                If ConvertirEntero(Bool) = 1 Then
+                    value = True
+                Else
+                    value = False
+                End If
+            End If
+
+        End If
+
+
+        Return value
+    End Function
+
 
     Function ConvertirEntero(ByVal Int As String)
         Dim value As Integer = 0
@@ -1066,6 +1089,18 @@
         If (Integer.TryParse(Int, value)) Then Return value Else Return 0
     End Function
 
+    Function ConvertirCadena(ByVal Cadena As Object)
+        Dim value As Integer = 0
+        If Cadena Is Nothing Then
+            Cadena = String.Empty
+        End If
+        If Cadena Is DBNull.Value Then
+            Cadena = String.Empty
+        End If
+        Return Cadena.ToString
+
+    End Function
+
     Function ConvertirFecha(ByVal Fecha As String)
         Dim value As Date = Date.Today.Date
 

File diff ditekan karena terlalu besar
+ 89 - 71
FRM/frmPrincipalInicio.Designer.vb


+ 10 - 12
FRM/frmPrincipalInicio.vb

@@ -1,4 +1,5 @@
 Public Class frmPrincipalInicio
+    Dim Operaciones As New Operaciones
     Private Sub frmPrincipalInicio_Load(sender As Object, e As EventArgs) Handles MyBase.Load
         Listas()
     End Sub
@@ -19,25 +20,19 @@
         Dim Rendimiento As String = "0.00 "
         Dim dt As DataTable = general.RendimientoMontoGraficas
         For Each rows As DataRow In dt.Rows
-            If Not String.IsNullOrEmpty(rows("Rendimiento").ToString) Then
-                Rendimiento = rows("Rendimiento").ToString
-            End If
 
-            If Not String.IsNullOrEmpty(rows("Monto").ToString) Then
-                Monto = rows("Monto").ToString
-            End If
+            Rendimiento = Operaciones.ConvertirDecimal(rows("Rendimiento").ToString)
+            Monto = Operaciones.ConvertirDecimal(rows("Monto").ToString)
+            Cantidad = Operaciones.ConvertirDecimal(rows("Cantidad").ToString)
 
-            If Not String.IsNullOrEmpty(rows("Cantidad").ToString) Then
-                Cantidad = rows("Cantidad")
-            End If
         Next
 
-        lblMontoIngresos.Text = "$ " + Monto
+        lblMontoIngresos.Text = "$ " + FormatNumber(Monto, 2)
         If Cantidad = 0 Then
-            lblMontoRendimiento.Text = "0 %"
+            lblMontoRendimiento.Text = "0.00 %"
         Else
 
-            lblMontoRendimiento.Text = FormatNumber((((CDec(Rendimiento) / Cantidad)) * 100), 6).ToString + " %"
+            lblMontoRendimiento.Text = FormatNumber((((CDec(Rendimiento) / Cantidad)) * 100), 2).ToString + " %"
         End If
     End Sub
 
@@ -80,12 +75,15 @@
         Dim general As New DAOGeneral
 
         Dim dt As DataTable = general.RendimientosInstrumentoGrafica
+
         charlineal.Series(0).Points.Clear()
 
 
 
         charlineal.Series(0).XValueMember = "Instrumento"
         charlineal.Series(0).YValueMembers = "Suma"
+
+
         charlineal.DataSource = dt
     End Sub
     Sub Listas()

+ 5 - 3
FRM/frmProgreso.Designer.vb

@@ -27,21 +27,23 @@ Partial Class frmProgreso
         '
         'PgbProgreso
         '
+        Me.PgbProgreso.BackColor = System.Drawing.Color.White
         Me.PgbProgreso.Dock = System.Windows.Forms.DockStyle.Fill
         Me.PgbProgreso.Location = New System.Drawing.Point(0, 0)
         Me.PgbProgreso.Name = "PgbProgreso"
-        Me.PgbProgreso.Size = New System.Drawing.Size(814, 37)
+        Me.PgbProgreso.Size = New System.Drawing.Size(753, 26)
         Me.PgbProgreso.TabIndex = 0
         '
         'frmProgreso
         '
         Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
-        Me.ClientSize = New System.Drawing.Size(814, 37)
+        Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
+        Me.ClientSize = New System.Drawing.Size(753, 26)
         Me.Controls.Add(Me.PgbProgreso)
         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
         Me.Name = "frmProgreso"
-        Me.Text = "frmProgreso"
+        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
         Me.ResumeLayout(False)
 
     End Sub

+ 3 - 3
FRM/frmReporto.Designer.vb

@@ -146,7 +146,7 @@ Partial Class frmReporto
         '
         Me.cboCasaCorredora.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
         Me.cboCasaCorredora.FormattingEnabled = True
-        Me.cboCasaCorredora.Location = New System.Drawing.Point(813, 39)
+        Me.cboCasaCorredora.Location = New System.Drawing.Point(733, 37)
         Me.cboCasaCorredora.Name = "cboCasaCorredora"
         Me.cboCasaCorredora.Size = New System.Drawing.Size(150, 21)
         Me.cboCasaCorredora.TabIndex = 1
@@ -305,7 +305,7 @@ Partial Class frmReporto
         '
         'txtMonto
         '
-        Me.txtMonto.Location = New System.Drawing.Point(401, 129)
+        Me.txtMonto.Location = New System.Drawing.Point(474, 117)
         Me.txtMonto.Name = "txtMonto"
         Me.txtMonto.Size = New System.Drawing.Size(100, 20)
         Me.txtMonto.TabIndex = 173
@@ -365,7 +365,7 @@ Partial Class frmReporto
         Me.cboAnioBase.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
         Me.cboAnioBase.FormattingEnabled = True
         Me.cboAnioBase.Items.AddRange(New Object() {""})
-        Me.cboAnioBase.Location = New System.Drawing.Point(813, 64)
+        Me.cboAnioBase.Location = New System.Drawing.Point(733, 63)
         Me.cboAnioBase.Name = "cboAnioBase"
         Me.cboAnioBase.Size = New System.Drawing.Size(150, 21)
         Me.cboAnioBase.TabIndex = 166

+ 15 - 15
FRM/frmReporto.resx

@@ -140,27 +140,27 @@
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
         YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHdSURBVDhPnZFLTBpRFIanLtptxY1bt2Xn2lXbdOVj4YoO
-        +ADMyGjc0HVnp2maxph0VdPEGtEWm6ZDmthuTXwQjONjRAJYHhpwRgcYCvMIhuPcG6BCnIb0T76cnJlz
-        vztzL4GS5+Yfp/lFS4p7b02drFt53v8Qv2gn0ejCo8LRXGc+8rYnERqqlMLMCO2ZCVITlOh2UqKrBacB
-        NTaVsducm1iQ3n5nkcNv+rXd56CHBkHnXoKqSKBqf0wplWVAEiy4CM52FUIvlI/M06p+ONWr7TwDbZ+E
-        WK5qCpKQJCXWBJ+6ijzzRN8bBm2rD9TgAAiCoHPxDKz4PsN3NtBg/es3OExcNQvQgQm8v3ti3H2jGRJ2
-        gz1HAwmpAnFRgZhBXFQbJHKVZkE9Iw6XIuZlYAM/8EDkXIIPi0uwvOxrsLrmh2hGNhdIxTL+VDSQvCoB
-        /zsLR2fNJK+V9gThTAm4eBb2DVCtc3ppInC0CE7SEvhWvzQOEIH604uCicDeLIhdVyAiKH8xdo5cqvh5
-        W4KDe64R9cfJlmusx06O5+4K0nIVk6rVu9wrsNkmy3lDsPHzFx74F4pahNHRab62lCAA4IHxC6zX+xo8
-        k16gPa9wNYOmad1BugMMw3TUFP8bgrgFE2VsAYrY1WUAAAAASUVORK5CYII=
+        +ADMyGjc0HVnp2maxph0VbuwRrTFpumQJrZbEx8E4/gYkQCWhwac0QGGwjyC4Tj3BqgQpyH9ky8nZ+bc
+        787cS6DkufnHaX7RkuLeW1Mn61ae9z/EL9pJNLrwqHA015mPvO1JhIYqpTAzQntmgtQEJbqdlOhqwWlA
+        jU1l7DbnJhakt99Z5PCbfm33OeihQdC5l6AqEqjaH1NKZRmQBAsugrNdhdAL5SPztKofTvVqO89A2ych
+        lquagiQkSYk1waeuIs880feGQdvqAzU4AIIg6Fw8Ayu+z/CdDTRY//oNDhNXzQJ0YALv754Yd99ohoTd
+        YM/RQEKqQFxUIGYQF9UGiVylWVDPiMOliHkZ2MAPPBA5l+DD4hIsL/sarK75IZqRzQVSsYw/FQ0kr0rA
+        /87C0VkzyWulPUE4UwIunoV9A1TrnF6aCBwtgpO0BL7VL40DRKD+9KJgIrA3C2LXFYgIyl+MnSOXKn7e
+        luDgnmtE/XGy5RrrsZPjubuCtFzFpGr1LvcKbLbJct4QbPz8hQf+haIWYXR0mq8tJQgAeGD8Auv1vgbP
+        pBdozytczaBpWneQ7gDDMB01xf+GIG4BECFsADOX2rAAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
         YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGySURBVDhPlZM7S8NQGIbTpv4AF3HwCg4iOCndSut18wco
-        LqKIk4ODRZdugoqDhtDJpS466KAUKxSqLoLg4uDmDSQlvdj0kqb31/OFJlZttX7wkHA475PvO4dw1epg
-        DDHsf9DDsDJ+1FA2m1VCoVC5VCqhHrlcDoIg7LK9dSV2CmcyGaiqapJMJpFIJCDLsi4Jh8MQRfGHxMKw
-        0wZN05DP5/UnkU6noSgKIpGILmBdgj7i9XoNiV6mgMIGJKBAKpVCNBr9Mg5BmWr2U1AsFs0N9E5zG6PE
-        YjG9E0mSGgu+UyuhTug84vF48wLCkNA4dCYkovWmBUShUNDPhSQErf1LQF28HO/hZm4AwbEWXM10Q7Bb
-        xF8FFDJ4PRFwv+qA5t9B5SEA9XAFIedg+cJlW/5TQO1fz/Yhy8LYmwLcrcBGL6JbLvhH+KeGgloJtV25
-        O0FtJTzt8IzaKqbA5/NV6kmIy+kuZPbnARbKrXJ4Z7wu8QhM8G8koBpm16M2+pmej7Zxu9gPyd2LyFoL
-        HhcsCDpt5fNx63o1z3Uyhhl0NXXZn2wTT0d5ido+c/LygYPf5DiO+wAWH4N+MGEl+gAAAABJRU5ErkJg
+        LqKIk4ODRZdugoqDhtDJobjooINSrFCougiCi4ObN5CU9GLTS5reX88Xmli11frBQ8LhvE++7xzCVauD
+        McSw/0EPw8r4UUPZbFYJhULlUqmEeuRyOQiCsMv21pXYKZzJZKCqqkkymUQikYAsy7okHA5DFMUfEgvD
+        Ths0TUM+n9efRDqdhqIoiEQiuoB1CfqI1+s1JHqZAgobkIACqVQK0Wj0yzgEZarZT0GxWDQ30DvNbYwS
+        i8X0TiRJaiz4Tq2EOqHziMfjzQsIQ0Lj0JmQiNabFhCFQkE/F5IQtPYvAXXxcryHm7kBBMdacDXTDcFu
+        EX8VUMjg9UTA/aoDmn8HlYcA1MMVhJyD5QuXbflPAbV/PduHLAtjbwpwtwIbvYhuueAf4Z8aCmol1Hbl
+        7gS1lfC0wzNqq5gCn89XqSchLqe7kNmfB1got8rhnfG6xCMwwb+RgGqYXY/a6Gd6PtrG7WI/JHcvImst
+        eFywIOi0lc/HrevVPNfJGGbQ1dRlf7JNPB3lJWr7zMnLBw5+k+M47gMT9IN7cfyavwAAAABJRU5ErkJg
         gg==
 </value>
   </data>

+ 100 - 506
FRM/frmReporto.vb

@@ -1,35 +1,24 @@
 Public Class frmReporto
     Dim oDAOGeneral As New DAOGeneral
-    Dim Aniobase As Integer = 365
     Const PorcentajeComisionCasa As Double = 0.2825
     Const PorcentajeComisionBolsa As Double = 0.2825
-    Const PorcentajeComisionIOF As Double = 0.25
-    Dim PorcentajeISR As Double = 10
     Dim oCEReporto As ReportosCE
     Dim oDAOReportos As ReportosDAO
     Dim Reporto As New ReportosCE
     Dim ReportoConsula As New ReportosDAO
-    Private CodigoInversion As String
     Dim Estado As String = String.Empty
     Dim CargarUnaVez As Boolean = True
     Dim Operaciones As New Operaciones
-    Dim NombreTitulo As New Dictionary(Of String, String)
     Dim Modificado As Boolean = False
     Dim InstrumentoFinanciero As String = oDAOGeneral.ObtenerInstrumento(Variables.Codigo)
     Dim CodigoRotar As Integer = 0
     Private _Modo As String
-    Private _IdDocumento As Integer
-    Private _TipoDocumento As String
     Private Cargado As Boolean = False
     Private Procesado As Boolean = False
     Private Tabla As String = String.Empty
     Private Base As Integer = 0
-    Private IOFEstado As Integer = 0
-    Private RentaEstado As Integer = 0
-    Private TipoOperacionRepo As String = String.Empty
-    Private CodigoRepo As String = String.Empty
     Private CodigoProveniente As String = String.Empty
-    Dim CodigoCheque As String = String.Empty
+
     Sub New()
 
         ' Esta llamada es exigida por el diseñador.
@@ -131,7 +120,6 @@
 
 
             dgvReportos.Columns.Add(Correlativo)
-
             dgvReportos.Columns.Add(ValTrans)
             dgvReportos.Columns.Add(Dias)
             dgvReportos.Columns.Add(FVen)
@@ -162,11 +150,6 @@
             dgvReportos.Columns.Add(EstadoIOF)
             dgvReportos.Columns.Add(EstadoRenta)
 
-
-            Dim CodImp, code As New DataGridViewTextBoxColumn
-            CodImp.Name = "CodImp"
-            code.Name = "codigo"
-
         End If
     End Sub
 
@@ -175,7 +158,6 @@
         Dim Index As Integer = dgvReportos.Rows.Count - 2
         Base = cboAnioBase.SelectedIndex
         Dim i As Integer = 0
-
         While i <= Index
             dgvReportos.Rows(i).Cells("Base").Value = Base
             i += 1
@@ -185,289 +167,60 @@
 
 
     Sub IngresarDatos()
-
-
-
         If Cargado Then
             If Procesado Then
-
-
-
                 If Not dgvReportos.CurrentRow Is Nothing Then
-
-
                     Dim Index As Integer = dgvReportos.CurrentRow.Index
-
-
-
-                    dgvReportos.Rows(Index).Cells("Nombre").Value = txtCodigoTitulo.Text
+                    dgvReportos.Rows(Index).Cells("Nombre").Value = txtCodigoTitulo.Text.ToString
                     dgvReportos.Rows(Index).Cells("FCompra").Value = dtpFechaCompra.Value
-
-                    If txtComisionCasa.Text.ToString.Trim("%") = 0 Then
-                        dgvReportos.Rows(Index).Cells("ComisionCasa").Value = "0.0"
-                    Else
-                        dgvReportos.Rows(Index).Cells("ComisionCasa").Value = CDec(txtComisionCasa.Text.ToString.Trim("%")) / 100
-                    End If
-
-
-                    If txtComisionBolsa.Text.ToString.Trim("%") = 0 Then
-                        dgvReportos.Rows(Index).Cells("ComisionBolsa").Value = "0.0"
-                    Else
-                        dgvReportos.Rows(Index).Cells("ComisionBolsa").Value = CDec(txtComisionBolsa.Text.ToString.Trim("%")) / 100
-                    End If
-
-
-
-
-
-
-                    If Variables.Codigo.IndexOf("REPO") > -1 Or Variables.Codigo.IndexOf("REPOVENTA") > -1 Then
-
-
-                        dgvReportos.Rows(Index).Cells("Casa").Value = cboCasaCorredora.SelectedValue
-
-
-                    End If
-
-                End If
+                    dgvReportos.Rows(Index).Cells("ComisionCasa").Value = Operaciones.ConvertirDecimal(txtComisionCasa.Text.ToString) / 100
+                    dgvReportos.Rows(Index).Cells("ComisionBolsa").Value = Operaciones.ConvertirDecimal(txtComisionBolsa.Text.ToString) / 100
+                    dgvReportos.Rows(Index).Cells("Casa").Value = cboCasaCorredora.SelectedValue
                 End If
+            End If
         End If
     End Sub
     Sub IngresarDatosReves()
         Procesado = False
-
-
-
         If Cargado Then
 
+            If Not dgvReportos.CurrentRow Is Nothing Then
 
-                If Not dgvReportos.CurrentRow Is Nothing Then
-
-
-                    Dim Index As Integer = dgvReportos.CurrentRow.Index
-                Dim Nombre = dgvReportos.Rows(Index).Cells("Nombre").Value
-                Dim FCompra = dgvReportos.Rows(Index).Cells("FCompra").Value
-                Dim ComisionCasa = dgvReportos.Rows(Index).Cells("ComisionCasa").Value
-                Dim ComisionBolsa = dgvReportos.Rows(Index).Cells("ComisionBolsa").Value
-                Dim EstadoIOF = dgvReportos.Rows(Index).Cells("EstadoIOF").Value
-                Dim EstadoRenta = dgvReportos.Rows(Index).Cells("EstadoRenta").Value
-                Dim Casa = dgvReportos.Rows(Index).Cells("Casa").Value
-
-
-
-                If Not Nombre Is DBNull.Value Then
-
-                    If Not Nombre Is Nothing Then
-
-
-                        If Not String.IsNullOrEmpty(Nombre) Then
-
-
-                            txtCodigoTitulo.Text = Nombre
-
-                        Else
-                            txtCodigoTitulo.Text = String.Empty
-                        End If
-                    Else
-                        txtCodigoTitulo.Text = String.Empty
-                    End If
-                Else
-                    txtCodigoTitulo.Text = String.Empty
-                    End If
-                If Not FCompra Is DBNull.Value Then
-                    If Not FCompra Is Nothing Then
-                        If Not String.IsNullOrEmpty(FCompra) Then
-
-
-                            dtpFechaCompra.Value = FCompra
-                        Else
-                            dtpFechaCompra.Value = Date.Now.Date
-                        End If
-                    Else
-                        dtpFechaCompra.Value = Date.Now.Date
-                    End If
-                Else
-                        dtpFechaCompra.Value = Date.Now.Date
-                    End If
-
-                If Not ComisionCasa Is DBNull.Value Then
-                    If Not ComisionCasa Is Nothing Then
-                        If Not String.IsNullOrEmpty(ComisionCasa.ToString.Trim("%")) Then
-
-
-                            txtComisionCasa.Text = ComisionCasa.ToString.Trim("%") * 100
-                        Else
-                            txtComisionCasa.Text = "0.2825%"
-                        End If
-                    Else
-                        txtComisionCasa.Text = "0.2825%"
-                    End If
-
-                Else
-                    txtComisionCasa.Text = "0.2825%"
-                End If
 
+                Dim Index As Integer = dgvReportos.CurrentRow.Index
+                Dim Nombre As String = CStr(dgvReportos.Rows(Index).Cells("Nombre").Value)
+                Dim FCompra As Date = Operaciones.ConvertirFecha(dgvReportos.Rows(Index).Cells("FCompra").Value)
+                Dim ComisionCasa As Double = Operaciones.ConvertirDecimal(dgvReportos.Rows(Index).Cells("ComisionCasa").Value) * 100
+                Dim ComisionBolsa As Double = Operaciones.ConvertirDecimal(dgvReportos.Rows(Index).Cells("ComisionBolsa").Value) * 100
+                Dim EstadoIOF As Boolean = Operaciones.ConvertirBoolNum(dgvReportos.Rows(Index).Cells("EstadoIOF").Value)
+                Dim EstadoRenta As Boolean = Operaciones.ConvertirBoolNum(dgvReportos.Rows(Index).Cells("EstadoRenta").Value)
+                Dim Casa As String = Operaciones.ConvertirCadena(dgvReportos.Rows(Index).Cells("Casa").Value)
 
 
-                If Not ComisionBolsa Is DBNull.Value Then
-                    If Not ComisionBolsa Is Nothing Then
-                        If Not String.IsNullOrEmpty(ComisionBolsa.ToString.Trim("%")) Then
 
+                txtCodigoTitulo.Text = Nombre
+                dtpFechaCompra.Value = FCompra
+                txtComisionCasa.Text = ComisionCasa
+                txtComisionBolsa.Text = ComisionBolsa
 
-                            txtComisionBolsa.Text = ComisionBolsa.ToString.Trim("%") * 100
-                        Else
-                            txtComisionBolsa.Text = "0.2825%"
-
-                        End If
-                    Else
-                        txtComisionBolsa.Text = "0.2825%"
-                    End If
-                Else
-                    txtComisionBolsa.Text = "0.2825%"
-                End If
-
-
-
-                If Not EstadoIOF Is DBNull.Value Then
-                    If Not EstadoIOF Is Nothing Then
-                        If Not String.IsNullOrEmpty(EstadoIOF) Then
-                            If Index = 0 Then
-                                If EstadoIOF = 1 Then
-                                    ChkIOF.Checked = True
-                                Else
-                                    ChkIOF.Checked = False
-                                End If
-                            Else
-                                Dim EstadoIOFAnt = dgvReportos.Rows(Index - 1).Cells("EstadoIOF").Value
-                                If EstadoIOFAnt = 1 Then
-                                    ChkIOF.Checked = True
-                                Else
-                                    ChkIOF.Checked = False
-                                End If
-                            End If
-
-
-
-                        Else
-                            If Not Index = 0 Then
-                                Dim EstadoIOFAnt = dgvReportos.Rows(Index - 1).Cells("EstadoIOF").Value
-                                If EstadoIOFAnt = 1 Then
-                                    ChkIOF.Checked = True
-                                Else
-                                    ChkIOF.Checked = False
-                                End If
-                            End If
-
-                        End If
-                    Else
-                        If Not Index = 0 Then
-                            Dim EstadoIOFAnt = dgvReportos.Rows(Index - 1).Cells("EstadoIOF").Value
-                            If EstadoIOFAnt = 1 Then
-                                ChkIOF.Checked = True
-                            Else
-                                ChkIOF.Checked = False
-                            End If
-                        End If
-                    End If
+                If Index = 0 Then
+                    ChkIOF.Checked = EstadoIOF
                 Else
-                    If Not Index = 0 Then
-                        Dim EstadoIOFAnt = dgvReportos.Rows(Index - 1).Cells("EstadoIOF").Value
-                        If EstadoIOFAnt = 1 Then
-                            ChkIOF.Checked = True
-                        Else
-                            ChkIOF.Checked = False
-                        End If
-                    End If
+                    Dim EstadoIOFAnt = Operaciones.ConvertirBoolNum(dgvReportos.Rows(Index - 1).Cells("EstadoIOF").Value)
+                    ChkIOF.Checked = EstadoIOFAnt
                 End If
 
 
-
-
-
-
-
-                If Not EstadoRenta Is DBNull.Value Then
-                    If Not EstadoRenta Is Nothing Then
-                        If Not String.IsNullOrEmpty(EstadoRenta) Then
-
-                            If Index = 0 Then
-                                If EstadoRenta = 1 Then
-                                    ChkRenta.Checked = True
-                                Else
-                                    ChkRenta.Checked = False
-                                End If
-                            Else
-                                Dim EstadoRentaAnt = dgvReportos.Rows(Index - 1).Cells("EstadoRenta").Value
-                                If EstadoRentaAnt = 1 Then
-                                    ChkRenta.Checked = True
-                                Else
-                                    ChkRenta.Checked = False
-                                End If
-                            End If
-
-
-
-
-
-                        Else
-
-
-                            If Not Index = 0 Then
-                                Dim EstadoRentaAnt = dgvReportos.Rows(Index - 1).Cells("EstadoRenta").Value
-                                If EstadoRentaAnt = 1 Then
-                                    ChkRenta.Checked = True
-                                Else
-                                    ChkRenta.Checked = False
-                                End If
-                            End If
-                        End If
-                    Else
-                        If Not Index = 0 Then
-                            Dim EstadoRentaAnt = dgvReportos.Rows(Index - 1).Cells("EstadoRenta").Value
-                            If EstadoRentaAnt = 1 Then
-                                ChkRenta.Checked = True
-                            Else
-                                ChkRenta.Checked = False
-                            End If
-                        End If
-                    End If
+                If Index = 0 Then
+                    ChkRenta.Checked = EstadoRenta
                 Else
-                    If Not Index = 0 Then
-                        Dim EstadoRentaAnt = dgvReportos.Rows(Index - 1).Cells("EstadoRenta").Value
-                        If EstadoRentaAnt = 1 Then
-                            ChkRenta.Checked = True
-                        Else
-                            ChkRenta.Checked = False
-                        End If
-                    End If
-                End If
-
-
-
-
+                    Dim EstadoRentaAnt = dgvReportos.Rows(Index - 1).Cells("EstadoRenta").Value
+                    ChkRenta.Checked = EstadoRentaAnt
 
-                If Not Casa Is DBNull.Value Then
-                    If Not Casa Is Nothing Then
-                        If Not String.IsNullOrEmpty(Casa) Then
-
-
-                            cboCasaCorredora.SelectedValue = Casa
-                        Else
-                            cboCasaCorredora.SelectedIndex = -1
-                        End If
-                    Else
-                        cboCasaCorredora.SelectedIndex = -1
-                    End If
-                Else
-                    cboCasaCorredora.SelectedIndex = -1
                 End If
-
-
-
-
-            End If
+                cboCasaCorredora.SelectedValue = Casa
             End If
-
+        End If
         Procesado = True
     End Sub
 
@@ -484,38 +237,7 @@
         dgvReportos.Rows(Index).Cells("Comision CB").Value = Operaciones.ConvertirDecimal(Reporto.Comision(ValorTrasado, Dias, por, Fecha1, Fecha2, Base).ToString)
     End Sub
 
-    Function ComisionCasaCargar(ByVal Index As Integer)
-        Dim ValorTrasado As Double = 0
-        Dim Dias As Integer = 0
-        Dim por As Double = 0
-
-        If Not String.IsNullOrEmpty(dgvReportos.Rows(Index).Cells("Valor Trasado").Value) Then
-            ValorTrasado = dgvReportos.Rows(Index).Cells("Valor Trasado").Value
-        End If
-
 
-        If Not String.IsNullOrEmpty(dgvReportos.Rows(Index).Cells("Dias").Value) Then
-            Dias = dgvReportos.Rows(Index).Cells("Dias").Value
-        End If
-
-
-
-        If (String.IsNullOrEmpty(txtComisionCasa.Text.ToString.Trim("%"))) Then
-            txtComisionCasa.Text = "0.2825%"
-
-        Else
-            por = CDec(txtComisionCasa.Text.ToString.Trim("%")) / 100
-        End If
-        Dim Fecha1 As Date = dgvReportos.Rows(Index).Cells("FCompra").Value
-        Dim Fecha2 As Date = dgvReportos.Rows(Index).Cells("Fecha de Vencimiento").Value
-
-
-        Dim Com = Reporto.Comision(ValorTrasado, Dias, por, Fecha1, Fecha2, Base)
-
-        dgvReportos.Rows(Index).Cells("Comision CB").Value = Com
-
-        Return Com
-    End Function
 
     Sub ComisionBolsa(ByVal ComisionBolsa As Double, ByVal Index As Integer)
         Dim ValorTrasado As Double = 0
@@ -697,23 +419,10 @@
         Dim Index As Integer = dgvReportos.CurrentRow.Index
         Dim Fecha As Date = dtpFechaCompra.Value
         Dim Fecha2 As Date = Date.Now.Date
-
-
-
-        If Not String.IsNullOrEmpty(dgvReportos.Rows(Index).Cells("Fecha de Vencimiento").Value) Then
-            Fecha2 = dgvReportos.Rows(Index).Cells("Fecha de Vencimiento").Value
-        End If
-
-
-
-
-
-
+        Fecha2 = Operaciones.ConvertirFecha(dgvReportos.Rows(Index).Cells("Fecha de Vencimiento").Value)
     End Sub
     Private Sub CargarCasaCorredora()
         If cboCasaCorredora.Items.Count = 0 Or cboCasaCorredora.Items.Count = 1 Then
-
-
             Me.cboCasaCorredora.DataSource = oDAOGeneral.ListaTiposImpuesto
             Me.cboCasaCorredora.DisplayMember = "Descripcion"
             Me.cboCasaCorredora.ValueMember = "Codigo"
@@ -724,8 +433,6 @@
 
     Sub CargarBase()
         If cboAnioBase.Items.Count = 0 Or cboAnioBase.Items.Count = 1 Then
-
-
             Me.cboAnioBase.DataSource = oDAOGeneral.ListaBase
             Me.cboAnioBase.DisplayMember = "Descripcion"
             Me.cboAnioBase.ValueMember = "Codigo"
@@ -734,11 +441,6 @@
     End Sub
 
 
-
-
-
-
-
     Private Sub frmReporto_Load(sender As Object, e As EventArgs) Handles MyBase.Load
 
         Titulo.TabPages.Remove(TbImpuestos)
@@ -923,32 +625,9 @@
         End While
     End Sub
 
-
-
-
-
-
-
-
-
-
-
-
-
-    Sub ActualizarImpuestos(ByVal Valor As Integer)
-
-        CargarReporto(Tabla)
-
-
-    End Sub
-
     Sub Calculos()
 
-
-        If Variables.Codigo.IndexOf("REPO") > -1 Or Variables.Codigo.IndexOf("REPOVENTA") > -1 Then
-
-
-            Dim Cantidad As Integer = dgvReportos.Rows.Count - 2
+        Dim Cantidad As Integer = dgvReportos.Rows.Count - 2
             Dim Index As Integer = 0
 
             While Index <= Cantidad
@@ -974,21 +653,15 @@
                 Index += 1
             End While
 
-
-        Else
-
-
-        End If
     End Sub
 
 
     Sub NuevaFila()
 
 
-        If Variables.Codigo.IndexOf("REPO") > -1 Or Variables.Codigo.IndexOf("REPOVENTA") > -1 Then
 
 
-            Dim i As Integer = dgvReportos.CurrentRow.Index
+        Dim i As Integer = dgvReportos.CurrentRow.Index
             Dim IndexAnterior As Integer = dgvReportos.CurrentRow.Index - 1
 
             If (String.IsNullOrEmpty(dgvReportos.Rows(i).Cells("Codigo").Value)) Then
@@ -1085,14 +758,11 @@
             If (String.IsNullOrEmpty(dgvReportos.Rows(i).Cells("R% Neto (Despues de Impuesto)").Value)) Then
                 dgvReportos.Rows(i).Cells("R% Neto (Despues de Impuesto)").Value = 0
             End If
-        End If
+
     End Sub
 
 
     Sub QuitarFila()
-
-
-
         Dim result As Integer = MsgBox("¿Está seguro que desea eliminar la fila?", MsgBoxStyle.OkCancel)
         ' Test result.
         Dim codigo As String = Variables.Codigo
@@ -1104,15 +774,7 @@
             Catch ex As Exception
                 MsgBox("No ha seleccionado una fila")
             End Try
-
-
-
         End If
-
-
-
-
-
     End Sub
 
 
@@ -1145,7 +807,7 @@
         Dim IndexCantidad As Integer = dgvReportos.Rows.Count - 2
         Dim NumeroMayor As Integer = 0
         While Index <= IndexCantidad
-            Dim Numero As Integer = dgvReportos.Rows(Index).Cells("codigo").Value
+            Dim Numero As Integer = Operaciones.ConvertirEntero(dgvReportos.Rows(Index).Cells("codigo").Value)
             If Numero > NumeroMayor Then
                 NumeroMayor = Numero
             End If
@@ -1158,91 +820,85 @@
 
 
     Sub CargarReporto(ByVal Tabla As String)
-
-
-        Dim ConvertirString As String
+        Dim FechaVencimientoFormatoCadena As String
         Dim Activo = 0.0, ActivoRenta = 0.0
         Dim EstadoIOF, EstadoRenta
-
         Dim dr = ReportoConsula.CargarReporto(Codigo, Tabla)
-        If Tabla = "REP0" Or Tabla = "REP0VENTA" Then
-
-
-
-            If (Not dr Is Nothing) Then
-
-
-
-
-                While dr.Read
-                    If dr("EstadoIOF") Then
-                        EstadoIOF = 1
-                        ChkIOF.Checked = True
-                    Else
-                        EstadoIOF = 0
-                        ChkIOF.Checked = False
-
-                    End If
-
-                    If dr("EstadoRenta") Then
-                        EstadoRenta = 1
-                        ChkRenta.Checked = True
-                    Else
-                        EstadoRenta = 0
-                        ChkRenta.Checked = False
-
-                    End If
+        Dim ValorTransado As Double = 0
+        Dim Rendimiento As Double = 0
+        Dim CostoTransferencia As Double = 0
+        Dim Nombre As String = String.Empty
+        Dim FechaCompra As Date = Date.Now.Date
+        Dim CasaCorredora As String = String.Empty
+        Dim Correlativo As Integer = 0
 
+        If (Not dr Is Nothing) Then
 
 
 
-                    Dim FechaVencimiento As Date = dr("FCompra")
-                    Dim Dias As Integer = dr("Dias")
-                    FechaVencimiento = FechaVencimiento.AddDays(Dias)
 
+            While dr.Read
+                If dr("EstadoIOF") Then
+                    EstadoIOF = 1
+                    ChkIOF.Checked = True
+                Else
+                    EstadoIOF = 0
+                    ChkIOF.Checked = False
 
+                End If
 
-                    ConvertirString = Format(FechaVencimiento, "dd/MM/yyyy")
-                    dtpFechaCompra.Value = dr("FCompra")
-                    If (dr("IOF")) Then
-                        Activo = 1
-                    Else
-                        Activo = 0
-                    End If
-                    If (dr("Renta")) Then
-                        ActivoRenta = 1
-                    Else
-                        ActivoRenta = 0
-                    End If
-                    Dim ComisionCasa As Double = 0
-                    Dim ComisionBolsa As Double = 0
-                    If Not String.IsNullOrEmpty(dr("ComisionCasa").ToString) Then
-                        ComisionCasa = dr("ComisionCasa")
-                    End If
+                If dr("EstadoRenta") Then
+                    EstadoRenta = 1
+                    ChkRenta.Checked = True
+                Else
+                    EstadoRenta = 0
+                    ChkRenta.Checked = False
 
-                    If Not String.IsNullOrEmpty(dr("ComisionBolsa").ToString) Then
-                        ComisionBolsa = dr("ComisionBolsa")
-                    End If
-                    If Tabla = "REP0VENTA" Then
+                End If
 
 
-                        dgvReportos.Rows.Add("", dr("ValTrans"), dr("Dias"), ConvertirString, (dr("Rend")), 0, 0, 0, 0, 0, 0, 0, 0, 0, dr("CostoTransfr"), ActivoRenta, "", "", "", dr("Nombre"), dr("FCompra"), ComisionCasa, ComisionBolsa, dr("Casa"), dr("codigo"), "", EstadoIOF, EstadoRenta)
 
 
-                    End If
+                Dim FechaVencimiento As Date = Operaciones.ConvertirFecha(dr("FCompra").ToString)
+                Dim Dias As Integer = Operaciones.ConvertirEntero(dr("Dias").ToString)
+                FechaVencimiento = FechaVencimiento.AddDays(Dias)
+                FechaVencimientoFormatoCadena = Format(FechaVencimiento, "dd/MM/yyyy")
+                dtpFechaCompra.Value = Operaciones.ConvertirFecha(dr("FCompra").ToString)
 
+                If (dr("IOF")) Then
+                    Activo = 1
+                Else
+                    Activo = 0
+                End If
+                If (dr("Renta")) Then
+                    ActivoRenta = 1
+                Else
+                    ActivoRenta = 0
+                End If
 
-                End While
-            End If
 
-        Else
+                Dim ComisionCasa As Double = 0
+                Dim ComisionBolsa As Double = 0
 
+                ComisionCasa = Operaciones.ConvertirDecimal(dr("ComisionCasa").ToString)
+                ComisionBolsa = Operaciones.ConvertirDecimal(dr("ComisionBolsa").ToString)
+                ValorTransado = Operaciones.ConvertirDecimal(dr("ValTrans").ToString)
+                CostoTransferencia = Operaciones.ConvertirDecimal(dr("CostoTransfr").ToString)
+                Nombre = dr("Nombre").ToString
+                FechaCompra = Operaciones.ConvertirFecha(dr("FCompra").ToString)
+                CasaCorredora = dr("Casa").ToString
+                Correlativo = Operaciones.ConvertirEntero(dr("codigo").ToString)
 
 
+                If Tabla = "REP0VENTA" Then
+                    dgvReportos.Rows.Add("", ValorTransado, Dias,
+                    FechaVencimientoFormatoCadena, Rendimiento, 0, 0, 0,
+                    0, 0, 0, 0, 0, 0, CostoTransferencia, ActivoRenta, "",
+                    "", "", Nombre, FechaCompra, ComisionCasa,
+                    ComisionBolsa, CasaCorredora, Correlativo, "", EstadoIOF, EstadoRenta)
+                End If
+            End While
         End If
-
-
-
     End Sub
 
 
@@ -1308,12 +964,12 @@
 
 
             coleccion.Add(Nombre)
-            coleccion.Add(CDate(FCompra))
-            coleccion.Add(CDec(ValTrans))
-            coleccion.Add(CInt(Dias))
-            coleccion.Add(CDate(FVenc))
-            coleccion.Add(CDec(Rend))
-            coleccion.Add(CDec(CostoTransfr))
+            coleccion.Add(FCompra)
+            coleccion.Add(ValTrans)
+            coleccion.Add(Dias)
+            coleccion.Add(FVenc)
+            coleccion.Add(Rend)
+            coleccion.Add(CostoTransfr)
             coleccion.Add(codigo)
             coleccion.Add(ComisionCasa)
             coleccion.Add(ComisionBolsa)
@@ -1321,7 +977,6 @@
             coleccion.Add(IOF)
             coleccion.Add(Renta)
             coleccion.Add(Base)
-
             coleccion.Add(ComisionCasaValor)
             coleccion.Add(ComisionBolsaValor)
             coleccion.Add(IOFValor)
@@ -1334,7 +989,6 @@
             coleccion.Add(ImpLiq)
             coleccion.Add(IngrNet)
             coleccion.Add(ValorNet)
-
             coleccion.Add(EstadoIOF)
             coleccion.Add(EstadoRenta)
 
@@ -1357,11 +1011,6 @@
     Private Sub dtpFechaCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaCompra.ValueChanged
         Formato()
         IngresarDatos()
-        If Variables.Codigo.IndexOf("REPOVENTA") > -1 Then
-
-
-
-        End If
         Modificado = True
         Calculos()
     End Sub
@@ -1369,17 +1018,10 @@
     Private Sub dgvReportos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvReportos.CellClick
         IOFRentaEstado()
         IngresarDatosReves()
-
         NuevaFila()
-        If Variables.Codigo.IndexOf("REPO") > -1 Or Variables.Codigo.IndexOf("REPOVENTA") > -1 Then
-            Dim Index = dgvReportos.CurrentRow.Cells("codigo").Value
-
-            CargarFecha()
-
-            Calculos()
-
-        End If
-
+        Dim Index = Operaciones.ConvertirEntero(dgvReportos.CurrentRow.Cells("codigo").Value)
+        CargarFecha()
+        Calculos()
         Formato()
     End Sub
     Private Sub dgvReportos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvReportos.CellContentClick
@@ -1416,9 +1058,6 @@
         i = Cantidad
         While i <= Index
 
-
-
-
             Dim coleccion = ObtenerDatos(i)
             If ReportoConsula.Nuevo(coleccion, Codigo, Tabla) Is Nothing Then
 
@@ -1439,9 +1078,6 @@
 
         While i <= Index
 
-
-
-
             Dim coleccion = ObtenerDatos(i)
             diccionario.Add(i, coleccion)
             i += 1
@@ -1450,34 +1086,18 @@
 
     End Function
 
-
-    Function CanRegistros(ByVal Tabla As String)
-
-
-        Dim Codigo = Variables.Codigo
-        Dim Cantidad As Integer = oDAOGeneral.CantidadRegistros(Codigo, Tabla)
-
-        Return Cantidad
-    End Function
-
-
-
     Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
         LlenarBase()
 
         Dim Codigo = Variables.Codigo
         Dim diccionario As Dictionary(Of String, Collection) = NuevoIngresoColeccion()
         If (Estado = "N") Then
-
             ReportoConsula.ProcesoDatos(diccionario, Codigo, Tabla)
-
-
             ValidarExistencia()
         ElseIf Not ExisteValidacion() Then
             Variables.ColeccionREPO = diccionario
             Me.Close()
         ElseIf (Estado = "M") Then
-
             ReportoConsula.ProcesoDatos(diccionario, Codigo, Tabla)
             ValidarExistencia()
         ElseIf (Estado = "B") Then
@@ -1485,21 +1105,15 @@
             ValidarExistencia()
         End If
 
-
-
-
-
     End Sub
 
     Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
         btnAccion.Text = "Agregar"
-
         Estado = "N"
     End Sub
 
     Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
         btnAccion.Text = "Eliminar"
-
         Estado = "B"
     End Sub
 
@@ -1602,11 +1216,6 @@
 
 
         IngresarDatos()
-        If (InstrumentoFinanciero = "REPOVENTA") Then
-
-
-
-        End If
         Modificado = True
         Calculos()
 
@@ -1616,11 +1225,6 @@
 
 
         IngresarDatos()
-        If (InstrumentoFinanciero = "REPOVENTA") Then
-
-
-
-        End If
         Modificado = True
         Calculos()
     End Sub
@@ -1690,12 +1294,10 @@
         Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
         If (Existe) Then
             navNuevo.Enabled = False
-
             navModificar.Enabled = True
             navEliminar.Enabled = True
         Else
             navNuevo.Enabled = True
-
             navModificar.Enabled = False
             navEliminar.Enabled = False
         End If
@@ -1713,8 +1315,6 @@
         ElseIf Variables.Codigo.IndexOf("REPO") > -1 Then
             Tabla = "REP0"
         End If
-
-
         Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
         Return Existe
     End Function
@@ -1739,13 +1339,7 @@
 
     Private Sub cboAnioBase_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBase.SelectedIndexChanged
         LlenarBase()
-
         IngresarDatos()
-        If (InstrumentoFinanciero = "REPOVENTA") Then
-
-
-
-        End If
         Modificado = True
         Calculos()
     End Sub

+ 99 - 143
FRM/frmResultadoTitularizacion.vb

@@ -9,6 +9,7 @@ Public Class frmResultadoTitularizacion
     Dim oDAOGeneral As New DAOGeneral
     Dim Operaciones As New Operaciones
     Dim IndexBase As Integer = 0
+
     Public FechaRedencion As Date = Date.Today.Date
     Private Sub txtRendimientoAntesISR_Op_TextChanged(sender As Object, e As EventArgs)
 
@@ -111,16 +112,13 @@ Public Class frmResultadoTitularizacion
     Private Sub frmResultadoTitularizacion_Load(sender As Object, e As EventArgs) Handles MyBase.Load
         AgregarColumnasAmortCap()
         AgregarColumnasAmort()
-
         CargarTIT()
         CargarAmortCap()
         CargarAmort()
-
         ExisteInversion()
         ValidarExistencia()
         Formato()
         CargarIndexBase()
-
         DefinirVigencia()
     End Sub
 
@@ -131,15 +129,15 @@ Public Class frmResultadoTitularizacion
 
 
         If Index = "0" Then
-            IndexBase = CInt(Index)
+            IndexBase = Operaciones.ConvertirEntero(Index)
         ElseIf Index = "1" Then
-            IndexBase = CInt(Index)
+            IndexBase = Operaciones.ConvertirEntero(Index)
 
         ElseIf Index = "2" Then
-            IndexBase = CInt(Index)
+            IndexBase = Operaciones.ConvertirEntero(Index)
 
         ElseIf Index = "3" Then
-            IndexBase = CInt(Index)
+            IndexBase = Operaciones.ConvertirEntero(Index)
 
 
 
@@ -256,12 +254,16 @@ Public Class frmResultadoTitularizacion
 
     Function ColeccionesTIT()
         Dim coleccion As New Collection
-        Dim Tasa, MontoCompra, MontoCompraPrimario As Double
+        Dim Tasa As Double, MontoCompra As Double, MontoCompraPrimario As Double
         Dim FechaEmision As Date = Date.Now.Date
+
+
         FechaEmision = dtpFechaEmision.Value
-        Tasa = CDec(txtTasaEmision.Text.ToString.Trim("%")) / 100
-        MontoCompra = txtMontoCompraEmision.Text
-        MontoCompraPrimario = txtMontoCompraPrimario.Text
+        Tasa = Operaciones.ConvertirDecimal(txtTasaEmision.Text.ToString) / 100
+        MontoCompra = Operaciones.ConvertirDecimal(txtMontoCompraEmision.Text.ToString)
+        MontoCompraPrimario = Operaciones.ConvertirDecimal(txtMontoCompraPrimario.Text.ToString)
+
+
         coleccion.Add(FechaEmision)
         coleccion.Add(Tasa)
         coleccion.Add(MontoCompra)
@@ -276,14 +278,14 @@ Public Class frmResultadoTitularizacion
         If Not coleccion.Count < 0 Then
 
 
-            Correlativo = dgvAmortizacion.Rows(Index).Cells("Correlativo").Value
-            Porcentaje = dgvAmortizacion.Rows(Index).Cells("Porcentaje").Value
-            Fecha2 = dgvAmortizacion.Rows(Index).Cells("Fecha").Value
-            Dias = dgvAmortizacion.Rows(Index).Cells("Dias").Value
-            Cuota = dgvAmortizacion.Rows(Index).Cells("Cuotas").Value
-            AmortCap2 = dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value
-            Interes2 = dgvAmortizacion.Rows(Index).Cells("Interés").Value
-            Saldo2 = dgvAmortizacion.Rows(Index).Cells("Saldos").Value
+            Correlativo = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Index).Cells("Correlativo").Value)
+            Porcentaje = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Porcentaje").Value)
+            Fecha2 = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(Index).Cells("Fecha").Value)
+            Dias = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Index).Cells("Dias").Value)
+            Cuota = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Cuotas").Value)
+            AmortCap2 = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value)
+            Interes2 = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Interés").Value)
+            Saldo2 = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Saldos").Value)
             Vigente = dgvAmortizacion.Rows(Index).Cells("Vigente").Value
 
             If Vigente = "True" Then
@@ -343,9 +345,7 @@ Public Class frmResultadoTitularizacion
         TitularizacionConsulta.NuevaTIT(coleccion, Codigo)
     End Sub
 
-    Sub NuevoAmortCap()
 
-    End Sub
 
 
 
@@ -459,7 +459,7 @@ Public Class frmResultadoTitularizacion
     End Sub
 
     Sub EliminarAmort()
-        Dim Correlativo = dgvAmortizacion.CurrentRow.Cells("Correlativo").Value
+        Dim Correlativo = Operaciones.ConvertirEntero(dgvAmortizacion.CurrentRow.Cells("Correlativo").Value)
         TitularizacionConsulta.EliminarAmort(Codigo, Correlativo)
     End Sub
 
@@ -467,13 +467,10 @@ Public Class frmResultadoTitularizacion
         Dim coleccion As Collection = TitularizacionConsulta.CargarTIT(Codigo)
 
         If (Not coleccion.Count = 0) Then
-
-
-
-            dtpFechaEmision.Value = coleccion(1)
-            txtTasaEmision.Text = CDec(coleccion(2)) * 100
-            txtMontoCompraEmision.Text = coleccion(3)
-            txtMontoCompraPrimario.Text = coleccion(4)
+            dtpFechaEmision.Value = Operaciones.ConvertirFecha(coleccion(1).ToString)
+            txtTasaEmision.Text = Operaciones.ConvertirDecimal(coleccion(2).ToString) * 100
+            txtMontoCompraEmision.Text = Operaciones.ConvertirDecimal(coleccion(3).ToString)
+            txtMontoCompraPrimario.Text = Operaciones.ConvertirDecimal(coleccion(4).ToString)
         End If
     End Sub
 
@@ -494,10 +491,21 @@ Public Class frmResultadoTitularizacion
     Sub CargarAmort()
         Dim dr = TitularizacionConsulta.CargarAmort(Codigo)
         Dim Iterador As Integer = 0
+        Dim Correlativo As Integer = 0
+        Dim Porcentaje As Double = 0
+        Dim Dias As Integer = 0
+        Dim Cuota As Double = 0
+        Dim AmortizacionCapital As Double = 0
+        Dim   Interes As Integer = 0
+        Dim Saldos As Double = 0
 
-        Dim ConvertirString As String
+
+
+
+
+        Dim FechaFormatoCadena As String
         While dr.Read
-            ConvertirString = Format(dr("Fecha"), "dd/MM/yyyy")
+            FechaFormatoCadena = Format(dr("Fecha"), "dd/MM/yyyy")
             Dim Vigente As String = dr("Vigente").ToString
 
             If String.IsNullOrEmpty(Vigente) Then
@@ -509,17 +517,23 @@ Public Class frmResultadoTitularizacion
                 Vigente = "False"
             End If
 
+            Correlativo = Operaciones.ConvertirEntero(dr("Correlativo").ToString)
+            Porcentaje = Operaciones.ConvertirDecimal(dr("Porcentaje").ToString)
+            Dias = Operaciones.ConvertirEntero(dr("Dias").ToString)
+            Cuota = Operaciones.ConvertirDecimal(dr("Cuota").ToString)
+            AmortizacionCapital = Operaciones.ConvertirDecimal(dr("AmortCap").ToString)
+            Interes = Operaciones.ConvertirDecimal(dr("Interes").ToString)
+            Saldos = Operaciones.ConvertirDecimal(dr("Saldos").ToString)
 
 
-
-            dgvAmortizacion.Rows.Add(dr("Correlativo"), dr("Porcentaje"), ConvertirString, dr("Dias"), dr("Cuota"), dr("AmortCap"), dr("Interes"), dr("Saldos"), Vigente)
+            dgvAmortizacion.Rows.Add(Correlativo, Porcentaje,
+            FechaFormatoCadena, Dias, Cuota, AmortizacionCapital,
+            Interes, Saldos, Vigente)
         End While
     End Sub
 
     Private Sub btnAmortCap_Click(sender As Object, e As EventArgs)
-        If (Estado = "N") Then
-            NuevoAmortCap()
-        ElseIf (Estado = "M") Then
+        If (Estado = "M") Then
             ModificarAmortCap()
         ElseIf (Estado = "B") Then
             EliminarAmortCap()
@@ -572,14 +586,18 @@ Public Class frmResultadoTitularizacion
             Dim FechaIni As Date = Date.Today.Date
             Dim Fecha = Format(FechaIni, "dd/MM/yyyy")
             Dim IndexAnterior As Integer = Index - 1
+
+
             If Index = 0 Then
                 FechaIni = MesFijo
             Else
-                FechaIni = dgvAmortizacion.Rows(IndexAnterior).Cells("Fecha").Value
+                FechaIni = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(IndexAnterior).Cells("Fecha").Value)
             End If
+
+
             Fecha = Operaciones.Meses(TipoPeriodicidad, FechaIni, MesFijo)
             If (String.IsNullOrEmpty(dgvAmortizacion.Rows(Index).Cells("Fecha").Value)) Then
-                dgvAmortizacion.Rows(Index).Cells("Fecha").Value = Format(CDate(Fecha), "dd/MM/yyyy")
+                dgvAmortizacion.Rows(Index).Cells("Fecha").Value = Format(Operaciones.ConvertirFecha(Fecha.ToString), "dd/MM/yyyy")
             End If
 
 
@@ -631,22 +649,12 @@ Public Class frmResultadoTitularizacion
     Sub CalculosAmort()
         Dim Cantidad = 0, Dias = 0, Fecha = Date.Now.Date, FechaEmis = Date.Now.Date, Cuota = 0.0, Amort = 0.0, Interes = 0.0, Saldo = 0.0, AmortPriTabla = 0.0, SaldoAnterior = 0.0, Posicion, PosicionAnterior, PosicionSiguiente
         Posicion = dgvAmortizacion.Rows.Count - 1
-
-
-
         FechaEmis = dtpFechaEmision.Value
         For index As Integer = 0 To Posicion
 
-
-
-
             PosicionAnterior = index - 1
             PosicionSiguiente = index + 1
-
-
-
-
-            Fecha = dgvAmortizacion.Rows(index).Cells("Fecha").Value
+            Fecha = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(index).Cells("Fecha").Value)
 
             SaldoAnterior = CalculosSaldoAnterior(PosicionAnterior)
             Dias = CalculosDias(index, FechaEmis, Fecha, PosicionAnterior)
@@ -675,7 +683,7 @@ Public Class frmResultadoTitularizacion
     Function CalcularSaldos2(ByVal Posicion As Integer, ByVal SaldoAnterior As Double, ByVal Amort As Double)
         Dim Saldo As Double = 0
         If (Posicion = 0) Then
-            Saldo = (CDec(txtMontoCompraEmision.Text)) - Amort
+            Saldo = Operaciones.ConvertirDecimal(txtMontoCompraEmision.Text.ToString) - Amort
         ElseIf (Posicion > 0) Then
             Saldo = SaldoAnterior - Amort
         Else
@@ -693,13 +701,13 @@ Public Class frmResultadoTitularizacion
 
 
         If (Posicion = 0) Then
-            Saldo = CDec(txtMontoCompraEmision.Text)
+            Saldo = Operaciones.ConvertirDecimal(txtMontoCompraEmision.Text.ToString)
         ElseIf (Posicion > 0) Then
-            Saldo = (CDec(SaldoAnterior))
+            Saldo = SaldoAnterior
         Else
             Saldo = 0
         End If
-        Tasa = CDec(txtTasaEmision.Text.ToString.Trim("%"))
+        Tasa = Operaciones.ConvertirDecimal(txtTasaEmision.Text.ToString)
         Dim Valor As Double = 0
 
         If (IndexBase = 0) Then
@@ -775,10 +783,8 @@ Public Class frmResultadoTitularizacion
 
     Function CalculosAmort2(ByVal Index As Integer, ByVal Cantidad As Integer, ByVal AmortPriTabla As Double)
         Dim Amort As Double = 0
-
-        AmortPriTabla = dgvAmortizacion.Rows(Index).Cells("Porcentaje").Value
-        Amort = AmortPriTabla * CDec(txtMontoCompraPrimario.Text)
-
+        AmortPriTabla = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Index).Cells("Porcentaje").Value)
+        Amort = AmortPriTabla * Operaciones.ConvertirDecimal(txtMontoCompraPrimario.Text.ToString)
         Return Amort
     End Function
 
@@ -803,7 +809,7 @@ Public Class frmResultadoTitularizacion
     Function CalculosSaldoAnterior(ByVal PosicionAnterior As Integer)
         Dim SaldoAnterior As Double = 0
         If (PosicionAnterior >= 0) Then
-            SaldoAnterior = dgvAmortizacion.Rows(PosicionAnterior).Cells("Saldos").Value
+            SaldoAnterior = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(PosicionAnterior).Cells("Saldos").Value)
         End If
         Return SaldoAnterior
     End Function
@@ -1329,40 +1335,32 @@ Public Class frmResultadoTitularizacion
         Dim ExisteFecha As Boolean = False
         Dim Diccionario As New Dictionary(Of String, String)
         While Index <= Cantidad
-            Dim Fecha As Date = dgvAmortizacion.Rows(Index).Cells("Fecha").Value
-            Dim Correlativo = dgvAmortizacion.Rows(Index).Cells("Correlativo").Value
-            Dim CantidadDias = dgvAmortizacion.Rows(Index).Cells("Dias").Value
-
+            Dim Fecha As Date = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(Index).Cells("Fecha").Value)
+            Dim Correlativo As Integer = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Index).Cells("Correlativo").Value)
+            Dim CantidadDias As Integer = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Index).Cells("Dias").Value)
             Dim InicioBucle As Integer = 0
 
 
-            If IsNumeric(Correlativo) And IsNumeric(CantidadDias) Then
-
-                Dim FechaBucle As Date = Fecha
-                While InicioBucle < CantidadDias
-
-                    Dim FechaRedencionBuscar_Limpia As String = Format(FechaRedencionBuscar, "yyyy/MM/dd")
+            Dim FechaBucle As Date = Fecha
+            While InicioBucle < CantidadDias
+                Dim FechaRedencionBuscar_Limpia As String = Format(FechaRedencionBuscar, "yyyy/MM/dd")
                     Dim FechaBucle_Limpia As String = Format(FechaBucle, "yyyy/MM/dd")
 
-                    If FechaRedencionBuscar_Limpia = FechaBucle_Limpia Then
-                        Posicion = Correlativo - 1
-                        ExisteFecha = True
-                        CantidadDiasFinal = InicioBucle
-                        Exit While
-                    Else
-                        FechaBucle = FechaBucle.AddDays(-1)
-                    End If
-
-
-
-
-                    InicioBucle += 1
+                If FechaRedencionBuscar_Limpia = FechaBucle_Limpia Then
+                    Posicion = Correlativo - 1
+                    ExisteFecha = True
+                    CantidadDiasFinal = InicioBucle
+                    Exit While
+                Else
+                    FechaBucle = FechaBucle.AddDays(-1)
+                End If
+                InicioBucle += 1
                 End While
 
 
 
 
-            End If
+
 
             Index += 1
         End While
@@ -1401,10 +1399,9 @@ Public Class frmResultadoTitularizacion
             Dim SegundaMitad As String = PosicionActual.ToString + ".2"
             Dim PosicionPrimera As Integer = Posicion
             Dim PosicionSegunda = Posicion + 1
-            Dim FechaPosicionAnterior As Date = dgvAmortizacion.Rows(Posicion).Cells("Fecha").Value
-            Dim DiasPosicionAnterior As Integer = dgvAmortizacion.Rows(Posicion).Cells("Dias").Value
-            Dim Porcentaje As Double = dgvAmortizacion.Rows(Posicion).Cells("Porcentaje").Value
-
+            Dim FechaPosicionAnterior As Date = Operaciones.ConvertirFecha(dgvAmortizacion.Rows(Posicion).Cells("Fecha").Value)
+            Dim DiasPosicionAnterior As Integer = Operaciones.ConvertirEntero(dgvAmortizacion.Rows(Posicion).Cells("Dias").Value)
+            Dim Porcentaje As Double = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(Posicion).Cells("Porcentaje").Value)
             Dim PrimeraFecha As Date = FechaPosicionAnterior.AddDays((DiasAtras) * -1)
             Dim SegundaFecha As Date = FechaPosicionAnterior
 
@@ -1450,7 +1447,7 @@ Public Class frmResultadoTitularizacion
         Dim Cantidad As Integer = dgvAmortizacion.Rows.Count - 1
 
         While Index <= Cantidad
-            Dim Vigente As String = dgvAmortizacion.Rows(Index).Cells("Vigente").Value
+            Dim Vigente As String = Operaciones.ConvertirCadena(dgvAmortizacion.Rows(Index).Cells("Vigente").Value)
 
             If Vigente = "False" Then
                 dgvAmortizacion.Rows(Index).DefaultCellStyle.BackColor = Color.LightGray
@@ -1470,7 +1467,7 @@ Public Class frmResultadoTitularizacion
         Dim SegundosDias As Integer = DiasCortos
         Dim DiasTotalesNegativos As Integer = DiasTotales * -1
         Dim FechaFin As Date = Date.Today.Date
-        
+
         If TipoDias = "iniciales" Then
             FechaCalculo = Fecha.AddDays(DiasTotalesNegativos)
             Fecha = FechaCalculo
@@ -1486,76 +1483,35 @@ Public Class frmResultadoTitularizacion
             PosicionSiguiente = Index + 1
             Fecha = FechaCalculo
             SaldoAnterior = CalculosSaldoAnterior(PosicionAnterior)
-
-            If IsNumeric(dgvAmortizacion.Rows(PosicionAnterior).Cells("Saldos").Value) Then
-                Amort = dgvAmortizacion.Rows(PosicionAnterior).Cells("Saldos").Value
-            End If
-
-
-
+            Amort = Operaciones.ConvertirDecimal(dgvAmortizacion.Rows(PosicionAnterior).Cells("Saldos").Value)
             Interes = CalculosInteres2(Index, SaldoAnterior, Dias, FechaEmis, FechaFin, IndexBase)
-                Saldo = CalcularSaldos2(Index, SaldoAnterior, Amort)
-
-                Cuota = Amort + Interes
-
-
-                dgvAmortizacion.Rows(Index).Cells("Cuotas").Value = Cuota
-                dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value = Amort
-                dgvAmortizacion.Rows(Index).Cells("Interés").Value = Interes
-                dgvAmortizacion.Rows(Index).Cells("Saldos").Value = Saldo
-            Else
-                FechaCalculo = Fecha.AddDays((SegundosDias * -1))
+            Saldo = CalcularSaldos2(Index, SaldoAnterior, Amort)
+            Cuota = Amort + Interes
+            dgvAmortizacion.Rows(Index).Cells("Cuotas").Value = Cuota
+            dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value = Amort
+            dgvAmortizacion.Rows(Index).Cells("Interés").Value = Interes
+            dgvAmortizacion.Rows(Index).Cells("Saldos").Value = Saldo
+        Else
+            FechaCalculo = Fecha.AddDays((SegundosDias * -1))
 
 
             FechaEmis = FechaCalculo
             FechaFin = Fecha
-
             Dias = DiasCortos
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
             PosicionAnterior = Index - 2
-
             Fecha = FechaCalculo
             SaldoAnterior = CalculosSaldoAnterior(PosicionAnterior)
-
-
             Amort = CalculosAmort2(Index, Posicion, AmortPriTabla)
-
-
-
-
             Interes = CalculosInteres2(Index, SaldoAnterior, Dias, FechaEmis, FechaFin, IndexBase)
             Saldo = CalcularSaldos2(Index, SaldoAnterior, Amort)
-
             Cuota = Amort + Interes
 
 
-                dgvAmortizacion.Rows(Index).Cells("Cuotas").Value = Cuota
-                dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value = Amort
-                dgvAmortizacion.Rows(Index).Cells("Interés").Value = Interes
-                dgvAmortizacion.Rows(Index).Cells("Saldos").Value = Saldo
-            End If
-
-
-
-
-
-
-
-
+            dgvAmortizacion.Rows(Index).Cells("Cuotas").Value = Cuota
+            dgvAmortizacion.Rows(Index).Cells("Amortizacion de Capital").Value = Amort
+            dgvAmortizacion.Rows(Index).Cells("Interés").Value = Interes
+            dgvAmortizacion.Rows(Index).Cells("Saldos").Value = Saldo
+        End If
     End Sub
 
     Sub Redencion()

+ 24 - 2
Inversiones.vbproj

@@ -15,7 +15,7 @@
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <TargetFrameworkProfile />
     <IsWebBootstrapper>false</IsWebBootstrapper>
-    <PublishUrl>C:\Users\ahernandez\Desktop\</PublishUrl>
+    <PublishUrl>C:\Users\ahernandez\Desktop\Versiones\</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Disk</InstallFrom>
     <UpdateEnabled>false</UpdateEnabled>
@@ -25,9 +25,10 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>false</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>37</ApplicationRevision>
+    <ApplicationRevision>1</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
+    <CreateDesktopShortcut>true</CreateDesktopShortcut>
     <PublishWizardCompleted>true</PublishWizardCompleted>
     <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
@@ -104,6 +105,12 @@
     <SignManifests>true</SignManifests>
   </PropertyGroup>
   <PropertyGroup />
+  <PropertyGroup>
+    <ApplicationIcon>inverlec.ico</ApplicationIcon>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>My Project\app.manifest</ApplicationManifest>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="adodb, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
       <EmbedInteropTypes>True</EmbedInteropTypes>
@@ -275,6 +282,7 @@
       <SubType>Component</SubType>
     </Compile>
     <Compile Include="Aplicacion.vb" />
+    <Compile Include="ApplicationEvents.vb" />
     <Compile Include="Class1.vb" />
     <Compile Include="Configuraciones.vb" />
     <Compile Include="DAO\AccionesDAO.vb" />
@@ -979,6 +987,9 @@
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
+    <None Include="My Project\app.manifest">
+      <SubType>Designer</SubType>
+    </None>
     <None Include="RPT\PrintPropuestaDeInversion.rpt" />
     <None Include="RPT\PrintPropuestaDeVenta.rpt" />
     <None Include="RPT\rptRequisicionDePago.rpt" />
@@ -1158,6 +1169,7 @@
     <Content Include="Img\img4.png" />
     <Content Include="Img\img5.png" />
     <Content Include="Img\img6.png" />
+    <Content Include="inverlec.ico" />
     <Content Include="SAPbobsCOM.dll" />
     <Content Include="SAPbouiCOM.dll" />
     <None Include="Resources\fondo1.jpg" />
@@ -1382,6 +1394,16 @@
       <IncludeHash>True</IncludeHash>
       <FileType>File</FileType>
     </PublishFile>
+    <PublishFile Include="inverlec.ico">
+      <Visible>False</Visible>
+      <Group>
+      </Group>
+      <TargetPath>
+      </TargetPath>
+      <PublishState>Include</PublishState>
+      <IncludeHash>True</IncludeHash>
+      <FileType>File</FileType>
+    </PublishFile>
     <PublishFile Include="log4net">
       <Visible>False</Visible>
       <Group>

+ 76 - 0
My Project/app.manifest

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <!-- Opciones del manifiesto UAC
+             Si quiere cambiar el nivel del Control de cuentas de usuario de Windows reemplace el 
+             nodo requestedExecutionLevel por uno de los siguientes.
+
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
+
+            Especificar el elemento requestedExecutionLevel deshabilitará la virtualización de archivos y registros. 
+            Quite este elemento si la aplicación necesita esta virtualización para la compatibilidad
+            con versiones anteriores.
+        -->
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- Una lista de las versiones de Windows en la que se ha probado esta aplicación y
+           con la que se ha diseñado para que trabaje. Quite la marca de comentario de los elementos adecuados y Windows seleccionará 
+           automáticamente el entorno más compatible. -->
+
+      <!-- Windows Vista -->
+      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+
+      <!-- Windows 7 -->
+      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+
+      <!-- Windows 8 -->
+      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+
+      <!-- Windows 8.1 -->
+      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+
+      <!-- Windows 10 -->
+      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+
+    </application>
+  </compatibility>
+
+  <!-- Indica que la aplicación tiene reconocimiento de PPP y Windows no la escalará de forma automática a
+       PPP superiores. Las aplicaciones de Windows Presentation Foundation (WPF) tienen reconocimiento de PPP automático y no necesitan 
+       participar. Las aplicaciones de Windows Forms que apuntan a .NET Framework 4.6 que participan en esta configuración, también 
+       deben establecer la configuración 'EnableWindowsFormsHighDpiAutoResizing' en 'true' en app.config. -->
+  <!--
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+    </windowsSettings>
+  </application>
+  -->
+
+  <!-- Habilitar los temas para los controles y cuadros de diálogo comunes de Windows (Windows XP y versiones posteriores) -->
+  <!--
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity
+          type="win32"
+          name="Microsoft.Windows.Common-Controls"
+          version="6.0.0.0"
+          processorArchitecture="*"
+          publicKeyToken="6595b64144ccf1df"
+          language="*"
+        />
+    </dependentAssembly>
+  </dependency>
+  -->
+
+</assembly>

TEMPAT SAMPAH
Resources/inverlec.ico


+ 6 - 2
frmINV.vb

@@ -548,7 +548,7 @@
         End If
 
         oInversionCE = oInversionDAO.CargarRegistro(Id)
-
+        Dim a = vBindingSource.Find("DocId", Id)
         vBindingSource.Position = vBindingSource.Find("DocId", Id)
         ConDatos = 0
         RefrescarValoresDeControles()
@@ -558,6 +558,7 @@
 
         Me.btnAccion.Text = "Aceptar"
 
+
     End Sub
 
     Sub ColoresBloqueados()
@@ -3596,7 +3597,10 @@
         Dim retorno As Integer = 0
         retorno = oInversionDAO.Modificar(oInversionCE)
         If retorno = 1 Then
-            CargarRegistro(oInversionCE.IdDeDocumento)
+            If Not Estado = "P" Then
+                CargarRegistro(oInversionCE.IdDeDocumento)
+            End If
+
             MsgBox(Mensaje)
         End If
 

+ 2 - 3
frmReqPago.vb

@@ -142,16 +142,15 @@ Public Class frmReqPago
         If Not ValidarDatos() Then
             Dim res As Integer
             oRequisicionDePagoCE_Refrescar()
+            Dim Id As Integer = frmINV.vBindingSource.Current("DocId")
             res = RequisicionDePagoDAO.GuardarNuevaRequisicion(oRequisicionDePagoCE, Transaccion)
 
             If res = 1 Then
                 frmINV.EnviadoContaduria = False
-                Dim Id As Integer = frmINV.vBindingSource.Current("DocId")
+                CargarRegistro()
                 frmINV.CargarRegistro(Id)
                 frmINV.EstadoBoton()
 
-                CargarRegistro()
-
             End If
 
 

TEMPAT SAMPAH
inverlec.ico


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini