Browse Source

Version 1.0

ahernandez 6 năm trước cách đây
commit
dd355c2f90
100 tập tin đã thay đổi với 47756 bổ sung0 xóa
  1. 63 0
      .gitattributes
  2. 261 0
      .gitignore
  3. BIN
      AccionesRPT - copia.rpt
  4. BIN
      AccionesRPT.rpt
  5. 159 0
      AccionesRPT.vb
  6. 16 0
      Aplicacion.vb
  7. 71 0
      App.config
  8. 63 0
      Appp.config
  9. 3 0
      Class1.vb
  10. 24 0
      Conexion.vb
  11. 15 0
      Config.vb
  12. 38 0
      Configuraciones.vb
  13. 1652 0
      DAO/AccionesDAO.vb
  14. 102 0
      DAO/BancosDAO.vb
  15. 1200 0
      DAO/BonosDAO.vb
  16. 27 0
      DAO/CambiarEstArbDAO.vb
  17. 275 0
      DAO/CargarElementosDAO.vb
  18. 1305 0
      DAO/CertificadosDeInversionDAO.vb
  19. 76 0
      DAO/ColaDAO.vb
  20. 2690 0
      DAO/DAOGeneral.vb
  21. 968 0
      DAO/DAONotaEstructurada.vb
  22. 1794 0
      DAO/DAOPropuestaInversion.vb
  23. 968 0
      DAO/DepositosAPlazoDAO.vb
  24. 43 0
      DAO/EmpresasDAO.vb
  25. 61 0
      DAO/FechasDAO.vb
  26. 30 0
      DAO/FlujoArbitrajeDAO.vb
  27. 671 0
      DAO/FondoInversionDAO.vb
  28. 696 0
      DAO/FuturosDAO.vb
  29. 386 0
      DAO/IngresosDAO.vb
  30. 2257 0
      DAO/InversionDAO.vb
  31. 1001 0
      DAO/LETESDAO.vb
  32. 329 0
      DAO/PoolTitulosDAO.vb
  33. 684 0
      DAO/PrestamoEmpresarialDAO.vb
  34. 929 0
      DAO/PrestamoPersonalDAO.vb
  35. 239 0
      DAO/RegistrosDAO.vb
  36. 1162 0
      DAO/ReportosDAO.vb
  37. 195 0
      DAO/RequisicionDePagoDAO.vb
  38. 359 0
      DAO/SeleccionTitulosReportosDAO.vb
  39. 232 0
      DAO/SeriesDAO.vb
  40. 844 0
      DAO/TitularizacionDAO.vb
  41. 205 0
      DAO/frmRendimientos.vb
  42. 827 0
      ENTI/AccionesCE.vb
  43. 21 0
      ENTI/AccionesInternacionalesCE.vb
  44. 20 0
      ENTI/AccionesNacionalesComunesCE.vb
  45. 20 0
      ENTI/AccionesNacionalesPreferentesCE.vb
  46. 1168 0
      ENTI/BonosCE.vb
  47. 378 0
      ENTI/CEPropuestaInversion.vb
  48. 34 0
      ENTI/CambiarEstArbCE.vb
  49. 27 0
      ENTI/CertificadoDeInversionCE.vb
  50. 15 0
      ENTI/Controldores.vb
  51. 344 0
      ENTI/DepositosAPlazoCE.vb
  52. 3 0
      ENTI/FondoInversionCE.vb
  53. 323 0
      ENTI/FondosDeInversionCE.vb
  54. 331 0
      ENTI/FormulasBonoCE.vb
  55. 184 0
      ENTI/FuturosCE.vb
  56. 180 0
      ENTI/IngresoDetalleCE.vb
  57. 3 0
      ENTI/Interface1.vb
  58. 375 0
      ENTI/InversionesCE.vb
  59. 161 0
      ENTI/LETESCE.vb
  60. 344 0
      ENTI/NotaEstructuradaCE.vb
  61. 1449 0
      ENTI/Operaciones.vb
  62. 14 0
      ENTI/PrestamoEmpresarialCE.vb
  63. 40 0
      ENTI/PrestamoPersonalCE.vb
  64. 185 0
      ENTI/RegistroIngresoCE.vb
  65. 778 0
      ENTI/ReportosCE.vb
  66. 131 0
      ENTI/RequisicionDePagoCE.vb
  67. 42 0
      ENTI/SeriesCE.vb
  68. 421 0
      ENTI/TrasladarDatosCMVTA.vb
  69. 80 0
      ENTI/zAccionesDetalleCE.vb
  70. 4 0
      FRM/InstrumentosFinancieros.vb
  71. 37 0
      FRM/JSON.Designer.vb
  72. 120 0
      FRM/JSON.resx
  73. 29 0
      FRM/JSON.vb
  74. 0 0
      FRM/Model1.Context.cs
  75. 575 0
      FRM/Model1.Context.tt
  76. 981 0
      FRM/SplashScreen1.resx
  77. 1163 0
      FRM/frmAcciones.Designer.vb
  78. 172 0
      FRM/frmAcciones.resx
  79. 3486 0
      FRM/frmAcciones.vb
  80. 52 0
      FRM/frmActualizar.Designer.vb
  81. 120 0
      FRM/frmActualizar.resx
  82. 13 0
      FRM/frmActualizar.vb
  83. 160 0
      FRM/frmAsociarAcciones.Designer.vb
  84. 138 0
      FRM/frmAsociarAcciones.resx
  85. 17 0
      FRM/frmAsociarAcciones.vb
  86. 1380 0
      FRM/frmBonos.Designer.vb
  87. 167 0
      FRM/frmBonos.resx
  88. 1088 0
      FRM/frmBonos.vb
  89. 317 0
      FRM/frmBuscarReporteVenta.Designer.vb
  90. 120 0
      FRM/frmBuscarReporteVenta.resx
  91. 172 0
      FRM/frmBuscarReporteVenta.vb
  92. 1549 0
      FRM/frmCertificadosDeInversion.Designer.vb
  93. 181 0
      FRM/frmCertificadosDeInversion.resx
  94. 4376 0
      FRM/frmCertificadosDeInversion.vb
  95. 582 0
      FRM/frmColaTitulos.Designer.vb
  96. 120 0
      FRM/frmColaTitulos.resx
  97. 443 0
      FRM/frmColaTitulos.vb
  98. 55 0
      FRM/frmCostosReportos.Designer.vb
  99. 120 0
      FRM/frmCostosReportos.resx
  100. 28 0
      FRM/frmCostosReportos.vb

+ 63 - 0
.gitattributes

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

+ 261 - 0
.gitignore

@@ -0,0 +1,261 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.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
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# 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
+# TODO: 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
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable 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
+
+# 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
+node_modules/
+orleans.codegen.cs
+
+# 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
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# 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/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc

BIN
AccionesRPT - copia.rpt


BIN
AccionesRPT.rpt


+ 159 - 0
AccionesRPT.vb

@@ -0,0 +1,159 @@
+'------------------------------------------------------------------------------
+' <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 Off
+Option Explicit On
+
+Imports CrystalDecisions.CrystalReports.Engine
+Imports CrystalDecisions.ReportSource
+Imports CrystalDecisions.Shared
+Imports System
+Imports System.ComponentModel
+
+
+Public Class AccionesRPT
+    Inherits ReportClass
+    
+    Public Sub New()
+        MyBase.New
+    End Sub
+    
+    Public Overrides Property ResourceName() As String
+        Get
+            Return "AccionesRPT.rpt"
+        End Get
+        Set
+            'Do nothing
+        End Set
+    End Property
+    
+    Public Overrides Property NewGenerator() As Boolean
+        Get
+            Return true
+        End Get
+        Set
+            'Do nothing
+        End Set
+    End Property
+    
+    Public Overrides Property FullResourceName() As String
+        Get
+            Return "Inversiones.AccionesRPT.rpt"
+        End Get
+        Set
+            'Do nothing
+        End Set
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public ReadOnly Property Section1() As CrystalDecisions.CrystalReports.Engine.Section
+        Get
+            Return Me.ReportDefinition.Sections(0)
+        End Get
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public ReadOnly Property Section2() As CrystalDecisions.CrystalReports.Engine.Section
+        Get
+            Return Me.ReportDefinition.Sections(1)
+        End Get
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public ReadOnly Property Section3() As CrystalDecisions.CrystalReports.Engine.Section
+        Get
+            Return Me.ReportDefinition.Sections(2)
+        End Get
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public ReadOnly Property Section4() As CrystalDecisions.CrystalReports.Engine.Section
+        Get
+            Return Me.ReportDefinition.Sections(3)
+        End Get
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public ReadOnly Property Section5() As CrystalDecisions.CrystalReports.Engine.Section
+        Get
+            Return Me.ReportDefinition.Sections(4)
+        End Get
+    End Property
+End Class
+
+<System.Drawing.ToolboxBitmapAttribute(GetType(CrystalDecisions.[Shared].ExportOptions), "report.bmp")>  _
+Public Class CachedAccionesRPT
+    Inherits Component
+    Implements ICachedReport
+    
+    Public Sub New()
+        MyBase.New
+    End Sub
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public Overridable Property IsCacheable() As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.IsCacheable
+        Get
+            Return true
+        End Get
+        Set
+            '
+        End Set
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public Overridable Property ShareDBLogonInfo() As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.ShareDBLogonInfo
+        Get
+            Return false
+        End Get
+        Set
+            '
+        End Set
+    End Property
+    
+    <Browsable(false),  _
+     DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>  _
+    Public Overridable Property CacheTimeOut() As System.TimeSpan Implements CrystalDecisions.ReportSource.ICachedReport.CacheTimeOut
+        Get
+            Return CachedReportConstants.DEFAULT_TIMEOUT
+        End Get
+        Set
+            '
+        End Set
+    End Property
+    
+    Public Overridable Function CreateReport() As CrystalDecisions.CrystalReports.Engine.ReportDocument Implements CrystalDecisions.ReportSource.ICachedReport.CreateReport
+        Dim rpt As AccionesRPT = New AccionesRPT()
+        rpt.Site = Me.Site
+        Return rpt
+    End Function
+    
+    Public Overridable Function GetCustomizedCacheKey(ByVal request As RequestContext) As String Implements CrystalDecisions.ReportSource.ICachedReport.GetCustomizedCacheKey
+        Dim key As [String] = Nothing
+        '// The following is the code used to generate the default
+        '// cache key for caching report jobs in the ASP.NET Cache.
+        '// Feel free to modify this code to suit your needs.
+        '// Returning key == null causes the default cache key to
+        '// be generated.
+        '
+        'key = RequestContext.BuildCompleteCacheKey(
+        '    request,
+        '    null,       // sReportFilename
+        '    this.GetType(),
+        '    this.ShareDBLogonInfo );
+        Return key
+    End Function
+End Class

+ 16 - 0
Aplicacion.vb

@@ -0,0 +1,16 @@
+Module Aplicacion
+    'Sub FormularioHijo(frmHijo As Form)
+
+    '    If frmInicio.pnlCuerpo.Controls.Count > 0 Then
+    '        frmInicio.pnlCuerpo.Controls.RemoveAt(0)
+    '    End If
+    '    frmHijo.TopLevel = False
+    '    'frmHijo.FormBorderStyle = FormBorderStyle.None
+    '    frmHijo.Dock = DockStyle.Fill
+    '    frmInicio.pnlCuerpo.Controls.Add(frmHijo)
+    '    frmInicio.pnlCuerpo.Tag = frmHijo
+    '    frmHijo.FormBorderStyle = FormBorderStyle.None
+    '    frmHijo.BackColor = System.Drawing.Color.WhiteSmoke
+    '    frmHijo.Show()
+    'End Sub
+End Module

+ 71 - 0
App.config

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <configSections>
+        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+            <section name="Inversiones.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <connectionStrings>
+        <add name="Inversiones.My.MySettings.InversionesConnectionString"
+            connectionString="Data Source=INVSVSAP;Initial Catalog=InversionesDEV;Persist Security Info=True;User ID=ahernandez;Password=1234;Connect Timeout=30;ApplicationIntent=ReadOnly"
+            providerName="System.Data.SqlClient" />
+        <add name="Inversiones.My.MySettings.SAP_INVERLEC_ESConnectionString"
+            connectionString="Data Source=MESVSAP;Initial Catalog=SAP_INVERLEC_ES;User ID=ahernandez;Password=1234"
+            providerName="System.Data.SqlClient" />
+        <add name="cnInversiones" connectionString="Data Source=INVSVSAP;Initial Catalog=InversionesDEV;Persist Security Info=True;User ID=ahernandez;Password=1234;Connect Timeout=30;ApplicationIntent=ReadOnly"
+            providerName="System.Data.SqlClient" />
+        <add name="Inversiones.My.MySettings.cnInversiones" connectionString="Data Source=INVSVSAP;Initial Catalog=InversionesDEV;Persist Security Info=True;User ID=ahernandez;Password=1234"
+            providerName="System.Data.SqlClient" />
+    </connectionStrings>
+    <startup>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+    <applicationSettings>
+        <Inversiones.My.MySettings>
+            <setting name="RutaReportes" serializeAs="String">
+                <value>C:\Users\ahernandez\Desktop\Inv\RPT\</value>
+            </setting>
+            <setting name="VERS_SQL" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="SERVER_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="IP_SERVER_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="USUARIO_DB_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="CLAVE_DB_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="UsuarioSAP" serializeAs="String">
+                <value>manager</value>
+            </setting>
+            <setting name="ClaveSAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="ClaveSQL" serializeAs="String">
+                <value>1234</value>
+            </setting>
+            <setting name="UsuarioSQL" serializeAs="String">
+                <value>inversiones</value>
+            </setting>
+            <setting name="ServidorSQL" serializeAs="String">
+                <value>INVSVSAP</value>
+            </setting>
+            <setting name="BaseDeDatos" serializeAs="String">
+                <value>InversionesDEV</value>
+            </setting>
+        </Inversiones.My.MySettings>
+    </applicationSettings>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>

+ 63 - 0
Appp.config

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <configSections>
+        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+            <section name="Inversiones.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <connectionStrings>
+        <add name="Inversiones.My.MySettings.InversionesConnectionString"
+            connectionString="Data Source=MESVSAP;Initial Catalog=Inversiones_20190711;Persist Security Info=True;User ID=sinversiones;Password=1234;Connect Timeout=30;ApplicationIntent=ReadOnly"
+            providerName="System.Data.SqlClient" />
+        <add name="Inversiones.My.MySettings.SAP_INVERLEC_ESConnectionString"
+            connectionString="Data Source=MESVSAP;Initial Catalog=SAP_INVERLEC_ES;User ID=sinversiones;Password=1234"
+            providerName="System.Data.SqlClient" />
+        <add name="cnInversiones" connectionString="Data Source=MESVSAP;Initial Catalog=InversionesDEV;Persist Security Info=True;User ID=sinversiones;Password=1234;Connect Timeout=30;ApplicationIntent=ReadOnly"
+            providerName="System.Data.SqlClient" />
+        <add name="Inversiones.My.MySettings.cnInversiones" connectionString="Data Source=INVSVSAP;Initial Catalog=Inversiones_20190711;Persist Security Info=True;User ID=inversiones;Password=1234"
+            providerName="System.Data.SqlClient" />
+    </connectionStrings>
+    <startup>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+    <applicationSettings>
+        <Inversiones.My.MySettings>
+            <setting name="RutaReportes" serializeAs="String">
+                <value>C:\dev\win\Inverlec\Inversiones\RPT\</value>
+            </setting>
+            <setting name="VERS_SQL" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="SERVER_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="IP_SERVER_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="USUARIO_DB_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="CLAVE_DB_SAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="UsuarioSAP" serializeAs="String">
+                <value>manager</value>
+            </setting>
+            <setting name="ClaveSAP" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="ClaveSQL" serializeAs="String">
+                <value>1234</value>
+            </setting>
+            <setting name="UsuarioSQL" serializeAs="String">
+                <value>inversiones</value>
+            </setting>
+            <setting name="ServidorSQL" serializeAs="String">
+                <value>INVSVSAP</value>
+            </setting>
+            <setting name="BaseDeDatos" serializeAs="String">
+                <value>Inversiones_20190711</value>
+            </setting>
+        </Inversiones.My.MySettings>
+    </applicationSettings>
+</configuration>

+ 3 - 0
Class1.vb

@@ -0,0 +1,3 @@
+Public Class Class1
+    Private hola As Integer
+End Class

+ 24 - 0
Conexion.vb

@@ -0,0 +1,24 @@
+Imports System.Data.SqlClient
+Imports System.Configuration
+
+Public Class Conexion
+
+
+    Public Function Conectar() As SqlConnection
+        Dim conexion As SqlConnection
+        Dim vSQLServer As String
+        Dim vUsuario As String
+        Dim vClaveSQL As String
+        Dim vBD As String
+
+        vSQLServer = My.Settings.ServidorSQL
+        vUsuario = My.Settings.UsuarioSQL
+        vClaveSQL = My.Settings.ClaveSQL
+        vBD = My.Settings.BaseDeDatos
+
+
+        'conexion = New SqlConnection(ConfigurationManager.ConnectionStrings("cnInversiones").ConnectionString)
+        Conexion = New SqlConnection("Data Source=" & vSQLServer & ";Initial Catalog=" & vBD & ";Persist Security Info=True;User ID=" & vUsuario & ";Password=" & vClaveSQL & ";Connect Timeout=30;ApplicationIntent=ReadOnly;MultipleActiveResultSets=true;")
+        Return Conexion
+    End Function
+End Class

+ 15 - 0
Config.vb

@@ -0,0 +1,15 @@
+Module Config
+    Private DecimalesPorcentaje As Integer = 6
+    Private _CodigoTXTPorcentaje As String
+
+    Public Property CodigoTXTPorcentaje As String
+        Get
+            Return "P" & DecimalesPorcentaje.ToString
+        End Get
+        Set(value As String)
+
+        End Set
+    End Property
+
+
+End Module

+ 38 - 0
Configuraciones.vb

@@ -0,0 +1,38 @@
+Module Configuraciones
+    Private DecimalesPorcentaje As Integer = 4
+    Private _CodigoTXTPorcentaje As String
+    Private DecimalesMontos As Integer = 4
+    Private _CodigoTXTMontos As String
+
+    Public Property CodigoTXTPorcentaje As String
+        Get
+            Return "P" & DecimalesPorcentaje.ToString
+        End Get
+        Set(value As String)
+
+        End Set
+    End Property
+    Public Property CodigoTXTMontos As String
+        Get
+            Return "N" & DecimalesMontos.ToString
+        End Get
+        Set(value As String)
+
+        End Set
+    End Property
+
+    Public ReadOnly Property ColorFondoError() As Color
+        Get
+            Return Color.FromArgb(230, 95, 95)
+        End Get
+    End Property
+    Public ReadOnly Property ColorFondoPredefinido() As Color
+        Get
+            Return SystemColors.Control
+        End Get
+    End Property
+    Public Function ColorFondoBusqueda() As Color
+        Return Color.FromArgb(248, 247, 199)
+    End Function
+
+End Module

+ 1652 - 0
DAO/AccionesDAO.vb

@@ -0,0 +1,1652 @@
+Imports System.Data.SqlClient
+Public Class AccionesDAO
+    Private Operaciones As New Operaciones
+    Public Function ProcesoDatos(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection), ByVal Estado As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            If Estado = "Nuevo" Then
+
+
+                sql = "INSERT INTO [dbo].[ACC0]
+           ([CodInv]
+           ,[PrecioLimpioC]
+           ,[FOperC]
+           ,[FVenC]
+           ,[DiasTC]
+           ,[GCapTotC]
+           ,[GCapUnC]
+           ,[RetAnBrC]
+           ,[RetAnNetC]
+           ,[UnC]
+           ,[ValTransC]
+           ,[MontoNetoC]
+           ,[PrecSucioC]
+           ,[PrecioLimpioV]
+           ,[FOperV]
+           ,[FVenV]
+           ,[DiasTV]
+           ,[GCapTotV]
+           ,[GCapUnV]
+           ,[RetAnBrV]
+           ,[RetAnNetV]
+           ,[UnV]
+           ,[ValTransV]
+           ,[MontoNetoV]
+           ,[PrecSucioV]
+           ,[ComisionCompraCasa]
+           ,[ComisionCompraBolsa]
+           ,[ComisionVentaCasa]
+           ,[ComisionVentaBolsa]
+           ,[IOF]
+           ,[Renta]
+           ,[Tipo]
+           ,[ComisionCompraCasaValor]
+           ,[ComisionCompraBolsaValor]
+           ,[ComisionVentaCasaValor]
+           ,[ComisionVentaBolsaValor]
+
+)
+     VALUES
+           (@CodInv
+           ,@PrecioLimpioC
+           ,@FOperC
+           ,@FVenC
+           ,@DiasTC
+           ,@GCapTotC
+           ,@GCapUnC
+           ,@RetAnBrC
+           ,@RetAnNetC
+           ,@UnC
+           ,@ValTransC
+           ,@MontoNetoC
+           ,@PrecSucioC
+           ,@PrecioLimpioV
+           ,@FOperV
+           ,@FVenV
+           ,@DiasTV
+           ,@GCapTotV
+           ,@GCapUnV
+           ,@RetAnBrV
+           ,@RetAnNetV
+           ,@UnV
+           ,@ValTransV
+           ,@MontoNetoV
+           ,@PrecSucioV
+           ,@ComisionCompraCasa
+           ,@ComisionCompraBolsa
+           ,@ComisionVentaCasa
+           ,@ComisionVentaBolsa
+           ,@IOF
+           ,@Renta
+           ,@Tipo
+           ,@ComisionCompraCasaValor
+           ,@ComisionCompraBolsaValor
+           ,@ComisionVentaCasaValor
+           ,@ComisionVentaBolsaValor
+)"
+
+
+
+
+
+            Else
+                sql = "UPDATE [dbo].[ACC0] SET
+           [PrecioLimpioC]=@PrecioLimpioC
+           ,[FOperC]=@FOperC
+           ,[FVenC]=@FVenC
+           ,[DiasTC]=@DiasTC
+           ,[GCapTotC]=@GCapTotC
+           ,[GCapUnC]=@GCapUnC
+           ,[RetAnBrC]=@RetAnBrC
+           ,[RetAnNetC]=@RetAnNetC
+           ,[UnC]=@UnC
+           ,[ValTransC]=@ValTransC
+           ,[MontoNetoC]=@MontoNetoC
+           ,[PrecSucioC]=@PrecSucioC
+           ,[PrecioLimpioV]=@PrecioLimpioV
+           ,[FOperV]=@FOperV
+           ,[FVenV]=@FVenV
+           ,[DiasTV]=@DiasTV
+           ,[GCapTotV]=@GCapTotV
+           ,[GCapUnV]=@GCapUnV
+           ,[RetAnBrV]=@RetAnBrV
+           ,[RetAnNetV]=@RetAnNetV
+           ,[UnV]=@UnV
+           ,[ValTransV]=@ValTransV
+           ,[MontoNetoV]=@MontoNetoV
+           ,[PrecSucioV]=@PrecSucioV
+
+           ,[ComisionCompraCasa]=@ComisionCompraCasa
+           ,[ComisionCompraBolsa]=@ComisionCompraBolsa
+           ,[ComisionVentaCasa]=@ComisionVentaCasa
+           ,[ComisionVentaBolsa]=@ComisionVentaBolsa
+           ,[IOF]=@IOF
+           ,[Renta]=@Renta
+           ,[Tipo]=@Tipo
+
+
+           ,[ComisionCompraCasaValor]=@ComisionCompraCasaValor
+           ,[ComisionCompraBolsaValor]=@ComisionCompraBolsaValor
+           ,[ComisionVentaCasaValor]=@ComisionVentaCasaValor
+           ,[ComisionVentaBolsaValor]=@ComisionVentaBolsaValor
+            where [CodInv]=@CodInv
+            
+     "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@PrecioLimpioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(1).ToString)
+                .Add("@FOperC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(2).ToString)
+                .Add("@FVenC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(3).ToString)
+                .Add("@DiasTC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(4).ToString)
+                .Add("@GCapTotC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(5).ToString)
+                .Add("@GCapUnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(6).ToString)
+                .Add("@RetAnBrC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(7).ToString)
+                .Add("@RetAnNetC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(8).ToString)
+                .Add("@UnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(9).ToString)
+                .Add("@ValTransC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(10).ToString)
+                .Add("@MontoNetoC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(11).ToString)
+                .Add("@PrecSucioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(12).ToString)
+                .Add("@PrecioLimpioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(13).ToString)
+                .Add("@FOperV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(14).ToString)
+                .Add("@FVenV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(15).ToString)
+                .Add("@DiasTV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(16).ToString)
+                .Add("@GCapTotV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(17).ToString)
+                .Add("@GCapUnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(18).ToString)
+                .Add("@RetAnBrV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(19).ToString)
+                .Add("@RetAnNetV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(20).ToString)
+                .Add("@UnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(21).ToString)
+                .Add("@ValTransV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(22).ToString)
+                .Add("@MontoNetoV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(23).ToString)
+                .Add("@PrecSucioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(24).ToString)
+                .Add("@ComisionCompraCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(25).ToString)
+                .Add("@ComisionCompraBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(26).ToString)
+                .Add("@ComisionVentaCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(27).ToString)
+                .Add("@ComisionVentaBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(28).ToString)
+                .Add("@IOF", SqlDbType.Bit).Value = CByte(Coleccion(29))
+                .Add("@Renta", SqlDbType.Bit).Value = CByte(Coleccion(30))
+                .Add("@Tipo", SqlDbType.VarChar).Value = Coleccion(31).ToString
+                .Add("@ComisionCompraCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(32).ToString)
+                .Add("@ComisionCompraBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(33).ToString)
+                .Add("@ComisionVentaCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(34).ToString)
+                .Add("@ComisionVentaBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(35).ToString)
+            End With
+            retorno = cmd.ExecuteNonQuery
+            sql = "DELETE FROM [dbo].[ACC1]
+            WHERE [CodInv]=@CodInv "
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            retorno = cmd.ExecuteNonQuery
+            If Not Diccionario Is Nothing Then
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[ACC1]
+           ([CodInv]
+             ,[Fecha]
+             ,[Dividendo]
+             ,[CantidadBase]
+             ,[IngresoBruto]
+             ,[PorcISR]
+             ,[ISR]
+             ,[IngresoNeto]
+             ,[Estado]
+
+             ,[FechaInicio]
+             ,[FechaCorte]
+             ,[NumDiv]
+
+        
+             
+           )
+     VALUES
+           (@CodInv
+             ,@Fecha
+             ,@Dividendo
+             ,@CantidadBase
+             ,@IngresoBruto
+             ,@PorcISR
+             ,@ISR
+             ,@IngresoNeto
+             ,@Estado
+             ,@FechaInicio
+             ,@FechaCorte
+             ,@NumDiv
+             
+          )"
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion2(1).ToString)
+                        .Add("@Dividendo", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion2(2).ToString)
+                        .Add("@CantidadBase", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion2(3).ToString)
+                        .Add("@IngresoBruto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion2(4).ToString)
+                        .Add("@PorcISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion2(5).ToString)
+                        .Add("@ISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion2(6).ToString)
+                        .Add("@IngresoNeto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion2(7).ToString)
+                        .Add("@Estado", SqlDbType.VarChar).Value = Coleccion2(8).ToString
+                        .Add("@NumDiv", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion2(9).ToString)
+                        .Add("@FechaInicio", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(Coleccion2(10).ToString)
+                        .Add("@FechaCorte", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(Coleccion2(11).ToString)
+
+
+
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+            ''''''''''''''''
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+
+
+
+
+    Public Sub Eliminar(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[ACC1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[ACC0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+    End Sub
+
+
+    Public Sub EliminarElemenoInd(ByVal Codigo As String, ByVal NumDiv As Integer)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[ACC1]
+      WHERE [CodInv]=@CodInv and [NumDiv]=@NumDiv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@NumDiv", SqlDbType.Int).Value = Operaciones.ConvertirEntero(NumDiv.ToString)
+
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+
+
+
+
+    Public Function NuevoElementoAccion(ByVal codigo As String, ByVal coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (coleccion Is Nothing) Then
+            Exit Function
+        End If
+
+        sql = "INSERT INTO [dbo].[ACC1]
+           ([CodInv]
+             ,[Fecha]
+             ,[Dividendo]
+             ,[CantidadBase]
+             ,[IngresoBruto]
+             ,[PorcISR]
+             ,[ISR]
+             ,[IngresoNeto]
+             ,[Estado]
+
+             ,[FechaInicio]
+             ,[FechaCorte]
+             ,[NumDiv]
+
+        
+             
+           )
+     VALUES
+           (@CodInv
+             ,@Fecha
+             ,@Dividendo
+             ,@CantidadBase
+             ,@IngresoBruto
+             ,@PorcISR
+             ,@ISR
+             ,@IngresoNeto
+             ,@Estado
+             ,@FechaInicio
+             ,@FechaCorte
+             ,@NumDiv
+             
+          )"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+
+        Try
+
+
+            With cmd.Parameters
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = codigo.ToString
+                .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(1).ToString)
+                .Add("@Dividendo", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(2).ToString)
+                .Add("@CantidadBase", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(3).ToString)
+                .Add("@IngresoBruto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+                .Add("@PorcISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(5).ToString)
+                .Add("@ISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(6).ToString)
+                .Add("@IngresoNeto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(7).ToString)
+                .Add("@Estado", SqlDbType.VarChar).Value = coleccion(8).ToString
+                .Add("@NumDiv", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(9).ToString)
+                .Add("@FechaInicio", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(10))
+                .Add("@FechaCorte", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(11))
+
+
+
+            End With
+
+            retorno = cmd.ExecuteNonQuery
+        Catch ex As Exception
+            Return Nothing
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+
+    Public Function ModificarElementoAccion(ByVal codigo As String, ByVal coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (coleccion Is Nothing) Then
+            Exit Function
+        End If
+
+        sql = "UPDATE [dbo].[ACC1] SET
+          
+             [Fecha]=@Fecha
+             ,[Dividendo]=@Dividendo
+             ,[CantidadBase]=@CantidadBase
+             ,[IngresoBruto]=@IngresoBruto
+             ,[PorcISR]=@PorcISR
+             ,[ISR]=@ISR
+             ,[IngresoNeto]=@IngresoNeto
+             ,[Estado]=@Estado
+
+             ,[FechaInicio]=@FechaInicio
+             ,[FechaCorte]=@FechaCorte
+             
+
+        where  [CodInv]=@CodInv and [NumDiv]=@NumDiv
+             
+
+"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+        Try
+
+
+            With cmd.Parameters
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = codigo.ToString
+                .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(1).ToString)
+                .Add("@Dividendo", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(2).ToString)
+                .Add("@CantidadBase", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(3).ToString)
+                .Add("@IngresoBruto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+                .Add("@PorcISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(5).ToString)
+                .Add("@ISR", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(6).ToString)
+                .Add("@IngresoNeto", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(coleccion(7).ToString)
+                .Add("@Estado", SqlDbType.VarChar).Value = coleccion(8).ToString
+                .Add("@NumDiv", SqlDbType.Int).Value = Operaciones.ConvertirEntero(coleccion(9).ToString)
+                .Add("@FechaInicio", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(10))
+                .Add("@FechaCorte", SqlDbType.DateTime).Value = Operaciones.ConvertirFecha(coleccion(11))
+
+            End With
+
+            retorno = cmd.ExecuteNonQuery
+
+        Catch ex As Exception
+            Return Nothing
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevaAccion(ByVal codigo As String, ByVal coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[ACC0]
+           ([CodInv]
+           ,[PrecioLimpioC]
+           ,[FOperC]
+           ,[FVenC]
+           ,[DiasTC]
+           ,[GCapTotC]
+           ,[GCapUnC]
+           ,[RetAnBrC]
+           ,[RetAnNetC]
+           ,[UnC]
+           ,[ValTransC]
+           ,[MontoNetoC]
+           ,[PrecSucioC]
+           ,[PrecioLimpioV]
+           ,[FOperV]
+           ,[FVenV]
+           ,[DiasTV]
+           ,[GCapTotV]
+           ,[GCapUnV]
+           ,[RetAnBrV]
+           ,[RetAnNetV]
+           ,[UnV]
+           ,[ValTransV]
+           ,[MontoNetoV]
+           ,[PrecSucioV]
+           ,[ComisionCompraCasa]
+           ,[ComisionCompraBolsa]
+           ,[ComisionVentaCasa]
+           ,[ComisionVentaBolsa]
+           ,[IOF]
+           ,[Renta]
+           ,[Tipo]
+           ,[ComisionCompraCasaValor]
+           ,[ComisionCompraBolsaValor]
+           ,[ComisionVentaCasaValor]
+           ,[ComisionVentaBolsaValor]
+
+)
+     VALUES
+           (@CodInv
+           ,@PrecioLimpioC
+           ,@FOperC
+           ,@FVenC
+           ,@DiasTC
+           ,@GCapTotC
+           ,@GCapUnC
+           ,@RetAnBrC
+           ,@RetAnNetC
+           ,@UnC
+           ,@ValTransC
+           ,@MontoNetoC
+           ,@PrecSucioC
+           ,@PrecioLimpioV
+           ,@FOperV
+           ,@FVenV
+           ,@DiasTV
+           ,@GCapTotV
+           ,@GCapUnV
+           ,@RetAnBrV
+           ,@RetAnNetV
+           ,@UnV
+           ,@ValTransV
+           ,@MontoNetoV
+           ,@PrecSucioV
+           ,@ComisionCompraCasa
+           ,@ComisionCompraBolsa
+           ,@ComisionVentaCasa
+           ,@ComisionVentaBolsa
+           ,@IOF
+           ,@Renta
+           ,@Tipo
+           ,@ComisionCompraCasaValor
+           ,@ComisionCompraBolsaValor
+           ,@ComisionVentaCasaValor
+           ,@ComisionVentaBolsaValor
+)"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+        Try
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = codigo.ToString
+                .Add("@PrecioLimpioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(1).ToString)
+                .Add("@FOperC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(2).ToString)
+                .Add("@FVenC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
+                .Add("@DiasTC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+                .Add("@GCapTotC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(5).ToString)
+                .Add("@GCapUnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(6).ToString)
+                .Add("@RetAnBrC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(7).ToString)
+                .Add("@RetAnNetC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(8).ToString)
+                .Add("@UnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(9).ToString)
+                .Add("@ValTransC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(10).ToString)
+                .Add("@MontoNetoC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(11).ToString)
+                .Add("@PrecSucioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(12).ToString)
+                .Add("@PrecioLimpioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(13).ToString)
+                .Add("@FOperV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(14).ToString)
+                .Add("@FVenV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(15).ToString)
+                .Add("@DiasTV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(16).ToString)
+                .Add("@GCapTotV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(17).ToString)
+                .Add("@GCapUnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(18).ToString)
+                .Add("@RetAnBrV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(19).ToString)
+                .Add("@RetAnNetV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(20).ToString)
+                .Add("@UnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(21).ToString)
+                .Add("@ValTransV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(22).ToString)
+                .Add("@MontoNetoV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(23).ToString)
+                .Add("@PrecSucioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(24).ToString)
+                .Add("@ComisionCompraCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(25).ToString)
+                .Add("@ComisionCompraBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(26).ToString)
+                .Add("@ComisionVentaCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(27).ToString)
+                .Add("@ComisionVentaBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(28).ToString)
+                .Add("@IOF", SqlDbType.Bit).Value = CByte(coleccion(29))
+                .Add("@Renta", SqlDbType.Bit).Value = CByte(coleccion(30))
+                .Add("@Tipo", SqlDbType.VarChar).Value = coleccion(31).ToString
+                .Add("@ComisionCompraCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(32).ToString)
+                .Add("@ComisionCompraBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(33).ToString)
+                .Add("@ComisionVentaCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(34).ToString)
+                .Add("@ComisionVentaBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(35).ToString)
+            End With
+
+
+
+
+
+
+
+            retorno = cmd.ExecuteNonQuery
+        Catch ex As Exception
+
+            MsgBox("Error al ingresar datos")
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+
+    Public Function ModificarAccion(ByVal codigo As String, ByVal coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "UPDATE [dbo].[ACC0] SET
+           [PrecioLimpioC]=@PrecioLimpioC
+           ,[FOperC]=@FOperC
+           ,[FVenC]=@FVenC
+           ,[DiasTC]=@DiasTC
+           ,[GCapTotC]=@GCapTotC
+           ,[GCapUnC]=@GCapUnC
+           ,[RetAnBrC]=@RetAnBrC
+           ,[RetAnNetC]=@RetAnNetC
+           ,[UnC]=@UnC
+           ,[ValTransC]=@ValTransC
+           ,[MontoNetoC]=@MontoNetoC
+           ,[PrecSucioC]=@PrecSucioC
+           ,[PrecioLimpioV]=@PrecioLimpioV
+           ,[FOperV]=@FOperV
+           ,[FVenV]=@FVenV
+           ,[DiasTV]=@DiasTV
+           ,[GCapTotV]=@GCapTotV
+           ,[GCapUnV]=@GCapUnV
+           ,[RetAnBrV]=@RetAnBrV
+           ,[RetAnNetV]=@RetAnNetV
+           ,[UnV]=@UnV
+           ,[ValTransV]=@ValTransV
+           ,[MontoNetoV]=@MontoNetoV
+           ,[PrecSucioV]=@PrecSucioV
+
+           ,[ComisionCompraCasa]=@ComisionCompraCasa
+           ,[ComisionCompraBolsa]=@ComisionCompraBolsa
+           ,[ComisionVentaCasa]=@ComisionVentaCasa
+           ,[ComisionVentaBolsa]=@ComisionVentaBolsa
+           ,[IOF]=@IOF
+           ,[Renta]=@Renta
+           ,[Tipo]=@Tipo
+
+
+           ,[ComisionCompraCasaValor]=@ComisionCompraCasaValor
+           ,[ComisionCompraBolsaValor]=@ComisionCompraBolsaValor
+           ,[ComisionVentaCasaValor]=@ComisionVentaCasaValor
+           ,[ComisionVentaBolsaValor]=@ComisionVentaBolsaValor
+            where [CodInv]=@CodInv
+            
+     "
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+        Try
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = codigo.ToString
+                .Add("@PrecioLimpioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(1).ToString)
+                .Add("@FOperC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(2).ToString)
+                .Add("@FVenC", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(3).ToString)
+                .Add("@DiasTC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(4).ToString)
+                .Add("@GCapTotC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(5).ToString)
+                .Add("@GCapUnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(6).ToString)
+                .Add("@RetAnBrC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(7).ToString)
+                .Add("@RetAnNetC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(8).ToString)
+                .Add("@UnC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(9).ToString)
+                .Add("@ValTransC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(10).ToString)
+                .Add("@MontoNetoC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(11).ToString)
+                .Add("@PrecSucioC", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(12).ToString)
+                .Add("@PrecioLimpioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(13).ToString)
+                .Add("@FOperV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(14).ToString)
+                .Add("@FVenV", SqlDbType.Date).Value = Operaciones.ConvertirFecha(coleccion(15).ToString)
+                .Add("@DiasTV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(16).ToString)
+                .Add("@GCapTotV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(17).ToString)
+                .Add("@GCapUnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(18).ToString)
+                .Add("@RetAnBrV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(19).ToString)
+                .Add("@RetAnNetV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(20).ToString)
+                .Add("@UnV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(21).ToString)
+                .Add("@ValTransV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(22).ToString)
+                .Add("@MontoNetoV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(23).ToString)
+                .Add("@PrecSucioV", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(24).ToString)
+                .Add("@ComisionCompraCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(25).ToString)
+                .Add("@ComisionCompraBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(26).ToString)
+                .Add("@ComisionVentaCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(27).ToString)
+                .Add("@ComisionVentaBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(28).ToString)
+                .Add("@IOF", SqlDbType.Bit).Value = CByte(coleccion(29))
+                .Add("@Renta", SqlDbType.Bit).Value = CByte(coleccion(30))
+                .Add("@Tipo", SqlDbType.VarChar).Value = coleccion(31).ToString
+                .Add("@ComisionCompraCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(32).ToString)
+                .Add("@ComisionCompraBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(33).ToString)
+                .Add("@ComisionVentaCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(34).ToString)
+                .Add("@ComisionVentaBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(coleccion(35).ToString)
+
+            End With
+
+            retorno = cmd.ExecuteNonQuery
+        Catch ex As Exception
+
+            MsgBox("Error al modificar datos")
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+
+    Public Sub EliminarAccion(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[ACC0]
+      WHERE [CodInv]=@CodInv;DELETE FROM [dbo].[ACC1]
+      WHERE [CodInv]=@CodInv;DELETE FROM [dbo].[ACC2]
+      WHERE [CodInv]=@CodInv;"
+
+
+
+        Try
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            cmd.Connection = cn
+
+
+
+            res = cmd.ExecuteNonQuery
+
+        Catch ex As Exception
+            MsgBox("Error al eliminar")
+        End Try
+        cn.Close()
+    End Sub
+
+    Public Function Nuevo(ByVal oAccion As Object) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[ACC0]
+           ([CodInv]
+           ,[OpPrefC]
+           ,[OpBolsaC]
+           ,[PrecioLimpioC]
+           ,[FOperC]
+           ,[FLiqC]
+           ,[DiasTC]
+           ,[GCapTotC]
+           ,[GCapUnC]
+           ,[RetAnBrC]
+           ,[RetAnNetC]
+           ,[UnC]
+           ,[ValTransC]
+           ,[MontoNetoC]
+           ,[PrecSucioC]
+           ,[FactDiv]
+           ,[PrecioLimpioV]
+           ,[FOperV]
+           ,[FLiqV]
+           ,[DiasTV]
+           ,[GCapTotV]
+           ,[GCapUnV]
+           ,[RetAnBrV]
+           ,[RetAnNetV]
+           ,[UnV]
+           ,[ValTransV]
+           ,[MontoNetoV]
+           ,[PrecSucioV]
+           ,[IngresoBruto]
+           ,[IngresoBrutoPend]
+           ,[ImpSumC]
+           ,[ComSumC]
+           ,[ImpSumV]
+           ,[ComSumV]
+           ,[ISR]
+           ,[ISRPend]
+           ,[IngresoNeto]
+           ,[IngresoNetoPend]
+           ,[SumImpComCompra]
+           ,[SumImpComVenta])
+     VALUES
+           (@CodInv
+           ,@OpPrefC
+           ,@OpBolsaC
+           ,@PrecioLimpioC
+           ,@FOperC
+           ,@FLiqC
+           ,@DiasTC
+           ,@GCapTotC
+           ,@GCapUnC
+           ,@RetAnBrC
+           ,@RetAnNetC
+           ,@UnC
+           ,@ValTransC
+           ,@MontoNetoC
+           ,@PrecSucioC
+           ,@FactDiv
+           ,@PrecioLimpioV
+           ,@FOperV
+           ,@FLiqV
+           ,@DiasTV
+           ,@GCapTotV
+           ,@GCapUnV
+           ,@RetAnBrV
+           ,@RetAnNetV
+           ,@UnV
+           ,@ValTransV
+           ,@MontoNetoV
+           ,@PrecSucioV
+           ,@IngresoBruto
+           ,@IngresoBrutoPend
+           ,@ImpSumC
+           ,@ComSumC
+           ,@ImpSumV
+           ,@ComSumV
+           ,@ISR
+           ,@ISRPend
+           ,@IngresoNeto
+           ,@IngresoNetoPend
+           ,@SumImpComCompra
+           ,@SumImpComVenta"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.Float).Value = oAccion.CodigoInversion
+            .Add("@OpPrefC", SqlDbType.Float).Value = oAccion.AccionPreferente
+            .Add("@OpBolsaC", SqlDbType.Float).Value = oAccion.OperacionEnBolsa
+            .Add("@PrecioLimpioC", SqlDbType.Float).Value = oAccion.PrecioLimpioCompra
+            .Add("@FOperC", SqlDbType.Float).Value = oAccion.FechaOperacionCompra
+            .Add("@FLiqC", SqlDbType.Float).Value = oAccion.FechaLiquidacionCompra
+            .Add("@DiasTC", SqlDbType.Float).Value = oAccion.DiasDeTenenciaCompra
+            .Add("@GCapTotC", SqlDbType.Float).Value = oAccion.GananciaDeCapitalTotalCompra
+            .Add("@GCapUnC", SqlDbType.Float).Value = oAccion.GananciaDeCapitalUnitarioCompra
+            .Add("@RetAnBrC", SqlDbType.Float).Value = oAccion.RetornoAnualizadoBrutoCompra
+            .Add("@RetAnNetC", SqlDbType.Float).Value = oAccion.RetornoAnualizadoNetoCompra
+            .Add("@UnC", SqlDbType.Float).Value = oAccion.CantidadCompra
+            .Add("@ValTransC", SqlDbType.Float).Value = oAccion.ValorTransadoCompra
+            .Add("@MontoNetoC", SqlDbType.Float).Value = oAccion.MontoNetoCompra
+            .Add("@PrecSucioC", SqlDbType.Float).Value = oAccion.PrecioSucioCompra
+            .Add("@FactDiv", SqlDbType.Float).Value = oAccion.FactorDeDividendo
+            .Add("@PrecioLimpioV", SqlDbType.Float).Value = oAccion.PrecioLimpioVenta
+            .Add("@FOperV", SqlDbType.Float).Value = oAccion.FechaOperacionVenta
+            .Add("@FLiqV", SqlDbType.Float).Value = oAccion.FechaLiquidacionVenta
+            .Add("@DiasTV", SqlDbType.Float).Value = oAccion.DiasDeTenenciaVenta
+            .Add("@GCapTotV", SqlDbType.Float).Value = oAccion.GananciaDeCapitalTotalVenta
+            .Add("@GCapUnV", SqlDbType.Float).Value = oAccion.GananciaDeCapitalUnitarioVenta
+            .Add("@RetAnBrV", SqlDbType.Float).Value = oAccion.RetornoAnualizadoBrutoVenta
+            .Add("@RetAnNetV", SqlDbType.Float).Value = oAccion.RetornoAnualizadoNetoVenta
+            .Add("@UnV", SqlDbType.Float).Value = oAccion.CantidadVenta
+            .Add("@ValTransV", SqlDbType.Float).Value = oAccion.ValorTransadoVenta
+            .Add("@MontoNetoV", SqlDbType.Float).Value = oAccion.MontoNetoVenta
+            .Add("@PrecSucioV", SqlDbType.Float).Value = oAccion.PrecioSucioVenta
+            .Add("@IngresoBruto", SqlDbType.Float).Value = oAccion.IngresoBruto
+            .Add("@IngresoBrutoPend", SqlDbType.Float).Value = oAccion.IngresoBrutoPendiente
+            .Add("@ImpSumC", SqlDbType.Float).Value = 0
+            .Add("@ComSumC", SqlDbType.Float).Value = 0
+            .Add("@ImpSumV", SqlDbType.Float).Value = 0
+            .Add("@ComSumV", SqlDbType.Float).Value = 0
+            .Add("@ISR", SqlDbType.Float).Value = oAccion.ISR
+            .Add("@ISRPend", SqlDbType.Float).Value = 0
+            .Add("@IngresoNeto", SqlDbType.Float).Value = oAccion.IngresoNeto
+            .Add("@IngresoNetoPend", SqlDbType.Float).Value = 0
+            .Add("@SumImpComCompra", SqlDbType.Float).Value = oAccion.SumaImpuestosYComisionesCompra
+            .Add("@SumImpComVenta", SqlDbType.Float).Value = oAccion.SumaImpuestosYComisionesVenta
+        End With
+
+        retorno = cmd.ExecuteNonQuery
+
+        Me.GuardarDividendos(oAccion.CodigoInversion, oAccion.Dividendos)
+        Me.GuardarImpuestosYComisiones(oAccion.CodigoInversion, oAccion.ImpuestosYComisiones)
+        cn.Close()
+        Return retorno
+    End Function
+    Function Nuevo(ByVal oAccion As AccionesCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim Tabla As String = ""
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PACC0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IACC0"
+        End If
+
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevaAccion")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+
+        query = "INSERT INTO [dbo].[" & Tabla & "]
+           ([DocId]
+           ,[CodCasaC]
+           ,[OpPrefC]
+           ,[OpBolsaC]
+           ,[PrecioLimpioC]
+           ,[FOperC]
+           ,[FLiqC]
+           ,[DiasTC]
+           ,[GCapTotC]
+           ,[GCapUnC]
+           ,[RetAnBrC]
+           ,[RetAnNetC]
+           ,[UnC]
+           ,[ValTransC]
+           ,[MontoNetoC]
+           ,[PrecSucioC]
+           ,[FactDiv]
+           ,[PrecioLimpioV]
+           ,[FOperV]
+           ,[FLiqV]
+           ,[DiasTV]
+           ,[GCapTotV]
+           ,[GCapUnV]
+           ,[RetAnBrV]
+           ,[RetAnNetV]
+           ,[UnV]
+           ,[ValTransV]
+           ,[MontoNetoV]
+           ,[PrecSucioV]
+           ,[CodCasaV])
+     VALUES
+           (@DocId
+           ,@CodCasaC
+           ,@OpPrefC
+           ,@OpBolsaC
+           ,@PrecioLimpioC
+           ,@FOperC
+           ,@FLiqC
+           ,@DiasTC
+           ,@GCapTotC
+           ,@GCapUnC
+           ,@RetAnBrC
+           ,@RetAnNetC
+           ,@UnC
+           ,@ValTransC
+           ,@MontoNetoC
+           ,@PrecSucioC
+           ,@FactDiv
+           ,@PrecioLimpioV
+           ,@FOperV
+           ,@FLiqV
+           ,@DiasTV
+           ,@GCapTotV
+           ,@GCapUnV
+           ,@RetAnBrV
+           ,@RetAnNetV
+           ,@UnV
+           ,@ValTransV
+           ,@MontoNetoV
+           ,@PrecSucioV
+           ,@CodCasaV
+		   )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            .Add("@CodCasaC", SqlDbType.VarChar).Value = oAccion.CodigoCasaCompra
+            .Add("@OpPrefC", SqlDbType.VarChar).Value = oAccion.AccionPreferente
+            .Add("@OpBolsaC", SqlDbType.VarChar).Value = oAccion.OperacionEnBolsa
+            .Add("@PrecioLimpioC", SqlDbType.Decimal).Value = oAccion.PrecioLimpioCompra
+            .Add("@FOperC", SqlDbType.DateTime).Value = oAccion.FechaOperacionCompra
+            .Add("@FLiqC", SqlDbType.DateTime).Value = oAccion.FechaVencimientoCompra
+            .Add("@DiasTC", SqlDbType.Int).Value = oAccion.DiasDeTenenciaCompra
+            .Add("@GCapTotC", SqlDbType.Decimal).Value = oAccion.GananciaDeCapitalTotalCompra
+            .Add("@GCapUnC", SqlDbType.Decimal).Value = oAccion.GananciaDeCapitalUnitarioCompra
+            .Add("@RetAnBrC", SqlDbType.Decimal).Value = oAccion.RetornoAnualizadoBrutoCompra
+            .Add("@RetAnNetC", SqlDbType.Decimal).Value = oAccion.RetornoAnualizadoNetoCompra
+            .Add("@UnC", SqlDbType.Int).Value = oAccion.CantidadCompra
+            .Add("@ValTransC", SqlDbType.Decimal).Value = oAccion.ValorTransadoCompra
+            .Add("@MontoNetoC", SqlDbType.Decimal).Value = oAccion.MontoNetoCompra
+            .Add("@PrecSucioC", SqlDbType.Decimal).Value = oAccion.PrecioSucioCompra
+
+            .Add("@FactDiv", SqlDbType.Decimal).Value = oAccion.FactorDeDividendo
+            .Add("@PrecioLimpioV", SqlDbType.Decimal).Value = oAccion.PrecioLimpioVenta
+            .Add("@FOperV", SqlDbType.DateTime).Value = oAccion.FechaOperacionVenta
+            .Add("@FLiqV", SqlDbType.DateTime).Value = oAccion.FechaVencimientoVenta
+            .Add("@DiasTV", SqlDbType.Int).Value = oAccion.DiasDeTenenciaVenta
+            .Add("@GCapTotV", SqlDbType.Decimal).Value = oAccion.GananciaDeCapitalTotalVenta
+            .Add("@GCapUnV", SqlDbType.Decimal).Value = oAccion.GananciaDeCapitalUnitarioVenta
+            .Add("@RetAnBrV", SqlDbType.Decimal).Value = oAccion.RetornoAnualizadoBrutoVenta
+            .Add("@RetAnNetV", SqlDbType.Decimal).Value = oAccion.RetornoAnualizadoNetoVenta
+            .Add("@UnV", SqlDbType.Int).Value = oAccion.CantidadVenta
+            .Add("@ValTransV", SqlDbType.Decimal).Value = oAccion.ValorTransadoVenta
+            .Add("@MontoNetoV", SqlDbType.Decimal).Value = oAccion.MontoNetoVenta
+            .Add("@PrecSucioV", SqlDbType.Decimal).Value = oAccion.PrecioSucioVenta
+            .Add("@CodCasaV", SqlDbType.VarChar).Value = oAccion.CodigoCasaVenta
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar Accion : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+
+        Return retorno
+    End Function
+
+
+    Public Function CargarRegistro(ByVal vCodigoInversion As String) As AccionesCE
+        Dim objCon As New Conexion
+        Dim oAcciones As New AccionesCE
+        Dim dtDividendos As New DataTable
+        Dim dtImpuestosYComisiones As New DataTable
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim da As SqlDataAdapter
+        Dim sql As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+        sql = "SELECT * FROM [dbo].[ACC0] T0 WHERE T0.CodInv=@CodInv"
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+
+            'SE ENCONTRO EL REGISTRO
+            'oAcciones = New AccionesCE
+
+            If drd.Read Then
+
+                oAcciones.CodigoInversion = vCodigoInversion
+                'COMPRA
+                oAcciones.AccionPreferente = drd.Item("OpPrefC").ToString
+                oAcciones.OperacionEnBolsa = drd.Item("OpBolsaC").ToString
+
+                If String.IsNullOrEmpty(drd.Item("PrecioLimpioC").ToString) Then
+                    oAcciones.PrecioLimpioCompra = 0
+                Else
+                    oAcciones.PrecioLimpioCompra = drd.Item("PrecioLimpioC").ToString
+
+                End If
+
+                If String.IsNullOrEmpty(drd.Item("UnC").ToString) Then
+                    oAcciones.CantidadCompra = 0
+                Else
+                    oAcciones.CantidadCompra = drd.Item("UnC").ToString
+                End If
+
+                If String.IsNullOrEmpty(drd.Item("FOperC").ToString) Then
+                    oAcciones.FechaOperacionCompra = Date.Now.Date
+                Else
+                    oAcciones.FechaOperacionCompra = drd.Item("FOperC").ToString
+                End If
+                If String.IsNullOrEmpty(drd.Item("FVenC").ToString) Then
+                    oAcciones.FechaVencimientoCompra = Date.Now.Date
+                Else
+
+                    oAcciones.FechaVencimientoCompra = drd.Item("FVenC").ToString
+                End If
+
+
+
+
+                If String.IsNullOrEmpty(drd.Item("RetAnBrC").ToString) Then
+                    oAcciones.RetornoBruto = 0
+                Else
+                    oAcciones.RetornoBruto = drd.Item("RetAnBrC").ToString
+                End If
+
+
+
+                If drd.Item("IOF").ToString Then
+                    oAcciones.IOF = True
+                Else
+                    oAcciones.IOF = False
+                End If
+
+
+                If drd.Item("Renta").ToString Then
+                    oAcciones.Renta = True
+                Else
+                    oAcciones.Renta = False
+                End If
+
+
+
+
+
+
+
+
+                If IsNumeric(drd.Item("GCapTotC")) Then
+                    oAcciones.GananciaDeCapitalTotalCompra = drd.Item("GCapTotC")
+                Else
+                    oAcciones.GananciaDeCapitalTotalCompra = 0
+                End If
+                If IsNumeric(drd.Item("GCapUnC")) Then
+                    oAcciones.GananciaDeCapitalUnitarioCompra = drd.Item("GCapUnC")
+                Else
+                    oAcciones.GananciaDeCapitalUnitarioCompra = 0
+                End If
+                If IsNumeric(drd.Item("RetAnBrC")) Then
+                    oAcciones.RetornoAnualizadoBrutoCompra = drd.Item("RetAnBrC")
+                Else
+                    oAcciones.RetornoAnualizadoBrutoCompra = 0
+                End If
+                If IsNumeric(drd.Item("RetAnNetC")) Then
+                    oAcciones.RetornoAnualizadoNetoCompra = drd.Item("RetAnNetC")
+                Else
+                    oAcciones.RetornoAnualizadoNetoCompra = 0
+                End If
+                If IsNumeric(drd.Item("FactDiv")) Then
+                    oAcciones.FactorDeDividendo = drd.Item("FactDiv")
+                Else
+                    oAcciones.FactorDeDividendo = 0
+                End If
+
+
+
+
+                If IsNumeric(drd.Item("GCapTotV")) Then
+                    oAcciones.GananciaDeCapitalTotalVentasus = drd.Item("GCapTotV")
+                Else
+                    oAcciones.GananciaDeCapitalTotalVentasus = 0
+                End If
+                If IsNumeric(drd.Item("GCapUnV")) Then
+                    oAcciones.GananciaDeCapitalUnitarioVenta = drd.Item("GCapUnV")
+                Else
+                    oAcciones.GananciaDeCapitalUnitarioVenta = 0
+                End If
+                If IsNumeric(drd.Item("RetAnBrV")) Then
+                    oAcciones.RetornoAnualizadoBrutoVentasus = drd.Item("RetAnBrV")
+                Else
+                    oAcciones.RetornoAnualizadoBrutoVentasus = 0
+                End If
+                If IsNumeric(drd.Item("RetAnNetV")) Then
+                    oAcciones.RetornoAnualizadoNetoVenta = drd.Item("RetAnNetV")
+                Else
+                    oAcciones.RetornoAnualizadoNetoVenta = 0
+                End If
+
+                'VENTA
+                If String.IsNullOrEmpty(drd.Item("PrecioLimpioV").ToString) Then
+                    oAcciones.PrecioLimpioVenta = 0
+                Else
+                    oAcciones.PrecioLimpioVenta = drd.Item("PrecioLimpioV").ToString
+                End If
+
+                If String.IsNullOrEmpty(drd.Item("PrecSucioC").ToString) Then
+                    oAcciones.PrecioSucioCompra = 0
+                Else
+                    oAcciones.PrecioSucioCompra = drd.Item("PrecSucioC").ToString
+                End If
+
+                If String.IsNullOrEmpty(drd.Item("PrecSucioV").ToString) Then
+                    oAcciones.PrecioSucioVentasus = 0
+                Else
+                    oAcciones.PrecioSucioVentasus = drd.Item("PrecSucioV").ToString
+                End If
+
+                If String.IsNullOrEmpty(drd.Item("FOperV").ToString) Then
+                    oAcciones.FechaOperacionVenta = Date.Now.Date
+                Else
+                    oAcciones.FechaOperacionVenta = drd.Item("FOperV").ToString
+                End If
+                If String.IsNullOrEmpty(drd.Item("FVenV").ToString) Then
+                    oAcciones.FechaVencimientoVenta = Date.Now.Date
+                Else
+
+                    oAcciones.FechaVencimientoVenta = drd.Item("FVenV").ToString
+                End If
+
+
+
+
+
+
+                If String.IsNullOrEmpty(drd.Item("UnV").ToString) Then
+                    oAcciones.CantidadVenta = 0
+                Else
+                    oAcciones.CantidadVenta = drd.Item("UnV").ToString
+                End If
+
+
+
+            End If
+
+            If String.IsNullOrEmpty(drd.Item("Tipo").ToString) Then
+                oAcciones.Tipo = 0
+            Else
+
+                oAcciones.Tipo = drd.Item("Tipo").ToString
+
+            End If
+
+
+            If String.IsNullOrEmpty(drd.Item("DiasTC").ToString) Then
+
+                oAcciones.DiasDeTenenciaCompra = 0
+            Else
+                oAcciones.DiasDeTenenciaCompra = drd.Item("DiasTC").ToString
+            End If
+
+            If String.IsNullOrEmpty(drd.Item("DiasTV").ToString) Then
+
+                oAcciones.DiasDeTenenciaVenta = 0
+            Else
+                oAcciones.DiasDeTenenciaVenta = drd.Item("DiasTV").ToString
+            End If
+
+
+            If String.IsNullOrEmpty(drd.Item("ValTransC")) Then
+                oAcciones.ValorTransadoCompra = 0
+
+            Else
+                oAcciones.ValorTransadoCompra = drd.Item("ValTransC")
+            End If
+            If String.IsNullOrEmpty(drd.Item("ValTransV")) Then
+                oAcciones.ValorTransadoVenta = 0
+
+            Else
+                oAcciones.ValorTransadoVenta = drd.Item("ValTransV")
+            End If
+            If String.IsNullOrEmpty(drd.Item("MontoNetoC").ToString) Then
+                oAcciones.MontoNetoComprasus = 0
+            Else
+                oAcciones.MontoNetoComprasus = drd.Item("MontoNetoC")
+            End If
+
+            If String.IsNullOrEmpty(drd.Item("MontoNetoV").ToString) Then
+                oAcciones.MontoNetoVentasus = 0
+            Else
+                oAcciones.MontoNetoVentasus = drd.Item("MontoNetoV")
+            End If
+
+
+
+
+
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionCompraCasaValor").ToString)) Then
+                oAcciones.ComisionCompraCasa = 0
+            Else
+                oAcciones.ComisionCompraCasa = drd.Item("ComisionCompraCasaValor").ToString
+            End If
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionCompraBolsaValor").ToString)) Then
+                oAcciones.ComisionCompraBolsa = 0
+            Else
+                oAcciones.ComisionCompraBolsa = drd.Item("ComisionCompraBolsaValor").ToString
+            End If
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionVentaCasaValor").ToString)) Then
+                oAcciones.ComisionVentaCasa = 0
+            Else
+                oAcciones.ComisionVentaCasa = drd.Item("ComisionVentaCasaValor").ToString
+            End If
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionVentaBolsaValor").ToString)) Then
+                oAcciones.ComisionVentaBolsa = 0
+            Else
+                oAcciones.ComisionVentaBolsa = drd.Item("ComisionVentaBolsaValor").ToString
+            End If
+
+
+
+
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionCompraCasa").ToString)) Then
+                oAcciones.ComisionPorcentajeCompraCasa = 0
+            Else
+                oAcciones.ComisionPorcentajeCompraCasa = drd.Item("ComisionCompraCasa").ToString
+            End If
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionCompraBolsa").ToString)) Then
+                oAcciones.ComisionPorcentajeCompraBolsa = 0
+            Else
+                oAcciones.ComisionPorcentajeCompraBolsa = drd.Item("ComisionCompraBolsa").ToString
+            End If
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionVentaCasa").ToString)) Then
+                oAcciones.ComisionPorcentajeVentaCasa = 0
+            Else
+                oAcciones.ComisionPorcentajeVentaCasa = drd.Item("ComisionVentaCasa").ToString
+            End If
+
+
+
+            If (String.IsNullOrEmpty(drd.Item("ComisionVentaBolsa").ToString)) Then
+                oAcciones.ComisionPorcentajeVentaBolsa = 0
+            Else
+                oAcciones.ComisionPorcentajeVentaBolsa = drd.Item("ComisionVentaBolsa").ToString
+            End If
+
+
+
+
+
+
+
+
+            drd.Close()
+
+
+        Else
+            oAcciones.CantidadCompra = 0
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return oAcciones
+    End Function
+
+
+    Public Function CargarRegistroActualizar() As DataTable
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim da As SqlDataAdapter
+        Dim sql As String = String.Empty
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+        sql = "SELECT * FROM [dbo].[ACC0] "
+        da = New SqlDataAdapter(sql, cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+    End Function
+
+    Public Function Actualizar(ByVal oAccionesCE As AccionesCE) As Integer
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim retorno As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "
+"
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Variables.Codigo
+
+
+
+
+
+        cmd.CommandType = CommandType.Text
+        cmd.Connection = cn
+        retorno = cmd.ExecuteNonQuery()
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+
+        Return retorno
+    End Function
+    Private Sub GuardarDividendos(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[ACC1]
+      WHERE [CodInv]=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[ACC1]
+           ([CodInv]
+           ,[Fecha]
+           ,[Dividendo]
+           ,[CantidadBase]
+           ,[IngresoBruto]
+           ,[PorcISR]
+           ,[ISR]
+           ,[IngresoNeto])
+     VALUES
+           (@CodInv
+           ,@Fecha
+           ,@Dividendo
+           ,@CantidadBase
+           ,@IngresoBruto
+           ,@PorcISR
+           ,@ISR
+           ,@IngresoNeto)"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@Fecha", dr("Fecha"))
+                cmd.Parameters.AddWithValue("@Dividendo", dr("Dividendo"))
+                cmd.Parameters.AddWithValue("@CantidadBase", dr("CantidadBase"))
+                cmd.Parameters.AddWithValue("@IngresoBruto", dr("IngresoBruto"))
+                cmd.Parameters.AddWithValue("@PorcISR", dr("PorcISR"))
+                cmd.Parameters.AddWithValue("@ISR", dr("ISR"))
+                cmd.Parameters.AddWithValue("@IngresoNeto", dr("IngresoNeto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+
+
+        cn.Close()
+    End Sub
+
+    Private Sub GuardarImpuestosYComisiones(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[ACC2]
+      WHERE [CodInv]=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[ACC2]
+           ([CodInv]
+           ,[TipoOper]
+           ,[CodImp]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[MontoSujeto])
+     VALUES
+           (@CodInv
+           ,@TipoOper
+           ,@CodImp
+           ,@PorcImp
+           ,@MontoImp
+           ,@MontoSujeto)"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@TipoOper", dr("TipoOper"))
+                cmd.Parameters.AddWithValue("@CodImp", dr("CodImp"))
+                cmd.Parameters.AddWithValue("@PorcImp", dr("PorcImp"))
+                cmd.Parameters.AddWithValue("@MontoImp", dr("MontoImp"))
+                cmd.Parameters.AddWithValue("@MontoSujeto", dr("MontoSujeto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+        cn.Close()
+    End Sub
+
+
+
+
+
+
+    Public Function CargarDividendo(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from ACC1 where CodInv='" + codigo + "' order by NumDiv"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+
+
+
+        Return dr
+    End Function
+
+
+
+End Class

+ 102 - 0
DAO/BancosDAO.vb

@@ -0,0 +1,102 @@
+Module BancosDAO
+    Private objCon As New Conexion
+    Private cn As SqlClient.SqlConnection = objCon.Conectar
+
+    Public Function Bancos() As DataTable
+        Dim dt As New DataTable
+        Dim query As String
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim da As SqlClient.SqlDataAdapter
+
+        query = "SELECT
+	T0.[CodBanco]
+	,T0.[NombreBanco]
+	,T0.[CodPais]
+FROM [dbo].[BAN0] T0"
+
+        da = New SqlClient.SqlDataAdapter(query, cn)
+        da.Fill(dt)
+
+        Return dt
+    End Function
+    Public Function CuentasBancarias(ByVal pCodEmpresa As String, pCodBanco As String) As DataTable
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim query As String
+        Dim da As SqlClient.SqlDataAdapter
+        Dim cmd As New SqlClient.SqlCommand
+
+        query = "SELECT
+	T0.[Id]
+	,T0.[CodBanco]
+	,T0.[CodEmpr]
+	,T0.[NumCuenta]
+	,T0.[Activo]
+	,T0.[NombreCuenta]
+FROM [dbo].[BAN1] T0
+WHERE
+	T0.[CodEmpr]='" & pCodEmpresa & "'
+	AND T0.[CodBanco]='" & pCodBanco & "'"
+
+        da = New SqlClient.SqlDataAdapter(query, cn)
+
+        da.Fill(dt)
+
+        Return dt
+    End Function
+    Public Function ObtieneCuentaContable(ByVal pCodigoEmpresa As String, ByVal pCodigoBanco As String, ByVal pCuentaBancaria As String) As String
+        Dim r As String
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim cmd As SqlClient.SqlCommand
+        Dim query As String
+
+        If Not (String.IsNullOrEmpty(pCodigoEmpresa) And String.IsNullOrEmpty(pCodigoBanco) And String.IsNullOrEmpty(pCuentaBancaria)) Then
+            query = "SELECT T0.CuentaContable FROM BAN1 T0 WHERE T0.CodBanco=@CodBanco AND T0.CodEmpr=@CodEmpr AND T0.NumCuenta=@NumCuenta"
+            cmd = New SqlClient.SqlCommand
+            cmd.CommandText = query
+            cmd.Parameters.Add("@CodBanco", SqlDbType.VarChar).Value = pCodigoBanco
+            cmd.Parameters.Add("@CodEmpr", SqlDbType.VarChar).Value = pCodigoEmpresa
+            cmd.Parameters.Add("@NumCuenta", SqlDbType.VarChar).Value = pCuentaBancaria
+
+
+            cmd.Connection = cn
+            r = cmd.ExecuteScalar.ToString()
+
+        End If
+
+        Return r
+    End Function
+End Module

+ 1200 - 0
DAO/BonosDAO.vb

@@ -0,0 +1,1200 @@
+Imports System.Data.SqlClient
+Public Class BonosDAO
+
+
+
+    Dim oDAOGeneral As New DAOGeneral
+
+    Public Function Nuevo(ByVal oBono As BonosCE) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim query As String
+
+        Dim cmd As SqlCommand
+        'Dim vSiguienteCodigo As String = String.Empty
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+        If Not oBono Is Nothing Then
+            'VIENE OBJETO BONO
+            'vSiguienteCodigo = Me.SiguienteCodigo(oBono)
+
+            query = "INSERT INTO [dbo].[BON0]
+([CodInv]
+,[PeriodicC]
+,[ValNomC]
+,[UltFCupC]
+,[SigFCupC]
+,[FLiqC]
+,[FVencC]
+,[PorcCupC]
+--,[YTMVencComC]
+,[YTMVencC]
+,[PrecVencC]
+,[PrecioCompra]
+,[DiasBaseC]
+--,[DiasAcumC]
+--,[DiasVencC]
+--,[PorcIntAcumC]
+--,[IntAcumC]
+--,[PrecioSucioC]
+--,[ValTransC]
+--,[MontoPagarC]
+,[CostoTransC]
+
+,[PeriodicV]
+,[ValNomV]
+,[UltFCupV]
+,[SigFCupV]
+,[FLiqV]
+,[FVencV]
+,[PorcCupV]
+--,[YTMVencComV]
+,[YTMVencV]
+,[PrecVencV]
+,[PrecioVenta]
+,[DiasBaseV]
+--,[DiasAcumV]
+--,[DiasVencV]
+--,[PorcIntAcumV]
+--,[IntAcumV]
+--,[PrecioSucioV]
+--,[ValTransV]
+--,[MontoPagarV]
+,[CostoTransV]
+--,[ValNomRO]
+--,[PlazoRO]
+--,[PrecioCompraRO]
+--,[PrecioVentaRO]
+--,[GanPerdCap]
+--,[IngrPorInt]
+--,[CostosTotales]
+--,[GanPerdTot]
+--,[RendGanPerd]
+--,[RendInt]
+--,[RendAntISR]
+--,[RendDespISR]
+)
+VALUES
+(@CodInv
+,@PeriodicC
+,@ValNomC
+,@UltFCupC
+,@SigFCupC
+,@FLiqC
+,@FVencC
+,@PorcCupC
+--,@YTMVencComC
+,@YTMVencC
+,@PrecVencC
+,@PrecioCompra
+,@DiasBaseC
+--,@DiasAcumC
+--,@DiasVencC
+--,@PorcIntAcumC
+--,@IntAcumC
+--,@PrecioSucioC
+--,@ValTransC
+--,@MontoPagarC
+,@CostoTransC
+
+,@PeriodicV
+,@ValNomV
+,@UltFCupV
+,@SigFCupV
+,@FLiqV
+,@FVencV
+,@PorcCupV
+--,@YTMVencComV
+,@YTMVencV
+,@PrecVencV
+,@PrecioVenta
+,@DiasBaseV
+--,@DiasAcumV
+--,@DiasVencV
+--,@PorcIntAcumV
+--,@IntAcumV
+--,@PrecioSucioV
+--,@ValTransV
+--,@MontoPagarV
+,@CostoTransV
+
+--,@ValNomRO
+--,@PlazoRO
+--,@PrecioCompraRO
+--,@PrecioVentaRO
+--,@GanPerdCap
+--,@IngrPorInt
+--,@CostosTotales
+--,@GanPerdTot
+--,@RendGanPerd
+--,@RendInt
+--,@RendAntISR
+--,@RendDespISR
+)"
+            cmd = New SqlCommand
+            cmd.CommandText = query
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = oBono.CodigoInversion
+                .Add("@PeriodicC", SqlDbType.VarChar).Value = oBono.PeriodicidadCompra
+                .Add("@ValNomC", SqlDbType.Float).Value = oBono.ValorNominalCompra
+                .Add("@UltFCupC", SqlDbType.Date).Value = oBono.UltimaFechaCuponCompra
+                .Add("@SigFCupC", SqlDbType.Date).Value = oBono.SiguienteFechaCuponCompra
+                .Add("@FLiqC", SqlDbType.Date).Value = oBono.FechaLiquidacionCompra
+                .Add("@FVencC", SqlDbType.Date).Value = oBono.FechaVencimientoCompra
+                .Add("@PorcCupC", SqlDbType.Float).Value = oBono.PorcentajeCuponCompra
+                '.Add("@YTMVencComC", SqlDbType.Float).Value = oBono.YTMAlVencimientoComisionCompra
+                .Add("@YTMVencC", SqlDbType.Float).Value = oBono.YTMAlVencimientoCompra
+                .Add("@PrecVencC", SqlDbType.Float).Value = oBono.PrecioAlVencimientoCompra
+                .Add("@PrecioCompra", SqlDbType.Float).Value = oBono.PrecioCompra
+                .Add("@DiasBaseC", SqlDbType.Int).Value = oBono.DiasBaseCompra
+                '.Add("@DiasAcumC", SqlDbType.Int).Value = oBono.DiasAcumuladosCompra
+                '.Add("@DiasVencC", SqlDbType.Int).Value = oBono.DiasAlVencimientoCompra
+                '.Add("@PorcIntAcumC", SqlDbType.Float).Value = oBono.PorcentajeInteresAcumuladoCompra
+                '.Add("@IntAcumC", SqlDbType.Float).Value = oBono.InteresAcumuladoCompra
+                '.Add("@PrecioSucioC", SqlDbType.Float).Value = oBono.PrecioSucioCompra
+                '.Add("@ValTransC", SqlDbType.Float).Value = oBono.ValorTransadoCompra
+                '.Add("@MontoPagarC", SqlDbType.Float).Value = oBono.MontoAPagarCompra
+                .Add("@CostoTransC", SqlDbType.Float).Value = oBono.CostoDeTransferenciaCompra
+
+                .Add("@PeriodicV", SqlDbType.Float).Value = oBono.PeriodicidadVenta
+                .Add("@ValNomV", SqlDbType.Float).Value = oBono.ValorNominalVenta
+                .Add("@UltFCupV", SqlDbType.Date).Value = oBono.UltimaFechaCuponVenta
+                .Add("@SigFCupV", SqlDbType.Date).Value = oBono.SiguienteFechaCuponVenta
+                .Add("@FLiqV", SqlDbType.Date).Value = oBono.FechaLiquidacionVenta
+                .Add("@FVencV", SqlDbType.Date).Value = oBono.FechaVencimientoVenta
+                .Add("@PorcCupV", SqlDbType.Float).Value = oBono.PorcentajeCuponVenta
+                '.Add("@YTMVencComV", SqlDbType.Float).Value = oBono.YTMAlVencimientoComisionVenta
+                .Add("@YTMVencV", SqlDbType.Float).Value = oBono.YTMAlVencimientoVenta
+                .Add("@PrecVencV", SqlDbType.Float).Value = oBono.PrecioAlVencimientoVenta
+                .Add("@PrecioVenta", SqlDbType.Float).Value = oBono.PrecioVenta
+                .Add("@DiasBaseV", SqlDbType.Int).Value = oBono.DiasBaseVenta
+                '.Add("@DiasAcumV", SqlDbType.Int).Value = oBono.DiasAcumuladosVenta
+                '.Add("@DiasVencV", SqlDbType.Int).Value = oBono.DiasAlVencimientoVenta
+                '.Add("@PorcIntAcumV", SqlDbType.Float).Value = oBono.PorcentajeInteresAcumuladoVenta
+                '.Add("@IntAcumV", SqlDbType.Float).Value = oBono.InteresAcumuladoVenta
+                '.Add("@PrecioSucioV", SqlDbType.Float).Value = oBono.PrecioSucioVenta
+                '.Add("@ValTransV", SqlDbType.Float).Value = oBono.ValorTransadoVenta
+                '.Add("@MontoPagarV", SqlDbType.Float).Value = oBono.MontoARecibirVenta
+                .Add("@CostoTransV", SqlDbType.Float).Value = oBono.CostoDeTransferenciaVenta
+
+                '.Add("@ValNomRO", SqlDbType.Float).Value = oBono.ValorNominalRO
+                '.Add("@PlazoRO", SqlDbType.Float).Value = oBono.DiasPlazoRO
+                '.Add("@PrecioCompraRO", SqlDbType.Float).Value = oBono.PrecioCompraRO
+                '.Add("@PrecioVentaRO", SqlDbType.Float).Value = oBono.PrecioVentaRO
+                '.Add("@GanPerdCap", SqlDbType.Float).Value = oBono.GananciaPerdidaDeCapital
+                '.Add("@IngrPorInt", SqlDbType.Float).Value = oBono.IngresoPorInteres
+                '.Add("@CostosTotales", SqlDbType.Float).Value = oBono.CostosTotales
+                '.Add("@GanPerdTot", SqlDbType.Float).Value = oBono.GananciaPerdidaTotal
+                '.Add("@RendGanPerd", SqlDbType.Float).Value = oBono.RendimientoGananciaPerdida
+                '.Add("@RendInt", SqlDbType.Float).Value = oBono.RendimientoDeIntereses
+                '.Add("@RendAntISR", SqlDbType.Float).Value = oBono.RendimientoAntesImpuestos
+                '.Add("@RendDespISR", SqlDbType.Float).Value = oBono.RendimientoDespuesImpuestos
+            End With
+
+
+            cmd.Connection = cn
+
+            Try
+                retorno = cmd.ExecuteNonQuery
+            Catch ex As Exception
+                retorno = 0
+            End Try
+
+        Else
+            'NO VIENE OBJETO BONO
+            retorno = 0
+        End If
+
+
+
+        cn.Close()
+        Return retorno
+    End Function
+    Function Nuevo(ByVal oBono As BonosCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim Tabla As String = ""
+
+
+        If Tipo = "P" Then
+            Tabla = "PBON"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IBON"
+        End If
+
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevoBono")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        query = "INSERT INTO [dbo].[PBON]
+           ([DocId]
+           ,[CodCasaC]
+           ,[ValNomC]
+           ,[UltFCupC]
+           ,[SigFCupC]
+           ,[FLiqC]
+           ,[FVencC]
+           ,[PorcCupC]
+           ,[YMTVencComC]
+           ,[YMTVencC]
+           ,[PrecVencC]
+           ,[PrecioCompra]
+           ,[DiasBaseC]
+           ,[DiasAcumC]
+           ,[DiasVencC]
+           ,[PorcIntAcumC]
+           ,[IntAcumC]
+           ,[PrecioSucioC]
+           ,[ValTransC]
+           ,[MontoPagarC]
+           ,[CostoTransC]
+           ,[CodCasaV]
+           ,[ValNomV]
+           ,[UltFCupV]
+           ,[SigFCupV]
+           ,[FLiqV]
+           ,[FVencV]
+           ,[PorcCupV]
+           ,[YMTVencComV]
+           ,[YMTVencV]
+           ,[PrecVencV]
+           ,[PrecioVenta]
+           ,[DiasBaseV]
+           ,[DiasAcumV]
+           ,[DiasVencV]
+           ,[PorcIntAcumV]
+           ,[IntAcumV]
+           ,[PrecioSucioV]
+           ,[ValTransV]
+           ,[MontoPagarV]
+           ,[CostoTransV]
+           ,[ValNomRO]
+           ,[PlazoRO]
+           ,[PrecioCompraRO]
+           ,[PrecioVentaRO]
+           ,[GanPerdCap]
+           ,[IngrPorInt]
+           ,[CostosTotales]
+           ,[GanPerdTot]
+           ,[RendGanPerd]
+           ,[RendInt]
+           ,[RendAntISR]
+           ,[RendDespISR])
+     VALUES
+           (@DocId
+           ,@CodCasaC
+           ,@ValNomC
+           ,@UltFCupC
+           ,@SigFCupC
+           ,@FLiqC
+           ,@FVencC
+           ,@PorcCupC
+           ,@YMTVencComC
+           ,@YMTVencC
+           ,@PrecVencC
+           ,@PrecioCompra
+           ,@DiasBaseC
+           ,@DiasAcumC
+           ,@DiasVencC
+           ,@PorcIntAcumC
+           ,@IntAcumC
+           ,@PrecioSucioC
+           ,@ValTransC
+           ,@MontoPagarC
+           ,@CostoTransC
+           ,@CodCasaV
+           ,@ValNomV
+           ,@UltFCupV
+           ,@SigFCupV
+           ,@FLiqV
+           ,@FVencV
+           ,@PorcCupV
+           ,@YMTVencComV
+           ,@YMTVencV
+           ,@PrecVencV
+           ,@PrecioVenta
+           ,@DiasBaseV
+           ,@DiasAcumV
+           ,@DiasVencV
+           ,@PorcIntAcumV
+           ,@IntAcumV
+           ,@PrecioSucioV
+           ,@ValTransV
+           ,@MontoPagarV
+           ,@CostoTransV
+           ,@ValNomRO
+           ,@PlazoRO
+           ,@PrecioCompraRO
+           ,@PrecioVentaRO
+           ,@GanPerdCap
+           ,@IngrPorInt
+           ,@CostosTotales
+           ,@GanPerdTot
+           ,@RendGanPerd
+           ,@RendInt
+           ,@RendAntISR
+           ,@RendDespISR
+		   )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            '.Add("@CodCasaC", SqlDbType.VarChar).Value = oBono.CodigoCasaCompra
+            .Add("@ValNomC", SqlDbType.Decimal).Value = oBono.ValorNominalCompra
+            .Add("@UltFCupC", SqlDbType.DateTime).Value = oBono.UltimaFechaCuponCompra
+            .Add("@SigFCupC", SqlDbType.DateTime).Value = oBono.SiguienteFechaCuponCompra
+            .Add("@FLiqC", SqlDbType.DateTime).Value = oBono.FechaLiquidacionCompra
+            .Add("@FVencC", SqlDbType.DateTime).Value = oBono.FechaVencimientoCompra
+            .Add("@PorcCupC", SqlDbType.Decimal).Value = oBono.PorcentajeCuponCompra
+            .Add("@YMTVencComC", SqlDbType.Decimal).Value = oBono.YTMAlVencimientoComisionCompra
+            .Add("@YMTVencC", SqlDbType.Decimal).Value = oBono.YTMAlVencimientoCompra
+            .Add("@PrecVencC", SqlDbType.Decimal).Value = oBono.PrecioAlVencimientoCompra
+            .Add("@PrecioCompra", SqlDbType.Decimal).Value = oBono.PrecioCompra
+            .Add("@DiasBaseC", SqlDbType.Int).Value = oBono.DiasBaseCompra
+            .Add("@DiasAcumC", SqlDbType.Int).Value = oBono.DiasAcumuladosCompra
+            .Add("@DiasVencC", SqlDbType.Int).Value = oBono.DiasAlVencimientoCompra
+            .Add("@PorcIntAcumC", SqlDbType.Decimal).Value = oBono.PorcentajeInteresAcumuladoCompra
+            .Add("@IntAcumC", SqlDbType.Decimal).Value = oBono.InteresAcumuladoCompra
+            .Add("@PrecioSucioC", SqlDbType.Decimal).Value = oBono.PrecioSucioCompra
+            .Add("@ValTransC", SqlDbType.Decimal).Value = oBono.ValorTransadoCompra
+            .Add("@MontoPagarC", SqlDbType.Decimal).Value = oBono.MontoAPagarCompra
+            .Add("@CostoTransC", SqlDbType.Decimal).Value = oBono.CostoDeTransferenciaCompra
+
+            '.Add("@CodCasaV", SqlDbType.VarChar).Value = oBono.CodigoCasaVenta
+            .Add("@ValNomV", SqlDbType.Decimal).Value = oBono.ValorNominalVenta
+            .Add("@UltFCupV", SqlDbType.DateTime).Value = oBono.UltimaFechaCuponVenta
+            .Add("@SigFCupV", SqlDbType.DateTime).Value = oBono.SiguienteFechaCuponVenta
+            .Add("@FLiqV", SqlDbType.DateTime).Value = oBono.FechaLiquidacionVenta
+            .Add("@FVencV", SqlDbType.DateTime).Value = oBono.FechaVencimientoVenta
+            .Add("@PorcCupV", SqlDbType.Decimal).Value = oBono.PorcentajeCuponVenta
+            .Add("@YMTVencComV", SqlDbType.Decimal).Value = oBono.YTMAlVencimientoComisionVenta
+            .Add("@YMTVencV", SqlDbType.Decimal).Value = oBono.YTMAlVencimientoVenta
+            .Add("@PrecVencV", SqlDbType.Decimal).Value = oBono.PrecioAlVencimientoVenta
+            .Add("@PrecioVenta", SqlDbType.Decimal).Value = oBono.PrecioVenta
+            .Add("@DiasBaseV", SqlDbType.Int).Value = oBono.DiasBaseVenta
+            .Add("@DiasAcumV", SqlDbType.Int).Value = oBono.DiasAcumuladosVenta
+            .Add("@DiasVencV", SqlDbType.Int).Value = oBono.DiasAlVencimientoVenta
+            .Add("@PorcIntAcumV", SqlDbType.Decimal).Value = oBono.InteresAcumuladoPorcentajeVenta
+            .Add("@IntAcumV", SqlDbType.Decimal).Value = oBono.InteresAcumuladoVenta
+            .Add("@PrecioSucioV", SqlDbType.Decimal).Value = oBono.PrecioSucioVenta
+            .Add("@ValTransV", SqlDbType.Decimal).Value = oBono.ValorTransadoVenta
+            .Add("@MontoPagarV", SqlDbType.Decimal).Value = oBono.MontoARecibirVenta
+            .Add("@CostoTransV", SqlDbType.Decimal).Value = oBono.CostoDeTransferenciaVenta
+            .Add("@ValNomRO", SqlDbType.Decimal).Value = oBono.ValorNominalRO
+            .Add("@PlazoRO", SqlDbType.Decimal).Value = oBono.DiasPlazoRO
+            .Add("@PrecioCompraRO", SqlDbType.Decimal).Value = oBono.PrecioCompraRO
+            .Add("@PrecioVentaRO", SqlDbType.Decimal).Value = oBono.PrecioVentaRO
+            .Add("@GanPerdCap", SqlDbType.Decimal).Value = oBono.GananciaPerdidaDeCapital
+            .Add("@IngrPorInt", SqlDbType.Decimal).Value = oBono.IngresoPorInteres
+            .Add("@CostosTotales", SqlDbType.Decimal).Value = oBono.CostosTotales
+            .Add("@GanPerdTot", SqlDbType.Decimal).Value = oBono.GananciaPerdidaTotal
+            .Add("@RendGanPerd", SqlDbType.Decimal).Value = oBono.RendimientoGananciaPerdida
+            .Add("@RendInt", SqlDbType.Decimal).Value = oBono.RendimientoDeIntereses
+            .Add("@RendAntISR", SqlDbType.Decimal).Value = oBono.RendimientoAntesImpuestos
+            .Add("@RendDespISR", SqlDbType.Decimal).Value = oBono.RendimientoDespuesImpuestos
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar Bono : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+        Return retorno
+    End Function
+    Public Sub CargarRegistro(ByVal oBonos As BonosCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PBON"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IBON"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                'oBonos.CodigoCasaCompra = drd.Item("CodCasaC")
+                oBonos.ValorNominalCompra = drd.Item("ValNomC")
+                oBonos.UltimaFechaCuponCompra = drd.Item("UltFCupC")
+                oBonos.SiguienteFechaCuponCompra = drd.Item("SigFCupC")
+                oBonos.FechaLiquidacionCompra = drd.Item("FLiqC")
+                oBonos.FechaVencimientoCompra = drd.Item("FVencC")
+                oBonos.PorcentajeCuponCompra = drd.Item("PorcCupC")
+                'oBonos.YTMAlVencimientoComisionCompra = drd.Item("YTMVencComC")
+                'oBonos.YTMAlVencimientoCompra = drd.Item("YTMVencC")
+                oBonos.PrecioAlVencimientoCompra = drd.Item("PrecVencC")
+                oBonos.PrecioCompra = drd.Item("PrecioCompra")
+                oBonos.DiasBaseCompra = drd.Item("DiasBaseC")
+                'oBonos.DiasAcumuladosCompra = drd.Item("DiasAcumC")
+                'oBonos.DiasAlVencimientoCompra = drd.Item("DiasVencC")
+                'oBonos.PorcentajeInteresAcumuladoCompra = drd.Item("PorcIntAcumC")
+                'oBonos.InteresAcumuladoCompra = drd.Item("IntAcumC")
+                'oBonos.PrecioSucioCompra = drd.Item("PrecioSucioC")
+                'oBonos.ValorTransadoCompra = drd.Item("ValTransC")
+                'oBonos.MontoAPagarCompra = drd.Item("MontoPagarC")
+                oBonos.CostoDeTransferenciaCompra = drd.Item("CostoTransC")
+
+                'oBonos.CodigoCasaVenta = drd.Item("CodCasaV")
+                oBonos.ValorNominalVenta = drd.Item("ValNomV")
+                oBonos.UltimaFechaCuponVenta = drd.Item("UltFCupV")
+                oBonos.SiguienteFechaCuponVenta = drd.Item("SigFCupV")
+                oBonos.FechaLiquidacionVenta = drd.Item("FLiqV")
+                oBonos.FechaVencimientoVenta = drd.Item("FVencV")
+                oBonos.PorcentajeCuponVenta = drd.Item("PorcCupV")
+                'oBonos.YTMAlVencimientoComisionVenta = drd.Item("YTMVencComV")
+                'oBonos.YTMAlVencimientoVenta = drd.Item("YTMVencV")
+                oBonos.PrecioAlVencimientoVenta = drd.Item("PrecVencV")
+                oBonos.PrecioVenta = drd.Item("PrecioVenta")
+                oBonos.DiasBaseVenta = drd.Item("DiasBaseV")
+                'oBonos.DiasAcumuladosVenta = drd.Item("DiasAcumV")
+                'oBonos.DiasAlVencimientoVenta = drd.Item("DiasVencV")
+                'oBonos.PorcentajeInteresAcumuladoVenta = drd.Item("PorcIntAcumV")
+                'oBonos.InteresAcumuladoVenta = drd.Item("IntAcumV")
+                'oBonos.PrecioSucioVenta = drd.Item("PrecioSucioV")
+                'oBonos.ValorTransadoVenta = drd.Item("ValTransV")
+                'oBonos.MontoAPagarVenta = drd.Item("MontoPagarV")
+                oBonos.CostoDeTransferenciaVenta = drd.Item("CostoTransV")
+
+                'oBonos.ValorNominalRO = drd.Item("ValNomRO")
+                'oBonos.PlazoRO = drd.Item("PlazoRO")
+                'oBonos.PrecioCompraRO = drd.Item("PrecioCompraRO")
+                'oBonos.PrecioVentaRO = drd.Item("PrecioVentaRO")
+                'oBonos.GananciaPerdidaDeCapital = drd.Item("GanPerdCap")
+                'oBonos.IngresoPorInteres = drd.Item("IngrPorInt")
+                'oBonos.CostosTotales = drd.Item("CostosTotales")
+                'oBonos.GananciaPerdidaTotal = drd.Item("GanPerdTot")
+                'oBonos.RendimientoGananciaPerdida = drd.Item("RendGanPerd")
+                'oBonos.RendimientoDeIntereses = drd.Item("RendInt")
+                'oBonos.RendimientoAntesImpuestos = drd.Item("RendAntISR")
+                'oBonos.RendimientoDespuesImpuestos = drd.Item("RendDespISR")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+    End Sub
+    Public Function CargarRegistro(ByVal CodigoInversion As String) As BonosCE
+        Dim objCon As New Conexion
+        Dim oBonos As BonosCE
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "SELECT * FROM [dbo].[BON0] T0 WHERE T0.CodInv=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            oBonos = New BonosCE
+            If drd.Read Then
+                'oBonos.CodigoCasaCompra = drd.Item("CodCasaC")
+                oBonos.PeriodicidadCompra = drd.Item("PeriodicV")
+                oBonos.ValorNominalCompra = drd.Item("ValNomC")
+                oBonos.UltimaFechaCuponCompra = drd.Item("UltFCupC")
+                oBonos.SiguienteFechaCuponCompra = drd.Item("SigFCupC")
+                oBonos.FechaLiquidacionCompra = drd.Item("FLiqC")
+                oBonos.FechaVencimientoCompra = drd.Item("FVencC")
+                oBonos.PorcentajeCuponCompra = drd.Item("PorcCupC")
+                'oBonos.YTMAlVencimientoComisionCompra = drd.Item("YTMVencComC")
+                'oBonos.YTMAlVencimientoCompra = drd.Item("YTMVencC")
+                oBonos.PrecioAlVencimientoCompra = drd.Item("PrecVencC")
+                oBonos.PrecioCompra = drd.Item("PrecioCompra")
+                oBonos.DiasBaseCompra = drd.Item("DiasBaseC")
+                'oBonos.DiasAcumuladosCompra = drd.Item("DiasAcumC")
+                'oBonos.DiasAlVencimientoCompra = drd.Item("DiasVencC")
+                'oBonos.PorcentajeInteresAcumuladoCompra = drd.Item("PorcIntAcumC")
+                'oBonos.InteresAcumuladoCompra = drd.Item("IntAcumC")
+                'oBonos.PrecioSucioCompra = drd.Item("PrecioSucioC")
+                'oBonos.ValorTransadoCompra = drd.Item("ValTransC")
+                'oBonos.MontoAPagarCompra = drd.Item("MontoPagarC")
+                oBonos.CostoDeTransferenciaCompra = drd.Item("CostoTransC")
+
+                'oBonos.CodigoCasaVenta = drd.Item("CodCasaV")
+                oBonos.PeriodicidadVenta = drd.Item("PeriodicV")
+                oBonos.ValorNominalVenta = drd.Item("ValNomV")
+                oBonos.UltimaFechaCuponVenta = drd.Item("UltFCupV")
+                oBonos.SiguienteFechaCuponVenta = drd.Item("SigFCupV")
+                oBonos.FechaLiquidacionVenta = drd.Item("FLiqV")
+                oBonos.FechaVencimientoVenta = drd.Item("FVencV")
+                oBonos.PorcentajeCuponVenta = drd.Item("PorcCupV")
+                'oBonos.YTMAlVencimientoComisionVenta = drd.Item("YTMVencComV")
+                'oBonos.YTMAlVencimientoVenta = drd.Item("YTMVencV")
+                oBonos.PrecioAlVencimientoVenta = drd.Item("PrecVencV")
+                oBonos.PrecioVenta = drd.Item("PrecioVenta")
+                oBonos.DiasBaseVenta = drd.Item("DiasBaseV")
+                'oBonos.DiasAcumuladosVenta = drd.Item("DiasAcumV")
+                'oBonos.DiasAlVencimientoVenta = drd.Item("DiasVencV")
+                'oBonos.PorcentajeInteresAcumuladoVenta = drd.Item("PorcIntAcumV")
+                'oBonos.InteresAcumuladoVenta = drd.Item("IntAcumV")
+                'oBonos.PrecioSucioVenta = drd.Item("PrecioSucioV")
+                'oBonos.ValorTransadoVenta = drd.Item("ValTransV")
+                'oBonos.MontoAPagarVenta = drd.Item("MontoPagarV")
+                oBonos.CostoDeTransferenciaVenta = drd.Item("CostoTransV")
+
+                'oBonos.ValorNominalRO = drd.Item("ValNomRO")
+                'oBonos.PlazoRO = drd.Item("PlazoRO")
+                'oBonos.PrecioCompraRO = drd.Item("PrecioCompraRO")
+                'oBonos.PrecioVentaRO = drd.Item("PrecioVentaRO")
+                'oBonos.GananciaPerdidaDeCapital = drd.Item("GanPerdCap")
+                'oBonos.IngresoPorInteres = drd.Item("IngrPorInt")
+                'oBonos.CostosTotales = drd.Item("CostosTotales")
+                'oBonos.GananciaPerdidaTotal = drd.Item("GanPerdTot")
+                'oBonos.RendimientoGananciaPerdida = drd.Item("RendGanPerd")
+                'oBonos.RendimientoDeIntereses = drd.Item("RendInt")
+                'oBonos.RendimientoAntesImpuestos = drd.Item("RendAntISR")
+                'oBonos.RendimientoDespuesImpuestos = drd.Item("RendDespISR")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return oBonos
+    End Function
+    Public Function Actualizar(ByVal oBonosCE As BonosCE) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[BON0]
+   SET [PeriodicC] = @PeriodicC
+      ,[ValNomC] = @ValNomC
+      ,[UltFCupC] = @UltFCupC
+      ,[SigFCupC] = @SigFCupC
+      ,[FLiqC] = @FLiqC
+      ,[FVencC] = @FVencC
+      ,[PorcCupC] = @PorcCupC
+      ,[YTMVencComC] = @YTMVencComC 
+      ,[PrecVencC] = @PrecVencC
+      ,[PrecioCompra] = @PrecioCompra
+      ,[DiasBaseC] = @DiasBaseC
+      ,[CostoTransC] = @CostoTransC
+      
+	  ,[PeriodicV] = @PeriodicV
+      ,[ValNomV] = @ValNomV
+      ,[UltFCupV] = @UltFCupV
+      ,[SigFCupV] = @SigFCupV
+      ,[FLiqV] = @FLiqV
+      ,[FVencV] = @FVencV
+      ,[PorcCupV] = @PorcCupV
+      ,[YTMVencComV] = @YTMVencComV
+      ,[DiasBaseV] = @DiasBaseV
+      ,[CostoTransV] = @CostoTransV
+ WHERE [CodInv] = @CodInv
+"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        With cmd.Parameters
+            .Add("@PeriodicC", SqlDbType.VarChar).Value = oBonosCE.PeriodicidadCompra
+            .Add("@ValNomC", SqlDbType.Float).Value = oBonosCE.ValorNominalCompra
+            .Add("@UltFCupC", SqlDbType.Date).Value = oBonosCE.UltimaFechaCuponCompra
+            .Add("@SigFCupC", SqlDbType.Date).Value = oBonosCE.SiguienteFechaCuponCompra
+            .Add("@FLiqC", SqlDbType.Date).Value = oBonosCE.FechaLiquidacionCompra
+            .Add("@FVencC", SqlDbType.Date).Value = oBonosCE.FechaVencimientoCompra
+            .Add("@PorcCupC", SqlDbType.Float).Value = oBonosCE.PorcentajeCuponCompra
+            .Add("@YTMVencComC", SqlDbType.Float).Value = oBonosCE.YTMAlVencimientoComisionCompra
+            .Add("@PrecVencC", SqlDbType.Float).Value = oBonosCE.PrecioAlVencimientoCompra
+            .Add("@PrecioCompra", SqlDbType.Float).Value = oBonosCE.PrecioCompra
+            .Add("@DiasBaseC", SqlDbType.Int).Value = oBonosCE.DiasBaseCompra
+            .Add("@CostoTransC", SqlDbType.Float).Value = oBonosCE.CostoDeTransferenciaCompra
+
+            .Add("@PeriodicV", SqlDbType.VarChar).Value = oBonosCE.PeriodicidadVenta
+            .Add("@ValNomV", SqlDbType.Float).Value = oBonosCE.ValorNominalVenta
+            .Add("@UltFCupV", SqlDbType.Date).Value = oBonosCE.UltimaFechaCuponVenta
+            .Add("@SigFCupV", SqlDbType.Date).Value = oBonosCE.SiguienteFechaCuponVenta
+            .Add("@FLiqV", SqlDbType.Date).Value = oBonosCE.FechaLiquidacionVenta
+            .Add("@FVencV", SqlDbType.Date).Value = oBonosCE.FechaVencimientoVenta
+            .Add("@PorcCupV", SqlDbType.Float).Value = oBonosCE.PorcentajeCuponVenta
+            .Add("@YTMVencComV", SqlDbType.Float).Value = oBonosCE.YTMAlVencimientoComisionVenta
+            .Add("@DiasBaseV", SqlDbType.Int).Value = oBonosCE.DiasBaseVenta
+            .Add("@CostoTransV", SqlDbType.Float).Value = oBonosCE.CostoDeTransferenciaVenta
+            .Add("@CodInv", SqlDbType.VarChar).Value = oBonosCE.CodigoInversion
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        GuardarIngresos(oBonosCE.CodigoInversion, oBonosCE.ImpuestosYComisiones)
+        Me.GuardarImpuestosYComisiones(oBonosCE.CodigoInversion, oBonosCE.ImpuestosYComisiones)
+        cn.Close()
+        Return retorno
+    End Function
+    Private Sub GuardarIngresos(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[BON1]
+      WHERE [CodInv]=@CodInv"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[BON1]
+    ([CodInv]
+    ,[NumCupon]
+    ,[FechaCupon]
+    ,[Dias]
+    ,[Ingreso]
+    ,[PorcImpuesto]
+    ,[MontoImpuesto]
+    ,[Liquido]
+)
+VALUES
+    (@CodInv
+    ,@NumCupon
+    ,@FechaCupon
+    ,@Dias
+    ,@Ingreso
+    ,@PorcImpuesto
+    ,@MontoImpuesto
+    ,@Liquido
+)
+"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@NumCupon", dr("NumCupon"))
+                cmd.Parameters.AddWithValue("@FechaCupon", dr("FechaCupon"))
+                cmd.Parameters.AddWithValue("@Dias", dr("Dias"))
+                cmd.Parameters.AddWithValue("@Ingreso", dr("Ingreso"))
+                cmd.Parameters.AddWithValue("@PorcImpuesto", dr("PorcImpuesto"))
+                cmd.Parameters.AddWithValue("@MontoImpuesto", dr("MontoImpuesto"))
+                cmd.Parameters.AddWithValue("@Liquido", dr("MontoImpuesto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+
+            Next
+        End If
+        cn.Close()
+    End Sub
+    Private Sub GuardarImpuestosYComisiones(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[BON2]
+      WHERE [CodInv]=@CodInv"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[BON2]
+           ([CodInv]
+           ,[TipoOper]
+           ,[CodImp]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[MontoSujeto])
+     VALUES
+           (@CodInv
+           ,@TipoOper
+           ,@CodImp
+           ,@PorcImp
+           ,@MontoImp
+           ,@MontoSujeto)"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@TipoOper", dr("TipoOper"))
+                cmd.Parameters.AddWithValue("@CodImp", dr("CodImp"))
+                cmd.Parameters.AddWithValue("@PorcImp", dr("PorcImp"))
+                cmd.Parameters.AddWithValue("@MontoImp", dr("MontoImp"))
+                cmd.Parameters.AddWithValue("@MontoSujeto", dr("MontoSujeto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+        cn.Close()
+    End Sub
+
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevoImpuesto(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[IMP](
+           [CodInv]
+           ,[TipoImp]
+           ,[TipoOp]
+           ,[PorcImp]           
+           ,[MontoSuje]
+           ,[MontoImp]
+) VALUES(
+           @CodInv
+           ,@TipoImp
+           ,@TipoOp
+           ,@PorcImp
+           ,@MontoSuje
+           ,@MontoImp
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@TipoImp", SqlDbType.VarChar).Value = Coleccion(1)
+            .Add("@TipoOp", SqlDbType.VarChar).Value = Coleccion(2)
+            .Add("@PorcImp", SqlDbType.Float).Value = Coleccion(3)
+            .Add("@MontoSuje", SqlDbType.Float).Value = Coleccion(4)
+            .Add("@MontoImp", SqlDbType.Float).Value = Coleccion(5)
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+    Public Function NuevoIngreso(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal InstrumentoFinanciero As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (InstrumentoFinanciero = "CINV") Then
+            Tabla = "CIN1"
+
+
+        ElseIf (InstrumentoFinanciero = "BONO") Then
+            Tabla = "BON1"
+
+        ElseIf (InstrumentoFinanciero = "EURB") Then
+            Tabla = "EURB1"
+        ElseIf (InstrumentoFinanciero = "TIT") Then
+            Tabla = "TIT0_0"
+        Else
+            Return 0
+
+        End If
+
+
+
+
+
+        sql = "INSERT INTO " + Tabla + "(
+           [CodInv]
+           ,[NumCupon]
+           ,[FechaCupon]
+           ,[Dias]
+           ,[Ingreso]
+           ,[PorcImpuesto]
+           ,[MontoImpuesto]
+           ,[Liquido]
+) VALUES(
+           @CodInv
+           ,@NumCupon
+           ,@FechaCupon
+           ,@Dias
+           ,@Ingreso
+           ,@PorcImpuesto
+           ,@MontoImpuesto
+           ,@Liquido
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        Try
+
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@NumCupon", SqlDbType.VarChar).Value = Coleccion(1)
+                .Add("@FechaCupon", SqlDbType.DateTime).Value = Coleccion(2)
+
+
+
+
+
+                .Add("@Dias", SqlDbType.Int).Value = Coleccion(3)
+                .Add("@Ingreso", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@PorcImpuesto", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@MontoImpuesto", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@Liquido", SqlDbType.Float).Value = Coleccion(7)
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+
+        Catch ex As Exception
+            MsgBox("Datos de ingreso no guardados")
+            Return Nothing
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+
+
+    Public Function ModificarIngreso(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal CodigoInstrumento As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN1"
+
+
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON1"
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB1"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT0_0"
+        Else
+            Return 0
+
+        End If
+
+        sql = "UPDATE " + Tabla + " SET
+           [FechaCupon]=@FechaCupon
+           ,[Dias]=@Dias
+           ,[Ingreso]=@Ingreso
+           ,[PorcImpuesto]=@PorcImpuesto
+           ,[MontoImpuesto]=@MontoImpuesto
+           ,[Liquido]=@Liquido
+           where [CodInv]=@CodInv AND [NumCupon]=@NumCupon
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@NumCupon", SqlDbType.VarChar).Value = Coleccion(1)
+            .Add("@FechaCupon", SqlDbType.DateTime).Value = Coleccion(2)
+
+
+
+            .Add("@Dias", SqlDbType.Int).Value = Coleccion(3)
+            .Add("@Ingreso", SqlDbType.Float).Value = Coleccion(4)
+            .Add("@PorcImpuesto", SqlDbType.Float).Value = Coleccion(5)
+            .Add("@MontoImpuesto", SqlDbType.Float).Value = Coleccion(6)
+            .Add("@Liquido", SqlDbType.Float).Value = Coleccion(7)
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+    Public Sub EliminarImpuesto(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[IMP]
+      WHERE [CodInv]=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+    Public Sub EliminarIngreso(ByVal Codigo As String, ByVal NoCupon As Integer, ByVal CodigoInstrumento As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN1"
+
+
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON1"
+
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT0_0"
+
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB1"
+
+
+        End If
+
+        sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv AND [NumCupon]=@NumCupon"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@NumCupon", SqlDbType.Int).Value = NoCupon
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+    Public Sub EliminarIngresoCompleto(ByVal Codigo As String, ByVal CodigoInstrumento As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN1"
+
+
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON1"
+
+
+        End If
+
+        sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv "
+
+        Try
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            cmd.Connection = cn
+
+            res = cmd.ExecuteNonQuery
+        Catch ex As Exception
+            MsgBox("Datos no actualizados")
+        End Try
+        cn.Close()
+    End Sub
+
+
+
+    Public Function CargarImpuestos(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from IMP where CodInv='" + codigo + "'"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+    Public Function CargarIngreso(ByVal codigo As String, ByVal CodigoInstrumento As String)
+        Dim objCon As New Conexion
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN1"
+
+
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON1"
+
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB1"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT0_0"
+
+        Else
+            Return 0
+
+        End If
+
+        Dim sql = "select * from " + Tabla + " where CodInv='" + codigo + "' order by NumCupon"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+End Class
+
+
+
+
+
+

+ 27 - 0
DAO/CambiarEstArbDAO.vb

@@ -0,0 +1,27 @@
+Imports System.Data.SqlClient
+
+Public Class CambiarEstArbDAO
+
+
+
+    Public Function CambiatEstArb(ByVal CodigoTitulo As String, ByVal Estado As String, ByRef cn As Object, ByRef Transaccion As Object) As String
+        Dim objCon As New Conexion
+        Dim Respuesta As String = String.Empty
+
+
+
+        Dim sql = "[dbo].[SP_CambiarEstArb]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = CodigoTitulo
+        cmd.Parameters.Add("@Estado", SqlDbType.VarChar).Value = Estado
+        cmd.Transaction = Transaccion
+        Respuesta = cmd.ExecuteScalar
+        If Respuesta Is Nothing Then
+            Respuesta = "Error"
+        End If
+        Return Respuesta
+    End Function
+End Class

+ 275 - 0
DAO/CargarElementosDAO.vb

@@ -0,0 +1,275 @@
+Imports System.Data.SqlClient
+
+Public Class CargarElementosDAO
+
+
+
+
+
+    Public Function ListaEstado()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaEstadoInversion", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+    Public Function ListaCasasCorredoras()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaCasasCorredoras", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+
+
+    Public Function ListaTipoRenta()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaTipoRenta", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+
+
+    Public Function ListaTipoTasa()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaTipoTasa", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+    Public Function ListaPeriodos()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaPeriodos", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+
+
+    Public Function ListaPlazosFactor()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaPlazosFactor", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+        Next
+
+        cn.Close()
+        Return diccionario
+    End Function
+
+    Public Function ListaTiposMercado()
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim da = New SqlDataAdapter("SP_ListaTiposMercado", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+
+
+        For Each row As DataRow In dt.Rows
+            diccionario.Add(row(0).ToString, row(1).ToString)
+
+        Next
+        cn.Close()
+        Return diccionario
+    End Function
+    Public Function CodEmpr()
+        Dim objCon As New Conexion
+
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SELECT * FROM [dbo].[EMPR]  "
+
+        If Not cn.State = ConnectionState.Open Then
+
+            cn.Open()
+        End If
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+
+        dr = cmd.ExecuteReader
+        If (diccionario.Count = 0) Then
+            While dr.Read
+                diccionario.Add(dr("CodEmpr"), dr("Descrip").ToString)
+
+
+            End While
+        End If
+
+        cn.Close()
+        Return diccionario
+    End Function
+
+    Public Function CodIF()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SELECT * FROM [dbo].[INFI]  "
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+    Public Function CodEmis()
+        Dim objCon As New Conexion
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SELECT * FROM [dbo].[EMIS]  "
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        If (diccionario.Count = 0) Then
+            While dr.Read
+                diccionario.Add(dr("CodEmis"), dr("Descrip").ToString)
+
+
+            End While
+        End If
+        cn.Close()
+        Return diccionario
+    End Function
+    Public Function CodECalRi()
+        Dim objCon As New Conexion
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SELECT * FROM [dbo].[ECALRI]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        While dr.Read
+            diccionario.Add(dr("CodECalRi").ToString, dr("Descrip").ToString)
+
+
+        End While
+        cn.Close()
+        cn.Close()
+        Return diccionario
+    End Function
+    Public Function CodPais()
+        Dim objCon As New Conexion
+        Dim diccionario As New Dictionary(Of String, String)
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SELECT * FROM [dbo].[PAIS]  "
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        While dr.Read
+            diccionario.Add(dr("CodPais"), dr("Descrip").ToString)
+
+
+        End While
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+End Class

+ 1305 - 0
DAO/CertificadosDeInversionDAO.vb

@@ -0,0 +1,1305 @@
+Imports System.Data.SqlClient
+Public Class CertificadosDeInversionDAO
+
+
+    Dim oDAOGeneral As New DAOGeneral
+
+    Private Function SiguienteCodigo(ByVal oCE As CertificadoDeInversionCE) As String
+        Dim retorno As String = String.Empty
+
+        retorno = SeriesDAO.SiguienteCodigoInversion(oCE.CodigoEmpresa, oCE.CodigoInstrumentoFinanciero)
+
+        Return retorno
+    End Function
+    Public Function Nuevo(ByVal oCE As CertificadoDeInversionCE) As Integer
+
+    End Function
+    Function Nuevo(ByVal oCE As CertificadoDeInversionCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim Tabla As String = ""
+
+
+        If Tipo = "P" Then
+            Tabla = "PBON"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IBON"
+        End If
+
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevoBono")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        query = "INSERT INTO [dbo].[PBON]
+           ([DocId]
+           ,[CodCasaC]
+           ,[ValNomC]
+           ,[UltFCupC]
+           ,[SigFCupC]
+           ,[FLiqC]
+           ,[FVencC]
+           ,[PorcCupC]
+           ,[YMTVencComC]
+           ,[YMTVencC]
+           ,[PrecVencC]
+           ,[PrecioCompra]
+           ,[DiasBaseC]
+           ,[DiasAcumC]
+           ,[DiasVencC]
+           ,[PorcIntAcumC]
+           ,[IntAcumC]
+           ,[PrecioSucioC]
+           ,[ValTransC]
+           ,[MontoPagarC]
+           ,[CostoTransC]
+           ,[CodCasaV]
+           ,[ValNomV]
+           ,[UltFCupV]
+           ,[SigFCupV]
+           ,[FLiqV]
+           ,[FVencV]
+           ,[PorcCupV]
+           ,[YMTVencComV]
+           ,[YMTVencV]
+           ,[PrecVencV]
+           ,[PrecioVenta]
+           ,[DiasBaseV]
+           ,[DiasAcumV]
+           ,[DiasVencV]
+           ,[PorcIntAcumV]
+           ,[IntAcumV]
+           ,[PrecioSucioV]
+           ,[ValTransV]
+           ,[MontoPagarV]
+           ,[CostoTransV]
+           ,[ValNomRO]
+           ,[PlazoRO]
+           ,[PrecioCompraRO]
+           ,[PrecioVentaRO]
+           ,[GanPerdCap]
+           ,[IngrPorInt]
+           ,[CostosTotales]
+           ,[GanPerdTot]
+           ,[RendGanPerd]
+           ,[RendInt]
+           ,[RendAntISR]
+           ,[RendDespISR])
+     VALUES
+           (@DocId
+           ,@CodCasaC
+           ,@ValNomC
+           ,@UltFCupC
+           ,@SigFCupC
+           ,@FLiqC
+           ,@FVencC
+           ,@PorcCupC
+           ,@YMTVencComC
+           ,@YMTVencC
+           ,@PrecVencC
+           ,@PrecioCompra
+           ,@DiasBaseC
+           ,@DiasAcumC
+           ,@DiasVencC
+           ,@PorcIntAcumC
+           ,@IntAcumC
+           ,@PrecioSucioC
+           ,@ValTransC
+           ,@MontoPagarC
+           ,@CostoTransC
+           ,@CodCasaV
+           ,@ValNomV
+           ,@UltFCupV
+           ,@SigFCupV
+           ,@FLiqV
+           ,@FVencV
+           ,@PorcCupV
+           ,@YMTVencComV
+           ,@YMTVencV
+           ,@PrecVencV
+           ,@PrecioVenta
+           ,@DiasBaseV
+           ,@DiasAcumV
+           ,@DiasVencV
+           ,@PorcIntAcumV
+           ,@IntAcumV
+           ,@PrecioSucioV
+           ,@ValTransV
+           ,@MontoPagarV
+           ,@CostoTransV
+           ,@ValNomRO
+           ,@PlazoRO
+           ,@PrecioCompraRO
+           ,@PrecioVentaRO
+           ,@GanPerdCap
+           ,@IngrPorInt
+           ,@CostosTotales
+           ,@GanPerdTot
+           ,@RendGanPerd
+           ,@RendInt
+           ,@RendAntISR
+           ,@RendDespISR
+		   )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            '.Add("@CodCasaC", SqlDbType.VarChar).Value = oBono.CodigoCasaCompra
+            .Add("@ValNomC", SqlDbType.Decimal).Value = oCE.ValorNominalCompra
+            .Add("@UltFCupC", SqlDbType.DateTime).Value = oCE.UltimaFechaCuponCompra
+            .Add("@SigFCupC", SqlDbType.DateTime).Value = oCE.SiguienteFechaCuponCompra
+            .Add("@FLiqC", SqlDbType.DateTime).Value = oCE.FechaLiquidacionCompra
+            .Add("@FVencC", SqlDbType.DateTime).Value = oCE.FechaVencimientoCompra
+            .Add("@PorcCupC", SqlDbType.Decimal).Value = oCE.PorcentajeCuponCompra
+            .Add("@YMTVencComC", SqlDbType.Decimal).Value = oCE.YTMAlVencimientoComisionCompra
+            .Add("@YMTVencC", SqlDbType.Decimal).Value = oCE.YTMAlVencimientoCompra
+            .Add("@PrecVencC", SqlDbType.Decimal).Value = oCE.PrecioAlVencimientoCompra
+            .Add("@PrecioCompra", SqlDbType.Decimal).Value = oCE.PrecioCompra
+            .Add("@DiasBaseC", SqlDbType.Int).Value = oCE.DiasBaseCompra
+            .Add("@DiasAcumC", SqlDbType.Int).Value = oCE.DiasAcumuladosCompra
+            .Add("@DiasVencC", SqlDbType.Int).Value = oCE.DiasAlVencimientoCompra
+            .Add("@PorcIntAcumC", SqlDbType.Decimal).Value = oCE.PorcentajeInteresAcumuladoCompra
+            .Add("@IntAcumC", SqlDbType.Decimal).Value = oCE.InteresAcumuladoCompra
+            .Add("@PrecioSucioC", SqlDbType.Decimal).Value = oCE.PrecioSucioCompra
+            .Add("@ValTransC", SqlDbType.Decimal).Value = oCE.ValorTransadoCompra
+            .Add("@MontoPagarC", SqlDbType.Decimal).Value = oCE.MontoAPagarCompra
+            .Add("@CostoTransC", SqlDbType.Decimal).Value = oCE.CostoDeTransferenciaCompra
+
+            '.Add("@CodCasaV", SqlDbType.VarChar).Value = oBono.CodigoCasaVenta
+            .Add("@ValNomV", SqlDbType.Decimal).Value = oCE.ValorNominalVenta
+            .Add("@UltFCupV", SqlDbType.DateTime).Value = oCE.UltimaFechaCuponVenta
+            .Add("@SigFCupV", SqlDbType.DateTime).Value = oCE.SiguienteFechaCuponVenta
+            .Add("@FLiqV", SqlDbType.DateTime).Value = oCE.FechaLiquidacionVenta
+            .Add("@FVencV", SqlDbType.DateTime).Value = oCE.FechaVencimientoVenta
+            .Add("@PorcCupV", SqlDbType.Decimal).Value = oCE.PorcentajeCuponVenta
+            .Add("@YMTVencComV", SqlDbType.Decimal).Value = oCE.YTMAlVencimientoComisionVenta
+            .Add("@YMTVencV", SqlDbType.Decimal).Value = oCE.YTMAlVencimientoVenta
+            .Add("@PrecVencV", SqlDbType.Decimal).Value = oCE.PrecioAlVencimientoVenta
+            .Add("@PrecioVenta", SqlDbType.Decimal).Value = oCE.PrecioVenta
+            .Add("@DiasBaseV", SqlDbType.Int).Value = oCE.DiasBaseVenta
+            .Add("@DiasAcumV", SqlDbType.Int).Value = oCE.DiasAcumuladosVenta
+            .Add("@DiasVencV", SqlDbType.Int).Value = oCE.DiasAlVencimientoVenta
+            .Add("@PorcIntAcumV", SqlDbType.Decimal).Value = oCE.InteresAcumuladoPorcentajeVenta
+            .Add("@IntAcumV", SqlDbType.Decimal).Value = oCE.InteresAcumuladoVenta
+            .Add("@PrecioSucioV", SqlDbType.Decimal).Value = oCE.PrecioSucioVenta
+            .Add("@ValTransV", SqlDbType.Decimal).Value = oCE.ValorTransadoVenta
+            .Add("@MontoPagarV", SqlDbType.Decimal).Value = oCE.MontoARecibirVenta
+            .Add("@CostoTransV", SqlDbType.Decimal).Value = oCE.CostoDeTransferenciaVenta
+            .Add("@ValNomRO", SqlDbType.Decimal).Value = oCE.ValorNominalRO
+            .Add("@PlazoRO", SqlDbType.Decimal).Value = oCE.DiasPlazoRO
+            .Add("@PrecioCompraRO", SqlDbType.Decimal).Value = oCE.PrecioCompraRO
+            .Add("@PrecioVentaRO", SqlDbType.Decimal).Value = oCE.PrecioVentaRO
+            .Add("@GanPerdCap", SqlDbType.Decimal).Value = oCE.GananciaPerdidaDeCapital
+            .Add("@IngrPorInt", SqlDbType.Decimal).Value = oCE.IngresoPorInteres
+            .Add("@CostosTotales", SqlDbType.Decimal).Value = oCE.CostosTotales
+            .Add("@GanPerdTot", SqlDbType.Decimal).Value = oCE.GananciaPerdidaTotal
+            .Add("@RendGanPerd", SqlDbType.Decimal).Value = oCE.RendimientoGananciaPerdida
+            .Add("@RendInt", SqlDbType.Decimal).Value = oCE.RendimientoDeIntereses
+            .Add("@RendAntISR", SqlDbType.Decimal).Value = oCE.RendimientoAntesImpuestos
+            .Add("@RendDespISR", SqlDbType.Decimal).Value = oCE.RendimientoDespuesImpuestos
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar Bono : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+        Return retorno
+    End Function
+    Public Sub CargarRegistro(ByVal oCE As CertificadoDeInversionCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PBON"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IBON"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                'oBonos.CodigoCasaCompra = drd.Item("CodCasaC")
+                oCE.ValorNominalCompra = drd.Item("ValNomC")
+                oCE.UltimaFechaCuponCompra = drd.Item("UltFCupC")
+                oCE.SiguienteFechaCuponCompra = drd.Item("SigFCupC")
+                oCE.FechaLiquidacionCompra = drd.Item("FLiqC")
+                oCE.FechaVencimientoCompra = drd.Item("FVencC")
+                oCE.PorcentajeCuponCompra = drd.Item("PorcCupC")
+                'oBonos.YTMAlVencimientoComisionCompra = drd.Item("YTMVencComC")
+                'oBonos.YTMAlVencimientoCompra = drd.Item("YTMVencC")
+                oCE.PrecioAlVencimientoCompra = drd.Item("PrecVencC")
+                oCE.PrecioCompra = drd.Item("PrecioCompra")
+                oCE.DiasBaseCompra = drd.Item("DiasBaseC")
+                'oBonos.DiasAcumuladosCompra = drd.Item("DiasAcumC")
+                'oBonos.DiasAlVencimientoCompra = drd.Item("DiasVencC")
+                'oBonos.PorcentajeInteresAcumuladoCompra = drd.Item("PorcIntAcumC")
+                'oBonos.InteresAcumuladoCompra = drd.Item("IntAcumC")
+                'oBonos.PrecioSucioCompra = drd.Item("PrecioSucioC")
+                'oBonos.ValorTransadoCompra = drd.Item("ValTransC")
+                'oBonos.MontoAPagarCompra = drd.Item("MontoPagarC")
+                oCE.CostoDeTransferenciaCompra = drd.Item("CostoTransC")
+
+                'oBonos.CodigoCasaVenta = drd.Item("CodCasaV")
+                oCE.ValorNominalVenta = drd.Item("ValNomV")
+                oCE.UltimaFechaCuponVenta = drd.Item("UltFCupV")
+                oCE.SiguienteFechaCuponVenta = drd.Item("SigFCupV")
+                oCE.FechaLiquidacionVenta = drd.Item("FLiqV")
+                oCE.FechaVencimientoVenta = drd.Item("FVencV")
+                oCE.PorcentajeCuponVenta = drd.Item("PorcCupV")
+                'oBonos.YTMAlVencimientoComisionVenta = drd.Item("YTMVencComV")
+                'oBonos.YTMAlVencimientoVenta = drd.Item("YTMVencV")
+                oCE.PrecioAlVencimientoVenta = drd.Item("PrecVencV")
+                oCE.PrecioVenta = drd.Item("PrecioVenta")
+                oCE.DiasBaseVenta = drd.Item("DiasBaseV")
+                'oBonos.DiasAcumuladosVenta = drd.Item("DiasAcumV")
+                'oBonos.DiasAlVencimientoVenta = drd.Item("DiasVencV")
+                'oBonos.PorcentajeInteresAcumuladoVenta = drd.Item("PorcIntAcumV")
+                'oBonos.InteresAcumuladoVenta = drd.Item("IntAcumV")
+                'oBonos.PrecioSucioVenta = drd.Item("PrecioSucioV")
+                'oBonos.ValorTransadoVenta = drd.Item("ValTransV")
+                'oBonos.MontoAPagarVenta = drd.Item("MontoPagarV")
+                oCE.CostoDeTransferenciaVenta = drd.Item("CostoTransV")
+
+                'oBonos.ValorNominalRO = drd.Item("ValNomRO")
+                'oBonos.PlazoRO = drd.Item("PlazoRO")
+                'oBonos.PrecioCompraRO = drd.Item("PrecioCompraRO")
+                'oBonos.PrecioVentaRO = drd.Item("PrecioVentaRO")
+                'oBonos.GananciaPerdidaDeCapital = drd.Item("GanPerdCap")
+                'oBonos.IngresoPorInteres = drd.Item("IngrPorInt")
+                'oBonos.CostosTotales = drd.Item("CostosTotales")
+                'oBonos.GananciaPerdidaTotal = drd.Item("GanPerdTot")
+                'oBonos.RendimientoGananciaPerdida = drd.Item("RendGanPerd")
+                'oBonos.RendimientoDeIntereses = drd.Item("RendInt")
+                'oBonos.RendimientoAntesImpuestos = drd.Item("RendAntISR")
+                'oBonos.RendimientoDespuesImpuestos = drd.Item("RendDespISR")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+    End Sub
+    Public Function CargarRegistro(ByVal CodigoInversion As String, ByVal CodigoInstrumento As String) As Collection
+        Dim objCon As New Conexion
+        Dim oCE As CertificadoDeInversionCE
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN0"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT"
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB0"
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON0"
+        Else
+            coleccion.Add(False)
+            Return coleccion
+        End If
+
+
+
+
+        sql = "SELECT * FROM " + Tabla + "  WHERE CodInv=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+        cmd.Connection = cn
+
+        Try
+
+            drd = cmd.ExecuteReader
+
+
+
+        Catch ex As Exception
+
+
+            coleccion.Add(False)
+            Return coleccion
+        End Try
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+            If drd.Read Then
+                coleccion.Add(drd.Item("PeriodicC").ToString)
+                coleccion.Add(drd.Item("ValNomC").ToString)
+                coleccion.Add(drd.Item("UltFCupC").ToString)
+                coleccion.Add(drd.Item("SigFCupC").ToString)
+                coleccion.Add(drd.Item("FLiqC").ToString)
+                coleccion.Add(drd.Item("FVencC").ToString)
+                coleccion.Add(drd.Item("PorcCupC").ToString)
+                coleccion.Add(drd.Item("PrecVencC").ToString)
+                coleccion.Add(drd.Item("PrecioCompra").ToString)
+                coleccion.Add(drd.Item("DiasBaseC").ToString)
+
+
+                coleccion.Add(drd.Item("CostTransC").ToString)
+
+
+
+
+                coleccion.Add(drd.Item("PeriodicV").ToString)
+                coleccion.Add(drd.Item("ValNomV").ToString)
+                coleccion.Add(drd.Item("UltFCupV").ToString)
+                coleccion.Add(drd.Item("SigFCupV").ToString)
+                coleccion.Add(drd.Item("FLiqV").ToString)
+                coleccion.Add(drd.Item("FVencV").ToString)
+                coleccion.Add(drd.Item("PorcCupV").ToString)
+                coleccion.Add(drd.Item("PrecVencV").ToString)
+                coleccion.Add(drd.Item("PrecioVenta").ToString)
+                coleccion.Add(drd.Item("DiasBaseV").ToString)
+                'oCE.CostoDeTransferenciaVenta = drd.Item("CostoTransV")
+                coleccion.Add(drd.Item("CupRecibidos").ToString)
+                coleccion.Add(drd.Item("PorcCupC").ToString)
+                coleccion.Add(drd.Item("PorcCupV").ToString)
+
+                coleccion.Add(drd.Item("ComisionPorCompraCasa").ToString)
+                coleccion.Add(drd.Item("ComisionPorCompraBolsa").ToString)
+                coleccion.Add(drd.Item("ComisionPorVentaCasa").ToString)
+                coleccion.Add(drd.Item("ComisionPorVentaBolsa").ToString)
+                coleccion.Add(drd.Item("YTMCompra").ToString)
+                coleccion.Add(drd.Item("YTMVenta").ToString)
+
+
+                'Çampos Extras (Calculados)
+
+
+                coleccion.Add(drd.Item("DiasVenC").ToString)
+                coleccion.Add(drd.Item("DiasVenV").ToString)
+
+                coleccion.Add(drd.Item("DiasAcuC").ToString)
+                coleccion.Add(drd.Item("DiasAcuV").ToString)
+
+
+                coleccion.Add(drd.Item("YTMVenC").ToString)
+                coleccion.Add(drd.Item("YTMVenV").ToString)
+
+
+                coleccion.Add(drd.Item("IntPorAcuC").ToString)
+                coleccion.Add(drd.Item("IntPorAcuV").ToString)
+
+
+                coleccion.Add(drd.Item("IntAcuC").ToString)
+                coleccion.Add(drd.Item("IntAcuV").ToString)
+
+
+                coleccion.Add(drd.Item("PrecSucioC").ToString)
+                coleccion.Add(drd.Item("PrecSucioV").ToString)
+
+
+                coleccion.Add(drd.Item("ComisionCasaC").ToString)
+                coleccion.Add(drd.Item("ComisionCasaV").ToString)
+
+
+                coleccion.Add(drd.Item("ComisionBolsaC").ToString)
+                coleccion.Add(drd.Item("ComisionBolsaV").ToString)
+
+
+                coleccion.Add(drd.Item("ValTransC").ToString)
+                coleccion.Add(drd.Item("ValTransV").ToString)
+
+
+
+                coleccion.Add(drd.Item("MontoPagar").ToString)
+                coleccion.Add(drd.Item("MontoRecibir").ToString)
+
+
+
+                coleccion.Add(drd.Item("CupRecibidos").ToString)
+
+            Else
+
+
+
+
+                coleccion.Add(False)
+                Return coleccion
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+
+
+            coleccion.Add(False)
+            Return coleccion
+        End If
+
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return coleccion
+    End Function
+    Public Function ProcesoDatos(ByVal coleccion As Collection, ByVal Diccionario As Dictionary(Of Integer, Collection), ByVal CodigoInstrumento As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Tabla As String = String.Empty
+        Dim TablaIngresos As String = String.Empty
+
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim myTrans As SqlTransaction
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN0"
+            TablaIngresos = "CIN1"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT"
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB0"
+            TablaIngresos = "EURB1"
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON0"
+            TablaIngresos = "BON1"
+        Else
+            Return 0
+
+        End If
+
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+
+            sql = "UPDATE " + Tabla + "
+   SET [PeriodicC] = @PeriodicC
+      ,[ValNomC] = @ValNomC
+      ,[UltFCupC] = @UltFCupC
+      ,[SigFCupC] = @SigFCupC
+      ,[FLiqC] = @FLiqC
+      ,[FVencC] = @FVencC
+      ,[PorcCupC] = @PorcCupC
+      ,[PrecVencC] = @PrecVencC
+      ,[PrecioCompra] = @PrecioCompra
+      ,[DiasBaseC] = @DiasBaseC
+     
+
+      
+	  ,[PeriodicV] = @PeriodicV
+      ,[ValNomV] = @ValNomV
+      ,[UltFCupV] = @UltFCupV
+      ,[SigFCupV] = @SigFCupV
+      ,[FLiqV] = @FLiqV
+      ,[FVencV] = @FVencV
+      ,[PorcCupV] = @PorcCupV
+      ,[PrecVencV] = @PrecVencV
+      ,[PrecioVenta] = @PrecioVenta
+      ,[DiasBaseV] = @DiasBaseV
+
+   
+
+
+      ,[ComisionPorCompraCasa]=@ComisionPorCompraCasa
+      ,[ComisionPorCompraBolsa]=@ComisionPorCompraBolsa
+      ,[ComisionPorVentaCasa]=@ComisionPorVentaCasa
+      ,[ComisionPorVentaBolsa]=@ComisionPorVentaBolsa
+      ,[YTMCompra]=@YTMCompra
+      ,[YTMVenta]=@YTMVenta
+
+
+
+
+
+        ,[DiasVenC]=@DiasVenC
+        ,[DiasVenV]=@DiasVenV
+        ,[DiasAcuC]=@DiasAcuC
+        ,[DiasAcuV]=@DiasAcuV
+        ,[YTMVenC]=@YTMVenC
+        ,[YTMVenV]=@YTMVenV
+        ,[IntAcuC]=@IntAcuC
+        ,[IntAcuV]=@IntAcuV
+        ,[IntPorAcuC]=@IntPorAcuC
+        ,[IntPorAcuV]=@IntPorAcuV
+        ,[PrecSucioC]=@PrecSucioC
+        ,[PrecSucioV]=@PrecSucioV
+        ,[ComisionCasaC]=@ComisionCasaC
+        ,[ComisionCasaV]=@ComisionCasaV
+        ,[ComisionBolsaC]=@ComisionBolsaC
+        ,[ComisionBolsaV]=@ComisionBolsaV
+        ,[ValTransC]=@ValTransC
+        ,[ValTransV]=@ValTransV
+        ,[MontoPagar]=@MontoPagar
+        ,[MontoRecibir]=@MontoRecibir
+        ,[CostTransC]=@CostTransC
+        ,[CupRecibidos]=@CupRecibidos
+        WHERE [CodInv] = @CodInv
+"
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+
+
+
+            With cmd.Parameters
+                .Add("@PeriodicC", SqlDbType.VarChar).Value = coleccion(1).ToString()
+                .Add("@ValNomC", SqlDbType.Float).Value = CDec(coleccion(2).ToString().TrimEnd("%"))
+                .Add("@UltFCupC", SqlDbType.Date).Value = coleccion(3)
+                .Add("@SigFCupC", SqlDbType.Date).Value = coleccion(4)
+                .Add("@FLiqC", SqlDbType.Date).Value = coleccion(5)
+                .Add("@FVencC", SqlDbType.Date).Value = coleccion(6)
+                .Add("@PorcCupC", SqlDbType.Float).Value = CDec(coleccion(7).ToString().TrimEnd("%"))
+                .Add("@PrecVencC", SqlDbType.Float).Value = CDec(coleccion(8).ToString().TrimEnd("%"))
+                .Add("@PrecioCompra", SqlDbType.Float).Value = CDec(coleccion(9).ToString().TrimEnd("%"))
+                .Add("@DiasBaseC", SqlDbType.Int).Value = CInt(coleccion(10).ToString().TrimEnd("%"))
+                .Add("@PeriodicV", SqlDbType.VarChar).Value = coleccion(12).ToString()
+                .Add("@ValNomV", SqlDbType.Float).Value = CDec(coleccion(13).ToString().TrimEnd("%"))
+                .Add("@UltFCupV", SqlDbType.Date).Value = coleccion(14)
+                .Add("@SigFCupV", SqlDbType.Date).Value = coleccion(15)
+                .Add("@FLiqV", SqlDbType.Date).Value = coleccion(16)
+                .Add("@FVencV", SqlDbType.Date).Value = coleccion(17)
+                .Add("@PorcCupV", SqlDbType.Float).Value = CDec(coleccion(18).ToString().TrimEnd("%"))
+                .Add("@PrecVencV", SqlDbType.Float).Value = CDec(coleccion(19).ToString().TrimEnd("%"))
+                .Add("@PrecioVenta", SqlDbType.Float).Value = CDec(coleccion(20).ToString().TrimEnd("%"))
+                .Add("@DiasBaseV", SqlDbType.Int).Value = CInt(coleccion(21).ToString().TrimEnd("%"))
+                .Add("@CodInv", SqlDbType.VarChar).Value = coleccion(23).ToString()
+
+                .Add("@ComisionPorCompraCasa", SqlDbType.Float).Value = coleccion(26).ToString()
+                .Add("@ComisionPorCompraBolsa", SqlDbType.Float).Value = coleccion(27).ToString()
+                .Add("@ComisionPorVentaCasa", SqlDbType.Float).Value = coleccion(28).ToString()
+                .Add("@ComisionPorVentaBolsa", SqlDbType.Float).Value = coleccion(29).ToString()
+
+                .Add("@YTMCompra", SqlDbType.Float).Value = coleccion(30).ToString()
+                .Add("@YTMVenta", SqlDbType.Float).Value = coleccion(31).ToString()
+
+
+
+
+                .Add("DiasVenC", SqlDbType.Int).Value = coleccion(32)
+                .Add("@DiasVenV", SqlDbType.Int).Value = coleccion(33)
+                .Add("@DiasAcuC", SqlDbType.Int).Value = coleccion(34)
+                .Add("@DiasAcuV", SqlDbType.Int).Value = coleccion(35)
+                .Add("@YTMVenC", SqlDbType.Float).Value = coleccion(36)
+                .Add("@YTMVenV", SqlDbType.Float).Value = coleccion(37)
+                .Add("@IntAcuC", SqlDbType.Float).Value = coleccion(38)
+                .Add("@IntAcuV", SqlDbType.Float).Value = coleccion(39)
+                .Add("@IntPorAcuC", SqlDbType.Float).Value = coleccion(40)
+                .Add("@IntPorAcuV", SqlDbType.Float).Value = coleccion(41)
+                .Add("@PrecSucioC", SqlDbType.Float).Value = coleccion(42)
+                .Add("@PrecSucioV", SqlDbType.Float).Value = coleccion(43)
+                .Add("@ComisionCasaC", SqlDbType.Float).Value = coleccion(44)
+                .Add("@ComisionCasaV", SqlDbType.Float).Value = coleccion(45)
+                .Add("@ComisionBolsaC", SqlDbType.Float).Value = coleccion(46)
+                .Add("@ComisionBolsaV", SqlDbType.Float).Value = coleccion(47)
+                .Add("@ValTransC", SqlDbType.Float).Value = coleccion(48)
+                .Add("@ValTransV", SqlDbType.Float).Value = coleccion(49)
+                .Add("@MontoPagar", SqlDbType.Float).Value = coleccion(50)
+                .Add("@MontoRecibir", SqlDbType.Float).Value = coleccion(51)
+                .Add("@CostTransC", SqlDbType.Float).Value = coleccion(52)
+                .Add("@CupRecibidos", SqlDbType.Float).Value = coleccion(53)
+
+            End With
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            If Not Diccionario Is Nothing And Not Diccionario.Count = 0 Then
+                If Not String.IsNullOrEmpty(TablaIngresos) Then
+
+
+
+
+                    sql = "DELETE FROM " + TablaIngresos + "
+            WHERE [CodInv]=@CodInv "
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+
+
+
+
+                    For Each DatosDiccionario In Diccionario
+                        Dim Coleccion2 As Collection = DatosDiccionario.Value
+                        sql = "INSERT INTO " + TablaIngresos + "(
+           [CodInv]
+           ,[NumCupon]
+           ,[FechaCupon]
+           ,[Dias]
+           ,[Ingreso]
+           ,[PorcImpuesto]
+           ,[MontoImpuesto]
+           ,[Liquido]
+) VALUES(
+           @CodInv
+           ,@NumCupon
+           ,@FechaCupon
+           ,@Dias
+           ,@Ingreso
+           ,@PorcImpuesto
+           ,@MontoImpuesto
+           ,@Liquido
+)
+    "
+
+
+                        cmd = New SqlCommand
+                        cmd.CommandText = sql
+                        cmd.Connection = cn
+                        cmd.Transaction = myTrans
+
+                        With cmd.Parameters
+                            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                            .Add("@NumCupon", SqlDbType.VarChar).Value = Coleccion2(1)
+                            .Add("@FechaCupon", SqlDbType.DateTime).Value = Coleccion2(2)
+                            .Add("@Dias", SqlDbType.Int).Value = Coleccion2(3)
+                            .Add("@Ingreso", SqlDbType.Float).Value = Coleccion2(4)
+                            .Add("@PorcImpuesto", SqlDbType.Float).Value = Coleccion2(5)
+                            .Add("@MontoImpuesto", SqlDbType.Float).Value = Coleccion2(6)
+                            .Add("@Liquido", SqlDbType.Float).Value = Coleccion2(7)
+                        End With
+
+                        retorno = cmd.ExecuteNonQuery
+                    Next
+                End If
+            End If
+
+
+            myTrans.Commit()
+            MsgBox("Datos Actualizados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        'cn.Close()
+
+
+        cn.Close()
+        Return retorno
+    End Function
+
+    Public Function Nuevo(ByVal coleccion As Collection, ByVal CodigoInstrumento As String) As Integer
+
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Tabla As String = String.Empty
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN0"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT"
+
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB0"
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON0"
+
+        End If
+
+
+        If (Not String.IsNullOrEmpty(Tabla.ToString)) Then
+
+
+            sql = "INSERT INTO " + Tabla + "
+      ([CodInv]   
+      ,[PeriodicC]
+      ,[ValNomC]
+      ,[UltFCupC]
+      ,[SigFCupC]
+      ,[FLiqC]
+      ,[FVencC]
+      ,[PorcCupC]
+      ,[PrecVencC]
+      ,[PrecioCompra]
+      ,[DiasBaseC]
+     
+      
+	  ,[PeriodicV]
+      ,[ValNomV]
+      ,[UltFCupV]
+      ,[SigFCupV]
+      ,[FLiqV]
+      ,[FVencV]
+      ,[PorcCupV]
+      ,[PrecVencV]
+      ,[PrecioVenta]
+      ,[DiasBaseV]
+   
+
+      ,[ComisionPorCompraCasa]
+      ,[ComisionPorCompraBolsa]
+      ,[ComisionPorVentaCasa]
+      ,[ComisionPorVentaBolsa]
+      ,[YTMCompra]
+      ,[YTMVenta]
+        ,[DiasVenC]
+        ,[DiasVenV]
+        ,[DiasAcuC]
+        ,[DiasAcuV]
+        ,[YTMVenC]
+        ,[YTMVenV]
+        ,[IntAcuC]
+        ,[IntAcuV]
+        ,[IntPorAcuC]
+        ,[IntPorAcuV]
+        ,[PrecSucioC]
+        ,[PrecSucioV]
+        ,[ComisionCasaC]
+        ,[ComisionCasaV]
+        ,[ComisionBolsaC]
+        ,[ComisionBolsaV]
+        ,[ValTransC]
+        ,[ValTransV]
+        ,[MontoPagar]
+        ,[MontoRecibir]
+        ,[CostTransC]
+        ,[CupRecibidos]
+
+)
+      VALUES(
+       @CodInv
+      ,@PeriodicC
+      ,@ValNomC
+      ,@UltFCupC
+      ,@SigFCupC
+      ,@FLiqC
+      ,@FVencC
+      ,@PorcCupC
+      ,@PrecVencC
+      ,@PrecioCompra
+      ,@DiasBaseC
+      
+	  ,@PeriodicV
+      ,@ValNomV
+      ,@UltFCupV
+      ,@SigFCupV
+      ,@FLiqV
+      ,@FVencV
+      ,@PorcCupV
+      ,@PrecVencV
+      ,@PrecioVenta
+      ,@DiasBaseV
+
+
+      ,@ComisionPorCompraCasa
+      ,@ComisionPorCompraBolsa
+      ,@ComisionPorVentaCasa
+      ,@ComisionPorVentaBolsa
+      ,@YTMCompra
+      ,@YTMVenta     
+
+
+
+        ,@DiasVenC
+        ,@DiasVenV
+        ,@DiasAcuC
+        ,@DiasAcuV
+        ,@YTMVenC
+        ,@YTMVenV
+        ,@IntAcuC
+        ,@IntAcuV
+        ,@IntPorAcuC
+        ,@IntPorAcuV
+        ,@PrecSucioC
+        ,@PrecSucioV
+        ,@ComisionCasaC
+        ,@ComisionCasaV
+        ,@ComisionBolsaC
+        ,@ComisionBolsaV
+        ,@ValTransC
+        ,@ValTransV
+        ,@MontoPagar
+        ,@MontoRecibir
+        ,@CostTransC
+        ,@CupRecibidos
+
+)
+
+
+ 
+"
+
+
+
+
+
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            'Try
+
+            With cmd.Parameters
+                If (coleccion(1) Is Nothing) Then
+                    .Add("@PeriodicC", SqlDbType.VarChar).Value = "M"
+                Else
+                    .Add("@PeriodicC", SqlDbType.VarChar).Value = coleccion(1).ToString()
+                End If
+
+                .Add("@ValNomC", SqlDbType.Float).Value = CDec(coleccion(2).ToString.Trim("%"))
+                .Add("@UltFCupC", SqlDbType.Date).Value = coleccion(3)
+                .Add("@SigFCupC", SqlDbType.Date).Value = coleccion(4)
+                .Add("@FLiqC", SqlDbType.Date).Value = coleccion(5)
+                .Add("@FVencC", SqlDbType.Date).Value = coleccion(6)
+                .Add("@PorcCupC", SqlDbType.Float).Value = CDec(coleccion(7).ToString.Trim("%"))
+                .Add("@PrecVencC", SqlDbType.Float).Value = CDec(coleccion(8).ToString.Trim("%"))
+                .Add("@PrecioCompra", SqlDbType.Float).Value = CDec(coleccion(9).ToString.Trim("%"))
+
+                If (coleccion(10) Is Nothing) Then
+                    .Add("@DiasBaseC", SqlDbType.Int).Value = 365
+                Else
+                    .Add("@DiasBaseC", SqlDbType.Int).Value = CInt(coleccion(10).ToString.Trim("%"))
+                End If
+
+
+                '.Add("@CostoTransC", SqlDbType.Float).Value = Trim(CDec(coleccion(11)))
+
+
+                If (coleccion(12) Is Nothing) Then
+                    .Add("@PeriodicV", SqlDbType.VarChar).Value = "M"
+                Else
+                    .Add("@PeriodicV", SqlDbType.VarChar).Value = coleccion(12).ToString()
+                End If
+
+
+
+                .Add("@ValNomV", SqlDbType.Float).Value = CDec(coleccion(13).ToString.Trim("%"))
+                .Add("@UltFCupV", SqlDbType.Date).Value = coleccion(14)
+                .Add("@SigFCupV", SqlDbType.Date).Value = coleccion(15)
+                .Add("@FLiqV", SqlDbType.Date).Value = coleccion(16)
+                .Add("@FVencV", SqlDbType.Date).Value = coleccion(17)
+                .Add("@PorcCupV", SqlDbType.Float).Value = CDec(coleccion(18).ToString.Trim("%"))
+                .Add("@PrecVencV", SqlDbType.Float).Value = CDec(coleccion(19).ToString.Trim("%"))
+                .Add("@PrecioVenta", SqlDbType.Float).Value = CDec(coleccion(20).ToString.Trim("%"))
+                If (coleccion(21) Is Nothing) Then
+                    .Add("@DiasBaseV", SqlDbType.Int).Value = 365
+                Else
+                    .Add("@DiasBaseV", SqlDbType.Int).Value = CInt(coleccion(21).ToString.Trim("%"))
+                End If
+
+                '.Add("@CostoTransV", SqlDbType.Float).Value = CDec(coleccion(22).ToString.Trim("%"))
+                .Add("@CodInv", SqlDbType.VarChar).Value = coleccion(23).ToString()
+
+                .Add("@ComisionPorCompraCasa", SqlDbType.Float).Value = coleccion(26).ToString()
+                .Add("@ComisionPorCompraBolsa", SqlDbType.Float).Value = coleccion(27).ToString()
+                .Add("@ComisionPorVentaCasa", SqlDbType.Float).Value = coleccion(28).ToString()
+                .Add("@ComisionPorVentaBolsa", SqlDbType.Float).Value = coleccion(29).ToString()
+
+                .Add("@YTMCompra", SqlDbType.Float).Value = coleccion(30).ToString()
+                .Add("@YTMVenta", SqlDbType.Float).Value = coleccion(31).ToString()
+
+
+
+
+                .Add("@DiasVenC", SqlDbType.Int).Value = coleccion(32)
+                .Add("@DiasVenV", SqlDbType.Int).Value = coleccion(33)
+                .Add("@DiasAcuC", SqlDbType.Int).Value = coleccion(34)
+                .Add("@DiasAcuV", SqlDbType.Int).Value = coleccion(35)
+                .Add("@YTMVenC", SqlDbType.Float).Value = coleccion(36)
+                .Add("@YTMVenV", SqlDbType.Float).Value = coleccion(37)
+                .Add("@IntAcuC", SqlDbType.Float).Value = coleccion(38)
+                .Add("@IntAcuV", SqlDbType.Float).Value = coleccion(39)
+                .Add("@IntPorAcuC", SqlDbType.Float).Value = coleccion(40)
+                .Add("@IntPorAcuV", SqlDbType.Float).Value = coleccion(41)
+                .Add("@PrecSucioC", SqlDbType.Float).Value = coleccion(42)
+                .Add("@PrecSucioV", SqlDbType.Float).Value = coleccion(43)
+                .Add("@ComisionCasaC", SqlDbType.Float).Value = coleccion(44)
+                .Add("@ComisionCasaV", SqlDbType.Float).Value = coleccion(45)
+                .Add("@ComisionBolsaC", SqlDbType.Float).Value = coleccion(46)
+                .Add("@ComisionBolsaV", SqlDbType.Float).Value = coleccion(47)
+                .Add("@ValTransC", SqlDbType.Float).Value = coleccion(48)
+                .Add("@ValTransV", SqlDbType.Float).Value = coleccion(49)
+                .Add("@MontoPagar", SqlDbType.Float).Value = coleccion(50)
+                .Add("@MontoRecibir", SqlDbType.Float).Value = coleccion(51)
+                .Add("@CostTransC", SqlDbType.Float).Value = coleccion(52)
+                .Add("@CupRecibidos", SqlDbType.Float).Value = coleccion(53)
+            End With
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro creado éxitosmente")
+            'Catch ex As Exception
+            '    MsgBox("No se pudo ingresar los datos")
+            'End Try
+        Else
+            MsgBox("No se pudo ingresar los datos")
+            retorno = 0
+        End If
+
+        cn.Close()
+        Return retorno
+    End Function
+
+    Public Sub Eliminar(ByVal Eliminar As String, ByVal CodigoInstrumento As String)
+        Dim objCon As New Conexion
+        Dim res As Integer
+        Dim Tabla As String = String.Empty
+        Dim TablaIngresos As String = String.Empty
+        Dim TablaTIT1 As String = String.Empty
+        Dim TablaTIT2 As String = String.Empty
+        If (CodigoInstrumento = "CINV") Then
+            Tabla = "CIN0"
+            TablaIngresos = "CIN1"
+        ElseIf (CodigoInstrumento = "TIT") Then
+            Tabla = "TIT"
+            TablaIngresos = "TIT0_0"
+            TablaTIT1 = "TIT0"
+            TablaTIT2 = "TIT2"
+        ElseIf (CodigoInstrumento = "BONO") Then
+            Tabla = "BON0"
+            TablaIngresos = "BON1"
+        ElseIf (CodigoInstrumento = "EURB") Then
+            Tabla = "EURB0"
+            TablaIngresos = "EURB1"
+
+        End If
+
+
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM " + TablaIngresos + "
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            retorno = cmd.ExecuteNonQuery
+
+
+            If (CodigoInstrumento = "TIT") Then
+                sql = "DELETE FROM " + TablaTIT1 + "
+      WHERE [CodInv]=@CodInv"
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                retorno = cmd.ExecuteNonQuery
+
+
+                sql = "DELETE FROM " + TablaTIT2 + "
+      WHERE [CodInv]=@CodInv"
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                retorno = cmd.ExecuteNonQuery
+            End If
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+
+    End Sub
+
+
+
+    Public Function GuardarIngreso(ByVal CodInversion As String, ByVal fecha As Date, ByVal Porcentaje As Double)
+
+
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim numero = CInt(Numeracion())
+        Dim sql = "INSERT INTO CIN1([CodInv],[NumCupon],[FechaCupon],[PorcImpuesto]) values(@cod,@num,@fecha,@PorcImpuesto)"
+
+
+        Dim comando = New SqlCommand()
+        comando.CommandText = sql
+
+        With comando.Parameters
+            .Add("@cod", SqlDbType.VarChar).Value = CodInversion
+            .Add("@num", SqlDbType.Int).Value = numero
+            .Add("@fecha", SqlDbType.DateTime).Value = fecha
+            .Add("@PorcImpuesto", SqlDbType.Float).Value = Porcentaje
+        End With
+        comando.Connection = cn
+        Dim i As Integer = comando.ExecuteNonQuery()
+        cn.Close()
+        If (i > 0) Then
+            Return True
+        Else
+            Return False
+        End If
+    End Function
+
+    Public Function CargarData()
+
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from CIN1"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function Numeracion()
+
+        Dim objCon As New Conexion
+        Dim sql = "select MAX(NumCupon) from CIN1"
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim numero = cmd.ExecuteScalar
+        If (String.IsNullOrEmpty(numero.ToString)) Then
+            numero = 0
+        Else
+            numero = numero + 1
+        End If
+        cn.Close()
+        Return numero
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Private Sub GuardarIngresos(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[CIN1]
+      WHERE [CodInv]=@CodInv"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[CIN1]
+    ([CodInv]
+    ,[NumCupon]
+    ,[FechaCupon]
+    ,[Dias]
+    ,[Ingreso]
+    ,[PorcImpuesto]
+    ,[MontoImpuesto]
+    ,[Liquido]
+)
+VALUES
+    (@CodInv
+    ,@NumCupon
+    ,@FechaCupon
+    ,@Dias
+    ,@Ingreso
+    ,@PorcImpuesto
+    ,@MontoImpuesto
+    ,@Liquido
+)
+"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@NumCupon", dr("NumCupon"))
+                cmd.Parameters.AddWithValue("@FechaCupon", dr("FechaCupon"))
+                cmd.Parameters.AddWithValue("@Dias", dr("Dias"))
+                cmd.Parameters.AddWithValue("@Ingreso", dr("Ingreso"))
+                cmd.Parameters.AddWithValue("@PorcImpuesto", dr("PorcImpuesto"))
+                cmd.Parameters.AddWithValue("@MontoImpuesto", dr("MontoImpuesto"))
+                cmd.Parameters.AddWithValue("@Liquido", dr("MontoImpuesto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+
+            Next
+        End If
+        cn.Close()
+    End Sub
+    Private Sub GuardarImpuestosYComisiones(ByVal CodInversion As String, ByVal dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[CIN2]
+      WHERE [CodInv]=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        sql = String.Empty
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[CIN2]
+           ([CodInv]
+           ,[TipoOper]
+           ,[CodImp]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[MontoSujeto])
+     VALUES
+           (@CodInv
+           ,@TipoOper
+           ,@CodImp
+           ,@PorcImp
+           ,@MontoImp
+           ,@MontoSujeto)"
+                cmd.CommandText = sql
+                cmd.Parameters.AddWithValue("@CodInv", CodInversion)
+                cmd.Parameters.AddWithValue("@TipoOper", dr("TipoOper"))
+                cmd.Parameters.AddWithValue("@CodImp", dr("CodImp"))
+                cmd.Parameters.AddWithValue("@PorcImp", dr("PorcImp"))
+                cmd.Parameters.AddWithValue("@MontoImp", dr("MontoImp"))
+                cmd.Parameters.AddWithValue("@MontoSujeto", dr("MontoSujeto"))
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+        cn.Close()
+    End Sub
+End Class
+
+

+ 76 - 0
DAO/ColaDAO.vb

@@ -0,0 +1,76 @@
+Imports System.Data.SqlClient
+
+Public Class ColaDAO
+
+
+
+
+    Dim Operaciones As New Operaciones
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function EstadoArbitraje() As DataTable
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_ControlProcesoTitulosYReportos]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+
+
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds.Tables(0)
+    End Function
+
+
+
+
+
+    Public Function TablasArbitraje(ByVal Tipo As String, ByVal CodigoAsociado As String) As DataTable
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_TiposTitulosReporto]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        With cmd.Parameters
+            .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
+            .Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociado
+        End With
+
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds.Tables(0)
+    End Function
+
+
+
+End Class

+ 2690 - 0
DAO/DAOGeneral.vb

@@ -0,0 +1,2690 @@
+Imports System.Data.SqlClient
+
+Public Class DAOGeneral
+
+    Dim da As SqlDataAdapter
+
+    Public Function ListaBase() As DataTable
+        Dim objCon As New Conexion
+
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+        da = New SqlDataAdapter("SP_ListaAnioBase", cn)
+        da.Fill(ds, "AnioBase")
+        dt = ds.Tables(0)
+
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+
+
+
+    Public Function ListaTiposImpuesto() As DataTable
+
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SELECT [Codigo] ,[Nombre] 'Descripcion' FROM [dbo].[TIMP]", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+    Public Function ListaTipoTasa() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_ListaTipoTasa", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+    Public Function ListaTipoRenta() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_ListaTipoRenta", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+    Public Function ListaEstadoInversion() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_ListaEstadoInversion", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+    Public Function ListaEstadoDocumento() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_ListaEstadoDocumento", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaTiposMercado() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaTiposMercado", cn)
+        da.Fill(ds, "ListaTiposMercado")
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+    Public Function ListaPaisesRelevanteInversion() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaPaisesInv", cn)
+        da.Fill(ds, "ListaPaisesInv")
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+    Public Function ListaEmpresas() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEmpresas", cn)
+        da.Fill(ds)
+
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+
+    End Function
+
+    Public Function ListaEmpresasCheque()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim diccionario As New Dictionary(Of String, String)
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "SP_ListaEmpresas"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        Dim i As Integer = 1
+        While dr.Read
+            If String.IsNullOrEmpty(dr.GetName(0)) Then
+                Return diccionario
+            End If
+
+
+
+
+
+
+
+            diccionario.Add(dr("Codigo"), dr("Descripcion"))
+            i += 1
+        End While
+        cn.Close()
+        Return diccionario
+
+
+
+    End Function
+    Public Function ListaEstadoAutorizacion() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEstadoAut", cn)
+        da.Fill(ds, "ListaEstadoAut")
+
+        dt = ds.Tables("ListaEstadoAut")
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+
+
+    Public Function ListaEstadoProceso() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEstadoProceso", cn)
+        da.Fill(ds, "ListaEstadoProceso")
+
+        dt = ds.Tables("ListaEstadoProceso")
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+
+
+
+
+
+    Public Function ListaTipoOperacion() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaTipoOperacion", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+
+    End Function
+
+
+    Public Function ListaInstrumentos() As DataTable
+        Dim objCon As New Conexion
+
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaInstrumentosFinancieros", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+
+
+    Public Function ListaEmisores() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEmisores", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaCalificacionesDeRiesgo() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaCalificacionesDeRiesgo", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaEmpresasCalificadoras() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEmpresasCalificadoras", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaOrigenDeFondos() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaOrigenDeFondos", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaPlazosFactor() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaPlazosFactor", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+    Public Function ListaPeriodicidad() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaPeriodos", cn)
+        da.Fill(ds, "ListaPeriodos")
+        dt = ds.Tables(0)
+
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaAnioBase() As DataSet
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaAnioBase", cn)
+        da.Fill(ds, "AnioBase")
+
+        da.Dispose()
+        cn.Dispose()
+        Return ds
+
+
+    End Function
+
+    Public Function ResultadosDeBusqueda(Query As String) As DataSet
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter(Query, cn)
+        da.Fill(ds, "Resultado")
+
+        da.Dispose()
+        cn.Dispose()
+        Return ds
+
+
+    End Function
+
+    Public Function ListaCasasCorredoras() As DataSet
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaCasasCorredoras", cn)
+        da.Fill(ds, "CasasCorredoras")
+
+        da.Dispose()
+        cn.Dispose()
+        Return ds
+
+
+
+    End Function
+
+
+
+
+    Public Function ListaImpuesto() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SELECT [CodImp],[Valor],[Impuesto]  'Descripcion' FROM [dbo].[IMPU]", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+
+    End Function
+
+    Public Function ListaInversion(ByVal codigo As String) As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SELECT [codigo]  'Descripcion' FROM [dbo].[REP0] Where [CodInv]='" + codigo + "'", cn)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+
+        da.Dispose()
+        cn.Dispose()
+        Return dt
+
+    End Function
+
+
+    Public Function ObtenerInstrumento(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If (Not String.IsNullOrEmpty(Codigo)) Then
+
+
+            Dim sql As String
+            Dim cmd As SqlCommand
+            Dim Instrumento As String
+
+            sql = "SELECT * FROM [dbo].[INV0] WHERE CodInv=@Codigo"
+
+
+            cmd = New SqlCommand
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+            cmd.Connection = cn
+
+            ' Dim Datos = cmd.ExecuteScalar
+            Dim Datos = cmd.ExecuteReader
+            If Datos.HasRows Then
+                'SE ENCONTRO EL REGISTRO
+
+
+                If Datos.Read Then
+
+                    Instrumento = Datos.Item("CodIF")
+
+
+
+                    Return Instrumento
+                End If
+            End If
+        End If
+
+
+        If Codigo Is Nothing Then
+            Codigo = String.Empty
+        End If
+
+        cn.Close()
+        If Codigo.IndexOf("CINV") > -1 Then
+            Return "CINV"
+        ElseIf Codigo.IndexOf("BONO") > -1 Then
+            Return "BONO"
+        ElseIf Codigo.IndexOf("EURB") > -1 Then
+            Return "EURB"
+        ElseIf Codigo.IndexOf("TIT") > -1 Then
+            Return "TIT"
+
+        End If
+    End Function
+
+
+    Public Function ObtenerEmpresa(ByRef Codigo As String, ByRef Tabla As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If (Not String.IsNullOrEmpty(Codigo)) Then
+
+
+            Dim sql As String
+            Dim cmd As SqlCommand
+            Dim Instrumento As String
+
+            sql = "SELECT CodEmpr FROM " + Tabla + " WHERE CodInv=@Codigo"
+
+
+            cmd = New SqlCommand
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+            cmd.Connection = cn
+
+            ' Dim Datos = cmd.ExecuteScalar
+            Dim Datos = cmd.ExecuteReader
+            cn.Close()
+            If Datos.HasRows Then
+                'SE ENCONTRO EL REGISTRO
+                If Datos.Read Then
+                    Instrumento = Datos.Item("CodEmpr")
+                    Return Instrumento
+                End If
+            End If
+        End If
+        Return String.Empty
+    End Function
+
+
+    Public Function TraerImpuesto(ByVal Codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If (Not String.IsNullOrEmpty(Codigo)) Then
+
+
+            Dim sql As String
+            Dim cmd As SqlCommand
+            Dim Impuesto As String
+
+            sql = "SELECT * FROM " + Tabla + " WHERE CodInv=@Codigo"
+
+
+            cmd = New SqlCommand
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+            cmd.Connection = cn
+
+            ' Dim Datos = cmd.ExecuteScalar
+            Dim Datos = cmd.ExecuteReader
+            cn.Close()
+            If Datos.HasRows Then
+                'SE ENCONTRO EL REGISTRO
+
+                Try
+
+
+                    If Datos.Read Then
+
+                        Impuesto = Datos.Item("Impuestos")
+                        Return Impuesto
+
+                    Else
+                        Return 0
+                    End If
+
+                Catch ex As Exception
+                    Return 0
+                End Try
+
+            Else
+                Return 0
+            End If
+        Else
+            Return 0
+        End If
+    End Function
+
+
+
+
+    Public Function AgregarImpuesto(ByVal CodigoInv As String, ByVal Tabla As String, ByVal Impues As String, ByVal flag As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Impuestos As String = TraerImpuesto(CodigoInv, Tabla)
+        If (String.IsNullOrEmpty(Impuestos) Or Impuestos = "0") Then
+            Impuestos = Impues
+        Else
+            If (flag = 0) Then
+
+
+                If InStr(1, Impuestos, Impues) = 0 Then
+
+                    Impuestos = Impuestos.ToString + "-" + Impues.ToString
+                End If
+            Else
+                If Not InStr(1, Impuestos, Impues) = 0 Then
+
+                    Dim QuitarImpuesto = Impuestos.Split("-")
+                    Impuestos = String.Empty
+                    For Each i In QuitarImpuesto
+                        If (Not i = Impues) Then
+                            If (String.IsNullOrEmpty(Impuestos)) Then
+                                Impuestos = i
+                            Else
+                                Impuestos = Impuestos + "-" + i
+                            End If
+                        End If
+                    Next
+
+
+
+                End If
+
+            End If
+        End If
+
+
+
+
+        sql = "UPDATE " + Tabla + " SET
+           
+           [Impuestos]=@Impuestos
+           where [CodInv]=@CodInv
+
+    "
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = CodigoInv
+            .Add("@Impuestos", SqlDbType.VarChar).Value = Impuestos
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+    Public Function CargarImpuesto(ByVal codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "select * from " + Tabla + " where CodInv='" + codigo + "'"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+    Public Function ObtenerImpuesto()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+
+        Dim diccionario As New Dictionary(Of String, String)
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "select * from IMPU"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        While dr.Read
+
+            diccionario.Add(dr("CodImp").ToString, dr("Valor").ToString)
+
+
+        End While
+
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+
+
+
+
+
+    Public Function ExisteTitulo(ByVal CodTitulo As String, ByVal Tabla As String) As Boolean
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As Integer = 0
+        Dim Existe As Boolean = False
+        Dim cmd As SqlCommand
+        If Not String.IsNullOrEmpty(CodTitulo) Then
+
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+            If Not String.IsNullOrEmpty(Tabla) Then
+
+
+
+                cmd = New SqlCommand("select count(*) from " + Tabla + " where CodInv='" + CodTitulo.ToString + "'", cn)
+                valor = CInt(cmd.ExecuteScalar)
+                cmd.Dispose()
+                If valor > 0 Then
+                    Existe = True
+                End If
+
+            End If
+
+            cn.Dispose()
+        End If
+        Return Existe
+    End Function
+
+    Public Function ExisteCMVTA(ByVal CodigoCompra As String) As Boolean
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As Integer = 0
+        Dim Existe As Boolean = False
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        If Not String.IsNullOrEmpty(CodigoCompra) Then
+
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+            myTrans = cn.BeginTransaction()
+            Try
+
+
+
+                cmd = New SqlCommand("select count(*) from OPERCMVTA where CodigoInversionCompra=@CodigoInversionCompra", cn)
+
+                With cmd.Parameters
+                    .Add("@CodigoInversionCompra", SqlDbType.VarChar).Value = CodigoCompra
+                End With
+                cmd.Transaction = myTrans
+                valor = CInt(cmd.ExecuteScalar)
+                cmd.Dispose()
+                If valor > 0 Then
+                    Existe = True
+                Else
+
+                    cmd = New SqlCommand("select count(*) from OPERCMVTA where CodigoInversionVenta=@CodigoInversionVenta", cn)
+
+                    With cmd.Parameters
+                        .Add("@CodigoInversionVenta", SqlDbType.VarChar).Value = CodigoCompra
+                    End With
+                    cmd.Transaction = myTrans
+                    valor = CInt(cmd.ExecuteScalar)
+                    cmd.Dispose()
+                    If valor > 0 Then
+                        Existe = True
+                    End If
+                End If
+            Catch ex As Exception
+
+                myTrans.Rollback()
+
+                MsgBox(ex.Message)
+
+            End Try
+
+        End If
+
+        cn.Dispose()
+
+        Return Existe
+    End Function
+
+    Public Function ExisteVenta(ByVal CodTitulo As String) As Boolean
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As Integer = 0
+        Dim Existe As Boolean = False
+        Dim cmd As SqlCommand
+        If Not String.IsNullOrEmpty(CodTitulo) Then
+
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+
+
+
+            cmd = New SqlCommand("select count(*) from  INV0 right join PIN0 on INV0.VCodInv=PIN0.VCodInv where ((INV0.VCodInv='" + CodTitulo + "' or PIN0.VCodInv='" + CodTitulo + "') and  (INV0.TipoOper='V' or PIN0.TipoOper='V')) ", cn)
+            valor = CInt(cmd.ExecuteScalar)
+            cmd.Dispose()
+            If valor > 0 Then
+                Existe = True
+            End If
+
+
+
+            cn.Dispose()
+        End If
+        Return Existe
+    End Function
+
+
+
+
+    Public Function IdPropuesta(ByVal CodTitulo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As Integer = 0
+        Dim Existe As Boolean = False
+        Dim cmd As SqlCommand
+        If Not String.IsNullOrEmpty(CodTitulo) Then
+
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+
+
+            cmd = New SqlCommand("select DocId from PIN0 WHERE CodInv='" + CodTitulo + "'", cn)
+            valor = CInt(cmd.ExecuteScalar)
+            cmd.Dispose()
+
+
+
+
+            cn.Dispose()
+        End If
+        Return valor
+    End Function
+
+
+    Public Function CantidadRegistros(ByVal Codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As Integer = 0
+        Dim Existe As Boolean = False
+        Dim cmd As SqlCommand
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        If (Not String.IsNullOrEmpty(Codigo)) Then
+            cmd = New SqlCommand("select count(*) from " + Tabla + " where CodInv='" + Codigo + "'", cn)
+            valor = CInt(cmd.ExecuteScalar)
+            cmd.Dispose()
+
+
+        End If
+
+        cn.Dispose()
+
+
+        Return valor
+    End Function
+    Public Function TipoDeInstrumento(ByVal pCodIF As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As String
+        Dim query As String
+        Dim cmd As SqlCommand
+
+
+        query = "SELECT T0.[Tipo] FROM [dbo].[INFI] T0 WHERE T0.CodIF=@CodIF"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodIF", SqlDbType.VarChar).Value = "LETE"
+
+        retorno = cmd.ExecuteScalar
+        cn.Close()
+        Return retorno
+    End Function
+
+
+
+    Public Function Periodicidad(ByVal Codigo As String, ByVal Tabla As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As String
+        Dim query As String
+        Dim cmd As SqlCommand
+
+
+        query = "SELECT T0.[Periodicidad] FROM " + Tabla + " T0 WHERE T0.CodInv=@CodInv"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+        Dim Datos = cmd.ExecuteScalar
+        cn.Close()
+        If Datos Is DBNull.Value Then
+            Return Datos.ToString
+        ElseIf Datos = Nothing Then
+
+            Return String.Empty
+        Else
+            Return Datos
+        End If
+
+
+
+
+
+    End Function
+
+    Public Function EstadoAutorizacionPro(ByVal Codigo As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As String
+        Dim query As String
+        Dim cmd As SqlCommand
+
+
+        query = "SELECT T0.[AutEstado] FROM PIN0 T0 WHERE T0.CodInv=@CodInv"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+        retorno = cmd.ExecuteScalar
+        cn.Close()
+        Return retorno
+    End Function
+
+
+
+    Public Function InstrumentosGrafica()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ConteoInstrumentos", cn)
+        da.Fill(dt)
+        cn.Close()
+        Return dt
+
+
+    End Function
+
+
+    Public Function MontosInstrumentosGrafica()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_CargarMonto", cn)
+        da.Fill(dt)
+        cn.Close()
+        Return dt
+    End Function
+
+    Public Function RendimientosInstrumentoGrafica()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_RendimientoGraficas", cn)
+        da.Fill(dt)
+        cn.Close()
+        Return dt
+    End Function
+
+
+    Public Function RendimientoMontoGraficas()
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_RendimientoMontoGraficas", cn)
+        da.Fill(dt)
+        cn.Close()
+        Return dt
+    End Function
+
+
+
+
+    Public Function EstadoInversion(ByVal Codigo As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As String = String.Empty
+        Dim query As String
+        Dim cmd As SqlCommand
+
+
+        query = "SELECT EstadoProceso from INV0 where CodInv='" + Codigo + "'"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        Dim con = cmd.ExecuteScalar
+        If Not con Is Nothing Then
+            retorno = con.ToString
+        End If
+
+        cn.Close()
+        Return retorno
+    End Function
+
+
+    Public Function AsociarReportoVenta(ByRef CodigoInstrumento As String, ByRef Tipo As String) As DataSet
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "SP_AsociacionReportoVentas"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInstrumento
+        cmd.Parameters.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds
+    End Function
+
+    Public Function EstadoReporto(ByVal Codigo As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As String = String.Empty
+        Dim query As String
+        Dim cmd As SqlCommand
+
+
+        query = "SP_AsociacionReportoVentas"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd = New SqlCommand(query, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@Tipo", SqlDbType.VarChar).Value = Codigo
+        Dim con = cmd.ExecuteScalar
+        If Not con Is Nothing Then
+            retorno = con.ToString
+        End If
+
+        cn.Close()
+        Return retorno
+    End Function
+
+
+
+
+
+
+
+
+    Public Sub GenerarCMVTA(ByVal CodigoCompra As String, ByVal CodigoVenta As String,
+    ByVal Tabla As String, ByVal coleccion As Collection, ByVal ObjPropuesta As CEPropuestaInversion)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+
+        Try
+
+
+
+            sql = "INSERT INTO [dbo].[PIN0]
+           ([CodInv]
+           ,[DocEst]
+           ,[Asunto]
+           ,[CodEmpr]
+           ,[CodIF]
+           ,[CodEmis]
+           ,[CodCalRi]
+           ,[CodECalRi]
+           ,[OFon]
+           ,[Coment]
+           ,[Just]
+           ,[TipoOper]
+           ,[MontoInv]
+           ,[Precio]
+           ,[Rendimiento]
+           ,[Plazo]
+           ,[PlazoFact]
+           ,[Ingresos]
+           ,[FechaDoc]
+           ,[AutEstado]
+           ,[TipoMerc]
+           ,[CodPais]
+           ,[TipoRenta]
+           ,[TipoTasa]
+           ,[Periodicidad]
+           ,[NombreManual]
+           ,[EstadoReporto]
+
+)
+     VALUES
+           (@CodInv
+           ,@DocEst
+           ,@Asunto
+           ,@CodEmpr
+           ,@CodIF
+           ,@CodEmis
+           ,@CodCalRi
+           ,@CodECalRi
+           ,@OFon
+           ,@Coment
+           ,@Just
+           ,@TipoOper
+           ,@MontoInv
+           ,@Precio
+           ,@Rendimiento
+           ,@Plazo
+           ,@PlazoFact
+           ,@Ingresos
+           ,@FechaDoc
+           ,@AutEstado
+           ,@TipoMerc
+           ,@CodPais
+           ,@TipoRenta
+           ,@TipoTasa
+           ,@Periodicidad
+           ,@NombreManual
+           ,@EstadoReporto
+		   )"
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+                .Add("@DocEst", SqlDbType.VarChar).Value = ObjPropuesta.EstadoDocumento.ToString
+                .Add("@Asunto", SqlDbType.VarChar).Value = ObjPropuesta.Asunto.ToString
+                .Add("@CodEmpr", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresa.ToString
+                .Add("@CodIF", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInstrumentoFinanciero.ToString
+                .Add("@CodEmis", SqlDbType.Int).Value = ObjPropuesta.CodigoEmisor.ToString
+                .Add("@CodCalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoCalificacionDeRiesgo.ToString
+                .Add("@CodECalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresaCalificadora.ToString
+                .Add("@OFon", SqlDbType.VarChar).Value = ObjPropuesta.OrigenDeFondos.ToString
+                .Add("@Coment", SqlDbType.VarChar).Value = ObjPropuesta.Comentarios.ToString
+                .Add("@Just", SqlDbType.VarChar).Value = ObjPropuesta.Justificacion.ToString
+                .Add("@TipoOper", SqlDbType.VarChar).Value = ObjPropuesta.TipoOperacion.ToString
+                .Add("@MontoInv", SqlDbType.Float).Value = ObjPropuesta.MontoInversion.ToString
+                .Add("@Precio", SqlDbType.Float).Value = ObjPropuesta.Precio.ToString
+                .Add("@Rendimiento", SqlDbType.Float).Value = ObjPropuesta.Rendimiento.ToString
+                .Add("@Plazo", SqlDbType.Int).Value = ObjPropuesta.PlazoNumero.ToString
+                .Add("@PlazoFact", SqlDbType.VarChar).Value = ObjPropuesta.PlazoFactor.ToString
+                .Add("@Ingresos", SqlDbType.Float).Value = ObjPropuesta.Ingresos.ToString
+                .Add("@FechaDoc", SqlDbType.Date).Value = ObjPropuesta.FechaDocumento.ToString
+                .Add("@AutEstado", SqlDbType.VarChar).Value = ObjPropuesta.EstadoAutorizacion.ToString
+                .Add("@TipoMerc", SqlDbType.VarChar).Value = ObjPropuesta.TipoMercado.ToString
+                .Add("@CodPais", SqlDbType.VarChar).Value = ObjPropuesta.Pais.ToString
+
+                .Add("@TipoRenta", SqlDbType.VarChar).Value = ObjPropuesta.TipoRenta.ToString
+                .Add("@TipoTasa", SqlDbType.VarChar).Value = ObjPropuesta.TipoTasa.ToString
+                .Add("@Periodicidad", SqlDbType.VarChar).Value = ObjPropuesta.Periodicidad.ToString
+                .Add("@NombreManual", SqlDbType.VarChar).Value = ObjPropuesta.NombreManual.ToString
+                .Add("@EstadoReporto", SqlDbType.VarChar).Value = "PRIMARIO"
+            End With
+            cmd.CommandText = sql
+
+            retorno = cmd.ExecuteNonQuery
+
+            ''Ingresar codigo
+
+
+            '#####################################################################'
+
+
+            cmd = New SqlCommand
+
+
+
+
+
+            sql = "INSERT INTO [dbo].[Propuesta]
+                   ([CodigoPropuesta]
+                    ,[Nombre]
+                    ,[Descrip]
+                    ,[Estado]
+        )
+             VALUES
+                   (@CodigoPropuesta
+                    ,@Nombre
+                    ,@Descrip
+                    ,@Estado
+        		   )"
+
+
+
+
+
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+                .Add("@CodigoPropuesta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+                .Add("@Nombre", SqlDbType.VarChar).Value = "ProCre"
+                .Add("@Descrip", SqlDbType.VarChar).Value = "Propuesta de Inversion Inicial Creada"
+                .Add("@Estado", SqlDbType.VarChar).Value = "En Propuesta"
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            ''###############################################################
+            ''###############################################################
+
+
+
+            cmd = New SqlCommand
+            sql = "INSERT INTO [dbo].[OPERCMVTA]
+                   ([FechaOperacion]
+                    ,[CodigoInversionCompra]
+                    ,[CodigoInversionVenta]
+                    ,[TipoFlujo]
+        )
+             VALUES
+                   (@FechaOperacion
+                    ,@CodigoInversionCompra
+                    ,@CodigoInversionVenta
+                    ,@TipoFlujo
+        		   )"
+
+
+
+
+
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+                .Add("@FechaOperacion", SqlDbType.Date).Value = Date.Now.Date
+                .Add("@CodigoInversionCompra", SqlDbType.VarChar).Value = CodigoVenta
+                .Add("@CodigoInversionVenta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+                .Add("@TipoFlujo", SqlDbType.VarChar).Value = "C-V"
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+            If Tabla = "OPC0" Or Tabla = "FUT0" Then
+
+                ''Crear Nuevo Venta
+                sql = "INSERT INTO " + Tabla + "
+([CodInv]
+,[FOperC]
+,[FLiqC]
+,[FVenC]
+,[VaUnidadC]
+,[ValorTransadoC]
+,[CoBrokerC]
+,[VaRecC]
+,[IdContratoC]
+,[CantContratoC]
+,[UniContraC]
+
+,[FOperV]
+,[FLiqV]
+,[FVenV]
+,[VaUnidadV]
+,[ValorTransadoV]
+,[CoBrokerV]
+,[VaRecV]
+,[IdContratoV]
+,[CantContratoV]
+,[UniContraV]
+,[GP]
+,[Rendimiento]
+,[TipoOperacion]
+
+) VALUES(
+           @CodInv
+,@FOperC
+,@FLiqC
+,@FVenC
+,@VaUnidadC
+,@ValorTransadoC
+,@CoBrokerC
+,@VaRecC
+,@IdContratoC
+,@CantContratoC
+,@UniContraC
+
+,@FOperV
+,@FLiqV
+,@FVenV
+,@VaUnidadV
+,@ValorTransadoV
+,@CoBrokerV
+,@VaRecV
+,@IdContratoV
+,@CantContratoV
+,@UniContraV
+,@GP
+,@Rendimiento
+,@TipoOperacion
+
+
+)
+    "
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+
+                'Try
+
+
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoVenta
+                    .Add("@FOperC", SqlDbType.DateTime).Value = CDate(coleccion(1))
+                    .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(coleccion(2))
+                    .Add("@FVenC", SqlDbType.DateTime).Value = CDate(coleccion(3))
+                    .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(coleccion(4))
+                    .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(coleccion(5))
+                    .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(coleccion(6))
+                    .Add("@VaRecC", SqlDbType.Float).Value = CDec(coleccion(7))
+                    .Add("@IdContratoC", SqlDbType.VarChar).Value = coleccion(8).ToString
+                    .Add("@CantContratoC", SqlDbType.Int).Value = CInt(coleccion(9))
+                    .Add("@UniContraC", SqlDbType.Int).Value = CInt(coleccion(10))
+
+
+                    .Add("@FOperV", SqlDbType.DateTime).Value = CDate(coleccion(11))
+                    .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(coleccion(12))
+                    .Add("@FVenV", SqlDbType.DateTime).Value = CDate(coleccion(13))
+                    .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(coleccion(14))
+                    .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(coleccion(15))
+                    .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(coleccion(16))
+                    .Add("@VaRecV", SqlDbType.Float).Value = CDec(coleccion(17))
+                    .Add("@IdContratoV", SqlDbType.VarChar).Value = coleccion(18).ToString
+                    .Add("@CantContratoV", SqlDbType.Int).Value = CInt(coleccion(19))
+                    .Add("@UniContraV", SqlDbType.Int).Value = CInt(coleccion(20))
+
+                    .Add("@GP", SqlDbType.Float).Value = CDec(coleccion(21))
+                    .Add("@Rendimiento", SqlDbType.Float).Value = CDec(coleccion(22))
+                    .Add("@TipoOperacion", SqlDbType.VarChar).Value = coleccion(23).ToString
+
+
+
+                End With
+
+
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+                ''Crear Nuevo Compra
+                sql = "UPDATE " + Tabla + " SET
+
+[FOperC]=@FOperC
+,[FLiqC]=@FLiqC
+,[FVenC]=@FVenC
+,[VaUnidadC]=@VaUnidadC
+,[ValorTransadoC]=@ValorTransadoC
+,[CoBrokerC]=@CoBrokerC
+,[VaRecC]=@VaRecC
+,[IdContratoC]=@IdContratoC
+,[CantContratoC]=@CantContratoC
+,[UniContraC]=@UniContraC
+,[FOperV]=@FOperV
+,[FLiqV]=@FLiqV
+,[FVenV]=@FVenV
+,[VaUnidadV]=@VaUnidadV
+,[ValorTransadoV]=@ValorTransadoV
+,[CoBrokerV]=@CoBrokerV
+,[VaRecV]=@VaRecV
+,[IdContratoV]=@IdContratoV
+,[CantContratoV]=@CantContratoV
+,[UniContraV]=@UniContraV
+,[GP]=@GP
+,[Rendimiento]=@Rendimiento
+,[TipoOperacion]=@TipoOperacion
+
+where [CodInv]=@CodInv
+    "
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+
+                'Try
+
+
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoCompra
+                    .Add("@FOperC", SqlDbType.DateTime).Value = CDate(coleccion(1))
+                    .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(coleccion(2))
+                    .Add("@FVenC", SqlDbType.DateTime).Value = CDate(coleccion(3))
+                    .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(coleccion(4))
+                    .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(coleccion(5))
+                    .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(coleccion(6))
+                    .Add("@VaRecC", SqlDbType.Float).Value = CDec(coleccion(7))
+                    .Add("@IdContratoC", SqlDbType.VarChar).Value = coleccion(8).ToString
+                    .Add("@CantContratoC", SqlDbType.Int).Value = CInt(coleccion(9))
+                    .Add("@UniContraC", SqlDbType.Int).Value = CInt(coleccion(10))
+
+
+                    .Add("@FOperV", SqlDbType.DateTime).Value = CDate(coleccion(11))
+                    .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(coleccion(12))
+                    .Add("@FVenV", SqlDbType.DateTime).Value = CDate(coleccion(13))
+                    .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(coleccion(14))
+                    .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(coleccion(15))
+                    .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(coleccion(16))
+                    .Add("@VaRecV", SqlDbType.Float).Value = CDec(coleccion(17))
+                    .Add("@IdContratoV", SqlDbType.VarChar).Value = coleccion(18).ToString
+                    .Add("@CantContratoV", SqlDbType.Int).Value = CInt(coleccion(19))
+                    .Add("@UniContraV", SqlDbType.Int).Value = CInt(coleccion(20))
+
+                    .Add("@GP", SqlDbType.Float).Value = CDec(coleccion(21))
+                    .Add("@Rendimiento", SqlDbType.Float).Value = CDec(coleccion(22))
+                    .Add("@TipoOperacion", SqlDbType.VarChar).Value = coleccion(23).ToString
+
+
+
+                End With
+
+
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+                myTrans.Commit()
+
+            ElseIf Tabla = "ACC0" Then
+                ''Crear Nuevo Venta
+
+
+                sql = "INSERT INTO " + Tabla + "
+           ([CodInv]
+           ,[PrecioLimpioC]
+           ,[FOperC]
+           ,[FVenC]
+           ,[DiasTC]
+           ,[GCapTotC]
+           ,[GCapUnC]
+           ,[RetAnBrC]
+           ,[RetAnNetC]
+           ,[UnC]
+           ,[ValTransC]
+           ,[MontoNetoC]
+           ,[PrecSucioC]
+           ,[PrecioLimpioV]
+           ,[FOperV]
+           ,[FVenV]
+           ,[DiasTV]
+           ,[GCapTotV]
+           ,[GCapUnV]
+           ,[RetAnBrV]
+           ,[RetAnNetV]
+           ,[UnV]
+           ,[ValTransV]
+           ,[MontoNetoV]
+           ,[PrecSucioV]
+           ,[ComisionCompraCasa]
+           ,[ComisionCompraBolsa]
+           ,[ComisionVentaCasa]
+           ,[ComisionVentaBolsa]
+           ,[IOF]
+           ,[Renta]
+           ,[Tipo]
+           ,[ComisionCompraCasaValor]
+           ,[ComisionCompraBolsaValor]
+           ,[ComisionVentaCasaValor]
+           ,[ComisionVentaBolsaValor]
+
+)
+     VALUES
+           (@CodInv
+           ,@PrecioLimpioC
+           ,@FOperC
+           ,@FVenC
+           ,@DiasTC
+           ,@GCapTotC
+           ,@GCapUnC
+           ,@RetAnBrC
+           ,@RetAnNetC
+           ,@UnC
+           ,@ValTransC
+           ,@MontoNetoC
+           ,@PrecSucioC
+           ,@PrecioLimpioV
+           ,@FOperV
+           ,@FVenV
+           ,@DiasTV
+           ,@GCapTotV
+           ,@GCapUnV
+           ,@RetAnBrV
+           ,@RetAnNetV
+           ,@UnV
+           ,@ValTransV
+           ,@MontoNetoV
+           ,@PrecSucioV
+           ,@ComisionCompraCasa
+           ,@ComisionCompraBolsa
+           ,@ComisionVentaCasa
+           ,@ComisionVentaBolsa
+           ,@IOF
+           ,@Renta
+           ,@Tipo
+           ,@ComisionCompraCasaValor
+           ,@ComisionCompraBolsaValor
+           ,@ComisionVentaCasaValor
+           ,@ComisionVentaBolsaValor
+)"
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoVenta
+                    .Add("@PrecioLimpioC", SqlDbType.Float).Value = CDec(coleccion(1))
+                    .Add("@FOperC", SqlDbType.Date).Value = coleccion(2)
+                    .Add("@FVenC", SqlDbType.Date).Value = coleccion(3)
+                    .Add("@DiasTC", SqlDbType.Float).Value = CDec(coleccion(4))
+                    .Add("@GCapTotC", SqlDbType.Float).Value = CDec(coleccion(5))
+                    .Add("@GCapUnC", SqlDbType.Float).Value = CDec(coleccion(6))
+                    .Add("@RetAnBrC", SqlDbType.Float).Value = CDec(coleccion(7))
+                    .Add("@RetAnNetC", SqlDbType.Float).Value = CDec(coleccion(8))
+                    .Add("@UnC", SqlDbType.Float).Value = CDec(coleccion(9))
+                    .Add("@ValTransC", SqlDbType.Float).Value = CDec(coleccion(10))
+                    .Add("@MontoNetoC", SqlDbType.Float).Value = CDec(coleccion(11))
+                    .Add("@PrecSucioC", SqlDbType.Float).Value = CDec(coleccion(12))
+                    .Add("@PrecioLimpioV", SqlDbType.Float).Value = CDec(coleccion(13))
+                    .Add("@FOperV", SqlDbType.Date).Value = coleccion(14)
+                    .Add("@FVenV", SqlDbType.Date).Value = coleccion(15)
+                    .Add("@DiasTV", SqlDbType.Float).Value = CDec(coleccion(16))
+                    .Add("@GCapTotV", SqlDbType.Float).Value = CDec(coleccion(17))
+                    If ((coleccion(18).ToString = "NaN")) Then
+                        .Add("@GCapUnV", SqlDbType.Float).Value = 0.0
+                    Else
+                        .Add("@GCapUnV", SqlDbType.Float).Value = CDec(coleccion(18))
+                    End If
+
+                    .Add("@RetAnBrV", SqlDbType.Float).Value = CDec(coleccion(19))
+                    .Add("@RetAnNetV", SqlDbType.Float).Value = CDec(coleccion(20))
+                    .Add("@UnV", SqlDbType.Float).Value = CDec(coleccion(21))
+                    .Add("@ValTransV", SqlDbType.Float).Value = CDec(coleccion(22))
+                    .Add("@MontoNetoV", SqlDbType.Float).Value = CDec(coleccion(23))
+
+                    If ((coleccion(24).ToString = "NaN")) Then
+                        .Add("@PrecSucioV", SqlDbType.Float).Value = 0.0
+
+                    Else
+                        .Add("@PrecSucioV", SqlDbType.Float).Value = CDec(coleccion(24))
+                    End If
+
+
+
+                    .Add("@ComisionCompraCasa", SqlDbType.Float).Value = CDec(coleccion(25))
+                    .Add("@ComisionCompraBolsa", SqlDbType.Float).Value = CDec(coleccion(26))
+                    .Add("@ComisionVentaCasa", SqlDbType.Float).Value = CDec(coleccion(27))
+                    .Add("@ComisionVentaBolsa", SqlDbType.Float).Value = CDec(coleccion(28))
+
+
+                    .Add("@IOF", SqlDbType.Bit).Value = CByte(coleccion(29))
+                    .Add("@Renta", SqlDbType.Bit).Value = CByte(coleccion(30))
+                    .Add("@Tipo", SqlDbType.VarChar).Value = coleccion(31)
+
+                    .Add("@ComisionCompraCasaValor", SqlDbType.Float).Value = CDec(coleccion(32))
+                    .Add("@ComisionCompraBolsaValor", SqlDbType.Float).Value = CDec(coleccion(33))
+                    .Add("@ComisionVentaCasaValor", SqlDbType.Float).Value = CDec(coleccion(34))
+                    .Add("@ComisionVentaBolsaValor", SqlDbType.Float).Value = CDec(coleccion(35))
+
+                End With
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+
+                ''Crear Nuevo Compra
+
+
+
+
+
+
+                sql = "UPDATE " + Tabla + " SET
+         
+            [PrecioLimpioC]=@PrecioLimpioC
+           ,[FOperC]=@FOperC
+           ,[FVenC]=@FVenC
+           ,[DiasTC]=@DiasTC
+           ,[GCapTotC]=@GCapTotC
+           ,[GCapUnC]=@GCapUnC
+           ,[RetAnBrC]=@RetAnBrC
+           ,[RetAnNetC]=@RetAnNetC
+           ,[UnC]=@UnC
+           ,[ValTransC]=@ValTransC
+           ,[MontoNetoC]=@MontoNetoC
+           ,[PrecSucioC]=@PrecSucioC
+           ,[PrecioLimpioV]=@PrecioLimpioV
+           ,[FOperV]=@FOperV
+           ,[FVenV]=@FVenV
+           ,[DiasTV]=@DiasTV
+           ,[GCapTotV]=@GCapTotV
+           ,[GCapUnV]=@GCapUnV
+           ,[RetAnBrV]=@RetAnBrV
+           ,[RetAnNetV]=@RetAnNetV
+           ,[UnV]=@UnV
+           ,[ValTransV]=@ValTransV
+           ,[MontoNetoV]=@MontoNetoV
+           ,[PrecSucioV]=@PrecSucioV
+           ,[ComisionCompraCasa]=@ComisionCompraCasa
+           ,[ComisionCompraBolsa]=@ComisionCompraBolsa
+           ,[ComisionVentaCasa]=@ComisionVentaCasa
+           ,[ComisionVentaBolsa]=@ComisionVentaBolsa
+           ,[IOF]=@IOF
+           ,[Renta]=@Renta
+           ,[Tipo]=@Tipo
+           ,[ComisionCompraCasaValor]=@ComisionCompraCasaValor
+           ,[ComisionCompraBolsaValor]=@ComisionCompraBolsaValor
+           ,[ComisionVentaCasaValor]=@ComisionVentaCasaValor
+           ,[ComisionVentaBolsaValor]=@ComisionVentaBolsaValor
+            where   [CodInv]=@CodInv
+"
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoCompra
+                    .Add("@PrecioLimpioC", SqlDbType.Float).Value = CDec(coleccion(1))
+                    .Add("@FOperC", SqlDbType.Date).Value = coleccion(2)
+                    .Add("@FVenC", SqlDbType.Date).Value = coleccion(3)
+                    .Add("@DiasTC", SqlDbType.Float).Value = CDec(coleccion(4))
+                    .Add("@GCapTotC", SqlDbType.Float).Value = CDec(coleccion(5))
+                    .Add("@GCapUnC", SqlDbType.Float).Value = CDec(coleccion(6))
+                    .Add("@RetAnBrC", SqlDbType.Float).Value = CDec(coleccion(7))
+                    .Add("@RetAnNetC", SqlDbType.Float).Value = CDec(coleccion(8))
+                    .Add("@UnC", SqlDbType.Float).Value = CDec(coleccion(9))
+                    .Add("@ValTransC", SqlDbType.Float).Value = CDec(coleccion(10))
+                    .Add("@MontoNetoC", SqlDbType.Float).Value = CDec(coleccion(11))
+                    .Add("@PrecSucioC", SqlDbType.Float).Value = CDec(coleccion(12))
+                    .Add("@PrecioLimpioV", SqlDbType.Float).Value = CDec(coleccion(13))
+                    .Add("@FOperV", SqlDbType.Date).Value = coleccion(14)
+                    .Add("@FVenV", SqlDbType.Date).Value = coleccion(15)
+                    .Add("@DiasTV", SqlDbType.Float).Value = CDec(coleccion(16))
+                    .Add("@GCapTotV", SqlDbType.Float).Value = CDec(coleccion(17))
+                    If ((coleccion(18).ToString = "NaN")) Then
+                        .Add("@GCapUnV", SqlDbType.Float).Value = 0.0
+                    Else
+                        .Add("@GCapUnV", SqlDbType.Float).Value = CDec(coleccion(18))
+                    End If
+
+                    .Add("@RetAnBrV", SqlDbType.Float).Value = CDec(coleccion(19))
+                    .Add("@RetAnNetV", SqlDbType.Float).Value = CDec(coleccion(20))
+                    .Add("@UnV", SqlDbType.Float).Value = CDec(coleccion(21))
+                    .Add("@ValTransV", SqlDbType.Float).Value = CDec(coleccion(22))
+                    .Add("@MontoNetoV", SqlDbType.Float).Value = CDec(coleccion(23))
+
+                    If ((coleccion(24).ToString = "NaN")) Then
+                        .Add("@PrecSucioV", SqlDbType.Float).Value = 0.0
+
+                    Else
+                        .Add("@PrecSucioV", SqlDbType.Float).Value = CDec(coleccion(24))
+                    End If
+
+
+
+                    .Add("@ComisionCompraCasa", SqlDbType.Float).Value = CDec(coleccion(25))
+                    .Add("@ComisionCompraBolsa", SqlDbType.Float).Value = CDec(coleccion(26))
+                    .Add("@ComisionVentaCasa", SqlDbType.Float).Value = CDec(coleccion(27))
+                    .Add("@ComisionVentaBolsa", SqlDbType.Float).Value = CDec(coleccion(28))
+
+
+                    .Add("@IOF", SqlDbType.Bit).Value = CByte(coleccion(29))
+                    .Add("@Renta", SqlDbType.Bit).Value = CByte(coleccion(30))
+                    .Add("@Tipo", SqlDbType.VarChar).Value = coleccion(31)
+
+                    .Add("@ComisionCompraCasaValor", SqlDbType.Float).Value = CDec(coleccion(32))
+                    .Add("@ComisionCompraBolsaValor", SqlDbType.Float).Value = CDec(coleccion(33))
+                    .Add("@ComisionVentaCasaValor", SqlDbType.Float).Value = CDec(coleccion(34))
+                    .Add("@ComisionVentaBolsaValor", SqlDbType.Float).Value = CDec(coleccion(35))
+
+                End With
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+                myTrans.Commit()
+
+
+            ElseIf Tabla = "CIN0" Or Tabla = "BON0" Or Tabla = "EURB0" Or Tabla = "TIT" Then
+                ''Crear Nueva Venta
+
+                sql = "INSERT INTO " + Tabla + "
+      ([CodInv]   
+      ,[PeriodicC]
+      ,[ValNomC]
+      ,[UltFCupC]
+      ,[SigFCupC]
+      ,[FLiqC]
+      ,[FVencC]
+      ,[PorcCupC]
+      ,[PrecVencC]
+      ,[PrecioCompra]
+      ,[DiasBaseC]
+     
+      
+	  ,[PeriodicV]
+      ,[ValNomV]
+      ,[UltFCupV]
+      ,[SigFCupV]
+      ,[FLiqV]
+      ,[FVencV]
+      ,[PorcCupV]
+      ,[PrecVencV]
+      ,[PrecioVenta]
+      ,[DiasBaseV]
+   
+
+      ,[ComisionPorCompraCasa]
+      ,[ComisionPorCompraBolsa]
+      ,[ComisionPorVentaCasa]
+      ,[ComisionPorVentaBolsa]
+      ,[YTMCompra]
+      ,[YTMVenta]
+        ,[DiasVenC]
+        ,[DiasVenV]
+        ,[DiasAcuC]
+        ,[DiasAcuV]
+        ,[YTMVenC]
+        ,[YTMVenV]
+        ,[IntAcuC]
+        ,[IntAcuV]
+        ,[IntPorAcuC]
+        ,[IntPorAcuV]
+        ,[PrecSucioC]
+        ,[PrecSucioV]
+        ,[ComisionCasaC]
+        ,[ComisionCasaV]
+        ,[ComisionBolsaC]
+        ,[ComisionBolsaV]
+        ,[ValTransC]
+        ,[ValTransV]
+        ,[MontoPagar]
+        ,[MontoRecibir]
+        ,[CostTransC]
+        ,[CupRecibidos]
+
+)
+      VALUES(
+       @CodInv
+      ,@PeriodicC
+      ,@ValNomC
+      ,@UltFCupC
+      ,@SigFCupC
+      ,@FLiqC
+      ,@FVencC
+      ,@PorcCupC
+      ,@PrecVencC
+      ,@PrecioCompra
+      ,@DiasBaseC
+      
+	  ,@PeriodicV
+      ,@ValNomV
+      ,@UltFCupV
+      ,@SigFCupV
+      ,@FLiqV
+      ,@FVencV
+      ,@PorcCupV
+      ,@PrecVencV
+      ,@PrecioVenta
+      ,@DiasBaseV
+
+
+      ,@ComisionPorCompraCasa
+      ,@ComisionPorCompraBolsa
+      ,@ComisionPorVentaCasa
+      ,@ComisionPorVentaBolsa
+      ,@YTMCompra
+      ,@YTMVenta     
+
+
+
+        ,@DiasVenC
+        ,@DiasVenV
+        ,@DiasAcuC
+        ,@DiasAcuV
+        ,@YTMVenC
+        ,@YTMVenV
+        ,@IntAcuC
+        ,@IntAcuV
+        ,@IntPorAcuC
+        ,@IntPorAcuV
+        ,@PrecSucioC
+        ,@PrecSucioV
+        ,@ComisionCasaC
+        ,@ComisionCasaV
+        ,@ComisionBolsaC
+        ,@ComisionBolsaV
+        ,@ValTransC
+        ,@ValTransV
+        ,@MontoPagar
+        ,@MontoRecibir
+        ,@CostTransC
+        ,@CupRecibidos
+
+)
+
+
+ 
+"
+
+
+
+
+
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                'Try
+
+                With cmd.Parameters
+                    If (coleccion(1) Is Nothing) Then
+                        .Add("@PeriodicC", SqlDbType.VarChar).Value = "M"
+                    Else
+                        .Add("@PeriodicC", SqlDbType.VarChar).Value = coleccion(1).ToString()
+                    End If
+
+                    .Add("@ValNomC", SqlDbType.Float).Value = CDec(coleccion(2).ToString.Trim("%"))
+                    .Add("@UltFCupC", SqlDbType.Date).Value = coleccion(3)
+                    .Add("@SigFCupC", SqlDbType.Date).Value = coleccion(4)
+                    .Add("@FLiqC", SqlDbType.Date).Value = coleccion(5)
+                    .Add("@FVencC", SqlDbType.Date).Value = coleccion(6)
+                    .Add("@PorcCupC", SqlDbType.Float).Value = CDec(coleccion(7).ToString.Trim("%"))
+                    .Add("@PrecVencC", SqlDbType.Float).Value = CDec(coleccion(8).ToString.Trim("%"))
+                    .Add("@PrecioCompra", SqlDbType.Float).Value = CDec(coleccion(9).ToString.Trim("%"))
+
+                    If (coleccion(10) Is Nothing) Then
+                        .Add("@DiasBaseC", SqlDbType.Int).Value = 365
+                    Else
+                        .Add("@DiasBaseC", SqlDbType.Int).Value = CInt(coleccion(10).ToString.Trim("%"))
+                    End If
+
+
+                    '.Add("@CostoTransC", SqlDbType.Float).Value = Trim(CDec(coleccion(11)))
+
+
+                    If (coleccion(12) Is Nothing) Then
+                        .Add("@PeriodicV", SqlDbType.VarChar).Value = "M"
+                    Else
+                        .Add("@PeriodicV", SqlDbType.VarChar).Value = coleccion(12).ToString()
+                    End If
+
+
+
+                    .Add("@ValNomV", SqlDbType.Float).Value = CDec(coleccion(13).ToString.Trim("%"))
+                    .Add("@UltFCupV", SqlDbType.Date).Value = coleccion(14)
+                    .Add("@SigFCupV", SqlDbType.Date).Value = coleccion(15)
+                    .Add("@FLiqV", SqlDbType.Date).Value = coleccion(16)
+                    .Add("@FVencV", SqlDbType.Date).Value = coleccion(17)
+                    .Add("@PorcCupV", SqlDbType.Float).Value = CDec(coleccion(18).ToString.Trim("%"))
+                    .Add("@PrecVencV", SqlDbType.Float).Value = CDec(coleccion(19).ToString.Trim("%"))
+                    .Add("@PrecioVenta", SqlDbType.Float).Value = CDec(coleccion(20).ToString.Trim("%"))
+                    If (coleccion(21) Is Nothing) Then
+                        .Add("@DiasBaseV", SqlDbType.Int).Value = 365
+                    Else
+                        .Add("@DiasBaseV", SqlDbType.Int).Value = CInt(coleccion(21).ToString.Trim("%"))
+                    End If
+
+                    '.Add("@CostoTransV", SqlDbType.Float).Value = CDec(coleccion(22).ToString.Trim("%"))
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoVenta
+
+                    .Add("@ComisionPorCompraCasa", SqlDbType.Float).Value = coleccion(26).ToString()
+                    .Add("@ComisionPorCompraBolsa", SqlDbType.Float).Value = coleccion(27).ToString()
+                    .Add("@ComisionPorVentaCasa", SqlDbType.Float).Value = coleccion(28).ToString()
+                    .Add("@ComisionPorVentaBolsa", SqlDbType.Float).Value = coleccion(29).ToString()
+
+                    .Add("@YTMCompra", SqlDbType.Float).Value = coleccion(30).ToString()
+                    .Add("@YTMVenta", SqlDbType.Float).Value = coleccion(31).ToString()
+
+
+
+
+                    .Add("@DiasVenC", SqlDbType.Int).Value = coleccion(32)
+                    .Add("@DiasVenV", SqlDbType.Int).Value = coleccion(33)
+                    .Add("@DiasAcuC", SqlDbType.Int).Value = coleccion(34)
+                    .Add("@DiasAcuV", SqlDbType.Int).Value = coleccion(35)
+                    .Add("@YTMVenC", SqlDbType.Float).Value = coleccion(36)
+                    .Add("@YTMVenV", SqlDbType.Float).Value = coleccion(37)
+                    .Add("@IntAcuC", SqlDbType.Float).Value = coleccion(38)
+                    .Add("@IntAcuV", SqlDbType.Float).Value = coleccion(39)
+                    .Add("@IntPorAcuC", SqlDbType.Float).Value = coleccion(40)
+                    .Add("@IntPorAcuV", SqlDbType.Float).Value = coleccion(41)
+                    .Add("@PrecSucioC", SqlDbType.Float).Value = coleccion(42)
+                    .Add("@PrecSucioV", SqlDbType.Float).Value = coleccion(43)
+                    .Add("@ComisionCasaC", SqlDbType.Float).Value = coleccion(44)
+                    .Add("@ComisionCasaV", SqlDbType.Float).Value = coleccion(45)
+                    .Add("@ComisionBolsaC", SqlDbType.Float).Value = coleccion(46)
+                    .Add("@ComisionBolsaV", SqlDbType.Float).Value = coleccion(47)
+                    .Add("@ValTransC", SqlDbType.Float).Value = coleccion(48)
+                    .Add("@ValTransV", SqlDbType.Float).Value = coleccion(49)
+                    .Add("@MontoPagar", SqlDbType.Float).Value = coleccion(50)
+                    .Add("@MontoRecibir", SqlDbType.Float).Value = coleccion(51)
+                    .Add("@CostTransC", SqlDbType.Float).Value = coleccion(52)
+                    .Add("@CupRecibidos", SqlDbType.Float).Value = coleccion(53)
+                End With
+
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+                ''Crear Nueva Compra
+
+
+                sql = "UPDATE " + Tabla + " SET 
+
+      [PeriodicC]=@PeriodicC
+      ,[ValNomC]=@ValNomC
+      ,[UltFCupC]=@UltFCupC
+      ,[SigFCupC]=@SigFCupC
+      ,[FLiqC]=@FLiqC
+      ,[FVencC]=@FVencC
+      ,[PorcCupC]=@PorcCupC
+      ,[PrecVencC]=@PrecVencC
+      ,[PrecioCompra]=@PrecioCompra
+      ,[DiasBaseC]  =@DiasBaseC
+	  ,[PeriodicV]=@PeriodicV
+      ,[ValNomV]=@ValNomV
+      ,[UltFCupV]=@UltFCupV
+      ,[SigFCupV]=@SigFCupV
+      ,[FLiqV]=@FLiqV
+      ,[FVencV]=@FVencV
+      ,[PorcCupV]=@PorcCupV
+      ,[PrecVencV]=@PrecVencV
+      ,[PrecioVenta]=@PrecioVenta
+      ,[DiasBaseV]=@DiasBaseV
+      ,[ComisionPorCompraCasa]=@ComisionPorCompraCasa
+      ,[ComisionPorCompraBolsa]=@ComisionPorCompraBolsa
+      ,[ComisionPorVentaCasa]=@ComisionPorVentaCasa
+      ,[ComisionPorVentaBolsa]=@ComisionPorVentaBolsa
+      ,[YTMCompra]=@YTMCompra
+      ,[YTMVenta]=@YTMVenta
+        ,[DiasVenC]=@DiasVenC
+        ,[DiasVenV]=@DiasVenV
+        ,[DiasAcuC]=@DiasAcuC
+        ,[DiasAcuV]=@DiasAcuV
+        ,[YTMVenC]=@YTMVenC
+        ,[YTMVenV]=@YTMVenV
+        ,[IntAcuC]=@IntAcuC
+        ,[IntAcuV]=@IntAcuV
+        ,[IntPorAcuC]=@IntPorAcuC
+        ,[IntPorAcuV]=@IntPorAcuV
+        ,[PrecSucioC]=@PrecSucioC
+        ,[PrecSucioV]=@PrecSucioV
+        ,[ComisionCasaC]=@ComisionCasaC
+        ,[ComisionCasaV]=@ComisionCasaV
+        ,[ComisionBolsaC]=@ComisionBolsaC
+        ,[ComisionBolsaV]=@ComisionBolsaV
+        ,[ValTransC]=@ValTransC
+        ,[ValTransV]=@ValTransV
+        ,[MontoPagar]=@MontoPagar
+        ,[MontoRecibir]=@MontoRecibir
+        ,[CostTransC]=@CostTransC
+        ,[CupRecibidos]=@CupRecibidos
+WHERE       [CodInv] = @CodInv
+
+ 
+"
+
+
+
+
+
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                'Try
+
+                With cmd.Parameters
+                    If (coleccion(1) Is Nothing) Then
+                        .Add("@PeriodicC", SqlDbType.VarChar).Value = "M"
+                    Else
+                        .Add("@PeriodicC", SqlDbType.VarChar).Value = coleccion(1).ToString()
+                    End If
+
+                    .Add("@ValNomC", SqlDbType.Float).Value = CDec(coleccion(2).ToString.Trim("%"))
+                    .Add("@UltFCupC", SqlDbType.Date).Value = coleccion(3)
+                    .Add("@SigFCupC", SqlDbType.Date).Value = coleccion(4)
+                    .Add("@FLiqC", SqlDbType.Date).Value = coleccion(5)
+                    .Add("@FVencC", SqlDbType.Date).Value = coleccion(6)
+                    .Add("@PorcCupC", SqlDbType.Float).Value = CDec(coleccion(7).ToString.Trim("%"))
+                    .Add("@PrecVencC", SqlDbType.Float).Value = CDec(coleccion(8).ToString.Trim("%"))
+                    .Add("@PrecioCompra", SqlDbType.Float).Value = CDec(coleccion(9).ToString.Trim("%"))
+
+                    If (coleccion(10) Is Nothing) Then
+                        .Add("@DiasBaseC", SqlDbType.Int).Value = 365
+                    Else
+                        .Add("@DiasBaseC", SqlDbType.Int).Value = CInt(coleccion(10).ToString.Trim("%"))
+                    End If
+
+
+                    '.Add("@CostoTransC", SqlDbType.Float).Value = Trim(CDec(coleccion(11)))
+
+
+                    If (coleccion(12) Is Nothing) Then
+                        .Add("@PeriodicV", SqlDbType.VarChar).Value = "M"
+                    Else
+                        .Add("@PeriodicV", SqlDbType.VarChar).Value = coleccion(12).ToString()
+                    End If
+
+
+
+                    .Add("@ValNomV", SqlDbType.Float).Value = CDec(coleccion(13).ToString.Trim("%"))
+                    .Add("@UltFCupV", SqlDbType.Date).Value = coleccion(14)
+                    .Add("@SigFCupV", SqlDbType.Date).Value = coleccion(15)
+                    .Add("@FLiqV", SqlDbType.Date).Value = coleccion(16)
+                    .Add("@FVencV", SqlDbType.Date).Value = coleccion(17)
+                    .Add("@PorcCupV", SqlDbType.Float).Value = CDec(coleccion(18).ToString.Trim("%"))
+                    .Add("@PrecVencV", SqlDbType.Float).Value = CDec(coleccion(19).ToString.Trim("%"))
+                    .Add("@PrecioVenta", SqlDbType.Float).Value = CDec(coleccion(20).ToString.Trim("%"))
+                    If (coleccion(21) Is Nothing) Then
+                        .Add("@DiasBaseV", SqlDbType.Int).Value = 365
+                    Else
+                        .Add("@DiasBaseV", SqlDbType.Int).Value = CInt(coleccion(21).ToString.Trim("%"))
+                    End If
+
+                    '.Add("@CostoTransV", SqlDbType.Float).Value = CDec(coleccion(22).ToString.Trim("%"))
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoCompra
+
+                    .Add("@ComisionPorCompraCasa", SqlDbType.Float).Value = coleccion(26).ToString()
+                    .Add("@ComisionPorCompraBolsa", SqlDbType.Float).Value = coleccion(27).ToString()
+                    .Add("@ComisionPorVentaCasa", SqlDbType.Float).Value = coleccion(28).ToString()
+                    .Add("@ComisionPorVentaBolsa", SqlDbType.Float).Value = coleccion(29).ToString()
+
+                    .Add("@YTMCompra", SqlDbType.Float).Value = coleccion(30).ToString()
+                    .Add("@YTMVenta", SqlDbType.Float).Value = coleccion(31).ToString()
+
+
+
+
+                    .Add("@DiasVenC", SqlDbType.Int).Value = coleccion(32)
+                    .Add("@DiasVenV", SqlDbType.Int).Value = coleccion(33)
+                    .Add("@DiasAcuC", SqlDbType.Int).Value = coleccion(34)
+                    .Add("@DiasAcuV", SqlDbType.Int).Value = coleccion(35)
+                    .Add("@YTMVenC", SqlDbType.Float).Value = coleccion(36)
+                    .Add("@YTMVenV", SqlDbType.Float).Value = coleccion(37)
+                    .Add("@IntAcuC", SqlDbType.Float).Value = coleccion(38)
+                    .Add("@IntAcuV", SqlDbType.Float).Value = coleccion(39)
+                    .Add("@IntPorAcuC", SqlDbType.Float).Value = coleccion(40)
+                    .Add("@IntPorAcuV", SqlDbType.Float).Value = coleccion(41)
+                    .Add("@PrecSucioC", SqlDbType.Float).Value = coleccion(42)
+                    .Add("@PrecSucioV", SqlDbType.Float).Value = coleccion(43)
+                    .Add("@ComisionCasaC", SqlDbType.Float).Value = coleccion(44)
+                    .Add("@ComisionCasaV", SqlDbType.Float).Value = coleccion(45)
+                    .Add("@ComisionBolsaC", SqlDbType.Float).Value = coleccion(46)
+                    .Add("@ComisionBolsaV", SqlDbType.Float).Value = coleccion(47)
+                    .Add("@ValTransC", SqlDbType.Float).Value = coleccion(48)
+                    .Add("@ValTransV", SqlDbType.Float).Value = coleccion(49)
+                    .Add("@MontoPagar", SqlDbType.Float).Value = coleccion(50)
+                    .Add("@MontoRecibir", SqlDbType.Float).Value = coleccion(51)
+                    .Add("@CostTransC", SqlDbType.Float).Value = coleccion(52)
+                    .Add("@CupRecibidos", SqlDbType.Float).Value = coleccion(53)
+                End With
+
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+                myTrans.Commit()
+
+
+            Else Tabla = "Error"
+                MsgBox("No se guardo el instrumento")
+            End If
+
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox("No se guardo el instrumento")
+        End Try
+    End Sub
+End Class

+ 968 - 0
DAO/DAONotaEstructurada.vb

@@ -0,0 +1,968 @@
+Imports System.Data.SqlClient
+
+
+Public Class DAONotaEstructurada
+
+
+    Function Nuevo(ByVal oNESTCE As NotaEstructuradaCE) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[NEST0]
+           ([CodInv]
+           ,[MontoInv]  
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           --,[AnBase]
+           ,[Periodic])
+     VALUES
+           (@CodInv
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           --,@AnBase
+           ,@Periodic)
+"
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = oNESTCE.CodigoInversion
+            .Add("@MontoInv", SqlDbType.Float).Value = oNESTCE.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oNESTCE.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oNESTCE.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Float).Value = oNESTCE.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oNESTCE.Plazo
+            '.Add("@AnBase",SqlDbType.VarChar).Value = oDAPCE.CodigoInversion
+            .Add("@Periodic", SqlDbType.VarChar).Value = oNESTCE.Periodicidad
+        End With
+
+        retorno = cmd.ExecuteNonQuery
+
+        cmd.Dispose()
+        cn.Dispose()
+
+        GuardaIntereses(oNESTCE.CodigoInversion, oNESTCE.dtIntereses)
+
+        Return retorno
+    End Function
+    Function Nuevo(ByVal oNEST As NotaEstructuradaCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim Tabla As String = ""
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        If Tipo = "P" Then
+            Tabla = "PDAP0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IDAP0"
+        End If
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevoDAP")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        query = "INSERT INTO [dbo].[" & Tabla & "]
+           ([DocId]
+           ,[MontoInv]
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           ,[AnBase]
+           ,[Periodic]
+           ,[RendBruto]
+           ,[RendNeto]
+           ,[IngrBruto]
+           ,[Impuestos]
+           ,[IngrNeto])
+     VALUES
+           (@DocId
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           ,@AnBase
+           ,@Periodic
+           ,@RendBruto
+           ,@RendNeto
+           ,@IngrBruto
+           ,@Impuestos
+           ,@IngrNeto
+		  )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            .Add("@MontoInv", SqlDbType.Decimal).Value = oNEST.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oNEST.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oNEST.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Decimal).Value = oNEST.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oNEST.Plazo
+            .Add("@AnBase", SqlDbType.Int).Value = oNEST.AnioBase
+            .Add("@Periodic", SqlDbType.NVarChar).Value = oNEST.Periodicidad
+            .Add("@RendBruto", SqlDbType.Decimal).Value = oNEST.RendimientoBruto
+            .Add("@RendNeto", SqlDbType.Decimal).Value = oNEST.RendimientoNeto
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = oNEST.IngresoBruto
+            .Add("@Impuestos", SqlDbType.Decimal).Value = oNEST.Impuestos
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = oNEST.IngresoNeto
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar DAP : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+        Return retorno
+    End Function
+
+    Public Sub CargarRegistro(ByVal oNEST As NotaEstructuradaCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PDAP0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IDAP0"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oNEST.MontoDeInversion = drd.Item("MontoInv")
+                oNEST.FechaOperacion = drd.Item("FOper")
+                oNEST.FechaVencimiento = drd.Item("FVenc")
+                oNEST.Tasa = drd.Item("Tasa")
+                oNEST.Plazo = drd.Item("Plazo")
+                oNEST.AnioBase = drd.Item("AnBase")
+                oNEST.Periodicidad = drd.Item("Periodic")
+                'oDAP.RendimientoBruto = drd.Item("RendBruto")
+                'oDAP.RendimientoNeto = drd.Item("RendNeto")
+                oNEST.IngresoBruto = drd.Item("IngrBruto")
+                oNEST.Impuestos = drd.Item("Impuestos")
+                oNEST.IngresoNeto = drd.Item("IngrNeto")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+    End Sub
+    Public Function CargarRegistro(ByVal vCodigoInversion As String) As NotaEstructuradaCE
+        Dim objCon As New Conexion
+        Dim oNESTCE As New NotaEstructuradaCE
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim da As SqlDataAdapter
+        Dim sql As String
+        Dim dtIntereses As New DataTable
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        'INTERESES
+        sql = "SELECT * FROM [dbo].[NEST1] T0 WHERE T0.CodInv=@CodInv"
+        da = New SqlDataAdapter(sql, cn)
+        da.SelectCommand.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        da.Fill(dtIntereses)
+        oNESTCE.dtIntereses = dtIntereses
+
+        sql = "SELECT * FROM [dbo].[NEST0] T0 WHERE T0.CodInv=@CodInv"
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oNESTCE.CodigoInversion = vCodigoInversion.ToString
+                oNESTCE.MontoDeInversion = drd.Item("MontoInv").ToString
+                oNESTCE.FechaOperacion = drd.Item("FOper").ToString
+                oNESTCE.FechaVencimiento = drd.Item("FVenc").ToString
+                oNESTCE.Tasa = drd.Item("Tasa").ToString
+                oNESTCE.Plazo = drd.Item("Plazo").ToString
+                oNESTCE.Periodicidad = drd.Item("Periodic").ToString
+
+            End If
+            drd.Close()
+
+        Else
+            'NO ENCONTRO EL REGISTRO
+        End If
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return oNESTCE
+
+    End Function
+
+    Public Function Actualizar(ByVal oNESTCE As NotaEstructuradaCE) As Integer
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim retorno As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "UPDATE [dbo].[NEST0]
+   SET [MontoInv] = @MontoInv
+      ,[FOper] = @FOper
+      ,[FVenc] = @FVenc
+      ,[Tasa] = @Tasa
+      ,[Plazo] = @Plazo
+      --,[AnBase] = @AnBase
+      ,[Periodic] = @Periodic
+ WHERE [CodInv] = @CodInv"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+
+
+        With cmd.Parameters
+            .Add("@MontoInv", SqlDbType.Float).Value = oNESTCE.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oNESTCE.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oNESTCE.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Float).Value = oNESTCE.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oNESTCE.Plazo
+            .Add("@Periodic", SqlDbType.VarChar).Value = oNESTCE.Periodicidad
+        End With
+
+        cmd.Connection = cn
+        retorno = cmd.ExecuteNonQuery
+
+        cmd.Dispose()
+        cn.Dispose()
+
+        GuardaIntereses(oNESTCE.CodigoInversion, oNESTCE.dtIntereses)
+
+        Return retorno
+    End Function
+    Private Sub GuardaIntereses(ByVal vCodInversion As String, dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim res As Integer
+
+        sql = "DELETE FROM [dbo].[NEST1]
+      WHERE [CodInv]=@CodInv"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodInversion
+
+
+        cmd.Connection = cn
+        res = cmd.ExecuteNonQuery
+        sql = String.Empty
+
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[NEST1]
+           ([CodInv]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+           ,[Estado])
+     VALUES
+           (@CodInv
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+           ,@Estado)"
+
+                cmd.CommandText = sql
+                With cmd.Parameters
+                    .AddWithValue("@CodInv", vCodInversion)
+                    .AddWithValue("@Plazo", dr("Plazo"))
+                    .AddWithValue("@Fecha", dr("Fecha"))
+                    .AddWithValue("@IngrBruto", dr("IngrBruto"))
+                    .AddWithValue("@PorcImp", dr("PorcImp"))
+                    .AddWithValue("@MontoImp", dr("MontoImp"))
+                    .AddWithValue("@IngrNeto", dr("IngrNeto"))
+                    .AddWithValue("@Estado", dr("Estado"))
+                End With
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+
+        cmd.Dispose()
+        cn.Dispose()
+
+    End Sub
+
+
+
+    Public Function NuevoDato(ByVal Coleccion As Collection, ByVal Diccionario As Dictionary(Of String, Collection), ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+            sql = "INSERT INTO [dbo].[NEST0](
+           [CodInv]
+           ,[MontoInv]
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           ,[Periodic]
+           ,[RendBr]
+           ,[RendNet]   
+           ,[IngrBrutoTot]
+           ,[IngrNetoTot]
+           ,[Renta]
+
+
+) VALUES(
+
+           @CodInv
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           ,@Periodic
+           ,@RendBr
+           ,@RendNet
+           ,@IngrBrutoTot
+           ,@IngrNetoTot
+           ,@Renta
+)
+    "
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@MontoInv", SqlDbType.Decimal).Value = Coleccion(1)
+                .Add("@FOper", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(3)
+                .Add("@Tasa", SqlDbType.Decimal).Value = Coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = Coleccion(5)
+                .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(6)
+                .Add("@RendBr", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@RendNet", SqlDbType.VarChar).Value = Coleccion(8)
+
+                .Add("@IngrBrutoTot", SqlDbType.Float).Value = Coleccion(9)
+                .Add("@IngrNetoTot", SqlDbType.Float).Value = Coleccion(10)
+                .Add("@Renta", SqlDbType.Float).Value = Coleccion(11)
+            End With
+
+            retorno = cmd.ExecuteNonQuery
+
+
+            sql = "INSERT INTO [dbo].[NEST1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+
+
+
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Correlativo", SqlDbType.Int).Value = Coleccion2(1)
+                        .Add("@Plazo", SqlDbType.Int).Value = Coleccion2(2)
+                        .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion2(3)
+                        .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion2(4)
+                        .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion2(5)
+                        .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion2(6)
+                        .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion2(7)
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+    End Function
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevoElemento(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[NEST1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+
+
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Plazo", SqlDbType.Int).Value = Coleccion(2)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(3)
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion(4)
+            .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion(5)
+            .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion(6)
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion(7)
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+    Public Function ModificarElemento(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE  [dbo].[NEST1] SET
+
+           [Plazo]=@Plazo
+           ,[Fecha]=@Fecha
+           ,[IngrBruto]=@IngrBruto
+           ,[PorcImp]=@PorcImp
+           ,[MontoImp]=@MontoImp
+           ,[IngrNeto]=@IngrNeto
+            where  [CodInv]=@CodInv AND [Correlativo]=@Correlativo
+
+    "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+
+
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Plazo", SqlDbType.Int).Value = Coleccion(2)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(3)
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion(4)
+            .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion(5)
+            .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion(6)
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion(7)
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Sub EliminarElemento(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[NEST1]
+      WHERE [CodInv]=@CodInv "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+
+
+
+
+
+
+
+    Public Function ModificarDato(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection))
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+            sql = "UPDATE [dbo].[NEST0] SET
+            [MontoInv]=@MontoInv
+           ,[FOper]=@FOper
+           ,[FVenc]=@FVenc
+           ,[Tasa]=@Tasa
+           ,[Plazo]=@Plazo
+           ,[Periodic]=@Periodic
+           ,[RendBr]=@RendBr
+           ,[RendNet]=@RendNet
+            ,[IngrBrutoTot]=@IngrBrutoTot
+            ,[IngrNetoTot]=@IngrNetoTot
+            ,[Renta]=@Renta
+            where [CodInv]=  @CodInv
+    "
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@MontoInv", SqlDbType.Decimal).Value = Coleccion(1)
+                .Add("@FOper", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(3)
+                .Add("@Tasa", SqlDbType.Decimal).Value = Coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = Coleccion(5)
+                .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(6)
+                .Add("@RendBr", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@RendNet", SqlDbType.VarChar).Value = Coleccion(8)
+
+                .Add("@IngrBrutoTot", SqlDbType.Float).Value = Coleccion(9)
+                .Add("@IngrNetoTot", SqlDbType.Float).Value = Coleccion(10)
+                .Add("@Renta", SqlDbType.Float).Value = Coleccion(11)
+            End With
+            retorno = cmd.ExecuteNonQuery
+
+
+            sql = "INSERT INTO [dbo].[NEST1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+            sql = "delete from NEST1 Where CodInv='" + Codigo + "'"
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            retorno = cmd.ExecuteNonQuery
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[NEST1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Correlativo", SqlDbType.Int).Value = Coleccion2(1)
+                        .Add("@Plazo", SqlDbType.Int).Value = Coleccion2(2)
+                        .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion2(3)
+                        .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion2(4)
+                        .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion2(5)
+                        .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion2(6)
+                        .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion2(7)
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+
+
+    'Public Sub EliminarDato(ByVal Codigo As String)
+    '    Dim sql As String
+    '    Dim cmd As SqlCommand
+    '    Dim res As Integer
+
+    '    sql = "DELETE FROM [dbo].[DAP0]
+    '  WHERE [CodInv]=@CodInv"
+
+
+
+    '    cn = objCon.Conectar
+
+    '    If Not cn.State = ConnectionState.Open Then
+    '        cn.Open()
+    '    End If
+
+    '    cmd = New SqlCommand
+    '    cmd.CommandText = sql
+    '    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+    '    cmd.Connection = cn
+
+    '    res = cmd.ExecuteNonQuery
+
+    'End Sub
+
+
+
+    Public Sub Eliminar(ByVal Codigo As String)
+
+        Dim objCon As New Conexion
+
+
+
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[NEST0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[NEST1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+    End Sub
+
+
+End Class

+ 1794 - 0
DAO/DAOPropuestaInversion.vb

@@ -0,0 +1,1794 @@
+Imports System.Data.SqlClient
+Public Class DAOPropuestaInversion
+
+    Dim CambiarEstArbCE As New CambiarEstArbCE
+    Dim da As SqlDataAdapter
+    Dim Operaciones As New Operaciones
+    'Dim cmd As SqlCommand
+
+
+    Function ExisteInstrumento(ByVal CodigoInversion As String)
+        Dim objCon As New Conexion
+        Dim valor As Double = 0
+        Dim cn As SqlClient.SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_ExisteTitulo]"
+        Dim cmd As New SqlClient.SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@CodigoInversion", SqlDbType.VarChar).Value = CodigoInversion
+        valor = Operaciones.ConvertirDecimal(cmd.ExecuteScalar)
+        cmd.Dispose()
+        cn.Dispose()
+        If valor = 0 Then
+            Return False
+        Else
+            Return True
+        End If
+    End Function
+
+    Public Function TraerMontosPrecio(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim diccionario As New Dictionary(Of String, Collection)
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SP_CargarMontoPrecio"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+
+
+
+
+
+
+
+        Dim dr As SqlDataReader
+        Dim SumaVal As Double = 0
+        dr = cmd.ExecuteReader
+        Dim CodigoEmpresa As String = String.Empty
+        Dim CodigoInstrumento As String = String.Empty
+
+        Dim MontoPrimario As Double = 0
+
+        Dim MontoSecundario As Double = 0
+        Dim PrecioV As Double = 0
+        Dim precioC As Double = 0
+
+
+
+        While dr.Read
+            If String.IsNullOrEmpty(dr.GetName(0)) Then
+                Return Coleccion
+            End If
+
+
+
+            CodigoEmpresa = dr("CodigoEmpresa")
+            CodigoInstrumento = dr("CodigoInstrumento")
+
+
+            If Not String.IsNullOrEmpty(dr("MontoPrimario").ToString) Then
+                MontoPrimario = dr("MontoPrimario")
+            End If
+
+            If Not String.IsNullOrEmpty(dr("MontoSecundario").ToString) Then
+                MontoSecundario = dr("MontoSecundario")
+            End If
+
+            If Not String.IsNullOrEmpty(dr("PrecioV").ToString) Then
+                PrecioV = dr("PrecioV")
+            End If
+
+            If Not String.IsNullOrEmpty(dr("PrecioC").ToString) Then
+
+                precioC = dr("PrecioC")
+            End If
+
+
+
+
+
+
+            If CodigoInstrumento.IndexOf("REPO") > -1 Then
+                SumaVal += MontoPrimario
+
+            Else
+
+                Coleccion.Add(CodigoEmpresa)
+                Coleccion.Add(CodigoInstrumento)
+                Coleccion.Add(MontoPrimario)
+                Coleccion.Add(MontoSecundario)
+
+                Coleccion.Add(PrecioV)
+                Coleccion.Add(precioC)
+                Return Coleccion
+            End If
+
+        End While
+        Coleccion.Add(CodigoEmpresa)
+        Coleccion.Add(CodigoInstrumento)
+        Coleccion.Add(SumaVal)
+        Coleccion.Add(MontoSecundario)
+
+        Coleccion.Add(PrecioV)
+
+        Coleccion.Add(precioC)
+
+        cn.Close()
+        Return Coleccion
+    End Function
+
+
+
+
+
+
+
+    Public Function ListaPropuestasInversion() As DataSet
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_PROPIN_SELECT", cn)
+        da.Fill(ds, "PropuestasDeInversion")
+        Return ds
+
+        ds.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+    End Function
+
+    Public Function BuscarPropuestasInversion(ByVal ObjPropuesta As CEPropuestaInversion) As DataSet
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter("SP_PROPIN_BUSQUEDA", cn)
+        da.SelectCommand.CommandType = CommandType.StoredProcedure
+
+        With da.SelectCommand.Parameters
+
+            .Add("@CodigoPropuesta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion
+            .Add("@Asunto", SqlDbType.VarChar).Value = ObjPropuesta.Asunto
+            .Add("@Empresa", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresa
+            .Add("@InstrumentoFinanciero", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInstrumentoFinanciero
+            .Add("@Emisor", SqlDbType.Int).Value = CInt(ObjPropuesta.CodigoEmisor)
+            .Add("@CalificacionDeRiesgo", SqlDbType.VarChar).Value = ObjPropuesta.CodigoCalificacionDeRiesgo
+            .Add("@CalificadoraDeRiesgo", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresaCalificadora
+            .Add("@EstadoDocumento", SqlDbType.VarChar).Value = ObjPropuesta.EstadoDocumento
+
+            .Add("@CodPais", SqlDbType.VarChar).Value = ObjPropuesta.Pais
+            .Add("@TipoMerc", SqlDbType.VarChar).Value = ObjPropuesta.TipoMercado
+            .Add("@Plazo", SqlDbType.Int).Value = ObjPropuesta.PlazoNumero
+            .Add("@PlazoFact", SqlDbType.VarChar).Value = ObjPropuesta.PlazoFactor
+            .Add("@MontoInv", SqlDbType.Float).Value = ObjPropuesta.MontoInversion
+            .Add("@Precio", SqlDbType.Float).Value = ObjPropuesta.Precio
+            .Add("@Rendimiento", SqlDbType.Float).Value = ObjPropuesta.Rendimiento
+            .Add("@Ingresos", SqlDbType.Float).Value = ObjPropuesta.Ingresos
+            .Add("@OFon", SqlDbType.VarChar).Value = ObjPropuesta.OrigenDeFondos
+            .Add("@TipoOper", SqlDbType.VarChar).Value = ObjPropuesta.TipoOperacion
+            .Add("@AutEstado", SqlDbType.VarChar).Value = ObjPropuesta.EstadoAutorizacion
+
+
+
+
+        End With
+
+        da.Fill(ds, "Resultado")
+        Return ds
+
+        ds.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+    End Function
+
+
+    Public Function BuscarPropuestasCodigo(ByVal DiccionarioColecciones As Dictionary(Of String, Collection)) As DataSet
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim cn = objCon.Conectar
+        Dim Col_Empresas As New Collection
+        Dim Col_Emisor As New Collection
+        Dim Col_EstDocumento As New Collection
+        Dim Col_Instrumento As New Collection
+        Dim Col_CalRiesgo As New Collection
+        Dim Col_TipOperacion As New Collection
+        Dim Col_OriFond As New Collection
+        Dim Col_CalERiesgo As New Collection
+        Dim Col_Aut As New Collection
+        Dim Col_Plazo As New Collection
+        Dim Col_Pais As New Collection
+        Dim Col_TipMercado As New Collection
+
+
+
+        For Each Item In DiccionarioColecciones
+            If Item.Key = "Empresa" Then
+                Col_Empresas = Item.Value
+            ElseIf Item.Key = "Emisor" Then
+
+                Col_Emisor = Item.Value
+
+            ElseIf Item.Key = "EstDocumento" Then
+                Col_EstDocumento = Item.Value
+
+
+
+            ElseIf Item.Key = "Instrumento" Then
+
+                Col_Instrumento = Item.Value
+
+
+            ElseIf Item.Key = "CalRiesgo" Then
+
+                Col_CalRiesgo = Item.Value
+
+
+            ElseIf Item.Key = "TipOperacion" Then
+                Col_TipOperacion = Item.Value
+
+
+            ElseIf Item.Key = "OriFond" Then
+                Col_OriFond = Item.Value
+
+
+            ElseIf Item.Key = "CalERiesgo" Then
+
+                Col_CalERiesgo = Item.Value
+
+
+            ElseIf Item.Key = "Aut" Then
+
+                Col_Aut = Item.Value
+
+
+            ElseIf Item.Key = "Plazo" Then
+
+                Col_Plazo = Item.Value
+
+            ElseIf Item.Key = "Pais" Then
+
+                Col_Pais = Item.Value
+
+            ElseIf Item.Key = "TipMercado" Then
+                Col_TipMercado = Item.Value
+            End If
+        Next
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        Dim sql As String = "select 
+        CAST(DocId as varchar) as 'Id'
+        ,CAST(CodInv as varchar) as 'Código de Propuesta'
+        ,CAST(DocEst as varchar) as 'Estado'
+        ,CAST(Asunto as varchar) as 'Asunto'
+        ,CAST(CodEmpr as varchar) as 'Empresa'
+        ,CAST(CodIF as varchar) as 'Instrumento Financiero'
+        ,CAST(CodEmis as varchar) as 'Emisor'
+        ,CAST(CodCalRi as varchar) as 'Calificación de Riesgo'
+        ,CAST(CodECalRi as varchar) as 'Empresa Calificadora'
+        ,CAST(OFon as varchar) as 'Origen de Fondos'
+        ,CAST(Coment as varchar) as 'Comentarios'
+        ,CAST(Just as varchar) as 'Justificaciones'
+        ,CAST(TipoOper as varchar)  as 'Tipo de Operacion'
+        ,CAST(DocBase as varchar) as 'Base de Calculo'
+        ,CAST(MontoInv as varchar) as 'Monto de Inversion'
+        ,CAST(Precio as varchar) as 'Precio'
+        ,CAST(Rendimiento as varchar) as 'Rendimiento'
+        ,CAST(Plazo as varchar)   as 'Cantidad en Plazo'
+        ,CAST(PlazoFact as varchar) as 'Tipo de Plazo'
+        ,CAST(Ingresos as varchar) as 'Ingresos'
+        ,CAST(FechaDoc as varchar) as 'Fecha de Creación'
+        ,CAST(AutEstado as varchar) as 'Estado de Autorización'
+        ,CAST(TipoMerc as varchar) as 'Tipo de Mercado'
+        ,CAST(CodPais as varchar) as 'Pais'
+        from PIN0 where 1=1 
+ "
+
+
+
+
+        Dim TodosEmpresas As Boolean = False
+        Dim TodosEmisor As Boolean = False
+        Dim TodosEstDocumento As Boolean = False
+        Dim TodosInstrumento As Boolean = False
+        Dim TodosCalRiesgo As Boolean = False
+        Dim TodosTipOperacion As Boolean = False
+        Dim TodosOriFond As Boolean = False
+        Dim TodosCalERiesgo As Boolean = False
+        Dim TodosAut As Boolean = False
+        Dim TodosPlazo As Boolean = False
+        Dim TodosPais As Boolean = False
+        Dim TodosTipMercado As Boolean = False
+
+
+        For Each Item In Col_Empresas
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEmpresas = True
+            End If
+        Next
+        For Each Item In Col_Emisor
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEmisor = True
+            End If
+        Next
+        For Each Item In Col_EstDocumento
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEstDocumento = True
+            End If
+        Next
+        For Each Item In Col_Instrumento
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosInstrumento = True
+            End If
+        Next
+        For Each Item In Col_CalRiesgo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosCalRiesgo = True
+            End If
+        Next
+        For Each Item In Col_TipOperacion
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosTipOperacion = True
+            End If
+        Next
+        For Each Item In Col_OriFond
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosOriFond = True
+            End If
+        Next
+        For Each Item In Col_CalERiesgo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosCalERiesgo = True
+            End If
+        Next
+        For Each Item In Col_Aut
+            TodosAut = True
+        Next
+        For Each Item In Col_Plazo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosPlazo = True
+            End If
+        Next
+        For Each Item In Col_Pais
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosPais = True
+            End If
+        Next
+        For Each Item In Col_TipMercado
+
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosTipMercado = True
+            End If
+        Next
+
+
+
+        Dim OperadorLogico As String = String.Empty
+        OperadorLogico = " And ("
+        Dim Fin As String = String.Empty
+
+
+
+        If Not TodosEmpresas Then
+
+
+            For Each Item In Col_Empresas
+                Dim Cadena As String = Col_Empresas.ToString
+
+
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = "" + OperadorLogico + " CodEmpr like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosEmisor Then
+
+
+            For Each Item In Col_Emisor
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodEmis like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+
+
+
+
+
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosEstDocumento Then
+
+
+
+            For Each Item In Col_EstDocumento
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " DocEst like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+
+        End If
+
+
+
+
+        If Not TodosInstrumento Then
+
+
+            For Each Item In Col_Instrumento
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodIF  like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+
+        End If
+        If Not TodosCalRiesgo Then
+
+
+            For Each Item In Col_CalRiesgo
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " CodCalRi   like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosTipOperacion Then
+
+
+            For Each Item In Col_TipOperacion
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = "" + OperadorLogico + " TipoOper   like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosOriFond Then
+
+
+            For Each Item In Col_OriFond
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " OFon  like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosCalERiesgo Then
+
+
+            For Each Item In Col_CalERiesgo
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " CodECalRi  like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosAut Then
+
+
+
+            For Each Item In Col_Aut
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " AutEstado  like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosPlazo Then
+
+
+            For Each Item In Col_Plazo
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " PlazoFact   like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+        If Not TodosPais Then
+
+
+
+            For Each Item In Col_Pais
+            Dim NombreItem As String = Item.ToString.Trim
+            Dim ConsultaExtra As String = " " + OperadorLogico + " CodPais   like '%" + NombreItem + "%'"
+            sql += ConsultaExtra
+            OperadorLogico = " Or"
+            Fin = ")"
+        Next
+        If Not String.IsNullOrEmpty(Fin) Then
+            sql += Fin
+        End If
+        Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+        If Not TodosTipMercado Then
+
+
+
+            For Each Item In Col_TipMercado
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " TipoMerc   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+        End If
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter(sql, cn)
+        da.SelectCommand.CommandType = CommandType.Text
+
+        da.Fill(ds, "Resultado")
+
+        Return ds
+
+        ds.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+    End Function
+
+
+    Public Function ListaEstadoDocumento() As DataSet
+        Dim objCon As New Conexion
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        da = New SqlDataAdapter("SP_ListaEstadoDocumento", cn)
+        da.Fill(ds, "EstadosDocumento")
+
+        da.Dispose()
+        cn.Dispose()
+        Return ds
+
+
+    End Function
+
+    Public Function NuevaPropuesta(ByVal ObjPropuesta As CEPropuestaInversion, ByVal CodigoAsociado As String, ByVal EstadoReporto As String, ByVal CodigoReporto As String, ByVal IdFlujo As Integer, ByVal IdECT As Integer)
+        Dim objCon As New Conexion
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim Retornar As Boolean
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        If String.IsNullOrEmpty(CodigoAsociado) Then
+            CodigoAsociado = String.Empty
+        End If
+
+
+        Dim Retorno As Integer
+        Dim NuevoDocId As Integer
+
+
+
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevaPropuesta")
+
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        'TRAE ULTIMO DOCID
+        cmd.CommandText = "SELECT ISNULL(MAX(DocId),0) FROM [dbo].[PIN0]"
+        NuevoDocId = cmd.ExecuteScalar()
+        NuevoDocId = NuevoDocId + 1
+
+
+        query = "INSERT INTO [dbo].[PIN0]
+           ([CodInv]
+           ,[DocEst]
+           ,[Asunto]
+           ,[CodEmpr]
+           ,[CodIF]
+           ,[CodEmis]
+           ,[CodCalRi]
+           ,[CodECalRi]
+           ,[OFon]
+           ,[Coment]
+           ,[Just]
+           ,[TipoOper]
+           ,[MontoInv]
+           ,[Precio]
+           ,[Rendimiento]
+           ,[Plazo]
+           ,[PlazoFact]
+           ,[Ingresos]
+           ,[FechaDoc]
+           ,[AutEstado]
+           ,[TipoMerc]
+           ,[CodPais]
+           ,[TipoRenta]
+           ,[TipoTasa]
+           ,[Periodicidad]
+           ,[NombreManual]
+           ,[CodigoAsociado]
+           ,[EstadoReporto]   
+
+)
+     VALUES
+           (@CodInv
+           ,@DocEst
+           ,@Asunto
+           ,@CodEmpr
+           ,@CodIF
+           ,@CodEmis
+           ,@CodCalRi
+           ,@CodECalRi
+           ,@OFon
+           ,@Coment
+           ,@Just
+           ,@TipoOper
+           ,@MontoInv
+           ,@Precio
+           ,@Rendimiento
+           ,@Plazo
+           ,@PlazoFact
+           ,@Ingresos
+           ,@FechaDoc
+           ,@AutEstado
+           ,@TipoMerc
+           ,@CodPais
+           ,@TipoRenta
+           ,@TipoTasa
+           ,@Periodicidad
+           ,@NombreManual
+           ,@CodigoAsociado
+           ,@EstadoReporto 
+		   )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+
+            .Add("@CodInv", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+            .Add("@DocEst", SqlDbType.VarChar).Value = ObjPropuesta.EstadoDocumento.ToString
+            .Add("@Asunto", SqlDbType.VarChar).Value = ObjPropuesta.Asunto.ToString
+            .Add("@CodEmpr", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresa.ToString
+            .Add("@CodIF", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInstrumentoFinanciero.ToString
+            .Add("@CodEmis", SqlDbType.Int).Value = ObjPropuesta.CodigoEmisor.ToString
+            .Add("@CodCalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoCalificacionDeRiesgo.ToString
+            .Add("@CodECalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresaCalificadora.ToString
+            .Add("@OFon", SqlDbType.VarChar).Value = ObjPropuesta.OrigenDeFondos.ToString
+            .Add("@Coment", SqlDbType.VarChar).Value = ObjPropuesta.Comentarios.ToString
+            .Add("@Just", SqlDbType.VarChar).Value = ObjPropuesta.Justificacion.ToString
+            .Add("@TipoOper", SqlDbType.VarChar).Value = ObjPropuesta.TipoOperacion.ToString
+            .Add("@MontoInv", SqlDbType.Float).Value = ObjPropuesta.MontoInversion.ToString
+            .Add("@Precio", SqlDbType.Float).Value = ObjPropuesta.Precio.ToString
+            .Add("@Rendimiento", SqlDbType.Float).Value = ObjPropuesta.Rendimiento.ToString
+            .Add("@Plazo", SqlDbType.Int).Value = ObjPropuesta.PlazoNumero.ToString
+            .Add("@PlazoFact", SqlDbType.VarChar).Value = ObjPropuesta.PlazoFactor.ToString
+            .Add("@Ingresos", SqlDbType.Float).Value = ObjPropuesta.Ingresos.ToString
+            .Add("@FechaDoc", SqlDbType.Date).Value = ObjPropuesta.FechaDocumento.ToString
+            .Add("@AutEstado", SqlDbType.VarChar).Value = ObjPropuesta.EstadoAutorizacion.ToString
+            .Add("@TipoMerc", SqlDbType.VarChar).Value = ObjPropuesta.TipoMercado.ToString
+            .Add("@CodPais", SqlDbType.VarChar).Value = ObjPropuesta.Pais.ToString
+
+            .Add("@TipoRenta", SqlDbType.VarChar).Value = ObjPropuesta.TipoRenta.ToString
+            .Add("@TipoTasa", SqlDbType.VarChar).Value = ObjPropuesta.TipoTasa.ToString
+            .Add("@Periodicidad", SqlDbType.VarChar).Value = ObjPropuesta.Periodicidad.ToString
+            .Add("@NombreManual", SqlDbType.VarChar).Value = ObjPropuesta.NombreManual.ToString
+            .Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociado.ToString
+            .Add("@EstadoReporto", SqlDbType.VarChar).Value = EstadoReporto.ToString
+        End With
+        cmd.CommandText = query
+        cmd.Transaction = Transaccion
+        Retorno = cmd.ExecuteNonQuery
+
+        ''Ingresar codigo
+
+
+        '#####################################################################'
+
+
+
+
+
+
+        cmd = New SqlCommand
+        query = " INSERT INTO TitEspApro(
+                         [CodigoAsociado]
+                        ,[CodigoReporto]
+                        ,[CodigoNuevoTitulo]
+                        ,[CodigoEstado]
+                        ,[Nombre]
+                        ,[Descrip]
+                        ,[IdFlujo]
+                        ,[IdECT]
+
+
+) VALUES(
+
+                         @CodigoAsociado
+                        ,@CodigoReporto
+                        ,@CodigoNuevoTitulo
+                        ,@CodigoEstado
+                        ,@Nombre
+                        ,@Descrip
+                        ,@IdFlujo
+                        ,@IdECT
+
+)"
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociado.ToString
+            .Add("@CodigoReporto", SqlDbType.VarChar).Value = CodigoReporto
+            .Add("@CodigoNuevoTitulo", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+            .Add("@CodigoEstado", SqlDbType.VarChar).Value = "TG"
+            .Add("@Nombre", SqlDbType.VarChar).Value = "Titulo Generado"
+            .Add("@Descrip", SqlDbType.VarChar).Value = "Titulo Generado Esperando Aprobación"
+            .Add("@IdFlujo", SqlDbType.Int).Value = IdFlujo
+            .Add("@IdECT", SqlDbType.Int).Value = IdECT
+
+        End With
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+        Retorno = cmd.ExecuteNonQuery
+
+
+
+        query = "INSERT INTO [dbo].[Propuesta]
+                   ([CodigoPropuesta]
+                    ,[Nombre]
+                    ,[Descrip]
+                    ,[Estado]
+        )
+             VALUES
+                   (@CodigoPropuesta
+                    ,@Nombre
+                    ,@Descrip
+                    ,@Estado
+        		   )"
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = query
+        cmd.Connection = cn
+
+
+        With cmd.Parameters
+            .Add("@CodigoPropuesta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+            .Add("@Nombre", SqlDbType.VarChar).Value = "ProCre"
+            .Add("@Descrip", SqlDbType.VarChar).Value = "Propuesta de Inversion Inicial Creada"
+            .Add("@Estado", SqlDbType.VarChar).Value = "En Propuesta"
+        End With
+        cmd.Transaction = Transaccion
+        Retorno = cmd.ExecuteNonQuery
+        Try
+
+
+
+
+            Transaccion.Commit()
+            MsgBox("Registro Guardado")
+            Retornar = True
+
+            frmColaTitulos.Inicializacion()
+
+        Catch ex As Exception
+            MsgBox("Error en Transaccion: " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+
+            Try
+                Transaccion.Rollback()
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex.Message)
+            End Try
+            Retornar = False
+        End Try
+
+        cmd.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+        Return Retornar
+    End Function
+
+
+
+
+    Public Function NuevaPropuesta(ByVal ObjPropuesta As CEPropuestaInversion, ByVal TipoProcesoCMVTA As String, ByVal CodigoInversionCMVTA As String)
+        Dim objCon As New Conexion
+        Dim query As String
+        Dim Retornar As Boolean
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+        Dim myTrans As SqlTransaction
+        myTrans = cn.BeginTransaction()
+        Dim Retorno As Integer
+        Dim cmd As SqlCommand = cn.CreateCommand
+        'TRAE ULTIMO DOCID
+        'cmd.CommandText = "SELECT ISNULL(MAX(DocId),0) FROM [dbo].[PIN0]"
+
+        query = "INSERT INTO [dbo].[PIN0]
+           ([CodInv]
+           ,[DocEst]
+           ,[Asunto]
+           ,[CodEmpr]
+           ,[CodIF]
+           ,[CodEmis]
+           ,[CodCalRi]
+           ,[CodECalRi]
+           ,[OFon]
+           ,[Coment]
+           ,[Just]
+           ,[TipoOper]
+           ,[MontoInv]
+           ,[Precio]
+           ,[Rendimiento]
+           ,[Plazo]
+           ,[PlazoFact]
+           ,[Ingresos]
+           ,[FechaDoc]
+           ,[AutEstado]
+           ,[TipoMerc]
+           ,[CodPais]
+           ,[TipoRenta]
+           ,[TipoTasa]
+           ,[Periodicidad]
+           ,[NombreManual]
+           ,[EstadoReporto]
+
+)
+     VALUES
+           (@CodInv
+           ,@DocEst
+           ,@Asunto
+           ,@CodEmpr
+           ,@CodIF
+           ,@CodEmis
+           ,@CodCalRi
+           ,@CodECalRi
+           ,@OFon
+           ,@Coment
+           ,@Just
+           ,@TipoOper
+           ,@MontoInv
+           ,@Precio
+           ,@Rendimiento
+           ,@Plazo
+           ,@PlazoFact
+           ,@Ingresos
+           ,@FechaDoc
+           ,@AutEstado
+           ,@TipoMerc
+           ,@CodPais
+           ,@TipoRenta
+           ,@TipoTasa
+           ,@Periodicidad
+           ,@NombreManual
+           ,@EstadoReporto
+		   )"
+
+        cmd = New SqlCommand
+        cmd.CommandText = query
+        cmd.Connection = cn
+
+
+
+
+
+
+        cmd.Transaction = myTrans
+
+        With cmd.Parameters
+
+            .Add("@CodInv", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+            .Add("@DocEst", SqlDbType.VarChar).Value = ObjPropuesta.EstadoDocumento.ToString
+            .Add("@Asunto", SqlDbType.VarChar).Value = ObjPropuesta.Asunto.ToString
+            .Add("@CodEmpr", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresa.ToString
+            .Add("@CodIF", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInstrumentoFinanciero.ToString
+            .Add("@CodEmis", SqlDbType.Int).Value = ObjPropuesta.CodigoEmisor.ToString
+            .Add("@CodCalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoCalificacionDeRiesgo.ToString
+            .Add("@CodECalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresaCalificadora.ToString
+            .Add("@OFon", SqlDbType.VarChar).Value = ObjPropuesta.OrigenDeFondos.ToString
+            .Add("@Coment", SqlDbType.VarChar).Value = ObjPropuesta.Comentarios.ToString
+            .Add("@Just", SqlDbType.VarChar).Value = ObjPropuesta.Justificacion.ToString
+            .Add("@TipoOper", SqlDbType.VarChar).Value = ObjPropuesta.TipoOperacion.ToString
+            .Add("@MontoInv", SqlDbType.Float).Value = ObjPropuesta.MontoInversion.ToString
+            .Add("@Precio", SqlDbType.Float).Value = ObjPropuesta.Precio.ToString
+            .Add("@Rendimiento", SqlDbType.Float).Value = ObjPropuesta.Rendimiento.ToString
+            .Add("@Plazo", SqlDbType.Int).Value = ObjPropuesta.PlazoNumero.ToString
+            .Add("@PlazoFact", SqlDbType.VarChar).Value = ObjPropuesta.PlazoFactor.ToString
+            .Add("@Ingresos", SqlDbType.Float).Value = ObjPropuesta.Ingresos.ToString
+            .Add("@FechaDoc", SqlDbType.Date).Value = ObjPropuesta.FechaDocumento.ToString
+            .Add("@AutEstado", SqlDbType.VarChar).Value = ObjPropuesta.EstadoAutorizacion.ToString
+            .Add("@TipoMerc", SqlDbType.VarChar).Value = ObjPropuesta.TipoMercado.ToString
+            .Add("@CodPais", SqlDbType.VarChar).Value = ObjPropuesta.Pais.ToString
+
+            .Add("@TipoRenta", SqlDbType.VarChar).Value = ObjPropuesta.TipoRenta.ToString
+            .Add("@TipoTasa", SqlDbType.VarChar).Value = ObjPropuesta.TipoTasa.ToString
+            .Add("@Periodicidad", SqlDbType.VarChar).Value = ObjPropuesta.Periodicidad.ToString
+            .Add("@NombreManual", SqlDbType.VarChar).Value = ObjPropuesta.NombreManual.ToString
+            .Add("@EstadoReporto", SqlDbType.VarChar).Value = "PRIMARIO"
+        End With
+        cmd.CommandText = query
+
+        Retorno = cmd.ExecuteNonQuery
+
+        ''Ingresar codigo
+
+
+        '#####################################################################'
+
+
+        cmd = New SqlCommand
+
+
+
+
+
+        query = "INSERT INTO [dbo].[Propuesta]
+                   ([CodigoPropuesta]
+                    ,[Nombre]
+                    ,[Descrip]
+                    ,[Estado]
+        )
+             VALUES
+                   (@CodigoPropuesta
+                    ,@Nombre
+                    ,@Descrip
+                    ,@Estado
+        		   )"
+
+
+
+
+
+        cmd.CommandText = query
+        cmd.Connection = cn
+        cmd.Transaction = myTrans
+
+        With cmd.Parameters
+            .Add("@CodigoPropuesta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+            .Add("@Nombre", SqlDbType.VarChar).Value = "ProCre"
+            .Add("@Descrip", SqlDbType.VarChar).Value = "Propuesta de Inversion Inicial Creada"
+            .Add("@Estado", SqlDbType.VarChar).Value = "En Propuesta"
+        End With
+
+
+        Retornar = cmd.ExecuteNonQuery
+
+        ''###############################################################
+        ''###############################################################
+        If TipoProcesoCMVTA = "V" Then
+
+
+            cmd = New SqlCommand
+            query = "INSERT INTO [dbo].[OPERCMVTA]
+                   ([FechaOperacion]
+                    ,[CodigoInversionCompra]
+                    ,[CodigoInversionVenta]
+                    ,[TipoFlujo]
+        )
+             VALUES
+                   (@FechaOperacion
+                    ,@CodigoInversionCompra
+                    ,@CodigoInversionVenta
+                    ,@TipoFlujo
+        		   )"
+
+
+
+
+
+            cmd.CommandText = query
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+                .Add("@FechaOperacion", SqlDbType.Date).Value = Date.Now.Date
+                .Add("@CodigoInversionCompra", SqlDbType.VarChar).Value = CodigoInversionCMVTA
+                .Add("@CodigoInversionVenta", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInversion.ToString
+                .Add("@TipoFlujo", SqlDbType.VarChar).Value = "C-V"
+            End With
+
+
+            Retornar = cmd.ExecuteNonQuery
+
+        End If
+        Try
+
+            myTrans.Commit()
+            MsgBox("Propuesta Guardada")
+        Catch ex As Exception
+            MsgBox("Error en Transaccion: " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+
+            Try
+                myTrans.Rollback()
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex.Message)
+            End Try
+        End Try
+
+
+
+
+        cmd.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+        Return Retornar
+    End Function
+
+
+
+    Public Function SoloNuevaPropuesta(ByVal ObjPropuesta As CEPropuestaInversion, ByVal CodigoPrincipal As String, ByVal CodigoSecundario As String)
+        Dim objCon As New Conexion
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim Retornar As Boolean
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+        Dim NuevoDocId As Integer
+
+
+
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevaPropuesta")
+
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        'TRAE ULTIMO DOCID
+        cmd.CommandText = "SELECT ISNULL(MAX(DocId),0) FROM [dbo].[PIN0]"
+        NuevoDocId = cmd.ExecuteScalar()
+        NuevoDocId = NuevoDocId + 1
+
+
+        query = "INSERT INTO [dbo].[PIN0]
+           ([CodInv]
+            ,[VCodInv]
+           ,[DocEst]
+           ,[Asunto]
+           ,[CodEmpr]
+           ,[CodIF]
+           ,[CodEmis]
+           ,[CodCalRi]
+           ,[CodECalRi]
+           ,[OFon]
+           ,[Coment]
+           ,[Just]
+           ,[TipoOper]
+           ,[MontoInv]
+           ,[Precio]
+           ,[Rendimiento]
+           ,[Plazo]
+           ,[PlazoFact]
+           ,[Ingresos]
+           ,[FechaDoc]
+           ,[AutEstado]
+           ,[TipoMerc]
+           ,[CodPais]
+           ,[TipoRenta]
+           ,[TipoTasa]
+           ,[Periodicidad]
+           ,[NombreManual]
+            
+
+)
+     VALUES
+           (@CodInv
+            ,@VCodInv
+           ,@DocEst
+           ,@Asunto
+           ,@CodEmpr
+           ,@CodIF
+           ,@CodEmis
+           ,@CodCalRi
+           ,@CodECalRi
+           ,@OFon
+           ,@Coment
+           ,@Just
+           ,@TipoOper
+           ,@MontoInv
+           ,@Precio
+           ,@Rendimiento
+           ,@Plazo
+           ,@PlazoFact
+           ,@Ingresos
+           ,@FechaDoc
+           ,@AutEstado
+           ,@TipoMerc
+           ,@CodPais
+           ,@TipoRenta
+           ,@TipoTasa
+           ,@Periodicidad
+           ,@NombreManual
+		   )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+
+            .Add("@CodInv", SqlDbType.VarChar).Value = CodigoPrincipal
+            .Add("@VCodInv", SqlDbType.VarChar).Value = CodigoSecundario
+            .Add("@DocEst", SqlDbType.VarChar).Value = ObjPropuesta.EstadoDocumento.ToString
+            .Add("@Asunto", SqlDbType.VarChar).Value = ObjPropuesta.Asunto.ToString
+            .Add("@CodEmpr", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresa.ToString
+            .Add("@CodIF", SqlDbType.VarChar).Value = ObjPropuesta.CodigoInstrumentoFinanciero.ToString
+            .Add("@CodEmis", SqlDbType.Int).Value = ObjPropuesta.CodigoEmisor.ToString
+            .Add("@CodCalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoCalificacionDeRiesgo.ToString
+            .Add("@CodECalRi", SqlDbType.VarChar).Value = ObjPropuesta.CodigoEmpresaCalificadora.ToString
+            .Add("@OFon", SqlDbType.VarChar).Value = ObjPropuesta.OrigenDeFondos.ToString
+            .Add("@Coment", SqlDbType.VarChar).Value = ObjPropuesta.Comentarios.ToString
+            .Add("@Just", SqlDbType.VarChar).Value = ObjPropuesta.Justificacion.ToString
+            .Add("@TipoOper", SqlDbType.VarChar).Value = ObjPropuesta.TipoOperacion.ToString
+            .Add("@MontoInv", SqlDbType.Float).Value = ObjPropuesta.MontoInversion.ToString
+            .Add("@Precio", SqlDbType.Float).Value = ObjPropuesta.Precio.ToString
+            .Add("@Rendimiento", SqlDbType.Float).Value = ObjPropuesta.Rendimiento.ToString
+            .Add("@Plazo", SqlDbType.Int).Value = ObjPropuesta.PlazoNumero.ToString
+            .Add("@PlazoFact", SqlDbType.VarChar).Value = ObjPropuesta.PlazoFactor.ToString
+            .Add("@Ingresos", SqlDbType.Float).Value = ObjPropuesta.Ingresos.ToString
+            .Add("@FechaDoc", SqlDbType.Date).Value = ObjPropuesta.FechaDocumento.ToString
+            .Add("@AutEstado", SqlDbType.VarChar).Value = ObjPropuesta.EstadoAutorizacion.ToString
+            .Add("@TipoMerc", SqlDbType.VarChar).Value = ObjPropuesta.TipoMercado.ToString
+            .Add("@CodPais", SqlDbType.VarChar).Value = ObjPropuesta.Pais.ToString
+
+            .Add("@TipoRenta", SqlDbType.VarChar).Value = ObjPropuesta.TipoRenta.ToString
+            .Add("@TipoTasa", SqlDbType.VarChar).Value = ObjPropuesta.TipoTasa.ToString
+            .Add("@Periodicidad", SqlDbType.VarChar).Value = ObjPropuesta.Periodicidad.ToString
+            .Add("@NombreManual", SqlDbType.VarChar).Value = ObjPropuesta.NombreManual.ToString
+        End With
+        cmd.ExecuteNonQuery()
+
+
+        cmd = New SqlCommand
+
+
+
+
+
+        query = "INSERT INTO [dbo].[Propuesta]
+           ([CodigoPropuesta]
+            ,[Nombre]
+            ,[Descrip]
+            ,[Estado]
+)
+     VALUES
+           (@CodigoPropuesta
+            ,@Nombre
+            ,@Descrip
+            ,@Estado
+		   )"
+
+
+
+
+
+        cmd.CommandText = query
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        With cmd.Parameters
+            .Add("@CodigoPropuesta", SqlDbType.VarChar).Value = CodigoPrincipal
+            .Add("@Nombre", SqlDbType.VarChar).Value = "ProCre"
+            .Add("@Descrip", SqlDbType.VarChar).Value = "Propuesta de Inversion Inicial Creada"
+            .Add("@Estado", SqlDbType.VarChar).Value = "En Propuesta"
+        End With
+
+
+        Retornar = cmd.ExecuteNonQuery
+
+
+        Try
+
+            Transaccion.Commit()
+            MsgBox("Registro Guardado")
+            Retornar = True
+
+
+
+        Catch ex As Exception
+            MsgBox("Error en Transaccion: " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+
+            Try
+                Transaccion.Rollback()
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex.Message)
+            End Try
+            Retornar = False
+        End Try
+
+        cmd.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+        Return Retornar
+    End Function
+
+
+
+
+
+
+
+
+
+    Public Function IdRegistro(CodigoInversion As String) As Integer
+        Dim objCon As New Conexion
+        Dim vRetorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand = New SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT DocId from [dbo].[PIN0] WHERE CodInv=@CodInv "
+
+        cmd.CommandText = sql
+
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+
+        cmd.Connection = cn
+
+        vRetorno = cmd.ExecuteScalar
+
+        cn.Close()
+        Return vRetorno
+    End Function
+
+    Public Function IdRegistroInversion(CodigoInversion As String) As Integer
+        Dim objCon As New Conexion
+        Dim vRetorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand = New SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT DocId from [dbo].[INV0] WHERE CodInv=@CodInv "
+
+        cmd.CommandText = sql
+
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+
+        cmd.Connection = cn
+
+        vRetorno = cmd.ExecuteScalar
+
+        cn.Close()
+        Return vRetorno
+    End Function
+
+
+
+    Public Function IdPropuesta(CodigoInversion As String) As Integer
+        Dim objCon As New Conexion
+        Dim vRetorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand = New SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT IdProInv from [dbo].[Propuesta] WHERE CodigoPropuesta=@CodigoPropuesta"
+
+        cmd.CommandText = sql
+
+        cmd.Parameters.Add("@CodigoPropuesta", SqlDbType.VarChar).Value = CodigoInversion
+
+        cmd.Connection = cn
+
+        vRetorno = cmd.ExecuteScalar
+
+        cn.Close()
+        Return vRetorno
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function CargarPropuesta(Id As Integer) As CEPropuestaInversion
+        Dim objCon As New Conexion
+        Dim oPropuesta As CEPropuestaInversion = New CEPropuestaInversion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim drd As SqlDataReader
+        Try
+
+            da = New SqlDataAdapter("SP_PROPIN_CARGAR", cn)
+            da.SelectCommand.CommandType = CommandType.StoredProcedure
+
+            With da.SelectCommand.Parameters
+                .Add("@IdPropuesta", SqlDbType.Int).Value = Id
+            End With
+
+
+            drd = da.SelectCommand.ExecuteReader()
+            If drd.HasRows Then
+                oPropuesta.IdDeDocumento = Id
+
+            End If
+
+            If drd.Read Then
+                oPropuesta.CodigoInversion = drd.Item("CodInv").ToString
+                oPropuesta.EstadoDocumento = drd.Item("DocEst").ToString
+                oPropuesta.TipoOperacion = drd.Item("TipoOper").ToString
+                oPropuesta.Asunto = drd.Item("Asunto").ToString
+                oPropuesta.CodigoEmpresa = drd.Item("CodEmpr").ToString
+                oPropuesta.CodigoInstrumentoFinanciero = drd.Item("CodIF").ToString
+                oPropuesta.CodigoEmisor = drd.Item("CodEmis").ToString
+                oPropuesta.CodigoCalificacionDeRiesgo = drd.Item("CodCalRi").ToString
+                oPropuesta.CodigoEmpresaCalificadora = drd.Item("CodECalRi").ToString
+                oPropuesta.OrigenDeFondos = drd.Item("OFon").ToString
+                oPropuesta.Justificacion = drd.Item("Just").ToString
+                oPropuesta.Comentarios = drd.Item("Coment").ToString
+                oPropuesta.MontoInversion = drd.Item("MontoInv").ToString
+                oPropuesta.Precio = drd.Item("Precio").ToString
+                oPropuesta.Rendimiento = drd.Item("Rendimiento").ToString
+                oPropuesta.PlazoNumero = drd.Item("Plazo").ToString
+                oPropuesta.PlazoFactor = drd.Item("PlazoFact").ToString
+                oPropuesta.Ingresos = drd.Item("Ingresos").ToString
+                oPropuesta.FechaDocumento = drd.Item("FechaDoc").ToString
+                oPropuesta.EstadoAutorizacion = drd.Item("AutEstado").ToString
+                oPropuesta.TipoMercado = drd.Item("TipoMerc").ToString
+                oPropuesta.Pais = drd.Item("CodPais").ToString
+
+
+                oPropuesta.TipoRenta = drd.Item("TipoRenta").ToString
+                oPropuesta.TipoTasa = drd.Item("TipoTasa").ToString
+                oPropuesta.Periodicidad = drd.Item("Periodicidad").ToString
+                oPropuesta.NombreManual = drd.Item("NombreManual").ToString
+                oPropuesta.IdFlujo = Operaciones.ConvertirDecimal(drd.Item("IdFlujo").ToString)
+                oPropuesta.IdEA = Operaciones.ConvertirDecimal(drd.Item("IdEA").ToString)
+                oPropuesta.EstadoReporto = drd.Item("EstadoReporto").ToString
+
+                oPropuesta.CodigoAsociado = drd.Item("CodigoAsociado").ToString
+            End If
+            drd.Close()
+        Catch ex As Exception
+            MsgBox("Error", MsgBoxStyle.Critical)
+            MsgBox(ex.Message)
+        Finally
+
+            da.Dispose()
+            cn.Dispose()
+        End Try
+
+        Return oPropuesta
+    End Function
+    Public Function Actualizar(ByVal oPropuestaCE As CEPropuestaInversion, ByVal parametro As String, ByVal EstadoReporto As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("ActualizarPropuesta")
+        Try
+            cmd.Connection = cn
+            cmd.Transaction = Transaccion
+
+            query = "UPDATE [dbo].[PIN0]
+   SET 
+      [CodInv] = @CodInv
+      ,[DocEst] = @DocEst
+      ,[Asunto] = @Asunto
+      ,[CodEmpr] = @CodEmpr
+      ,[CodIF] = @CodIF
+      ,[CodEmis] = @CodEmis
+      ,[CodCalRi] = @CodCalRi
+      ,[CodECalRi] = @CodECalRi
+      ,[OFon] = @OFon
+      ,[Coment] = @Coment
+      ,[Just] = @Just
+      ,[TipoOper] = @TipoOper
+      ,[MontoInv] = @MontoInv
+      ,[Precio] = @Precio
+      ,[Rendimiento] = @Rendimiento
+      ,[Plazo] = @Plazo
+      ,[PlazoFact] = @PlazoFact
+      ,[Ingresos] = @Ingresos
+      ,[FechaDoc] = @FechaDoc
+      ,[AutEstado] = @AutEstado
+	  ,[TipoMerc] = @TipoMerc
+      ,[CodPais] = @CodPais
+
+           ,[TipoRenta]=@TipoRenta
+           ,[TipoTasa]=@TipoTasa
+           ,[Periodicidad]=@Periodicidad
+           ,[NombreManual]=@NombreManual
+
+
+ WHERE [CodInv] = @CodInv"
+
+            cmd.CommandText = query
+
+            With cmd.Parameters
+                .Add("@DocId", SqlDbType.VarChar).Value = oPropuestaCE.IdDeDocumento
+                .Add("@CodInv", SqlDbType.VarChar).Value = parametro
+                .Add("@DocEst", SqlDbType.VarChar).Value = oPropuestaCE.EstadoDocumento
+                .Add("@Asunto", SqlDbType.VarChar).Value = oPropuestaCE.Asunto
+                .Add("@CodEmpr", SqlDbType.VarChar).Value = oPropuestaCE.CodigoEmpresa
+                .Add("@CodIF", SqlDbType.VarChar).Value = oPropuestaCE.CodigoInstrumentoFinanciero
+                .Add("@CodEmis", SqlDbType.Int).Value = oPropuestaCE.CodigoEmisor
+                .Add("@CodCalRi", SqlDbType.VarChar).Value = oPropuestaCE.CodigoCalificacionDeRiesgo
+                .Add("@CodECalRi", SqlDbType.VarChar).Value = oPropuestaCE.CodigoEmpresaCalificadora
+                .Add("@OFon", SqlDbType.VarChar).Value = oPropuestaCE.OrigenDeFondos
+                .Add("@Coment", SqlDbType.VarChar).Value = oPropuestaCE.Comentarios
+                .Add("@Just", SqlDbType.VarChar).Value = oPropuestaCE.Justificacion
+                .Add("@TipoOper", SqlDbType.VarChar).Value = oPropuestaCE.TipoOperacion
+                .Add("@MontoInv", SqlDbType.Float).Value = oPropuestaCE.MontoInversion
+                .Add("@Precio", SqlDbType.Float).Value = oPropuestaCE.Precio
+                .Add("@Rendimiento", SqlDbType.Float).Value = oPropuestaCE.Rendimiento
+                .Add("@Plazo", SqlDbType.Int).Value = oPropuestaCE.PlazoNumero
+                .Add("@PlazoFact", SqlDbType.VarChar).Value = oPropuestaCE.PlazoFactor
+                .Add("@Ingresos", SqlDbType.Float).Value = oPropuestaCE.Ingresos
+                .Add("@FechaDoc", SqlDbType.Date).Value = oPropuestaCE.FechaDocumento
+                .Add("@AutEstado", SqlDbType.VarChar).Value = oPropuestaCE.EstadoAutorizacion
+                .Add("@TipoMerc", SqlDbType.VarChar).Value = oPropuestaCE.TipoMercado
+                .Add("@CodPais", SqlDbType.VarChar).Value = oPropuestaCE.Pais
+                .Add("@TipoRenta", SqlDbType.VarChar).Value = oPropuestaCE.TipoRenta.ToString
+                .Add("@TipoTasa", SqlDbType.VarChar).Value = oPropuestaCE.TipoTasa.ToString
+                .Add("@Periodicidad", SqlDbType.VarChar).Value = oPropuestaCE.Periodicidad.ToString
+                .Add("@NombreManual", SqlDbType.VarChar).Value = oPropuestaCE.NombreManual.ToString
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery()
+
+            If oPropuestaCE.OrigenDeFondos = "REPOVENTA" Then
+                EstadoReporto = "SECUNDARIO"
+            End If
+
+
+            If oPropuestaCE.EstadoAutorizacion = "C" Or oPropuestaCE.EstadoAutorizacion = "R" And EstadoReporto = "SECUNDARIO" Then
+
+                Dim IniciarError As String = CambiarEstArbCE.ProcesarCambio(parametro, "CambiarRechazado", cn, Transaccion)
+                If IniciarError = "NO" Or IniciarError = "Error" Then
+                    Throw New Exception
+                End If
+                Dim CodigoReporto As String = String.Empty
+                cmd = New SqlCommand
+                cmd.Connection = cn
+                cmd.Transaction = Transaccion
+
+                query = "select CodigoReporto from TitEspApro where CodigoNuevoTitulo=@CodigoNuevoTitulo"
+
+                cmd.CommandText = query
+
+                With cmd.Parameters
+                    .Add("@CodigoNuevoTitulo", SqlDbType.VarChar).Value = parametro
+                End With
+                CodigoReporto = cmd.ExecuteScalar
+
+
+
+                ''#########################################################
+                ''#########################################################
+                If String.IsNullOrEmpty(CodigoReporto) Then
+                    CodigoReporto = Nothing
+                End If
+
+
+
+
+
+                cmd = New SqlCommand
+                cmd.Connection = cn
+                cmd.Transaction = Transaccion
+                query = "UPDATE [dbo].[INV0]
+                SET EstadoProceso=@EstadoProceso
+                WHERE [CodInv] = @CodInv"
+
+                cmd.CommandText = query
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = CodigoReporto
+                    .Add("@EstadoProceso", SqlDbType.VarChar).Value = "E"
+                End With
+
+
+                retorno = cmd.ExecuteNonQuery()
+
+
+            End If
+            Transaccion.Commit()
+            retorno = 0
+
+        Catch ex As Exception
+            retorno = 1
+
+
+
+            Try
+                Transaccion.Rollback()
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex.Message)
+            End Try
+        End Try
+
+        If retorno = 0 Then
+            'Transaccion.Commit()
+        Else
+            'Transaccion.Rollback()
+            MsgBox("Falla al Guardar Propuesta")
+        End If
+
+        cmd.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+        Return retorno
+    End Function
+    Public Function ConvertirEnInversion(ByVal IdPropuesta As Integer, ByVal EstadoReporto As String) As Integer
+        Dim vRetorno As Integer = 1
+        Dim oCEPropuesta As CEPropuestaInversion = CargarPropuesta(IdPropuesta)
+        Dim oCEInversion As InversionesCE
+        Dim oDAOInversion As InversionDAO
+
+        If Not oCEPropuesta Is Nothing Then
+            'ES OBJETO
+            oCEInversion = New InversionesCE
+            oDAOInversion = New InversionDAO
+
+            oCEInversion.CodigoIversion = oCEPropuesta.CodigoInversion
+            oCEInversion.CodigoEmpresa = oCEPropuesta.CodigoEmpresa
+            oCEInversion.CodigoInstrumentoFinanciero = oCEPropuesta.CodigoInstrumentoFinanciero
+            oCEInversion.CodigoEmisor = oCEPropuesta.CodigoEmisor
+            oCEInversion.CodigoCalificacionDeRiesgo = oCEPropuesta.CodigoCalificacionDeRiesgo
+            oCEInversion.CodigoEmpresaCalificadora = oCEPropuesta.CodigoEmpresaCalificadora
+            oCEInversion.Comentarios = oCEPropuesta.Comentarios
+            oCEInversion.TipoOperacion = oCEPropuesta.TipoOperacion
+            oCEInversion.DocumentoBase = oCEPropuesta.IdDeDocumento
+            oCEInversion.Pais = oCEPropuesta.Pais
+            oCEInversion.TipoMercado = oCEPropuesta.TipoMercado
+            oCEInversion.DocumentoBase = oCEPropuesta.IdDeDocumento
+
+            oCEInversion.EstadoDocumento = oCEPropuesta.EstadoDocumento
+
+
+
+            oCEInversion.NombreManual = oCEPropuesta.NombreManual
+            oCEInversion.TipoRenta = oCEPropuesta.TipoRenta
+            oCEInversion.TipoTasa = oCEPropuesta.TipoTasa
+            oCEInversion.Periodicidad = oCEPropuesta.Periodicidad
+
+            oCEInversion.PlazoFactor = oCEPropuesta.PlazoFactor
+            oCEInversion.PlazoNumero = oCEPropuesta.PlazoNumero
+            oCEInversion.OFondo = oCEPropuesta.OrigenDeFondos
+            oCEInversion.CodigoCompra = oCEPropuesta.CodigoCompra
+            oCEInversion.EstadoProceso = "R"
+            oCEInversion.FechaDocumento = oCEPropuesta.FechaDocumento
+
+            oCEInversion.EstadoReporto = oCEPropuesta.EstadoReporto
+
+            If oCEPropuesta.EstadoReporto = "SECUNDARIO" Then
+                oCEInversion.CodigoAsociado = oCEPropuesta.CodigoAsociado
+                oCEInversion.IdFlujo = oCEPropuesta.IdFlujo
+                oCEInversion.IdEA = oCEPropuesta.IdEA
+            End If
+            oCEInversion.IdProInv = Me.IdPropuesta(oCEPropuesta.CodigoInversion)
+            Dim vResNuevo As Integer
+            vResNuevo = oDAOInversion.Nuevo(oCEInversion)
+
+            If vResNuevo > 0 Then
+                'MsgBox("Completado.")
+                'CERRAR PROPUESTA
+                Cerrar(IdPropuesta)
+                vRetorno = 1
+            Else
+                'NO SE PUDO
+                vRetorno = -2
+                MsgBox("Falla al convertir en Inversion")
+            End If
+
+
+        Else
+            'NO ES NADA
+            vRetorno = -1
+        End If
+
+
+        Return vRetorno
+    End Function
+    Public Sub Cerrar(ByVal IidPropuesta As Integer)
+        Dim objCon As New Conexion
+        Dim vTransaccion As SqlTransaction
+        Dim query As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        vTransaccion = cn.BeginTransaction
+
+        cmd.Connection = cn
+        cmd.Transaction = vTransaccion
+
+        query = "UPDATE [dbo].[PIN0]
+SET [DocEst] = 'C'
+WHERE [DocId] = @DocId"
+
+        cmd.CommandText = query
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.VarChar).Value = IidPropuesta
+        End With
+        Try
+            cmd.ExecuteNonQuery()
+            vTransaccion.Commit()
+
+        Catch ex As Exception
+            MsgBox("Error en Transaccion: " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+
+            Try
+                vTransaccion.Rollback()
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex.Message)
+            End Try
+        End Try
+
+
+
+        cmd.Dispose()
+        cn.Dispose()
+    End Sub
+
+End Class

+ 968 - 0
DAO/DepositosAPlazoDAO.vb

@@ -0,0 +1,968 @@
+Imports System.Data.SqlClient
+Public Class DepositosAPlazoDAO
+
+
+    Function Nuevo(ByVal oDAPCE As DepositosAPlazoCE) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[DAP0]
+           ([CodInv]
+           ,[MontoInv]
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           --,[AnBase]
+           ,[Periodic])
+     VALUES
+           (@CodInv
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           --,@AnBase
+           ,@Periodic)
+"
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = oDAPCE.CodigoInversion
+            .Add("@MontoInv", SqlDbType.Float).Value = oDAPCE.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oDAPCE.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oDAPCE.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Float).Value = oDAPCE.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oDAPCE.Plazo
+            '.Add("@AnBase",SqlDbType.VarChar).Value = oDAPCE.CodigoInversion
+            .Add("@Periodic", SqlDbType.VarChar).Value = oDAPCE.Periodicidad
+        End With
+
+        retorno = cmd.ExecuteNonQuery
+
+        cmd.Dispose()
+        cn.Dispose()
+
+        GuardaIntereses(oDAPCE.CodigoInversion, oDAPCE.dtIntereses)
+
+        Return retorno
+    End Function
+    Function Nuevo(ByVal oDAP As DepositosAPlazoCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim Tabla As String = ""
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        If Tipo = "P" Then
+            Tabla = "PDAP0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IDAP0"
+        End If
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevoDAP")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        query = "INSERT INTO [dbo].[" & Tabla & "]
+           ([DocId]
+           ,[MontoInv]
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           ,[AnBase]
+           ,[Periodic]
+           ,[RendBruto]
+           ,[RendNeto]
+           ,[IngrBruto]
+           ,[Impuestos]
+           ,[IngrNeto])
+     VALUES
+           (@DocId
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           ,@AnBase
+           ,@Periodic
+           ,@RendBruto
+           ,@RendNeto
+           ,@IngrBruto
+           ,@Impuestos
+           ,@IngrNeto
+		  )"
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            .Add("@MontoInv", SqlDbType.Decimal).Value = oDAP.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oDAP.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oDAP.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Decimal).Value = oDAP.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oDAP.Plazo
+            .Add("@AnBase", SqlDbType.Int).Value = oDAP.AnioBase
+            .Add("@Periodic", SqlDbType.NVarChar).Value = oDAP.Periodicidad
+            .Add("@RendBruto", SqlDbType.Decimal).Value = oDAP.RendimientoBruto
+            .Add("@RendNeto", SqlDbType.Decimal).Value = oDAP.RendimientoNeto
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = oDAP.IngresoBruto
+            .Add("@Impuestos", SqlDbType.Decimal).Value = oDAP.Impuestos
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = oDAP.IngresoNeto
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar DAP : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+        Return retorno
+    End Function
+
+    Public Sub CargarRegistro(ByVal oDAP As DepositosAPlazoCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PDAP0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IDAP0"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oDAP.MontoDeInversion = drd.Item("MontoInv")
+                oDAP.FechaOperacion = drd.Item("FOper")
+                oDAP.FechaVencimiento = drd.Item("FVenc")
+                oDAP.Tasa = drd.Item("Tasa")
+                oDAP.Plazo = drd.Item("Plazo")
+                oDAP.AnioBase = drd.Item("AnBase")
+                oDAP.Periodicidad = drd.Item("Periodic")
+                'oDAP.RendimientoBruto = drd.Item("RendBruto")
+                'oDAP.RendimientoNeto = drd.Item("RendNeto")
+                oDAP.IngresoBruto = drd.Item("IngrBruto")
+                oDAP.Impuestos = drd.Item("Impuestos")
+                oDAP.IngresoNeto = drd.Item("IngrNeto")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+    End Sub
+    Public Function CargarRegistro(ByVal vCodigoInversion As String) As DepositosAPlazoCE
+        Dim objCon As New Conexion
+        Dim oDAPCE As New DepositosAPlazoCE
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim da As SqlDataAdapter
+        Dim sql As String
+        Dim dtIntereses As New DataTable
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        'INTERESES
+        sql = "SELECT * FROM [dbo].[DAP1] T0 WHERE T0.CodInv=@CodInv"
+        da = New SqlDataAdapter(sql, cn)
+        da.SelectCommand.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        da.Fill(dtIntereses)
+        oDAPCE.dtIntereses = dtIntereses
+
+        sql = "SELECT * FROM [dbo].[DAP0] T0 WHERE T0.CodInv=@CodInv"
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oDAPCE.CodigoInversion = vCodigoInversion.ToString
+                oDAPCE.MontoDeInversion = drd.Item("MontoInv").ToString
+                oDAPCE.FechaOperacion = drd.Item("FOper").ToString
+                oDAPCE.FechaVencimiento = drd.Item("FVenc").ToString
+                oDAPCE.Tasa = drd.Item("Tasa").ToString
+                oDAPCE.Plazo = drd.Item("Plazo").ToString
+                oDAPCE.Periodicidad = drd.Item("Periodic").ToString
+
+            End If
+            drd.Close()
+
+        Else
+            'NO ENCONTRO EL REGISTRO
+        End If
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return oDAPCE
+
+    End Function
+
+    Public Function Actualizar(ByVal oDAPCE As DepositosAPlazoCE) As Integer
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim retorno As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "UPDATE [dbo].[DAP0]
+   SET [MontoInv] = @MontoInv
+      ,[FOper] = @FOper
+      ,[FVenc] = @FVenc
+      ,[Tasa] = @Tasa
+      ,[Plazo] = @Plazo
+      --,[AnBase] = @AnBase
+      ,[Periodic] = @Periodic
+ WHERE [CodInv] = @CodInv"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+
+
+        With cmd.Parameters
+            .Add("@MontoInv", SqlDbType.Float).Value = oDAPCE.MontoDeInversion
+            .Add("@FOper", SqlDbType.Date).Value = oDAPCE.FechaOperacion
+            .Add("@FVenc", SqlDbType.Date).Value = oDAPCE.FechaVencimiento
+            .Add("@Tasa", SqlDbType.Float).Value = oDAPCE.Tasa
+            .Add("@Plazo", SqlDbType.Int).Value = oDAPCE.Plazo
+            .Add("@Periodic", SqlDbType.VarChar).Value = oDAPCE.Periodicidad
+        End With
+
+        cmd.Connection = cn
+        retorno = cmd.ExecuteNonQuery
+
+        cmd.Dispose()
+        cn.Dispose()
+
+        GuardaIntereses(oDAPCE.CodigoInversion, oDAPCE.dtIntereses)
+
+        Return retorno
+    End Function
+    Private Sub GuardaIntereses(ByVal vCodInversion As String, dt As DataTable)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim res As Integer
+
+        sql = "DELETE FROM [dbo].[DAP1]
+      WHERE [CodInv]=@CodInv"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodInversion
+
+
+        cmd.Connection = cn
+        res = cmd.ExecuteNonQuery
+        sql = String.Empty
+
+        If dt.Rows.Count > 0 Then
+            For Each dr In dt.Rows
+                cmd = New SqlCommand
+                sql = "INSERT INTO [dbo].[DAP1]
+           ([CodInv]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+           ,[Estado])
+     VALUES
+           (@CodInv
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+           ,@Estado)"
+
+                cmd.CommandText = sql
+                With cmd.Parameters
+                    .AddWithValue("@CodInv", vCodInversion)
+                    .AddWithValue("@Plazo", dr("Plazo"))
+                    .AddWithValue("@Fecha", dr("Fecha"))
+                    .AddWithValue("@IngrBruto", dr("IngrBruto"))
+                    .AddWithValue("@PorcImp", dr("PorcImp"))
+                    .AddWithValue("@MontoImp", dr("MontoImp"))
+                    .AddWithValue("@IngrNeto", dr("IngrNeto"))
+                    .AddWithValue("@Estado", dr("Estado"))
+                End With
+                cmd.Connection = cn
+                res = cmd.ExecuteNonQuery
+            Next
+        End If
+
+        cmd.Dispose()
+        cn.Dispose()
+
+    End Sub
+
+
+
+    Public Function NuevoDato(ByVal Coleccion As Collection, ByVal Diccionario As Dictionary(Of String, Collection), ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+            sql = "INSERT INTO [dbo].[DAP0](
+           [CodInv]
+           ,[MontoInv]
+           ,[FOper]
+           ,[FVenc]
+           ,[Tasa]
+           ,[Plazo]
+           ,[Periodic]
+           ,[RendBr]
+           ,[RendNet]   
+           ,[IngrBrutoTot]
+           ,[IngrNetoTot]
+           ,[Renta]
+
+
+) VALUES(
+
+           @CodInv
+           ,@MontoInv
+           ,@FOper
+           ,@FVenc
+           ,@Tasa
+           ,@Plazo
+           ,@Periodic
+           ,@RendBr
+           ,@RendNet
+           ,@IngrBrutoTot
+           ,@IngrNetoTot
+           ,@Renta
+)
+    "
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@MontoInv", SqlDbType.Decimal).Value = Coleccion(1)
+                .Add("@FOper", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(3)
+                .Add("@Tasa", SqlDbType.Decimal).Value = Coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = Coleccion(5)
+                .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(6)
+                .Add("@RendBr", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@RendNet", SqlDbType.VarChar).Value = Coleccion(8)
+
+                .Add("@IngrBrutoTot", SqlDbType.Float).Value = Coleccion(9)
+                .Add("@IngrNetoTot", SqlDbType.Float).Value = Coleccion(10)
+                .Add("@Renta", SqlDbType.Float).Value = Coleccion(11)
+            End With
+
+            retorno = cmd.ExecuteNonQuery
+
+
+            sql = "INSERT INTO [dbo].[DAP1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+
+
+
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Correlativo", SqlDbType.Int).Value = Coleccion2(1)
+                        .Add("@Plazo", SqlDbType.Int).Value = Coleccion2(2)
+                        .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion2(3)
+                        .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion2(4)
+                        .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion2(5)
+                        .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion2(6)
+                        .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion2(7)
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+    End Function
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevoElemento(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[DAP1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+
+
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Plazo", SqlDbType.Int).Value = Coleccion(2)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(3)
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion(4)
+            .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion(5)
+            .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion(6)
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion(7)
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+    Public Function ModificarElemento(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE  [dbo].[DAP1] SET
+
+           [Plazo]=@Plazo
+           ,[Fecha]=@Fecha
+           ,[IngrBruto]=@IngrBruto
+           ,[PorcImp]=@PorcImp
+           ,[MontoImp]=@MontoImp
+           ,[IngrNeto]=@IngrNeto
+            where  [CodInv]=@CodInv AND [Correlativo]=@Correlativo
+
+    "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+
+
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Plazo", SqlDbType.Int).Value = Coleccion(2)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(3)
+            .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion(4)
+            .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion(5)
+            .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion(6)
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion(7)
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Sub EliminarElemento(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[DAP1]
+      WHERE [CodInv]=@CodInv "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+        cmd.Connection = cn
+        cn.Close()
+        res = cmd.ExecuteNonQuery
+
+    End Sub
+
+
+
+
+
+
+
+
+
+
+    Public Function ModificarDato(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection))
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+            sql = "UPDATE [dbo].[DAP0] SET
+            [MontoInv]=@MontoInv
+           ,[FOper]=@FOper
+           ,[FVenc]=@FVenc
+           ,[Tasa]=@Tasa
+           ,[Plazo]=@Plazo
+           ,[Periodic]=@Periodic
+           ,[RendBr]=@RendBr
+           ,[RendNet]=@RendNet
+            ,[IngrBrutoTot]=@IngrBrutoTot
+            ,[IngrNetoTot]=@IngrNetoTot
+            ,[Renta]=@Renta
+            where [CodInv]=  @CodInv
+    "
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@MontoInv", SqlDbType.Decimal).Value = Coleccion(1)
+                .Add("@FOper", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(3)
+                .Add("@Tasa", SqlDbType.Decimal).Value = Coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = Coleccion(5)
+                .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(6)
+                .Add("@RendBr", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@RendNet", SqlDbType.VarChar).Value = Coleccion(8)
+
+                .Add("@IngrBrutoTot", SqlDbType.Float).Value = Coleccion(9)
+                .Add("@IngrNetoTot", SqlDbType.Float).Value = Coleccion(10)
+                .Add("@Renta", SqlDbType.Float).Value = Coleccion(11)
+            End With
+            retorno = cmd.ExecuteNonQuery
+
+
+            sql = "INSERT INTO [dbo].[DAP1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+            sql = "delete from DAP1 Where CodInv='" + Codigo + "'"
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            retorno = cmd.ExecuteNonQuery
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[DAP1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Plazo]
+           ,[Fecha]
+           ,[IngrBruto]
+           ,[PorcImp]
+           ,[MontoImp]
+           ,[IngrNeto]
+
+
+) VALUES(
+
+           @CodInv
+           ,@Correlativo
+           ,@Plazo
+           ,@Fecha
+           ,@IngrBruto
+           ,@PorcImp
+           ,@MontoImp
+           ,@IngrNeto
+
+)
+    "
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+                        .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+                        .Add("@Correlativo", SqlDbType.Int).Value = Coleccion2(1)
+                        .Add("@Plazo", SqlDbType.Int).Value = Coleccion2(2)
+                        .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion2(3)
+                        .Add("@IngrBruto", SqlDbType.Decimal).Value = Coleccion2(4)
+                        .Add("@PorcImp", SqlDbType.Decimal).Value = Coleccion2(5)
+                        .Add("@MontoImp", SqlDbType.Decimal).Value = Coleccion2(6)
+                        .Add("@IngrNeto", SqlDbType.Decimal).Value = Coleccion2(7)
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+
+
+    'Public Sub EliminarDato(ByVal Codigo As String)
+    '    Dim sql As String
+    '    Dim cmd As SqlCommand
+    '    Dim res As Integer
+
+    '    sql = "DELETE FROM [dbo].[DAP0]
+    '  WHERE [CodInv]=@CodInv"
+
+
+
+    '    cn = objCon.Conectar
+
+    '    If Not cn.State = ConnectionState.Open Then
+    '        cn.Open()
+    '    End If
+
+    '    cmd = New SqlCommand
+    '    cmd.CommandText = sql
+    '    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+    '    cmd.Connection = cn
+
+    '    res = cmd.ExecuteNonQuery
+
+    'End Sub
+
+
+
+    Public Sub Eliminar(ByVal Codigo As String)
+
+
+
+        Dim objCon As New Conexion
+
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[DAP0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[DAP1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+    End Sub
+
+
+
+
+
+End Class

+ 43 - 0
DAO/EmpresasDAO.vb

@@ -0,0 +1,43 @@
+Imports System.Data.SqlClient
+Module EmpresasDAO
+
+
+
+    Public Function ObtenerNombreBDSAP(ByVal pCodigoEmpresa As String) As String
+        Dim objCon As New Conexion
+        Dim r As String = String.Empty
+        Dim query As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Not String.IsNullOrEmpty(pCodigoEmpresa) Then
+            query = "SELECT T0.SAP_BD FROM [dbo].[EMPR] T0 WHERE T0.CodEmpr=@CodEmpr"
+            cmd = New SqlCommand
+            cmd.CommandText = query
+
+            cmd.Parameters.Add("@CodEmpr", SqlDbType.VarChar).Value = pCodigoEmpresa
+            cmd.Connection = cn
+
+
+
+            'Double.TryParse(cmd.ExecuteScalar.ToString, r)
+            r = cmd.ExecuteScalar.ToString
+            cn.Close()
+            If String.IsNullOrEmpty(r) Then
+                Return 0
+            End If
+
+        End If
+
+        Return r
+    End Function
+
+
+
+
+
+
+
+End Module

+ 61 - 0
DAO/FechasDAO.vb

@@ -0,0 +1,61 @@
+Imports System.Data.SqlClient
+Public Class FechasDAO
+
+
+
+
+
+
+    Public Function NuevaFechaACC(ByVal codigo As String, ByVal coleccion As Collection)
+        Dim oCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = oCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[FechaACC]
+           ([CodInv]
+             ,[Correlativo]
+             ,[FechaInicio]
+             ,[FechaCorte]
+
+        
+             
+           )
+     VALUES
+           (@CodInv
+             ,@Correlativo
+             ,@FechaInicio
+             ,@FechaCorte
+ 
+             
+          )"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+        With cmd.Parameters
+
+            .Add("@CodInv", SqlDbType.VarChar).Value = codigo
+            .Add("@Correlativo", SqlDbType.Int).Value = coleccion(1)
+            .Add("@FechaInicio", SqlDbType.DateTime).Value = coleccion(2)
+            .Add("@FechaCorte", SqlDbType.DateTime).Value = coleccion(3)
+
+        End With
+        Try
+
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Fechas guardadas correctamente")
+        Catch ex As Exception
+            MsgBox("Ha ocurrido un error")
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+End Class

+ 30 - 0
DAO/FlujoArbitrajeDAO.vb

@@ -0,0 +1,30 @@
+Imports System.Data.SqlClient
+
+Public Class FlujoArbitrajeDAO
+
+
+    Dim Operaciones As New Operaciones
+
+
+    Public Function CargarArbitraje(ByVal CodigoAsociado As String) As DataSet
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_CargarArbitraje]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("CodigoAso", SqlDbType.VarChar).Value = CodigoAsociado
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds
+    End Function
+End Class

+ 671 - 0
DAO/FondoInversionDAO.vb

@@ -0,0 +1,671 @@
+Imports System.Data.SqlClient
+Public Class FondoInversionDAO
+
+
+
+    Dim Operaciones As New Operaciones
+
+
+    Public Function Modificar(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+
+        sql = "UPDATE [dbo].[FINV]
+       SET 
+           [CuoPart]=@CuoPart
+           ,[VaPart]=@VaPart
+           ,[CoCasa]=@CoCasa
+           ,[CoBolsa]=@CoBolsa
+           ,[DiasLiq]=@DiasLiq
+           ,[FechaOpe]=@FechaOpe
+           ,[FechaVen]=@FechaVen
+           ,[Periodic]=@Periodic
+           ,[Base]=@Base
+           ,[PlaInv]=@PlaInv
+           ,[RendOfre]=@RendOfre
+           ,[Dividendo]=@Dividendo
+   where [CodInv]=@CodInv  "
+
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+            .Add("@CuoPart", SqlDbType.Float).Value = CDec(Coleccion(1).TrimEnd("%"))
+            .Add("@VaPart", SqlDbType.Float).Value = CDec(Coleccion(2).TrimEnd("%"))
+            .Add("@CoCasa", SqlDbType.Float).Value = CDec(Coleccion(3).TrimEnd("%"))
+            .Add("@CoBolsa", SqlDbType.Float).Value = CDec(Coleccion(4).TrimEnd("%"))
+            .Add("@DiasLiq", SqlDbType.Int).Value = CInt(Coleccion(5))
+            .Add("@FechaOpe", SqlDbType.DateTime).Value = CDate(Coleccion(6))
+            .Add("@FechaVen", SqlDbType.DateTime).Value = CDate(Coleccion(7))
+            .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(8).ToString
+            .Add("@Base", SqlDbType.Int).Value = CInt(Coleccion(9))
+            .Add("@PlaInv", SqlDbType.VarChar).Value = Coleccion(10).ToString
+            .Add("@RendOfre", SqlDbType.Float).Value = CDec(Coleccion(11).TrimEnd("%"))
+            .Add("@Dividendo", SqlDbType.Float).Value = CDec(Coleccion(12).TrimEnd("%"))
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection), ByVal Estado As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            If Estado = "Nuevo" Then
+
+
+                sql = "INSERT INTO [dbo].[FINV]
+           ([CodInv]
+           ,[ValNominal]	
+           ,[CuoPart]	
+           ,[ValPart]	
+           ,[PorcComisionCasa]	
+           ,[PorcComisionBolsa]	
+           ,[ComisionCasa]
+           ,[ComisionBolsa]
+           ,[ValTrans]	
+           ,[FechaOpe]	
+           ,[FechaLiq]	
+           ,[FechaVen]	
+           ,[DiasLiq]	
+           ,[RendOfre]	
+           ,[Periodicidad]	
+           ,[Base]	
+           ,[Plazo]
+           ,[Dividendo]
+           ,[TipCalBase]
+
+)
+     VALUES
+           (@CodInv
+           ,@ValNominal	
+           ,@CuoPart
+           ,@ValPart
+           ,@PorcComisionCasa
+           ,@PorcComisionBolsa
+           ,@ComisionCasa
+           ,@ComisionBolsa
+           ,@ValTrans
+           ,@FechaOpe
+           ,@FechaLiq
+           ,@FechaVen
+           ,@DiasLiq	
+           ,@RendOfre	
+           ,@Periodicidad	
+           ,@Base
+           ,@Plazo
+           ,@Dividendo
+           ,@TipCalBase
+)"
+
+
+
+
+
+            Else
+                sql = "UPDATE [dbo].[FINV] SET
+         
+           [ValNominal]=@ValNominal
+           ,[CuoPart]=@CuoPart
+           ,[ValPart]=@ValPart
+           ,[PorcComisionCasa]=@PorcComisionCasa
+           ,[PorcComisionBolsa]=@PorcComisionBolsa
+           ,[ComisionCasa]=@ComisionCasa
+           ,[ComisionBolsa]=@ComisionBolsa
+           ,[ValTrans]=@ValTrans
+           ,[FechaOpe]=@FechaOpe
+           ,[FechaLiq]=@FechaLiq
+           ,[FechaVen]=@FechaVen
+           ,[DiasLiq]=@DiasLiq
+           ,[RendOfre]=@RendOfre
+           ,[Periodicidad]=	@Periodicidad
+           ,[Base]=@Base
+           ,[Plazo]=@Plazo
+           ,[Dividendo]=@Dividendo
+           ,[TipCalBase]=@TipCalBase
+            where [CodInv]=@CodInv
+            
+     "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@ValNominal", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(1).ToString)
+                .Add("@CuoPart", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(2).ToString)
+                .Add("@ValPart", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(3).ToString)
+                .Add("@PorcComisionCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(4).ToString)
+                .Add("@PorcComisionBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(5).ToString)
+                .Add("@ComisionCasa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(6).ToString)
+                .Add("@ComisionBolsa", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(7).ToString)
+                .Add("@ValTrans", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(8).ToString)
+                .Add("@FechaOpe", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(Coleccion(9).ToString)
+                .Add("@FechaLiq", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(Coleccion(10).ToString)
+                .Add("@FechaVen", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(Coleccion(11).ToString)
+                .Add("@DiasLiq", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion(12).ToString)
+                .Add("@RendOfre", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(13).ToString)
+                .Add("@Periodicidad", SqlDbType.VarChar).Value = Coleccion(14).ToString
+                .Add("@Base", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion(15).ToString)
+                .Add("@Plazo", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion(16).ToString)
+                .Add("@Dividendo", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(17).ToString)
+                .Add("TipCalBase", SqlDbType.VarChar).Value = Coleccion(18).ToString
+
+
+
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+            sql = "DELETE FROM [dbo].[FINV1]
+            WHERE [CodInv]=@CodInv "
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[FINV1]
+           ([CodInv]
+           ,[NumDiv]
+           ,[Fecha]
+           ,[Dias]
+           ,[Dividendo]
+           ,[Ingreso]
+           ,[Rend]
+
+        
+             
+           )
+     VALUES
+           (@CodInv
+           ,@NumDiv
+           ,@Fecha
+           ,@Dias
+           ,@Dividendo
+           ,@Ingreso
+           ,@Rend
+             
+          )"
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                        .Add("@NumDiv", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion2(1).ToString)
+                        .Add("@Fecha", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(Coleccion2(2).ToString)
+                        .Add("@Dias", SqlDbType.Int).Value = Operaciones.ConvertirEntero(Coleccion2(3).ToString)
+                        .Add("@Dividendo", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion2(4).ToString)
+                        .Add("@Ingreso", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion2(5).ToString)
+                        .Add("@Rend", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion2(6).ToString)
+
+
+
+
+
+
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+            ''''''''''''''''
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+    Public Function Nuevo(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[FINV](
+
+           [CuoPart]
+           ,[VaPart]
+           ,[CoCasa]
+           ,[CoBolsa]
+           ,[DiasLiq]
+           ,[FechaOpe]
+           ,[FechaVen]
+           ,[Periodic]
+           ,[Base]
+           ,[PlaInv]
+           ,[RendOfre]
+           ,[Dividendo]
+           ,[CodInv]
+) VALUES(
+           @CuoPart
+           ,@VaPart
+           ,@CoCasa
+           ,@CoBolsa
+           ,@DiasLiq
+           ,@FechaOpe
+           ,@FechaVen
+           ,@Periodic
+           ,@Base
+           ,@PlaInv
+           ,@RendOfre
+           ,@Dividendo
+           ,@CodInv
+)
+    "
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+
+            .Add("@CuoPart", SqlDbType.Float).Value = CDec(Coleccion(1).TrimEnd("%"))
+            .Add("@VaPart", SqlDbType.Float).Value = CDec(Coleccion(2).TrimEnd("%"))
+            .Add("@CoCasa", SqlDbType.Float).Value = CDec(Coleccion(3).TrimEnd("%"))
+            .Add("@CoBolsa", SqlDbType.Float).Value = CDec(Coleccion(4).TrimEnd("%"))
+            .Add("@DiasLiq", SqlDbType.Int).Value = CInt(Coleccion(5))
+            .Add("@FechaOpe", SqlDbType.DateTime).Value = CDate(Coleccion(6))
+            .Add("@FechaVen", SqlDbType.DateTime).Value = CDate(Coleccion(7))
+            .Add("@Periodic", SqlDbType.VarChar).Value = Coleccion(8).ToString
+            .Add("@Base", SqlDbType.Int).Value = CInt(Coleccion(9))
+            .Add("@PlaInv", SqlDbType.VarChar).Value = Coleccion(10).ToString
+            .Add("@RendOfre", SqlDbType.Float).Value = CDec(Coleccion(11).TrimEnd("%"))
+            .Add("@Dividendo", SqlDbType.Float).Value = CDec(Coleccion(12).TrimEnd("%"))
+            .Add("@CodInv ", SqlDbType.VarChar).Value = Codigo.ToString
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+    Public Function Cargar(ByVal CodInv As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[FINV] WHERE CodInv=@CodInv"
+
+
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInv
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+
+            If Datos.Read Then
+
+
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("ValNominal").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("CuoPart").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("ValPart").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("PorcComisionCasa").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("PorcComisionBolsa").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("ComisionCasa").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("ComisionBolsa").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("ValTrans").ToString))
+                Coleccion.Add(Operaciones.ConvertirFecha(Datos("FechaOpe").ToString))
+                Coleccion.Add(Operaciones.ConvertirFecha(Datos("FechaLiq").ToString))
+                Coleccion.Add(Operaciones.ConvertirFecha(Datos("FechaVen").ToString))
+                Coleccion.Add(Operaciones.ConvertirEntero(Datos("DiasLiq").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("RendOfre").ToString))
+                Coleccion.Add(Datos("Periodicidad").ToString)
+                Coleccion.Add(Operaciones.ConvertirEntero(Datos("Base").ToString))
+                Coleccion.Add(Operaciones.ConvertirEntero(Datos("Plazo").ToString))
+                Coleccion.Add(Operaciones.ConvertirDecimal(Datos("Dividendo").ToString))
+                Coleccion.Add(Datos("TipCalBase").ToString)
+                Return Coleccion
+            End If
+        End If
+        cn.Close()
+        Return Coleccion
+    End Function
+
+
+    Function GuardarDataGrid(ByVal coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[FINV1](
+
+           [CodInv]
+           ,[correlativo]
+           ,[FechaCorte]
+           ,[Dias]
+           ,[Dividendo]
+           ,[Ingreso]
+           ,[RendMensual]
+         
+      
+) VALUES(
+           @CodInv
+           ,@correlativo
+           ,@FechaCorte
+           ,@Dias
+           ,@Dividendo
+           ,@Ingreso
+           ,@RendMensual
+)
+    "
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@correlativo", SqlDbType.Int).Value = CInt(coleccion(1))
+            .Add("@FechaCorte", SqlDbType.DateTime).Value = coleccion(2)
+            .Add("@Dias", SqlDbType.Int).Value = coleccion(3)
+            .Add("@Dividendo", SqlDbType.Float).Value = coleccion(4)
+            .Add("@Ingreso", SqlDbType.Float).Value = coleccion(5)
+            .Add("@RendMensual", SqlDbType.VarChar).Value = coleccion(6)
+
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+    Function ModificarDataGrid(ByVal coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[FINV1] SET
+           [FechaCorte]=@FechaCorte
+           ,[Dias]=@Dias
+           ,[Dividendo]=@Dividendo
+           ,[Ingreso]=@Ingreso
+           ,[RendMensual]=@RendMensual
+            WHERE  [CodInv]=@CodInv AND [correlativo]=@correlativo
+
+    "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@correlativo", SqlDbType.Int).Value = CInt(coleccion(1))
+            .Add("@FechaCorte", SqlDbType.DateTime).Value = coleccion(2)
+            .Add("@Dias", SqlDbType.Int).Value = coleccion(3)
+            .Add("@Dividendo", SqlDbType.Float).Value = coleccion(4)
+            .Add("@Ingreso", SqlDbType.Float).Value = coleccion(5)
+            .Add("@RendMensual", SqlDbType.VarChar).Value = coleccion(6)
+
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Function CargarFilas(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from FINV1 where CodInv='" + codigo + "'"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        Dim Tabla As New DataTable
+
+
+        dr = cmd.ExecuteReader
+        Tabla.Load(dr)
+        cn.Close()
+        Return Tabla
+    End Function
+
+
+    Public Sub Eliminar(ByVal CodInv As String)
+
+
+
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[FINV]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInv
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[FINV1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInv
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+
+
+
+
+    End Sub
+
+    Public Sub EliminarIngreso(ByVal Codigo As String, ByVal NumDiv As Integer)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "DELETE FROM FINV1
+      WHERE [CodInv]=@CodInv AND [NumDiv]=@NumDiv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@NumDiv", SqlDbType.Int).Value = NumDiv
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+    Public Sub EliminarDatGrid(ByVal Codigo As String, ByVal correlativo As Integer)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[FINV1]
+      WHERE [CodInv]=@CodInv AND [correlativo]=@correlativo"
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@correlativo", SqlDbType.Int).Value = correlativo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+End Class

+ 696 - 0
DAO/FuturosDAO.vb

@@ -0,0 +1,696 @@
+
+Imports System.Data.SqlClient
+
+Public Class FuturosDAO
+
+
+
+
+
+
+    Public Function Modificar(ByVal Codigo As String, ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[FUT0] SET
+[FOperC]=@FOperC
+,[FLiqC]=@FLiqC
+,[FVenC]=@FVenC
+,[VaUnidadC]=@VaUnidadC
+,[ValorTransadoC]=@ValorTransadoC
+,[CoBrokerC]=@CoBrokerC
+,[VaRecC]=@VaRecC
+,[IdContratoC]=@IdContratoC
+,[CantContratoC]=@CantContratoC
+,[UniContraC]=@UniContraC
+
+,[FOperV]=@FOperV
+,[FLiqV]=@FLiqV
+,[FVenV]=@FVenV
+,[VaUnidadV]=@VaUnidadV
+,[ValorTransadoV]=@ValorTransadoV
+,[CoBrokerV]=@CoBrokerV
+,[VaRecV]=@VaRecV
+,[IdContratoV]=@IdContratoV
+,[CantContratoV]=@CantContratoV
+,[UniContraV]=@UniContraV
+,[GP]=@GP
+,[Rendimiento]=@Rendimiento
+,[TipoOperacion]=@TipoOperacion
+where  [CodInv]=@CodInv
+     
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        Try
+
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@FOperC", SqlDbType.DateTime).Value = CDate(Coleccion(1))
+                .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+                .Add("@FVenC", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(Coleccion(4))
+                .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(Coleccion(5))
+                .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(Coleccion(6))
+                .Add("@VaRecC", SqlDbType.Float).Value = CDec(Coleccion(7))
+                .Add("@IdContratoC", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                .Add("@CantContratoC", SqlDbType.Int).Value = CInt(Coleccion(9))
+                .Add("@UniContraC", SqlDbType.Int).Value = CInt(Coleccion(10))
+
+
+                .Add("@FOperV", SqlDbType.DateTime).Value = CDate(Coleccion(11))
+                .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(Coleccion(12))
+                .Add("@FVenV", SqlDbType.DateTime).Value = CDate(Coleccion(13))
+                .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(Coleccion(14))
+                .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(Coleccion(15))
+                .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(Coleccion(16))
+                .Add("@VaRecV", SqlDbType.Float).Value = CDec(Coleccion(17))
+                .Add("@IdContratoV", SqlDbType.VarChar).Value = Coleccion(18).ToString
+                .Add("@CantContratoV", SqlDbType.Int).Value = CInt(Coleccion(19))
+                .Add("@UniContraV", SqlDbType.Int).Value = CInt(Coleccion(20))
+
+                .Add("@GP", SqlDbType.Float).Value = CDec(Coleccion(21))
+                .Add("@Rendimiento", SqlDbType.Float).Value = CDec(Coleccion(22))
+                .Add("@TipoOperacion", SqlDbType.VarChar).Value = Coleccion(23).ToString
+
+
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+
+            MsgBox("Registro modificado")
+        Catch ex As Exception
+            MsgBox("Error al modificar el registro")
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Function ModificarOpciones(ByVal Codigo As String, ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[OPC0] SET
+[FOperC]=@FOperC
+,[FLiqC]=@FLiqC
+,[FVenC]=@FVenC
+,[VaUnidadC]=@VaUnidadC
+,[ValorTransadoC]=@ValorTransadoC
+,[CoBrokerC]=@CoBrokerC
+,[VaRecC]=@VaRecC
+,[IdContratoC]=@IdContratoC
+,[CantContratoC]=@CantContratoC
+,[UniContraC]=@UniContraC
+
+,[FOperV]=@FOperV
+,[FLiqV]=@FLiqV
+,[FVenV]=@FVenV
+,[VaUnidadV]=@VaUnidadV
+,[ValorTransadoV]=@ValorTransadoV
+,[CoBrokerV]=@CoBrokerV
+,[VaRecV]=@VaRecV
+,[IdContratoV]=@IdContratoV
+,[CantContratoV]=@CantContratoV
+,[UniContraV]=@UniContraV
+,[GP]=@GP
+,[Rendimiento]=@Rendimiento
+,[TipoOperacion]=@TipoOperacion
+where  [CodInv]=@CodInv
+     
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        Try
+
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@FOperC", SqlDbType.DateTime).Value = CDate(Coleccion(1))
+                .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+                .Add("@FVenC", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(Coleccion(4))
+                .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(Coleccion(5))
+                .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(Coleccion(6))
+                .Add("@VaRecC", SqlDbType.Float).Value = CDec(Coleccion(7))
+                .Add("@IdContratoC", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                .Add("@CantContratoC", SqlDbType.Int).Value = CInt(Coleccion(9))
+                .Add("@UniContraC", SqlDbType.Int).Value = CInt(Coleccion(10))
+
+
+                .Add("@FOperV", SqlDbType.DateTime).Value = CDate(Coleccion(11))
+                .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(Coleccion(12))
+                .Add("@FVenV", SqlDbType.DateTime).Value = CDate(Coleccion(13))
+                .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(Coleccion(14))
+                .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(Coleccion(15))
+                .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(Coleccion(16))
+                .Add("@VaRecV", SqlDbType.Float).Value = CDec(Coleccion(17))
+                .Add("@IdContratoV", SqlDbType.VarChar).Value = Coleccion(18).ToString
+                .Add("@CantContratoV", SqlDbType.Int).Value = CInt(Coleccion(19))
+                .Add("@UniContraV", SqlDbType.Int).Value = CInt(Coleccion(20))
+
+                .Add("@GP", SqlDbType.Float).Value = CDec(Coleccion(21))
+                .Add("@Rendimiento", SqlDbType.Float).Value = CDec(Coleccion(22))
+                .Add("@TipoOperacion", SqlDbType.VarChar).Value = Coleccion(23).ToString
+
+
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro modificado")
+        Catch ex As Exception
+            MsgBox("Error al modificar el registro")
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+    Public Function Nuevo(ByVal Codigo As String, ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[FUT0](
+           [CodInv]
+,[FOperC]
+,[FLiqC]
+,[FVenC]
+,[VaUnidadC]
+,[ValorTransadoC]
+,[CoBrokerC]
+,[VaRecC]
+,[IdContratoC]
+,[CantContratoC]
+,[UniContraC]
+
+,[FOperV]
+,[FLiqV]
+,[FVenV]
+,[VaUnidadV]
+,[ValorTransadoV]
+,[CoBrokerV]
+,[VaRecV]
+,[IdContratoV]
+,[CantContratoV]
+,[UniContraV]
+,[GP]
+,[Rendimiento]
+,[TipoOperacion]
+
+) VALUES(
+           @CodInv
+,@FOperC
+,@FLiqC
+,@FVenC
+,@VaUnidadC
+,@ValorTransadoC
+,@CoBrokerC
+,@VaRecC
+,@IdContratoC
+,@CantContratoC
+,@UniContraC
+
+,@FOperV
+,@FLiqV
+,@FVenV
+,@VaUnidadV
+,@ValorTransadoV
+,@CoBrokerV
+,@VaRecV
+,@IdContratoV
+,@CantContratoV
+,@UniContraV
+,@GP
+,@Rendimiento
+,@TipoOperacion
+
+
+)
+    "
+
+        cmd = New SqlCommand
+            cmd.CommandText = sql
+
+        'Try
+
+
+
+        With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@FOperC", SqlDbType.DateTime).Value = CDate(Coleccion(1))
+                .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+                .Add("@FVenC", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(Coleccion(4))
+                .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(Coleccion(5))
+                .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(Coleccion(6))
+                .Add("@VaRecC", SqlDbType.Float).Value = CDec(Coleccion(7))
+                .Add("@IdContratoC", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                .Add("@CantContratoC", SqlDbType.Int).Value = CInt(Coleccion(9))
+                .Add("@UniContraC", SqlDbType.Int).Value = CInt(Coleccion(10))
+
+
+                .Add("@FOperV", SqlDbType.DateTime).Value = CDate(Coleccion(11))
+                .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(Coleccion(12))
+                .Add("@FVenV", SqlDbType.DateTime).Value = CDate(Coleccion(13))
+                .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(Coleccion(14))
+                .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(Coleccion(15))
+                .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(Coleccion(16))
+                .Add("@VaRecV", SqlDbType.Float).Value = CDec(Coleccion(17))
+                .Add("@IdContratoV", SqlDbType.VarChar).Value = Coleccion(18).ToString
+                .Add("@CantContratoV", SqlDbType.Int).Value = CInt(Coleccion(19))
+                .Add("@UniContraV", SqlDbType.Int).Value = CInt(Coleccion(20))
+
+                .Add("@GP", SqlDbType.Float).Value = CDec(Coleccion(21))
+                .Add("@Rendimiento", SqlDbType.Float).Value = CDec(Coleccion(22))
+                .Add("@TipoOperacion", SqlDbType.VarChar).Value = Coleccion(23).ToString
+
+
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro Creado")
+        'Catch ex As Exception
+        '    MsgBox("Error al crear el registro")
+        'End Try
+        cn.Close()
+        Return retorno
+
+        End Function
+
+
+
+    Public Function NuevoOpciones(ByVal Codigo As String, ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[OPC0](
+           [CodInv]
+,[FOperC]
+,[FLiqC]
+,[FVenC]
+,[VaUnidadC]
+,[ValorTransadoC]
+,[CoBrokerC]
+,[VaRecC]
+,[IdContratoC]
+,[CantContratoC]
+,[UniContraC]
+
+,[FOperV]
+,[FLiqV]
+,[FVenV]
+,[VaUnidadV]
+,[ValorTransadoV]
+,[CoBrokerV]
+,[VaRecV]
+,[IdContratoV]
+,[CantContratoV]
+,[UniContraV]
+,[GP]
+,[Rendimiento]
+,[TipoOperacion]
+
+) VALUES(
+           @CodInv
+,@FOperC
+,@FLiqC
+,@FVenC
+,@VaUnidadC
+,@ValorTransadoC
+,@CoBrokerC
+,@VaRecC
+,@IdContratoC
+,@CantContratoC
+,@UniContraC
+
+,@FOperV
+,@FLiqV
+,@FVenV
+,@VaUnidadV
+,@ValorTransadoV
+,@CoBrokerV
+,@VaRecV
+,@IdContratoV
+,@CantContratoV
+,@UniContraV
+,@GP
+,@Rendimiento
+,@TipoOperacion
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        Try
+
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                .Add("@FOperC", SqlDbType.DateTime).Value = CDate(Coleccion(1))
+                .Add("@FLiqC", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+                .Add("@FVenC", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@VaUnidadC", SqlDbType.Float).Value = CDec(Coleccion(4))
+                .Add("@ValorTransadoC", SqlDbType.Float).Value = CDec(Coleccion(5))
+                .Add("@CoBrokerC", SqlDbType.Float).Value = CDec(Coleccion(6))
+                .Add("@VaRecC", SqlDbType.Float).Value = CDec(Coleccion(7))
+                .Add("@IdContratoC", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                .Add("@CantContratoC", SqlDbType.Int).Value = CInt(Coleccion(9))
+                .Add("@UniContraC", SqlDbType.Int).Value = CInt(Coleccion(10))
+
+
+                .Add("@FOperV", SqlDbType.DateTime).Value = CDate(Coleccion(11))
+                .Add("@FLiqV", SqlDbType.DateTime).Value = CDate(Coleccion(12))
+                .Add("@FVenV", SqlDbType.DateTime).Value = CDate(Coleccion(13))
+                .Add("@VaUnidadV", SqlDbType.Float).Value = CDec(Coleccion(14))
+                .Add("@ValorTransadoV", SqlDbType.Float).Value = CDec(Coleccion(15))
+                .Add("@CoBrokerV", SqlDbType.Float).Value = CDec(Coleccion(16))
+                .Add("@VaRecV", SqlDbType.Float).Value = CDec(Coleccion(17))
+                .Add("@IdContratoV", SqlDbType.VarChar).Value = Coleccion(18).ToString
+                .Add("@CantContratoV", SqlDbType.Int).Value = CInt(Coleccion(19))
+                .Add("@UniContraV", SqlDbType.Int).Value = CInt(Coleccion(20))
+
+                .Add("@GP", SqlDbType.Float).Value = CDec(Coleccion(21))
+                .Add("@Rendimiento", SqlDbType.Float).Value = CDec(Coleccion(22))
+                .Add("@TipoOperacion", SqlDbType.VarChar).Value = Coleccion(23).ToString
+
+
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro Creado")
+        Catch ex As Exception
+            MsgBox("Error al crear el registro")
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+    Public Function CargarDatos(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim Err As Boolean = False
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[FUT0] WHERE CodInv=@Codigo"
+
+
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            Try
+
+
+
+                If Datos.Read Then
+
+                    Coleccion.Add(Datos.Item("FOperC").ToString)
+                    Coleccion.Add(Datos.Item("FLiqC").ToString)
+                    Coleccion.Add(Datos.Item("FVenC").ToString)
+                    Coleccion.Add(Datos.Item("VaUnidadC").ToString)
+                    Coleccion.Add(Datos.Item("ValorTransadoC").ToString)
+                    Coleccion.Add(Datos.Item("CoBrokerC").ToString)
+                    Coleccion.Add(Datos.Item("VaRecC").ToString)
+                    Coleccion.Add(Datos.Item("IdContratoC").ToString)
+                    Coleccion.Add(Datos.Item("CantContratoC").ToString)
+                    Coleccion.Add(Datos.Item("UniContraC").ToString)
+
+
+                    Coleccion.Add(Datos.Item("FOperV").ToString)
+                    Coleccion.Add(Datos.Item("FLiqV").ToString)
+                    Coleccion.Add(Datos.Item("FVenV").ToString)
+                    Coleccion.Add(Datos.Item("VaUnidadV").ToString)
+                    Coleccion.Add(Datos.Item("ValorTransadoV").ToString)
+                    Coleccion.Add(Datos.Item("CoBrokerV").ToString)
+                    Coleccion.Add(Datos.Item("VaRecV").ToString)
+                    Coleccion.Add(Datos.Item("IdContratoV").ToString)
+                    Coleccion.Add(Datos.Item("CantContratoV").ToString)
+                    Coleccion.Add(Datos.Item("UniContraV").ToString)
+
+                    Coleccion.Add(Datos.Item("GP").ToString)
+                    Coleccion.Add(Datos.Item("Rendimiento").ToString)
+                    Coleccion.Add(Datos.Item("TipoOperacion").ToString)
+
+
+                    Return Coleccion
+                Else
+
+                    Err = True
+                End If
+            Catch ex As Exception
+                MsgBox("Ha Ocurrido un error interno")
+            End Try
+        Else
+
+        End If
+        Coleccion.Add(False)
+        cn.Close()
+        Return Coleccion
+
+    End Function
+
+
+
+
+    Public Function CargarDatosOpciones(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[OPC0] WHERE CodInv=@Codigo"
+
+
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            Try
+
+
+
+                If Datos.Read Then
+
+                    Coleccion.Add(Datos.Item("FOperC"))
+                    Coleccion.Add(Datos.Item("FLiqC"))
+                    Coleccion.Add(Datos.Item("FVenC"))
+                    Coleccion.Add(Datos.Item("VaUnidadC"))
+                    Coleccion.Add(Datos.Item("ValorTransadoC"))
+                    Coleccion.Add(Datos.Item("CoBrokerC"))
+                    Coleccion.Add(Datos.Item("VaRecC"))
+                    Coleccion.Add(Datos.Item("IdContratoC"))
+                    Coleccion.Add(Datos.Item("CantContratoC"))
+                    Coleccion.Add(Datos.Item("UniContraC"))
+
+
+                    Coleccion.Add(Datos.Item("FOperV"))
+                    Coleccion.Add(Datos.Item("FLiqV"))
+                    Coleccion.Add(Datos.Item("FVenV"))
+                    Coleccion.Add(Datos.Item("VaUnidadV"))
+                    Coleccion.Add(Datos.Item("ValorTransadoV"))
+                    Coleccion.Add(Datos.Item("CoBrokerV"))
+                    Coleccion.Add(Datos.Item("VaRecV"))
+                    Coleccion.Add(Datos.Item("IdContratoV"))
+                    Coleccion.Add(Datos.Item("CantContratoV"))
+                    Coleccion.Add(Datos.Item("UniContraV"))
+
+                    Coleccion.Add(Datos.Item("GP"))
+                    Coleccion.Add(Datos.Item("Rendimiento"))
+                    Coleccion.Add(Datos.Item("TipoOperacion").ToString)
+
+
+                    Return Coleccion
+                End If
+            Catch ex As Exception
+                MsgBox("Ha Ocurrido un error interno")
+            End Try
+        End If
+        Coleccion.Add(False)
+        cn.Close()
+        Return Coleccion
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Sub Eliminar(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[FUT0]
+      WHERE [CodInv]=@CodInv "
+
+
+        Try
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+            cmd.Connection = cn
+
+            res = cmd.ExecuteNonQuery
+            MsgBox("Registro Eliminado")
+        Catch ex As Exception
+            MsgBox("No se pudo Eliminar")
+        End Try
+        cn.Close()
+    End Sub
+
+
+
+    Public Sub EliminarOpciones(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[OPC0]
+      WHERE [CodInv]=@CodInv "
+
+
+        Try
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+            cmd.Connection = cn
+
+            res = cmd.ExecuteNonQuery
+            MsgBox("Registro Eliminado")
+        Catch ex As Exception
+            MsgBox("No se pudo Eliminar")
+        End Try
+        cn.Close()
+    End Sub
+End Class
+

+ 386 - 0
DAO/IngresosDAO.vb

@@ -0,0 +1,386 @@
+Imports System.Data.SqlClient
+Module IngresosDAO
+    Public Function ListaIngresos(ByVal vFechaI As Date, vFechaF As Date, vSoloPendientes As Boolean) As DataTable
+        Dim cn As New Conexion
+        Dim dt As New DataTable
+        Dim da As SqlDataAdapter
+        Dim pSoloPendientes As Integer
+
+        If vSoloPendientes Then
+            pSoloPendientes = 1
+        Else
+            pSoloPendientes = 0
+        End If
+
+        da = New SqlDataAdapter("SP_Ingresos_Master", cn.Conectar)
+        da.SelectCommand.CommandType = CommandType.StoredProcedure
+        da.SelectCommand.Parameters.Add("@FechaI", SqlDbType.DateTime).Value = vFechaI
+        da.SelectCommand.Parameters.Add("@FechaF", SqlDbType.DateTime).Value = vFechaF
+        da.SelectCommand.Parameters.Add("@SoloPendientes", SqlDbType.Bit).Value = pSoloPendientes
+        da.Fill(dt)
+        Return dt
+
+
+    End Function
+
+    Public Function DetalleDeIngreso(ByVal vCodInv As String, ByVal vIngresoID As Integer) As IngresoDetalleCE
+        Dim oIngresoDetalleCE As New IngresoDetalleCE
+        Dim oConexion As New Conexion
+        Dim cn As SqlConnection
+        Dim cmd As SqlCommand
+        Dim vSqlParameter As SqlParameter
+        Dim dr As SqlDataReader
+
+        cmd = New SqlCommand
+        cmd.CommandText = "SP_IngresosDetalle"
+        cmd.CommandType = CommandType.StoredProcedure
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@CodInv"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = vCodInv
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@IngresoId"
+        vSqlParameter.SqlDbType = SqlDbType.Int
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = vIngresoID
+        cmd.Parameters.Add(vSqlParameter)
+
+        cn = oConexion.Conectar
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        dr = cmd.ExecuteReader()
+
+        If dr.HasRows Then
+            'oIngresoDetalleCE = New IngresoDetalleCE
+
+            While dr.Read
+                oIngresoDetalleCE.CodigoInversion = dr.Item("CodInv").ToString
+                oIngresoDetalleCE.CodigoInstrumentoFinanciero = dr.Item("CodIF").ToString
+                oIngresoDetalleCE.NombreManualIF = dr.Item("NombreManIF").ToString
+                oIngresoDetalleCE.CodigoManualIF = dr.Item("CodManIF").ToString
+                oIngresoDetalleCE.CodigoEmpresa = dr.Item("CodEmpr").ToString
+                If Not Date.TryParse(dr.Item("FechaVencimiento"), oIngresoDetalleCE.FechaVencimiento) Then
+                    oIngresoDetalleCE.FechaVencimiento = Date.MinValue.Date
+                End If
+                Integer.TryParse(dr.Item("Correlativo"), oIngresoDetalleCE.IngresoId)
+                Double.TryParse(dr.Item("Capital").ToString, oIngresoDetalleCE.MontoCapitalProyectado)
+                Double.TryParse(dr.Item("IngresoBruto"), oIngresoDetalleCE.MontoIngresoBrutoProyectado)
+                Double.TryParse(dr.Item("ISR"), oIngresoDetalleCE.MontoISRProyectado)
+                Double.TryParse(dr.Item("IngresoNeto"), oIngresoDetalleCE.MontoIngresoNetoProyectado)
+                oIngresoDetalleCE.EstadoDelIngreso = dr.Item("EstadoIngreso").ToString
+                oIngresoDetalleCE.SAP_BD = dr.Item("SAP_BD").ToString
+
+            End While
+        End If
+
+        Return oIngresoDetalleCE
+    End Function
+
+    Public Function ValidarIngreso(ByVal pCodInv As String, ByVal pIngresoId As Integer) As Integer
+        Dim res As Integer
+        Dim oConexion As New Conexion
+        Dim cn As SqlConnection
+        Dim cmd As SqlCommand
+        Dim vSqlParameter As SqlParameter
+        Dim query As String
+
+        query = "UPDATE [dbo].[INGR]
+SET	[FechaValidacion] = @FechaValidacion
+	,[Validado] = 'S'
+ WHERE
+	[CodInv]=@CodInv 
+	AND [IngresoID]=@IngresoID
+"
+        cn = oConexion.Conectar
+        cmd = New SqlCommand()
+
+        cmd.CommandText = query
+        cmd.CommandType = CommandType.Text
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@CodInv"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pCodInv
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@IngresoId"
+        vSqlParameter.SqlDbType = SqlDbType.Int
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pIngresoId
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@FechaValidacion"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = Date.Now.Date
+        cmd.Parameters.Add(vSqlParameter)
+
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        res = cmd.ExecuteNonQuery()
+
+        Return res
+    End Function
+    Public Function ConciliarIngreso(ByVal pCodInv As String, ByVal pIngresoId As Integer) As Integer
+        Dim res As Integer
+        Dim oConexion As New Conexion
+        Dim cn As SqlConnection
+        Dim cmd As SqlCommand
+        Dim vSqlParameter As SqlParameter
+        Dim query As String
+
+        query = "UPDATE [dbo].[INGR]
+SET	[FechaConciliacion] = @FechaConciliacion
+	,[Conciliado] = 'S'
+ WHERE
+	[CodInv]=@CodInv 
+	AND [IngresoID]=@IngresoID
+"
+        cn = oConexion.Conectar
+        cmd = New SqlCommand()
+
+        cmd.CommandText = query
+        cmd.CommandType = CommandType.Text
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@CodInv"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pCodInv
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@IngresoId"
+        vSqlParameter.SqlDbType = SqlDbType.Int
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pIngresoId
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@FechaConciliacion"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = Date.Now.Date
+        cmd.Parameters.Add(vSqlParameter)
+
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        res = cmd.ExecuteNonQuery()
+
+        Return res
+    End Function
+    Public Function RegistrarIngreso(ByVal pRegistroIngresoCE As RegistroIngresoCE) As Integer
+        Dim query As String
+        Dim cmd As SqlCommand
+        Dim oConexion As New Conexion
+        Dim cn As SqlConnection
+        Dim retorno As Integer
+
+        query = "INSERT INTO [dbo].[INGR]
+           ([CodEmpr]
+           ,[CodIF]
+           ,[CodBanco]
+           ,[CodInv]
+           ,[IngresoID]
+           ,[FormaPago]
+           ,[CuentaBanco]
+           ,[FechaRegistro]
+           ,[Registrado]
+,[FechaIngreso]
+,[MontoCapital]
+,[MontoIngresoBruto]
+,[MontoISR]
+,[MontoIngresoNeto]
+,[MontoIngresoLiquido]
+,[TransId]
+)
+     VALUES
+           (@CodEmpr
+           ,@CodIF
+           ,@CodBanco
+           ,@CodInv
+           ,@IngresoID
+           ,@FormaPago
+           ,@CuentaBanco
+           ,@FechaRegistro
+           ,'S'
+,@FechaIngreso
+,@MontoCapital
+,@MontoIngresoBruto
+,@MontoISR
+,@MontoIngresoNeto
+,@MontoIngresoLiquido
+,@TransId
+)
+		   "
+
+        cmd = New SqlCommand
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodEmpr", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoEmpresa
+        cmd.Parameters.Add("@CodIF", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoInstrumento
+        cmd.Parameters.Add("@CodBanco", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoBanco
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoInversion
+        cmd.Parameters.Add("@IngresoID", SqlDbType.Int).Value = pRegistroIngresoCE.IngresoID
+        cmd.Parameters.Add("@FormaPago", SqlDbType.VarChar).Value = pRegistroIngresoCE.FormaDePago
+        cmd.Parameters.Add("@CuentaBanco", SqlDbType.VarChar).Value = pRegistroIngresoCE.CuentaBancaria
+        cmd.Parameters.Add("@FechaRegistro", SqlDbType.DateTime).Value = pRegistroIngresoCE.FechaRegistro
+        cmd.Parameters.Add("@FechaIngreso", SqlDbType.DateTime).Value = pRegistroIngresoCE.FechaDelIngreso
+        cmd.Parameters.Add("@MontoCapital", SqlDbType.Float).Value = pRegistroIngresoCE.MontoCapital
+        cmd.Parameters.Add("@MontoIngresoBruto", SqlDbType.Float).Value = pRegistroIngresoCE.MontoIngresoBruto
+        cmd.Parameters.Add("@MontoISR", SqlDbType.Float).Value = pRegistroIngresoCE.MontoISR
+        cmd.Parameters.Add("@MontoIngresoNeto", SqlDbType.Float).Value = pRegistroIngresoCE.MontoIngresoNeto
+        cmd.Parameters.Add("@MontoIngresoLiquido", SqlDbType.Float).Value = pRegistroIngresoCE.MontoIngresoLiquido
+        cmd.Parameters.Add("@TransId", SqlDbType.VarChar).Value = pRegistroIngresoCE.TransId
+
+        cn = oConexion.Conectar
+        cmd.Connection = cn
+        cn.Open()
+        retorno = cmd.ExecuteNonQuery
+
+        'ACTUALIZA ESTADO DEL INGRESO PROYECTADO
+        Dim vTipoIF As String
+        query = String.Empty
+
+        cmd = New SqlCommand
+        cmd.CommandText = "SELECT T0.Tipo FROM [dbo].[INFI] T0 WHERE T0.CodIF = @CodIF"
+        cmd.Parameters.Add("@CodIF", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoInstrumento
+        cmd.Connection = cn
+
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        vTipoIF = cmd.ExecuteScalar
+
+        If vTipoIF = "ACC" Then
+            query = "UPDATE [dbo].[ACC1] SET Estado='R' WHERE CodInv=@CodInv AND Correlativo=@Correlativo"
+        End If
+        If vTipoIF = "DAP" Then
+            query = "UPDATE [dbo].[DAP1] SET Estado='R' WHERE CodInv=@CodInv AND Correlativo=@Correlativo"
+        End If
+
+        Dim vUpdate As Integer
+        cmd = New SqlCommand
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = pRegistroIngresoCE.CodigoInversion
+        cmd.Parameters.Add("@Correlativo", SqlDbType.VarChar).Value = pRegistroIngresoCE.IngresoID
+
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+        cmd.Connection = cn
+        vUpdate = cmd.ExecuteNonQuery
+
+        If vUpdate <> 1 Then
+            MsgBox("Falla al actualizar el Ingreso a 'Recibido'.")
+        End If
+
+        Return retorno
+    End Function
+
+    Public Function DetalleIngresoRecibido(ByVal pCodInv As String, ByVal pIngresoId As Integer) As RegistroIngresoCE
+        Dim oRegistroIngresoCE As RegistroIngresoCE
+        Dim oConexion As New Conexion
+        Dim cn As SqlConnection
+        Dim cmd As SqlCommand
+        Dim query As String
+        Dim vCount As Integer
+        Dim vSqlParameter As SqlParameter
+        Dim dr As SqlDataReader
+
+        cn = oConexion.Conectar
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.Connection = cn
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@CodInv"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pCodInv
+        cmd.Parameters.Add(vSqlParameter)
+
+        vSqlParameter = New SqlParameter
+        vSqlParameter.ParameterName = "@IngresoId"
+        vSqlParameter.SqlDbType = SqlDbType.VarChar
+        vSqlParameter.Direction = ParameterDirection.Input
+        vSqlParameter.Value = pIngresoId
+        cmd.Parameters.Add(vSqlParameter)
+
+        query = "SELECT COUNT('A')
+FROM [dbo].[INGR] T0
+WHERE T0.Codinv=@Codinv AND T0.IngresoId=@IngresoId"
+
+        cmd.CommandText = query
+        cmd.CommandType = CommandType.Text
+
+        vCount = cmd.ExecuteScalar
+
+        If vCount = 1 Then
+            oRegistroIngresoCE = New RegistroIngresoCE
+
+            query = "SELECT T0.*
+FROM [dbo].[INGR] T0
+WHERE T0.Codinv=@Codinv AND T0.IngresoId=@IngresoId"
+
+            cmd.CommandText = query
+            dr = cmd.ExecuteReader
+
+            If dr.HasRows Then
+                While dr.Read
+                    oRegistroIngresoCE.CodigoBanco = dr.Item("CodBanco").ToString
+                    oRegistroIngresoCE.FormaDePago = dr.Item("FormaPago").ToString
+                    oRegistroIngresoCE.CuentaBancaria = dr.Item("CuentaBanco").ToString
+                    oRegistroIngresoCE.FechaDelIngreso = dr.Item("FechaIngreso").ToString
+                    oRegistroIngresoCE.Validado = dr.Item("Validado").ToString
+                    If Not IsDBNull(dr.Item("FechaValidacion")) Then
+                        oRegistroIngresoCE.FechaValidacion = dr.Item("FechaValidacion")
+                    Else
+                        oRegistroIngresoCE.FechaValidacion = Date.MinValue.Date
+                    End If
+                    oRegistroIngresoCE.Conciliado = dr.Item("Conciliado").ToString
+                    If Not IsDBNull(dr.Item("FechaConciliacion")) Then
+                        oRegistroIngresoCE.FechaConciliacion = dr.Item("FechaConciliacion")
+                    Else
+                        oRegistroIngresoCE.FechaConciliacion = Date.MinValue.Date
+                    End If
+
+                    oRegistroIngresoCE.MontoCapital = dr.Item("MontoCapital").ToString
+                    oRegistroIngresoCE.MontoIngresoBruto = dr.Item("MontoIngresoBruto").ToString
+                    oRegistroIngresoCE.MontoISR = dr.Item("MontoISR").ToString
+                    oRegistroIngresoCE.MontoIngresoNeto = dr.Item("MontoIngresoNeto").ToString
+                    oRegistroIngresoCE.MontoIngresoLiquido = dr.Item("MontoIngresoLiquido").ToString
+                End While
+            End If
+
+        End If
+
+
+
+
+
+        Return oRegistroIngresoCE
+    End Function
+
+
+
+End Module

+ 2257 - 0
DAO/InversionDAO.vb

@@ -0,0 +1,2257 @@
+Imports System.Data.SqlClient
+Public Class InversionDAO
+
+
+    'Private frmPIN As New frmPIN
+    Private Operaciones As New Operaciones
+    Dim CambiarEstArbCE As New CambiarEstArbCE
+
+
+
+    Public Function ObtenerTipoInstrumentoFinanciero(ByVal vCodigoIF As String) As String
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As String = String.Empty
+        Dim sql As String
+        Dim cmd As SqlCommand
+
+        sql = "SELECT T0.Tipo FROM [dbo].[INFI] T0 where T0.CodIF=@CodIF"
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodIF", SqlDbType.VarChar).Value = vCodigoIF
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        valor = cmd.ExecuteScalar
+
+        cmd.Dispose()
+        cn.Close()
+        Return valor
+    End Function
+
+    Public Function ResumenPorInstrumento() As DataTable
+        Dim dt As DataTable = VistaInversiones_ValorNominal()
+
+
+
+
+
+    End Function
+    Public Function VistaInversiones_ValorNominal() As DataTable
+        Dim oVistaInversiones As DataTable = Me.VistaInversiones
+        Dim vCodigoInstrumento As String
+        Dim vCodigoInversion As String
+        Dim oInstrumentoDAO As Object
+        Dim oInstrumentoCE As Object
+        Dim vValorNominal As Double
+        Dim vDataColumn As DataColumn
+
+        vDataColumn = New DataColumn
+        vDataColumn.ColumnName = "ValorNominal"
+        vDataColumn.DataType = GetType(Double)
+        oVistaInversiones.Columns.Add(vDataColumn)
+
+
+        For Each r As DataRow In oVistaInversiones.Rows
+            vCodigoInstrumento = r.Item("CodIF")
+            vCodigoInversion = r.Item("CodInv")
+
+            If vCodigoInstrumento = "ACC" Then
+                oInstrumentoDAO = New AccionesDAO
+                oInstrumentoCE = oInstrumentoDAO.CargarRegistro(vCodigoInversion)
+                vValorNominal = oInstrumentoCE.ValorTransadoCompra
+            End If
+
+            r.Item("ValorNominal") = vValorNominal
+            oInstrumentoDAO = Nothing
+        Next
+
+
+        Return oVistaInversiones
+    End Function
+    Private Function VistaInversiones() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim sql As String
+        Dim cmd As SqlCommand
+
+        Dim da As SqlDataAdapter
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        cmd = New SqlCommand
+
+
+        sql = "SELECT [CodInv]
+      ,[CodIF]
+      ,[Descrip]
+      ,[CodEmpr]
+      ,[Empresa]
+      ,[CodEmis]
+      ,[Emisor]
+      ,[CodCalRi]
+      ,[Calificacion]
+      ,[CodECalRi]
+      ,[Calificadora]
+      ,[CodPais]
+      ,[Pais]
+  FROM [dbo].[vInversiones]
+"
+
+
+
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+        da = New SqlDataAdapter(cmd.CommandText, cmd.Connection)
+        da.Fill(dt)
+        cn.Close()
+        Return dt
+    End Function
+    Public Function ListaCodigosInversion() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim sql As String
+        Dim da As SqlDataAdapter
+
+        Dim dt As New DataTable
+
+        sql = "SELECT [DocId] FROM [dbo].[INV0] ORDER BY [CodInv]"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter(sql, cn)
+        da.Fill(dt)
+
+        Return dt
+        dt.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+    End Function
+
+
+    Public Function ListaCodigosPropuesta() As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim sql As String
+        Dim da As SqlDataAdapter
+
+        Dim dt As New DataTable
+
+        sql = "SELECT 
+[DocId]
+,[CodEmpr]
+,[Asunto]
+,[CodIF]
+,[MontoInv]
+,[Precio]
+,[Rendimiento]
+,[Plazo]
+,[PlazoFact]
+,[Ingresos]
+,[OFon]
+,[CodEmis]
+,[CodCalRi]
+,[CodECalRi]
+,[CodPais]
+,[TipoMerc]
+,[CodInv]
+,[DocEst]
+,[TipoOper]
+,[FechaDoc]
+,[AutEstado] 
+FROM [dbo].[PIN0] ORDER BY [CodInv]"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        da = New SqlDataAdapter(sql, cn)
+        da.Fill(dt)
+
+        Return dt
+        dt.Dispose()
+        da.Dispose()
+        cn.Dispose()
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function Eliminar(ByVal Codigo As String, ByVal Tabla As String, ByVal Validar As Boolean) As Integer
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim oCon As New Conexion
+
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            If Not Validar Then
+
+
+
+                If Codigo.IndexOf("LETE") > -1 Then
+                    sql = "DELETE FROM [dbo].[LET0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("PBUR") > -1 Then
+                    sql = "DELETE FROM [dbo].[PBUR]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("VCN") > -1 Then
+                    sql = "DELETE FROM [dbo].[VCN]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("CETE") > -1 Then
+                    sql = "DELETE FROM [dbo].[CET0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("ACC") > -1 Then
+                    sql = "DELETE FROM [dbo].[ACC1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[ACC0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("CINV") > -1 Then
+                    sql = "DELETE FROM [dbo].[CIN0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[CIN1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                End If
+
+                If Codigo.IndexOf("BONO") > -1 Then
+                    sql = "DELETE FROM [dbo].[BON0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[BON1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("EURB") > -1 Then
+                    sql = "DELETE FROM [dbo].[EURB0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[EURB1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("TIT") > -1 Then
+                    sql = "DELETE FROM [dbo].[TIT]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[TIT0_0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                    sql = "DELETE FROM [dbo].[TIT0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[TIT2]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("DAP") > -1 Then
+                    sql = "DELETE FROM [dbo].[DAP0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+                    sql = "DELETE FROM [dbo].[DAP1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("FUTU") > -1 Then
+                    sql = "DELETE FROM [dbo].[FUT0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("OPC") > -1 Then
+                    sql = "DELETE FROM [dbo].[OPC0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("PEMP") > -1 Then
+                    sql = "DELETE FROM [dbo].[PEMP0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                    sql = "DELETE FROM [dbo].[PEMP1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("PPER") > -1 Then
+
+
+                    sql = "DELETE FROM [dbo].[PPER0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                    sql = "DELETE FROM [dbo].[PPER1]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+
+                    sql = "DELETE FROM [dbo].[PPER2]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+                End If
+
+                If Codigo.IndexOf("REPOVENTA") > -1 Then
+                    sql = "DELETE FROM [dbo].[REP0VENTA]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                ElseIf Codigo.IndexOf("REPO") > -1 Then
+                    sql = "DELETE FROM [dbo].[REP0]
+      WHERE [CodInv]=@CodInv"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                    retorno = cmd.ExecuteNonQuery
+
+                End If
+
+
+
+
+
+
+
+
+
+
+            End If
+
+
+
+            myTrans.Commit()
+
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+            Return 1
+        End Try
+        cn.Close()
+
+        Return 0
+
+
+    End Function
+
+
+
+
+    Public Function EliminarPropuesta(ByVal CodInv As String) As Integer
+
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim valor As String = String.Empty
+        Dim sql As String
+        Dim cmd As SqlCommand
+
+
+        sql = "Delete from [dbo].[PIN0] where [CodInv]=@CodInv"
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodInv.ToString()
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        valor = cmd.ExecuteScalar
+
+        cmd.Dispose()
+        cmd.Dispose()
+        cmd.Dispose()
+
+
+        Return 0
+
+
+    End Function
+
+
+
+
+
+
+
+    Public Function NuevoConReportoVenta(ByVal oInversionesCE As InversionesCE, ByVal Diccionario As Dictionary(Of String, Collection), ByVal CodigoReporto As String, ByVal CodigoAsociacion As String, ByRef EstadoReporto As String, ByRef ColUnionTablas As Collection)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As Integer
+
+
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim vPuedoContinuar As Boolean = True
+        Dim vCodigoNuevo As String
+        vCodigoNuevo = oInversionesCE.CodigoIversion
+        '        vCodigoNuevo = SeriesDAO.SiguienteCodigoInversion(oInversionesCE.CodigoEmpresa, oInversionesCE.CodigoInstrumentoFinanciero)
+
+        If oInversionesCE Is Nothing Then
+
+            vPuedoContinuar = False
+        Else
+
+            If Me.ComprobarCodigoinversion(vCodigoNuevo) > 0 Then
+                vPuedoContinuar = False
+                MsgBox("Ya existe una inversión con el mismo código.")
+            End If
+        End If
+
+        oInversionesCE.CodigoIversion = vCodigoNuevo
+        If vPuedoContinuar Then
+
+
+            Dim sql As String
+            Dim cmd As SqlCommand
+            Dim myTrans As SqlTransaction
+            myTrans = cn.BeginTransaction()
+            Dim vRetorno As Integer = 0
+            Try
+
+
+
+
+                sql = "INSERT INTO [dbo].[INV0]
+([CodInv]
+,[CodEmpr]
+,[CodIF]
+,[CodEmis]
+,[CodCalRi]
+,[CodECalRi]
+,[Coment]
+,[TipoOper]
+,[DocBase]
+,[Plazo]
+,[PlazoFact]
+,[TipoMerc]
+,[CodPais]
+,[NombreManIF]           
+,[CodManIF]
+,[Periodicidad]
+,[TipTasa]           
+,[TipRenta]
+,[DocEst]
+,[OFon]
+,[EstadoProceso]
+,[FechaDoc]
+,[EstadoReporto]
+)
+VALUES
+(
+@CodInv
+,@CodEmpr
+,@CodIF
+,@CodEmis
+,@CodCalRi
+,@CodECalRi
+,@Coment
+,@TipoOper
+,@DocBase
+,@Plazo
+,@PlazoFact
+,@TipoMerc
+,@CodPais
+,@NombreManIF
+,@CodManIF
+,@Periodicidad
+,@TipTasa
+,@TipRenta
+,@DocEst
+,@OFon
+,@EstadoProceso
+,@FechaDoc
+,@EstadoReporto
+)"
+
+
+                cmd = New SqlCommand
+
+                With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = vCodigoNuevo.ToString
+                    .Add("@CodEmpr", SqlDbType.VarChar).Value = oInversionesCE.CodigoEmpresa.ToString
+                    .Add("@CodIF", SqlDbType.VarChar).Value = oInversionesCE.CodigoInstrumentoFinanciero.ToString
+                    .Add("@CodEmis", SqlDbType.Int).Value = oInversionesCE.CodigoEmisor
+                    .Add("@CodCalRi", SqlDbType.VarChar).Value = oInversionesCE.CodigoCalificacionDeRiesgo.ToString
+                    .Add("@CodECalRi", SqlDbType.VarChar).Value = oInversionesCE.CodigoEmpresaCalificadora.ToString
+                    .Add("@Coment", SqlDbType.VarChar).Value = oInversionesCE.Comentarios.ToString
+                    .Add("@TipoOper", SqlDbType.VarChar).Value = oInversionesCE.TipoOperacion.ToString
+                    .Add("@DocBase", SqlDbType.Int).Value = oInversionesCE.DocumentoBase
+                    .Add("@TipoMerc", SqlDbType.VarChar).Value = oInversionesCE.TipoMercado.ToString
+                    .Add("@Plazo", SqlDbType.VarChar).Value = oInversionesCE.PlazoNumero.ToString
+                    .Add("@PlazoFact", SqlDbType.VarChar).Value = oInversionesCE.PlazoFactor.ToString
+                    .Add("@CodPais", SqlDbType.VarChar).Value = oInversionesCE.Pais.ToString
+                    .Add("@NombreManIF", SqlDbType.VarChar).Value = oInversionesCE.NombreManual.ToString
+                    .Add("@CodManIF", SqlDbType.VarChar).Value = oInversionesCE.CodigoManual.ToString
+                    .Add("@Periodicidad", SqlDbType.VarChar).Value = oInversionesCE.Periodicidad.ToString
+                    .Add("@TipTasa", SqlDbType.VarChar).Value = oInversionesCE.TipoTasa.ToString
+                    .Add("@TipRenta", SqlDbType.VarChar).Value = oInversionesCE.TipoRenta.ToString
+                    .Add("@DocEst", SqlDbType.VarChar).Value = oInversionesCE.EstadoDocumento.ToString
+                    .Add("@OFon", SqlDbType.VarChar).Value = oInversionesCE.OFondo.ToString
+                    .Add("@EstadoProceso", SqlDbType.VarChar).Value = oInversionesCE.EstadoProceso.ToString
+                    .Add("@FechaDoc", SqlDbType.Date).Value = oInversionesCE.FechaDocumento
+
+                    .Add("@EstadoReporto", SqlDbType.VarChar).Value = EstadoReporto
+
+
+                End With
+
+
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                '########################################################3'
+
+                sql = "DELETE FROM REP0VENTA
+                WHERE [CodInv]=@CodInv "
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoReporto
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+                sql = "INSERT INTO ReportoGenerado(
+                                    [CodigoAsociacion]
+                                   ,[FechaCreado]
+                                   ,[CodigoReporto])
+                                    values(
+                                    @CodigoAsociacion
+                                   ,@FechaCreado
+                                   ,@CodigoReporto
+
+
+
+                )"
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodigoAsociacion", SqlDbType.VarChar).Value = CodigoAsociacion
+                cmd.Parameters.Add("@FechaCreado", SqlDbType.VarChar).Value = Date.Now.Date
+                cmd.Parameters.Add("@CodigoReporto", SqlDbType.VarChar).Value = CodigoReporto
+                retorno = cmd.ExecuteNonQuery
+
+
+                If Not Diccionario Is Nothing Then
+
+
+                    For Each DatosDiccionario In Diccionario
+                        Dim Coleccion As Collection = DatosDiccionario.Value
+
+
+
+
+
+
+
+
+                        sql = "INSERT INTO REP0VENTA    (
+                           [CodInv]
+                            ,[codigo]
+                            ,[Nombre]
+                            ,[FCompra]
+                            ,[ValTrans]
+                            ,[Dias]
+                            ,[FVenc]
+                            ,[Rend]
+                            ,[CostoTransfr]
+                            ,[ComisionCasa]
+                            ,[ComisionBolsa]
+                            ,[Casa]
+                            ,[IOF]
+                            ,[Renta]
+                            ,[Base]
+                            ,[ComisionCasaValor]
+                            ,[ComisionBolsaValor]
+                            ,[IOFValor]
+                            ,[OtrosCostos]
+                            ,[TotalCostos]
+                            ,[MontoLiq]
+                            ,[IntGenerar]
+                            ,[RendAntImp]
+                            ,[RendDesImp]
+                            ,[ImpLiq]
+                            ,[IngrNet]
+                            ,[ValorNet]
+                            ,[EstadoIOF]
+                            ,[EstadoRenta]
+                          
+
+                ) VALUES(
+                           @CodInv
+                            ,@codigo
+                            ,@Nombre
+                            ,@FCompra
+                            ,@ValTrans
+                            ,@Dias
+                            ,@FVenc
+                            ,@Rend
+                            ,@CostoTransfr
+                            ,@ComisionCasa
+                            ,@ComisionBolsa
+                            ,@Casa
+                            ,@IOF
+                            ,@Renta
+                            ,@Base
+                            ,@ComisionCasaValor
+                            ,@ComisionBolsaValor
+                            ,@IOFValor
+                            ,@OtrosCostos
+                            ,@TotalCostos
+                            ,@MontoLiq
+                            ,@IntGenerar
+                            ,@RendAntImp
+                            ,@RendDesImp
+                            ,@ImpLiq
+                            ,@IngrNet
+                            ,@ValorNet
+                            ,@EstadoIOF
+                            ,@EstadoRenta
+                        
+                )
+                    "
+
+
+
+
+
+
+
+
+
+
+                        cmd = New SqlCommand
+                        cmd.CommandText = sql
+                        cmd.Connection = cn
+                        cmd.Transaction = myTrans
+
+
+
+                        With cmd.Parameters
+                            .Add("@CodInv", SqlDbType.VarChar).Value = CodigoReporto.ToString
+                            .Add("@Nombre", SqlDbType.VarChar).Value = Coleccion(1).ToString
+                            .Add("@FCompra", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(2).ToString)
+                            .Add("@ValTrans", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(3).ToString)
+                            .Add("@Dias", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(4).ToString)
+                            .Add("@FVenc", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(5).ToString)
+                            .Add("@Rend", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(6).ToString)
+                            .Add("@CostoTransfr", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(7).ToString)
+                            .Add("@codigo", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                            .Add("@ComisionCasa", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion(9).ToString)
+                            .Add("@ComisionBolsa", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion(10).ToString)
+                            .Add("@Casa", SqlDbType.VarChar).Value = Coleccion(11).ToString
+                            .Add("@IOF", SqlDbType.Bit).Value = CByte(Coleccion(12))
+                            .Add("@Renta", SqlDbType.Bit).Value = CByte(Coleccion(13))
+                            .Add("@Base", SqlDbType.Int).Value = DBNull.Value
+                            .Add("@ComisionCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(14).ToString)
+                            .Add("@ComisionBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(15).ToString)
+                            .Add("@IOFValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(16).ToString)
+                            .Add("@OtrosCostos", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(17).ToString)
+                            .Add("@TotalCostos", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(18).ToString)
+                            .Add("@MontoLiq", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(19).ToString)
+                            .Add("@IntGenerar", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(20).ToString)
+                            .Add("@RendAntImp", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(21).ToString)
+                            .Add("@RendDesImp", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(22).ToString)
+                            .Add("@ImpLiq", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(23).ToString)
+                            .Add("@IngrNet", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(24).ToString)
+                            .Add("@ValorNet", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(25).ToString)
+                            .Add("@EstadoIOF", SqlDbType.Bit).Value = CByte(Coleccion(27))
+                            .Add("@EstadoRenta", SqlDbType.Bit).Value = CByte(Coleccion(28))
+
+
+
+
+
+
+
+                        End With
+
+
+
+                        retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                    Next
+
+
+                End If
+
+                Dim PIdFlujo As Integer = 0
+
+                ''''''''''''''''''
+                For Each DicUnionTab As Dictionary(Of String, Object) In ColUnionTablas
+                    Dim CodigoTitulos = Function()
+                                            If DicUnionTab.ContainsKey("CodigoTitulos") Then
+                                                Return DicUnionTab.Item("CodigoTitulos")
+                                            Else
+                                                Return String.Empty
+                                            End If
+                                        End Function
+
+
+                    Dim IdFlujo = Function()
+                                      If DicUnionTab.ContainsKey("IdFlujo") Then
+                                          Return DicUnionTab.Item("IdFlujo")
+                                      Else
+                                          Return 0
+                                      End If
+                                  End Function
+
+
+                    Dim IdLisRep = Function()
+                                       If DicUnionTab.ContainsKey("IdLisRep") Then
+                                           Return DicUnionTab.Item("IdLisRep")
+                                       Else
+                                           Return 0
+                                       End If
+                                   End Function
+
+                    Dim ValorCodigoTitulos As String = CodigoTitulos().ToString
+                    Dim ValorIdFlujo As Integer = Operaciones.ConvertirEntero(IdFlujo().ToString)
+                    Dim ValorIdLisRep As Integer = Operaciones.ConvertirEntero(IdLisRep().ToString)
+                    If PIdFlujo = 0 Then
+                        PIdFlujo = ValorIdFlujo
+                    End If
+
+                    sql = "INSERT INTO REPOGEN(
+                                     [CodigoAsociado]
+                                    ,[CodigoReporto]
+                                    ,[CodigoTitulo]
+                                    ,[CodigoEstado]
+                                    ,[Nombre]
+                                    ,[Descrip]
+                                    ,[IdFlujo]
+                                    ,[IdLisRep]
+)VALUES(
+                                     @CodigoAsociado
+                                    ,@CodigoReporto
+                                    ,@CodigoTitulo
+                                    ,@CodigoEstado
+                                    ,@Nombre
+                                    ,@Descrip
+                                    ,@IdFlujo
+                                    ,@IdLisRep
+
+)"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+
+
+
+
+
+
+
+
+                    cmd.Parameters.Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociacion
+                    cmd.Parameters.Add("@CodigoReporto", SqlDbType.VarChar).Value = CodigoReporto
+                    cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = ValorCodigoTitulos
+                    cmd.Parameters.Add("@CodigoEstado", SqlDbType.VarChar).Value = "RC"
+                    cmd.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = "Reporto Creado"
+                    cmd.Parameters.Add("@Descrip", SqlDbType.VarChar).Value = "Reporto Creado(En Espera de Generar Lista de Titulos de Inversion)"
+                    cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = ValorIdFlujo
+                    cmd.Parameters.Add("@IdLisRep", SqlDbType.Int).Value = ValorIdLisRep
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+                    '########################################################################'
+
+
+
+
+
+                    sql = "INSERT INTO TitTerm(
+                                     [CodigoAsociado]
+                                    ,[CodigoTitulo]
+                                    ,[CodigoEstado]
+                                    ,[Nombre]
+                                    ,[Descrip]
+                                    ,[IdFlujo]
+                                    ,[IdLisRep]
+)VALUES(
+                                     @CodigoAsociado
+                                    ,@CodigoTitulo
+                                    ,@CodigoEstado
+                                    ,@Nombre
+                                    ,@Descrip
+                                    ,@IdFlujo
+                                    ,@IdLisRep
+
+)"
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+
+
+
+
+
+
+
+
+                    cmd.Parameters.Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociacion
+                    cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = ValorCodigoTitulos
+                    cmd.Parameters.Add("@CodigoEstado", SqlDbType.VarChar).Value = "FIN"
+                    cmd.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = "Ciclo de Titulo Finalizado"
+                    cmd.Parameters.Add("@Descrip", SqlDbType.VarChar).Value = "Ciclo de TItulo Finalizado(En Espera de Generar más)"
+                    cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = ValorIdFlujo
+                    cmd.Parameters.Add("@IdLisRep", SqlDbType.Int).Value = ValorIdLisRep
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+                Next
+
+
+                sql = "INSERT INTO SegundaFase(
+                                     [CodigoReporto]
+                                    ,[CodigoAsociado]
+                                    ,[IdFlujo]
+)VALUES(
+                                     @CodigoReporto
+                                    ,@CodigoAsociado
+                                    ,@IdFlujo
+
+)"
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodigoReporto", SqlDbType.VarChar).Value = CodigoReporto
+                cmd.Parameters.Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociacion
+                cmd.Parameters.Add("@IdFlujo", SqlDbType.VarChar).Value = PIdFlujo
+
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+                myTrans.Commit()
+                MsgBox("Datos Ingresados")
+                frmColaTitulos.Inicializacion()
+            Catch ex As Exception
+
+                myTrans.Rollback()
+                MsgBox(ex.Message)
+            End Try
+        End If
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+
+    Public Function Nuevo(ByVal oInversionesCE As InversionesCE) As Integer
+
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim vRetorno As Integer = 0
+        Dim vPuedoContinuar As Boolean = True
+        Dim vCodigoNuevo As String
+        vCodigoNuevo = oInversionesCE.CodigoIversion
+        '        vCodigoNuevo = SeriesDAO.SiguienteCodigoInversion(oInversionesCE.CodigoEmpresa, oInversionesCE.CodigoInstrumentoFinanciero)
+
+        If oInversionesCE Is Nothing Then
+
+            vPuedoContinuar = False
+        Else
+
+            If Me.ComprobarCodigoinversion(vCodigoNuevo) > 0 Then
+                vPuedoContinuar = False
+                MsgBox("Ya existe una inversión con el mismo código.")
+            End If
+        End If
+
+        oInversionesCE.CodigoIversion = vCodigoNuevo
+        If vPuedoContinuar Then
+            'VIENE UNA CE DE INVERCIONES
+            Dim vQuery As String = ""
+
+            If cn Is Nothing Then
+                cn = objCon.Conectar
+            End If
+            If cn.State = ConnectionState.Open Then
+                cn.Close()
+                cn.Dispose()
+                cn = objCon.Conectar
+                cn.Open()
+            Else
+                cn = objCon.Conectar
+                cn.Open()
+            End If
+
+
+            If cn.State = ConnectionState.Open Then
+                Dim vTransaccion As SqlTransaction
+                Dim cmd As SqlCommand = cn.CreateCommand
+                vTransaccion = cn.BeginTransaction
+                cmd.Connection = cn
+                cmd.Transaction = vTransaccion
+                Try
+
+
+
+
+                    vQuery = "INSERT INTO [dbo].[INV0]
+([CodInv]
+,[CodEmpr]
+,[CodIF]
+,[CodEmis]
+,[CodCalRi]
+,[CodECalRi]
+,[Coment]
+,[TipoOper]
+,[DocBase]
+,[Plazo]
+,[PlazoFact]
+,[TipoMerc]
+,[CodPais]
+,[NombreManIF]           
+,[CodManIF]
+,[Periodicidad]
+,[TipTasa]           
+,[TipRenta]
+,[DocEst]
+,[OFon]
+,[EstadoProceso]
+,[FechaDoc]
+,[CodigoAsociado]
+,[EstadoReporto]
+
+)
+VALUES
+(
+@CodInv
+,@CodEmpr
+,@CodIF
+,@CodEmis
+,@CodCalRi
+,@CodECalRi
+,@Coment
+,@TipoOper
+,@DocBase
+,@Plazo
+,@PlazoFact
+,@TipoMerc
+,@CodPais
+,@NombreManIF
+,@CodManIF
+,@Periodicidad
+,@TipTasa
+,@TipRenta
+,@DocEst
+,@OFon
+,@EstadoProceso
+,@FechaDoc
+,@CodigoAsociado
+,@EstadoReporto
+)"
+                    cmd.CommandText = vQuery
+
+                    With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = vCodigoNuevo.ToString
+                        .Add("@CodEmpr", SqlDbType.VarChar).Value = oInversionesCE.CodigoEmpresa.ToString
+                        .Add("@CodIF", SqlDbType.VarChar).Value = oInversionesCE.CodigoInstrumentoFinanciero.ToString
+                        .Add("@CodEmis", SqlDbType.Int).Value = oInversionesCE.CodigoEmisor
+                        .Add("@CodCalRi", SqlDbType.VarChar).Value = oInversionesCE.CodigoCalificacionDeRiesgo.ToString
+                        .Add("@CodECalRi", SqlDbType.VarChar).Value = oInversionesCE.CodigoEmpresaCalificadora.ToString
+                        .Add("@Coment", SqlDbType.VarChar).Value = oInversionesCE.Comentarios.ToString
+                        .Add("@TipoOper", SqlDbType.VarChar).Value = oInversionesCE.TipoOperacion.ToString
+                        .Add("@DocBase", SqlDbType.Int).Value = oInversionesCE.DocumentoBase
+                        .Add("@TipoMerc", SqlDbType.VarChar).Value = oInversionesCE.TipoMercado.ToString
+                        .Add("@Plazo", SqlDbType.VarChar).Value = oInversionesCE.PlazoNumero.ToString
+                        .Add("@PlazoFact", SqlDbType.VarChar).Value = oInversionesCE.PlazoFactor.ToString
+                        .Add("@CodPais", SqlDbType.VarChar).Value = oInversionesCE.Pais.ToString
+                        .Add("@NombreManIF", SqlDbType.VarChar).Value = oInversionesCE.NombreManual.ToString
+                        .Add("@CodManIF", SqlDbType.VarChar).Value = oInversionesCE.CodigoManual.ToString
+                        .Add("@Periodicidad", SqlDbType.VarChar).Value = oInversionesCE.Periodicidad.ToString
+                        .Add("@TipTasa", SqlDbType.VarChar).Value = oInversionesCE.TipoTasa.ToString
+                        .Add("@TipRenta", SqlDbType.VarChar).Value = oInversionesCE.TipoRenta.ToString
+                        .Add("@DocEst", SqlDbType.VarChar).Value = oInversionesCE.EstadoDocumento.ToString
+                        .Add("@OFon", SqlDbType.VarChar).Value = oInversionesCE.OFondo.ToString
+                        .Add("@EstadoProceso", SqlDbType.VarChar).Value = oInversionesCE.EstadoProceso.ToString
+                        .Add("@FechaDoc", SqlDbType.Date).Value = Date.Now.Date
+                        .Add("@CodigoAsociado", SqlDbType.VarChar).Value = oInversionesCE.CodigoAsociado
+                        .Add("@EstadoReporto", SqlDbType.VarChar).Value = oInversionesCE.EstadoReporto
+                    End With
+
+                    vRetorno = cmd.ExecuteNonQuery
+                    oInversionesCE.IdFlujo += 1
+
+
+
+                    vQuery = "INSERT INTO TitulosGenerarLREP(
+                            [CodigoTitulo]
+                            ,[CodigoEstado]
+                            ,[Nombre]
+                            ,[Descrip]
+                            ,[IdProInv]
+                            ,[IdFlujo]
+                            )
+                            VALUES(
+                             @CodigoTitulo
+                            ,@CodigoEstado
+                            ,@Nombre
+                            ,@Descrip
+                            ,@IdProInv
+                            ,@IdFlujo
+
+                            )
+                       "
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = vQuery
+                    cmd.Connection = cn
+                    cmd.Transaction = vTransaccion
+                    cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = vCodigoNuevo.ToString
+                    cmd.Parameters.Add("@CodigoEstado", SqlDbType.VarChar).Value = "SEG"
+                    cmd.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = "Sin Asignar"
+                    cmd.Parameters.Add("@Descrip", SqlDbType.VarChar).Value = "Sin Asignar(En Espera de Generar una Lista de Titulos para Reportear)"
+                    cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = oInversionesCE.IdFlujo
+                    cmd.Parameters.Add("@IdProInv", SqlDbType.Int).Value = oInversionesCE.IdProInv
+                    vRetorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                    vQuery = "INSERT INTO IniFlu(
+                            [IdFlujo]   
+                           ,[CodigoAsociadoAnterior]
+                           ,[CodigoTitulo]   
+                            )
+                            VALUES(
+                            @IdFlujo
+                           ,@CodigoAsociadoAnterior
+                           ,@CodigoTitulo
+
+                            )
+                       "
+                    If String.IsNullOrEmpty(oInversionesCE.CodigoAsociado) Then
+                        oInversionesCE.CodigoAsociado = "Sin Pasado"
+                    End If
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = vQuery
+                    cmd.Connection = cn
+                    cmd.Transaction = vTransaccion
+                    cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = oInversionesCE.IdFlujo
+                    cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = vCodigoNuevo.ToString
+                    cmd.Parameters.Add("@CodigoAsociadoAnterior", SqlDbType.VarChar).Value = oInversionesCE.CodigoAsociado
+                    vRetorno = cmd.ExecuteNonQuery
+
+
+                    '' #####################################################
+
+                    Dim IniciarError As String = CambiarEstArbCE.ProcesarCambio(vCodigoNuevo.ToString, "CambiarAprobacion", cn, vTransaccion)
+                    If IniciarError = "NO" Or IniciarError = "Error" Then
+                        Throw New Exception
+                    End If
+                    '##############################################################'
+
+                    If oInversionesCE.EstadoReporto = "SECUNDARIO" Then
+
+
+                        vQuery = "INSERT INTO TitApro(
+                            [CodigoAsociado]   
+                           ,[CodigoTitulo]   
+                           ,[CodigoEstado]   
+                           ,[Nombre]   
+                           ,[Descrip]   
+                           ,[IdEA]
+                           ,[IdFlujo]   
+                            )
+                            VALUES(
+                            @CodigoAsociado   
+                           ,@CodigoTitulo   
+                           ,@CodigoEstado   
+                           ,@Nombre   
+                           ,@Descrip   
+                           ,@IdEA
+                           ,@IdFlujo   
+
+                            )
+                       "
+
+
+                        cmd = New SqlCommand
+                        cmd.CommandText = vQuery
+                        cmd.Connection = cn
+                        cmd.Transaction = vTransaccion
+                        cmd.Parameters.Add("@CodigoAsociado", SqlDbType.VarChar).Value = oInversionesCE.CodigoAsociado
+                        cmd.Parameters.Add("@CodigoTitulo", SqlDbType.VarChar).Value = vCodigoNuevo.ToString
+                        cmd.Parameters.Add("@CodigoEstado", SqlDbType.VarChar).Value = "TA"
+                        cmd.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = "Titulo Aprobado"
+                        cmd.Parameters.Add("@Descrip", SqlDbType.VarChar).Value = "Titulo Aprobado"
+                        cmd.Parameters.Add("@IdEA", SqlDbType.Int).Value = oInversionesCE.IdEA
+                        cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = oInversionesCE.IdFlujo
+
+                        vRetorno = cmd.ExecuteNonQuery
+                    End If
+
+
+
+
+                    '###########################################################'
+
+
+                    ''Ingresar codigo
+                    vTransaccion.Commit()
+                    cmd.Dispose()
+                    vTransaccion.Dispose()
+                    cn.Dispose()
+                    cn.Close()
+                Catch ex2 As Exception
+                    vTransaccion.Rollback()
+                    MsgBox("Error")
+                    vRetorno = 0
+                End Try
+
+
+
+
+            Else
+                'NADA?
+                vRetorno = 0
+            End If
+
+
+        Else
+            cn.Close()
+            'NO VIENE
+            vRetorno = -1
+        End If
+
+
+        Return vRetorno
+    End Function
+
+
+
+
+
+
+
+    Public Function Modificar(ByVal oCEINV As InversionesCE) As Integer
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As Integer
+        Dim cmd As SqlCommand
+        Dim sql As String
+
+        sql = "UPDATE [dbo].[INV0]
+   SET [Asunto] = @Asunto
+      ,[CodEmpr] = @CodEmpr      
+      ,[CodEmis] = @CodEmis
+      ,[CodCalRi] = @CodCalRi
+      ,[CodECalRi] = @CodECalRi
+      ,[OFon] = @OFon
+      ,[Coment] = @Coment
+      ,[Just] = @Just
+      ,[TipoOper] = @TipoOper            
+      ,[Plazo] = @Plazo
+      ,[PlazoFact] = @PlazoFact      
+	  ,[FechaDoc] = @FechaDoc      
+	  ,[TipoMerc] = @TipoMerc
+      ,[CodPais] = @CodPais
+      ,[NombreManIF] = @NombreManIF
+      ,[CodManIF] = @CodManIF
+      ,[Periodicidad] = @Periodicidad
+      ,[TipTasa] = @TipTasa
+      ,[TipRenta] = @TipRenta
+      ,[DocEst]=@DocEst
+      ,[EstadoProceso]=@EstadoProceso
+ WHERE [CodInv]=@CodInv"
+
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+        With cmd.Parameters
+            .Add("@Asunto", SqlDbType.VarChar).Value = String.Empty
+            .Add("@CodEmpr", SqlDbType.VarChar).Value = oCEINV.CodigoEmpresa
+            .Add("@CodEmis", SqlDbType.VarChar).Value = oCEINV.CodigoEmisor
+            .Add("@CodCalRi", SqlDbType.VarChar).Value = oCEINV.CodigoCalificacionDeRiesgo
+            .Add("@CodECalRi", SqlDbType.VarChar).Value = oCEINV.CodigoEmpresaCalificadora
+            .Add("@OFon", SqlDbType.VarChar).Value = oCEINV.OFondo
+            .Add("@Coment", SqlDbType.VarChar).Value = oCEINV.Comentarios
+            .Add("@Just", SqlDbType.VarChar).Value = String.Empty
+            .Add("@TipoOper", SqlDbType.VarChar).Value = oCEINV.TipoOperacion
+            .Add("@Plazo", SqlDbType.Int).Value = oCEINV.PlazoNumero
+            .Add("@PlazoFact", SqlDbType.VarChar).Value = oCEINV.PlazoFactor
+            .Add("@FechaDoc", SqlDbType.Date).Value = oCEINV.FechaDocumento
+            .Add("@TipoMerc", SqlDbType.VarChar).Value = oCEINV.TipoMercado
+            .Add("@CodPais", SqlDbType.VarChar).Value = oCEINV.Pais
+            .Add("@NombreManIF", SqlDbType.VarChar).Value = oCEINV.NombreManual
+            .Add("@CodManIF", SqlDbType.VarChar).Value = oCEINV.CodigoManual
+            .Add("@Periodicidad", SqlDbType.VarChar).Value = oCEINV.Periodicidad
+            .Add("@TipTasa", SqlDbType.VarChar).Value = oCEINV.TipoTasa
+            .Add("@TipRenta", SqlDbType.VarChar).Value = oCEINV.TipoRenta
+            .Add("@CodInv", SqlDbType.VarChar).Value = oCEINV.CodigoIversion
+            .Add("@DocId", SqlDbType.Int).Value = oCEINV.IdDeDocumento
+
+            .Add("@DocEst", SqlDbType.VarChar).Value = oCEINV.EstadoDocumento
+
+            .Add("@EstadoProceso", SqlDbType.VarChar).Value = oCEINV.EstadoProceso
+        End With
+
+        retorno = cmd.ExecuteNonQuery
+        cn.Close()
+        Return retorno
+    End Function
+    Public Function ComprobarCodigoinversion(CodigoInversion As String) As Integer
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim vRetorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand = New SqlCommand
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        sql = "SELECT COUNT('A') FROM [dbo].[INV0] WHERE CodInv=@CodInv"
+        cmd.CommandText = sql
+        cmd.Connection = cn
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+
+
+        vRetorno = cmd.ExecuteScalar
+
+        cn.Close()
+        Return vRetorno
+    End Function
+
+    Public Function Buscar(ByVal DiccionarioColecciones As Dictionary(Of String, Collection)) As DataSet
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim ds As New DataSet
+        Dim da As SqlDataAdapter
+        cn = objCon.Conectar
+        Dim Col_Empresas As New Collection
+        Dim Col_Emisor As New Collection
+        Dim Col_EstDocumento As New Collection
+        Dim Col_Instrumento As New Collection
+        Dim Col_CalRiesgo As New Collection
+        Dim Col_TipOperacion As New Collection
+        Dim Col_OriFond As New Collection
+        Dim Col_CalERiesgo As New Collection
+        Dim Col_Aut As New Collection
+        Dim Col_Plazo As New Collection
+        Dim Col_Pais As New Collection
+        Dim Col_TipMercado As New Collection
+        Dim Vacio As Boolean = False
+
+
+        For Each Item In DiccionarioColecciones
+            If Item.Key = "Empresa" Then
+                Col_Empresas = Item.Value
+            ElseIf Item.Key = "Emisor" Then
+
+                Col_Emisor = Item.Value
+
+            ElseIf Item.Key = "EstDocumento" Then
+                Col_EstDocumento = Item.Value
+
+
+
+            ElseIf Item.Key = "Instrumento" Then
+
+                Col_Instrumento = Item.Value
+
+
+            ElseIf Item.Key = "CalRiesgo" Then
+
+                Col_CalRiesgo = Item.Value
+
+
+            ElseIf Item.Key = "TipOperacion" Then
+                Col_TipOperacion = Item.Value
+
+
+            ElseIf Item.Key = "OriFond" Then
+                Col_OriFond = Item.Value
+
+
+            ElseIf Item.Key = "CalERiesgo" Then
+
+                Col_CalERiesgo = Item.Value
+
+
+            ElseIf Item.Key = "Aut" Then
+
+                Col_Aut = Item.Value
+
+
+            ElseIf Item.Key = "Plazo" Then
+
+                Col_Plazo = Item.Value
+
+            ElseIf Item.Key = "Pais" Then
+
+                Col_Pais = Item.Value
+
+            ElseIf Item.Key = "TipMercado" Then
+                Col_TipMercado = Item.Value
+            End If
+        Next
+
+
+
+
+        If Col_Empresas.Count = 0 Or Col_Emisor.Count = 0 Or Col_EstDocumento.Count = 0 Or Col_OriFond.Count = 0 Or Col_CalERiesgo.Count = 0 Or Col_Aut.Count = 0 Or Col_Plazo.Count = 0 Or Col_Pais.Count = 0 Or Col_TipMercado.Count = 0 Or Col_Instrumento.Count = 0 Then
+            Vacio = True
+        End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        Dim sql As String = "select 
+        CAST(DocId as varchar) as 'Id'
+        ,CAST(CodInv as varchar) as 'Código de Propuesta'
+        ,CAST(DocEst as varchar) as 'Estado'
+        ,CAST(Asunto as varchar) as 'Asunto'
+        ,CAST(CodEmpr as varchar) as 'Empresa'
+        ,CAST(CodIF as varchar) as 'Instrumento Financiero'
+        ,CAST(CodEmis as varchar) as 'Emisor'
+        ,CAST(CodCalRi as varchar) as 'Calificación de Riesgo'
+        ,CAST(CodECalRi as varchar) as 'Empresa Calificadora'
+        ,CAST(OFon as varchar) as 'Origen de Fondos'
+        ,CAST(Coment as varchar) as 'Comentarios'
+        ,CAST(Just as varchar) as 'Justificaciones'
+        ,CAST(TipoOper as varchar)  as 'Tipo de Operacion'
+        ,CAST(DocBase as varchar) as 'Base de Calculo'
+        ,CAST(MontoInv as varchar) as 'Monto de Inversion'
+        ,CAST(Precio as varchar) as 'Precio'
+        ,CAST(Rendimiento as varchar) as 'Rendimiento'
+        ,CAST(Plazo as varchar)   as 'Cantidad en Plazo'
+        ,CAST(PlazoFact as varchar) as 'Tipo de Plazo'
+        ,CAST(Ingresos as varchar) as 'Ingresos'
+        ,CAST(FechaDoc as varchar) as 'Fecha de Creación'
+        ,CAST(AutEstado as varchar) as 'Estado de Autorización'
+        ,CAST(TipoMerc as varchar) as 'Tipo de Mercado'
+        ,CAST(CodPais as varchar) as 'Pais'
+        from INV0 
+ "
+
+        If Vacio Then
+            sql += " where 0=1"
+
+        Else
+            sql += " where 1=1"
+        End If
+
+
+
+
+        Dim TodosEmpresas As Boolean = False
+        Dim TodosEmisor As Boolean = False
+        Dim TodosEstDocumento As Boolean = False
+        Dim TodosInstrumento As Boolean = False
+        Dim TodosCalRiesgo As Boolean = False
+        Dim TodosTipOperacion As Boolean = False
+        Dim TodosOriFond As Boolean = False
+        Dim TodosCalERiesgo As Boolean = False
+        Dim TodosAut As Boolean = False
+        Dim TodosPlazo As Boolean = False
+        Dim TodosPais As Boolean = False
+        Dim TodosTipMercado As Boolean = False
+
+
+        For Each Item In Col_Empresas
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEmpresas = True
+            End If
+        Next
+        For Each Item In Col_Emisor
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEmisor = True
+            End If
+        Next
+        For Each Item In Col_EstDocumento
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosEstDocumento = True
+            End If
+        Next
+        For Each Item In Col_Instrumento
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosInstrumento = True
+            End If
+        Next
+        For Each Item In Col_CalRiesgo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosCalRiesgo = True
+            End If
+        Next
+        For Each Item In Col_TipOperacion
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosTipOperacion = True
+            End If
+        Next
+        For Each Item In Col_OriFond
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosOriFond = True
+            End If
+        Next
+        For Each Item In Col_CalERiesgo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosCalERiesgo = True
+            End If
+        Next
+        For Each Item In Col_Aut
+            TodosAut = True
+        Next
+        For Each Item In Col_Plazo
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosPlazo = True
+            End If
+        Next
+        For Each Item In Col_Pais
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosPais = True
+            End If
+        Next
+        For Each Item In Col_TipMercado
+
+            If Not Item.IndexOf("Todos") = -1 Then
+                TodosTipMercado = True
+            End If
+        Next
+
+
+
+        Dim OperadorLogico As String = String.Empty
+        OperadorLogico = " And ("
+        Dim Fin As String = String.Empty
+
+
+
+        If Not TodosEmpresas Then
+
+
+            For Each Item In Col_Empresas
+                Dim Cadena As String = Col_Empresas.ToString
+
+
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = "" + OperadorLogico + " CodEmpr like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosEmisor Then
+
+
+            For Each Item In Col_Emisor
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodEmis like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+
+
+
+
+
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosEstDocumento Then
+
+
+
+            For Each Item In Col_EstDocumento
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " DocEst like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+
+        End If
+
+
+
+
+        If Not TodosInstrumento Then
+
+
+            For Each Item In Col_Instrumento
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodIF  like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+
+        End If
+        If Not TodosCalRiesgo Then
+
+
+            For Each Item In Col_CalRiesgo
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodCalRi   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosTipOperacion Then
+
+
+            For Each Item In Col_TipOperacion
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = "" + OperadorLogico + " TipoOper   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosOriFond Then
+
+
+            For Each Item In Col_OriFond
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " OFon  like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosCalERiesgo Then
+
+
+            For Each Item In Col_CalERiesgo
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodECalRi  like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+        If Not TodosAut Then
+
+
+
+            For Each Item In Col_Aut
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " AutEstado  like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+
+
+        If Not TodosPlazo Then
+
+
+            For Each Item In Col_Plazo
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " PlazoFact   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+        If Not TodosPais Then
+
+
+
+            For Each Item In Col_Pais
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " CodPais   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+            OperadorLogico = " And ("
+        End If
+        If Not TodosTipMercado Then
+
+
+
+            For Each Item In Col_TipMercado
+                Dim NombreItem As String = Item.ToString.Trim
+                Dim ConsultaExtra As String = " " + OperadorLogico + " TipoMerc   like '%" + NombreItem + "%'"
+                sql += ConsultaExtra
+                OperadorLogico = " Or"
+                Fin = ")"
+            Next
+
+            If Not String.IsNullOrEmpty(Fin) Then
+                sql += Fin
+            End If
+            Fin = String.Empty
+        End If
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        da = New SqlDataAdapter(sql, cn)
+        da.SelectCommand.CommandType = CommandType.Text
+
+        da.Fill(ds, "Resultado")
+        cn.Close()
+        Return ds
+
+
+    End Function
+    Public Function CargarRegistro(ByVal IdRegistro As Integer) As InversionesCE
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim oInversion As InversionesCE
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim dr As SqlDataReader
+
+        sql = "SELECT * FROM [dbo].[INV0] WHERE [DocId]=@DocId"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        cmd = New SqlCommand(sql, cn)
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+
+        dr = cmd.ExecuteReader
+
+        If dr.HasRows Then
+            oInversion = New InversionesCE
+            While dr.Read
+                oInversion.CodigoEmpresa = dr.Item("CodEmpr").ToString
+                oInversion.CodigoInstrumentoFinanciero = dr.Item("CodIF").ToString
+                If (String.IsNullOrEmpty(dr.Item("CodEmis").ToString)) Then
+                    oInversion.CodigoEmisor = -1
+                Else
+                    oInversion.CodigoEmisor = dr.Item("CodEmis").ToString
+                End If
+
+                oInversion.CodigoCalificacionDeRiesgo = dr.Item("CodCalRi").ToString
+                oInversion.CodigoEmpresaCalificadora = dr.Item("CodECalRi").ToString
+                oInversion.Pais = dr.Item("CodPais").ToString
+                oInversion.TipoMercado = dr.Item("TipoMerc").ToString
+                oInversion.CodigoIversion = dr.Item("CodInv").ToString
+                oInversion.EstadoDocumento = dr.Item("DocEst").ToString
+                oInversion.NombreManual = dr.Item("NombreManIF").ToString
+                oInversion.CodigoManual = dr.Item("CodManIF").ToString
+                oInversion.Periodicidad = dr.Item("Periodicidad").ToString
+                oInversion.TipoTasa = dr.Item("TipTasa").ToString
+                oInversion.TipoRenta = dr.Item("TipRenta").ToString
+
+
+                If String.IsNullOrEmpty(dr.Item("Plazo").ToString) Then
+                    oInversion.PlazoNumero = 0
+                Else
+                    oInversion.PlazoNumero = dr.Item("Plazo")
+                End If
+
+                oInversion.PlazoFactor = dr.Item("PlazoFact").ToString
+                oInversion.Comentarios = dr.Item("Coment").ToString
+                oInversion.TipoOperacion = dr.Item("TipoOper").ToString
+                oInversion.OFondo = dr.Item("OFon").ToString
+                oInversion.EstadoProceso = dr.Item("EstadoProceso").ToString
+                oInversion.FechaDocumento = Operaciones.ConvertirFecha(dr.Item("FechaDoc").ToString)
+            End While
+            dr.Close()
+            cmd.Dispose()
+
+
+            oInversion.TipoInstrumentoFinanciero = Me.ObtenerTipoInstrumentoFinanciero(oInversion.CodigoInstrumentoFinanciero)
+
+        Else
+
+        End If
+
+
+        'oSqlConnection.Dispose()
+
+        cn.Close()
+        Return oInversion
+    End Function
+
+
+
+
+    Public Function CargarRegistroPropuesta(ByVal IdRegistro As Integer) As InversionesCE
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim oInversion As InversionesCE
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim dr As SqlDataReader
+
+        sql = "SELECT * FROM [dbo].[PIN0] WHERE [DocId]=@DocId"
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        cmd = New SqlCommand(sql, cn)
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+
+        dr = cmd.ExecuteReader
+
+        If dr.HasRows Then
+            oInversion = New InversionesCE
+            While dr.Read
+                'oInversion.CodigoEmpresa = dr.Item("CodEmpr")
+                'oInversion.CodigoInstrumentoFinanciero = dr.Item("CodIF")
+                oInversion.CodigoEmisor = dr.Item("CodEmis")
+                'oInversion.CodigoCalificacionDeRiesgo = dr.Item("CodCalRi").ToString
+                'oInversion.CodigoEmpresaCalificadora = dr.Item("CodECalRi").ToString
+                'oInversion.Pais = dr.Item("CodPais").ToString
+                'oInversion.TipoMercado = dr.Item("TipoMerc").ToString
+                'oInversion.CodigoIversion = dr.Item("CodInv").ToString
+                'oInversion.EstadoDocumento = dr.Item("DocEst").ToString
+                'oInversion.NombreManual = dr.Item("NombreManIF").ToString
+                'oInversion.CodigoManual = dr.Item("CodManIF").ToString
+                'oInversion.Periodicidad = dr.Item("Periodicidad").ToString
+                'oInversion.TipoTasa = dr.Item("TipTasa").ToString
+                'oInversion.TipoRenta = dr.Item("TipRenta").ToString
+                'oInversion.PlazoNumero = dr.Item("Plazo").ToString
+                'oInversion.PlazoFactor = dr.Item("PlazoFact").ToString
+                'oInversion.Comentarios = dr.Item("Coment").ToString
+
+
+            End While
+            dr.Close()
+            cmd.Dispose()
+
+
+            '    oInversion.TipoInstrumentoFinanciero = Me.ObtenerTipoInstrumentoFinanciero(oInversion.CodigoInstrumentoFinanciero)
+
+        Else
+
+        End If
+
+
+        'oSqlConnection.Dispose()
+
+        cn.Close()
+        Return oInversion
+    End Function
+
+
+
+
+
+End Class

+ 1001 - 0
DAO/LETESDAO.vb

@@ -0,0 +1,1001 @@
+Imports System.Data.SqlClient
+Public Class LETESDAO
+
+
+
+    Public Function Nuevo(ByVal objLete As LETESCE) As Integer
+        Dim retorno As Integer
+
+
+        Return retorno
+    End Function
+    Public Function Nuevo(ByVal coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim query As String
+
+        Dim Tabla As String = ""
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+
+
+        Dim cmd As SqlCommand
+
+
+
+
+        query = "INSERT INTO [dbo].[LET0]
+           (
+           [ValNom]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[Plazo])
+     VALUES
+           (@ValNom
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@Plazo
+		   )"
+
+        cmd = New SqlCommand
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@ValNom", SqlDbType.Decimal).Value = coleccion(1)
+            .Add("@FOper", SqlDbType.DateTime).Value = coleccion(2)
+            .Add("@FLiq", SqlDbType.DateTime).Value = coleccion(3)
+
+            .Add("@RendBruto", SqlDbType.Decimal).Value = coleccion(4)
+            .Add("@Plazo", SqlDbType.Int).Value = coleccion(5)
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+        cn.Close()
+        Return retorno
+    End Function
+
+
+    Public Function ActualizarLETE(ByVal coleccion As Collection, ByVal Instrumento As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (Instrumento = "LETE") Then
+            sql = "UPDATE [dbo].[LET0] SET 
+            
+           [ValNom]=@ValNom
+           ,[FOper]=@FOper
+           ,[FLiq]=@FLiq
+           ,[RendBruto]=@RendBruto
+           ,[Plazo]=@Plazo
+           ,[ComisionCasa]=@ComisionCasa
+           ,[ComisionBolsa]=@ComisionBolsa
+           ,[CasasCorredoras]=@CasasCorredoras
+           ,[Periodic]=@Periodic
+           ,[AnioBase]=@AnioBase
+          
+            ,[ValTrans] = @ValTrans 
+            ,[Precio] = @Precio
+            ,[TotPagar]=  @TotPagar
+            ,[RendNeto] = @RendNeto 
+            ,[IngrBruto] =@IngrBruto
+            ,[IngrNeto] =@IngrNeto
+            ,[ComisionCasaValor] =@ComisionCasaValor
+            ,[ComisionBolsaValor] =@ComisionBolsaValor
+            ,[FUlt] =@FUlt
+            ,[FRed] =@FRed
+            ,[FVenc] =@FVenc
+
+where [CodInv]=   @CodInv
+
+            
+"
+        ElseIf (Instrumento = "PBUR") Then
+
+            sql = "UPDATE [dbo].[PBUR] SET
+       
+           [ValNom]=@ValNom
+           ,[FOper]=@FOper
+           ,[FLiq]=@FLiq
+           ,[RendBruto]=@RendBruto
+           ,[Plazo]=@Plazo
+           ,[ComisionCasa]=@ComisionCasa
+           ,[ComisionBolsa]=@ComisionBolsa
+           ,[CasasCorredoras]=@CasasCorredoras
+           ,[Periodic]=@Periodic
+           ,[AnioBase]=@AnioBase
+           ,[ValorPar]= @ValorPar
+           ,[FechaUltima]=@FechaUltima
+           
+            ,[ValTrans] = @ValTrans 
+            ,[Precio] = @Precio
+            ,[TotPagar]=  @TotPagar
+            ,[RendNeto] = @RendNeto 
+            ,[IngrBruto] =@IngrBruto
+            ,[IngrNeto] =@IngrNeto
+            ,[ComisionCasaValor] =@ComisionCasaValor
+            ,[ComisionBolsaValor] =@ComisionBolsaValor
+            ,[FUlt] =@FUlt
+            ,[FRed] =@FRed
+            ,[FVenc] =@FVenc
+            ,[IntAcumulado]=@IntAcumulado
+where [CodInv]=   @CodInv
+            
+"
+
+        ElseIf (Instrumento = "VCN") Then
+
+            sql = "UPDATE [dbo].[VCN] SET
+           [ValNom]=@ValNom
+           ,[FOper]=@FOper
+           ,[FLiq]=@FLiq
+           ,[RendBruto]=@RendBruto
+           ,[Plazo]=@Plazo
+           ,[ComisionCasa]=@ComisionCasa
+           ,[ComisionBolsa]=@ComisionBolsa
+           ,[CasasCorredoras]=@CasasCorredoras
+           ,[Periodic]=@Periodic
+           ,[AnioBase]=@AnioBase
+           ,[ValorPar]= @ValorPar
+           ,[FechaUltima]=@FechaUltima
+           ,[OtrosCostos]=@OtrosCostos
+
+            ,[ValTrans] = @ValTrans 
+            ,[Precio] = @Precio
+            ,[TotPagar]=  @TotPagar
+            ,[RendNeto] = @RendNeto 
+            ,[IngrBruto] =@IngrBruto
+            ,[IngrNeto] =@IngrNeto
+            ,[ComisionCasaValor] =@ComisionCasaValor
+            ,[ComisionBolsaValor] =@ComisionBolsaValor
+            ,[FUlt] =@FUlt
+            ,[FRed] =@FRed
+            ,[FVenc] =@FVenc
+            ,[IntAcumulado]=@IntAcumulado
+            where [CodInv]=   @CodInv
+"
+
+
+
+        ElseIf (Instrumento = "CETE") Then
+
+            sql = "UPDATE [dbo].[CET0] SET
+           [ValNom]=@ValNom
+           ,[FOper]= @FOper
+           ,[FLiq]=@FLiq
+           ,[RendBruto]= @RendBruto
+           ,[Plazo]=@Plazo
+           ,[ComisionCasa]=  @ComisionCasa
+           ,[ComisionBolsa]= @ComisionBolsa
+           ,[CasasCorredoras]=     @CasasCorredoras
+           ,[Periodic]=   @Periodic
+           ,[AnioBase]=@AnioBase
+           ,[FechaUltima]=@FechaUltima
+
+            ,[ValTrans] = @ValTrans 
+            ,[Precio] = @Precio
+            ,[TotPagar]=  @TotPagar
+            ,[RendNeto] = @RendNeto 
+            ,[IngrBruto] =@IngrBruto
+            ,[IngrNeto] =@IngrNeto
+            ,[ComisionCasaValor] =@ComisionCasaValor
+            ,[ComisionBolsaValor] =@ComisionBolsaValor
+            ,[FUlt] =@FUlt
+            ,[FRed] =@FRed
+            ,[FVenc] =@FVenc
+            ,[IntAcumulado]=@IntAcumulado
+            where [CodInv]=   @CodInv
+           
+"
+        End If
+
+        'Try
+
+
+        cmd = New SqlCommand
+            cmd.CommandText = sql
+
+            With cmd.Parameters
+                .Add("@ValNom", SqlDbType.Decimal).Value = coleccion(1)
+
+                .Add("@FOper", SqlDbType.DateTime).Value = coleccion(2)
+                .Add("@FLiq", SqlDbType.DateTime).Value = coleccion(3)
+                .Add("@RendBruto", SqlDbType.Decimal).Value = coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = CInt(coleccion(5))
+                .Add("@CodInv", SqlDbType.VarChar).Value = coleccion(6)
+                .Add("@ComisionCasa", SqlDbType.Decimal).Value = CDec(coleccion(7))
+                .Add("@ComisionBolsa", SqlDbType.Decimal).Value = CDec(coleccion(8))
+                .Add("@Periodic", SqlDbType.VarChar).Value = coleccion(9)
+
+                .Add("@AnioBase", SqlDbType.Int).Value = CInt(coleccion(10))
+
+                .Add("@CasasCorredoras", SqlDbType.VarChar).Value = coleccion(11)
+
+                If Instrumento = "LETE" Then
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(12)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(13)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(14)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(15)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(16)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(18)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(19)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(20)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(21)
+                    .Add("FVenc", SqlDbType.Date).Value = coleccion(22)
+                End If
+
+                If (Instrumento = "VCN" Or Instrumento = "PBUR") Then
+
+
+                    .Add("@ValorPar", SqlDbType.Bit).Value = CByte(coleccion(12))
+                    .Add("@FechaUltima", SqlDbType.DateTime).Value = CDate(coleccion(13))
+
+
+
+                ElseIf Instrumento = "CETE" Then
+                    .Add("@FechaUltima", SqlDbType.DateTime).Value = CDate(coleccion(12))
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(13)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(14)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(15)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(16)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(19)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(20)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(21)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(22)
+                .Add("FVenc", SqlDbType.Date).Value = coleccion(23)
+                .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(24)
+            End If
+                If Instrumento = "VCN" Then
+                    .Add("@OtrosCostos", SqlDbType.Decimal).Value = CDec(coleccion(14))
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(15)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(16)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(17)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(19)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(20)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(21)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(22)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(23)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(24)
+                .Add("FVenc", SqlDbType.Date).Value = coleccion(25)
+                .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(26)
+            End If
+                If Instrumento = "PBUR" Then
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(14)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(15)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(16)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(19)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(20)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(21)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(22)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(23)
+                .Add("FVenc", SqlDbType.Date).Value = coleccion(24)
+                .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(25)
+            End If
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro Modificado con éxito")
+        'Catch ex As Exception
+        '    MsgBox("Error al modificar el registro")
+        'End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+    Public Function NuevoIngreso(ByVal coleccion As Collection, ByVal Instrumento As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (Instrumento = "LETE") Then
+            sql = "INSERT INTO [dbo].[LET0](
+            [CodInv]
+           ,[ValNom]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[Plazo]
+           ,[ComisionCasa]
+           ,[ComisionBolsa]
+           ,[CasasCorredoras]
+           ,[Periodic]
+           ,[AnioBase]
+            ,[ValTrans] 
+            ,[Precio]
+            ,[TotPagar] 
+            ,[RendNeto] 
+            ,[IngrBruto] 
+            ,[IngrNeto] 
+            ,[ComisionCasaValor] 
+            ,[ComisionBolsaValor] 
+            ,[FUlt] 
+            ,[FRed] 
+            ,[FVenc]         
+
+)
+           VALUES(
+            @CodInv 
+           ,@ValNom
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@Plazo
+           ,@ComisionCasa
+           ,@ComisionBolsa
+           ,@CasasCorredoras
+           ,@Periodic 
+           ,@AnioBase 
+
+            ,@ValTrans 
+            ,@Precio 
+            ,@TotPagar 
+            ,@RendNeto 
+            ,@IngrBruto 
+            ,@IngrNeto 
+            ,@ComisionCasaValor 
+            ,@ComisionBolsaValor 
+            ,@FUlt 
+            ,@FRed 
+            ,@FVenc    
+
+)
+            
+"
+        ElseIf (Instrumento = "PBUR") Then
+
+            sql = "INSERT INTO [dbo].[PBUR](
+            [CodInv]
+           ,[ValNom]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[Plazo]
+           ,[ComisionCasa]
+           ,[ComisionBolsa]
+           ,[CasasCorredoras]
+           ,[Periodic]
+           ,[AnioBase]
+           ,[ValorPar]
+           ,[FechaUltima]
+
+,[ValTrans] 
+            ,[Precio]
+            ,[TotPagar] 
+            ,[RendNeto] 
+            ,[IngrBruto] 
+            ,[IngrNeto] 
+            ,[ComisionCasaValor] 
+            ,[ComisionBolsaValor] 
+            ,[FUlt] 
+            ,[FRed] 
+            ,[FVenc]  
+            ,[IntAcumulado]
+
+)
+           VALUES(
+            @CodInv 
+           ,@ValNom
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@Plazo
+           ,@ComisionCasa
+           ,@ComisionBolsa
+           ,@CasasCorredoras
+           ,@Periodic 
+           ,@AnioBase
+           ,@ValorPar
+           ,@FechaUltima
+            ,@ValTrans 
+            ,@Precio 
+            ,@TotPagar 
+            ,@RendNeto 
+            ,@IngrBruto 
+            ,@IngrNeto 
+            ,@ComisionCasaValor 
+            ,@ComisionBolsaValor 
+            ,@FUlt 
+            ,@FRed 
+            ,@FVenc    
+            ,@IntAcumulado
+)
+            
+"
+
+        ElseIf (Instrumento = "VCN") Then
+
+            sql = "INSERT INTO [dbo].[VCN](
+            [CodInv]
+           ,[ValNom]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[Plazo]
+           ,[ComisionCasa]
+           ,[ComisionBolsa]
+           ,[CasasCorredoras]
+           ,[Periodic]
+           ,[AnioBase]
+           ,[ValorPar]
+           ,[FechaUltima]
+           ,[OtrosCostos]
+
+,[ValTrans] 
+            ,[Precio]
+            ,[TotPagar] 
+            ,[RendNeto] 
+            ,[IngrBruto] 
+            ,[IngrNeto] 
+            ,[ComisionCasaValor] 
+            ,[ComisionBolsaValor] 
+            ,[FUlt] 
+            ,[FRed] 
+            ,[FVenc]    
+            ,[IntAcumulado]
+
+)
+           VALUES(
+            @CodInv 
+           ,@ValNom
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@Plazo
+           ,@ComisionCasa
+           ,@ComisionBolsa
+           ,@CasasCorredoras
+           ,@Periodic 
+           ,@AnioBase 
+           ,@ValorPar
+           ,@FechaUltima
+           ,@OtrosCostos
+            ,@ValTrans 
+            ,@Precio 
+            ,@TotPagar 
+            ,@RendNeto 
+            ,@IngrBruto 
+            ,@IngrNeto 
+            ,@ComisionCasaValor 
+            ,@ComisionBolsaValor 
+            ,@FUlt 
+            ,@FRed 
+            ,@FVenc  
+            ,@IntAcumulado
+)
+            
+"
+
+
+
+        ElseIf (Instrumento = "CETE") Then
+
+            sql = "INSERT INTO [dbo].[CET0](
+            [CodInv]
+           ,[ValNom]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[Plazo]
+           ,[ComisionCasa]
+           ,[ComisionBolsa]
+           ,[CasasCorredoras]
+           ,[Periodic]
+           ,[AnioBase]
+           ,[FechaUltima]
+
+,[ValTrans] 
+            ,[Precio]
+            ,[TotPagar] 
+            ,[RendNeto] 
+            ,[IngrBruto] 
+            ,[IngrNeto] 
+            ,[ComisionCasaValor] 
+            ,[ComisionBolsaValor] 
+            ,[FUlt] 
+            ,[FRed] 
+            ,[FVenc]    
+            ,[IntAcumulado]
+
+)
+           VALUES(
+            @CodInv 
+           ,@ValNom
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@Plazo
+           ,@ComisionCasa
+           ,@ComisionBolsa
+           ,@CasasCorredoras
+           ,@Periodic 
+           ,@AnioBase 
+           ,@FechaUltima
+            ,@ValTrans 
+            ,@Precio 
+            ,@TotPagar 
+            ,@RendNeto 
+            ,@IngrBruto 
+            ,@IngrNeto 
+            ,@ComisionCasaValor 
+            ,@ComisionBolsaValor 
+            ,@FUlt 
+            ,@FRed 
+            ,@FVenc
+            ,@IntAcumulado
+)
+            
+"
+        End If
+
+        Try
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+
+            With cmd.Parameters
+                .Add("@ValNom", SqlDbType.Decimal).Value = coleccion(1)
+
+                .Add("@FOper", SqlDbType.DateTime).Value = coleccion(2)
+                .Add("@FLiq", SqlDbType.DateTime).Value = coleccion(3)
+                .Add("@RendBruto", SqlDbType.Decimal).Value = coleccion(4)
+                .Add("@Plazo", SqlDbType.Int).Value = CInt(coleccion(5))
+                .Add("@CodInv", SqlDbType.VarChar).Value = coleccion(6)
+                .Add("@ComisionCasa", SqlDbType.Decimal).Value = CDec(coleccion(7))
+                .Add("@ComisionBolsa", SqlDbType.Decimal).Value = CDec(coleccion(8))
+                .Add("@Periodic", SqlDbType.VarChar).Value = coleccion(9)
+
+                .Add("@AnioBase", SqlDbType.Int).Value = CInt(coleccion(10))
+
+                .Add("@CasasCorredoras", SqlDbType.VarChar).Value = coleccion(11)
+
+                If Instrumento = "LETE" Then
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(12)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(13)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(14)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(15)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(16)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(18)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(19)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(20)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(21)
+                    .Add("FVenc", SqlDbType.Date).Value = coleccion(22)
+                End If
+
+                If (Instrumento = "VCN" Or Instrumento = "PBUR") Then
+
+
+                    .Add("@ValorPar", SqlDbType.Bit).Value = CByte(coleccion(12))
+                    .Add("@FechaUltima", SqlDbType.DateTime).Value = CDate(coleccion(13))
+
+
+
+                ElseIf Instrumento = "CETE" Then
+                    .Add("@FechaUltima", SqlDbType.DateTime).Value = CDate(coleccion(12))
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(13)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(14)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(15)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(16)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(19)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(20)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(21)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(22)
+                    .Add("FVenc", SqlDbType.Date).Value = coleccion(23)
+                    .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(24)
+                End If
+                If Instrumento = "VCN" Then
+                    .Add("@OtrosCostos", SqlDbType.Decimal).Value = CDec(coleccion(14))
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(15)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(16)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(17)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(19)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(20)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(21)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(22)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(23)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(24)
+                    .Add("FVenc", SqlDbType.Date).Value = coleccion(25)
+                    .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(26)
+                End If
+                If Instrumento = "PBUR" Then
+                    .Add("ValTrans", SqlDbType.Float).Value = coleccion(14)
+                    .Add("Precio", SqlDbType.Float).Value = coleccion(15)
+                    .Add("TotPagar", SqlDbType.Float).Value = coleccion(16)
+                    .Add("RendNeto", SqlDbType.Float).Value = coleccion(17)
+                    .Add("IngrBruto", SqlDbType.Float).Value = coleccion(18)
+                    .Add("IngrNeto", SqlDbType.Float).Value = coleccion(19)
+                    .Add("ComisionCasaValor", SqlDbType.Float).Value = coleccion(20)
+                    .Add("ComisionBolsaValor", SqlDbType.Float).Value = coleccion(21)
+                    .Add("FUlt", SqlDbType.Date).Value = coleccion(22)
+                    .Add("FRed", SqlDbType.Date).Value = coleccion(23)
+                    .Add("FVenc", SqlDbType.Date).Value = coleccion(24)
+                    .Add("@IntAcumulado", SqlDbType.Float).Value = coleccion(25)
+                End If
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            MsgBox("Registro creado con éxito")
+        Catch ex As Exception
+            MsgBox("Error al crear el registro")
+        End Try
+        cn.Close()
+        Return retorno
+    End Function
+
+    Public Sub Eliminar(ByVal Eliminar As String, ByVal Instrumento As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (Instrumento = "LETE") Then
+            sql = "DELETE FROM [dbo].[LET0]
+      WHERE [CodInv]=@CodInv"
+        ElseIf (Instrumento = "PBUR") Then
+            sql = "DELETE FROM [dbo].[PBUR]
+      WHERE [CodInv]=@CodInv"
+
+        ElseIf (Instrumento = "VCN") Then
+            sql = "DELETE FROM [dbo].[VCN]
+      WHERE [CodInv]=@CodInv"
+
+        ElseIf (Instrumento = "CETE") Then
+            sql = "DELETE FROM [dbo].[CET0]
+      WHERE [CodInv]=@CodInv"
+        End If
+
+
+        cn = objCon.Conectar
+        Try
+
+
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Eliminar
+            cmd.Connection = cn
+
+            res = cmd.ExecuteNonQuery
+            MsgBox("Registro eliminado con éxito")
+        Catch ex As Exception
+            MsgBox("Error al eliminar el registro")
+        End Try
+        cn.Close()
+    End Sub
+    Public Function Nuevo(ByVal oLete As LETESCE, CodigoInversion As String) As Integer
+        Dim Resultado As Integer = 0
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Not oLete Is Nothing Then
+            Dim Transaccion As SqlTransaction
+            Dim query As String
+
+            Dim cmd As SqlCommand = cn.CreateCommand
+
+            Transaccion = cn.BeginTransaction("NuevoLete")
+            cmd.Connection = cn
+            cmd.Transaction = Transaccion
+
+            query = "INSERT INTO [dbo].[LET0]
+           ([CodInv]
+           ,[CodCasa]
+           ,[ValNom]
+           ,[ValTrans]
+           ,[Precio]
+           ,[Impuestos]
+           ,[TotPagar]
+           ,[FOper]
+           ,[FLiq]
+           ,[RendBruto]
+           ,[RendNeto]
+           ,[Periodic]
+           ,[Plazo]
+           ,[IngrBruto]
+           ,[IngrNeto])
+     VALUES
+           (@CodInv
+           ,@CodCasa
+           ,@ValNom
+           ,@ValTrans
+           ,@Precio
+           ,@Impuestos
+           ,@TotPagar
+           ,@FOper
+           ,@FLiq
+           ,@RendBruto
+           ,@RendNeto
+           ,@Periodic
+           ,@Plazo
+           ,@IngrBruto
+           ,@IngrNeto
+		   )"
+
+            cmd.CommandText = query
+
+            With cmd.Parameters
+                '.Add("@DocId", SqlDbType.Int).Value = DocId
+                .Add("@CodInv", SqlDbType.VarChar).Value = CodigoInversion
+                .Add("@CodCasa", SqlDbType.VarChar).Value = oLete.CodigoCasa
+                .Add("@ValNom", SqlDbType.Float).Value = oLete.ValorNominal
+                .Add("@ValTrans", SqlDbType.Float).Value = oLete.ValorTransado
+                .Add("@Precio", SqlDbType.Float).Value = oLete.Precio
+                .Add("@Impuestos", SqlDbType.Float).Value = oLete.Impuestos
+                .Add("@TotPagar", SqlDbType.Float).Value = oLete.TotalaPagar
+                .Add("@FOper", SqlDbType.DateTime).Value = oLete.FechaOperacion
+                .Add("@FLiq", SqlDbType.DateTime).Value = oLete.FechaLiquidacion
+                .Add("@RendBruto", SqlDbType.Float).Value = oLete.RendimientoBruto
+                .Add("@RendNeto", SqlDbType.Float).Value = oLete.RendimientoNeto
+                .Add("@Periodic", SqlDbType.VarChar).Value = oLete.Periodicidad
+                .Add("@Plazo", SqlDbType.Int).Value = oLete.Plazo
+                .Add("@IngrBruto", SqlDbType.Float).Value = oLete.IngresoBruto
+                .Add("@IngrNeto", SqlDbType.Float).Value = oLete.IngresoNeto
+            End With
+
+            Try
+                Resultado = cmd.ExecuteNonQuery()
+                Transaccion.Commit()
+
+            Catch ex As Exception
+                MsgBox("Error al Guardar Lete : " & ex.GetType.ToString)
+                MsgBox("Mensaje: " & ex.Message)
+                Resultado = 0
+                Try
+                    Transaccion.Rollback()
+                Catch ex2 As Exception
+                    MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                    MsgBox("Mensaje Rollbak: " & ex2.Message)
+                End Try
+            End Try
+
+            cmd.Dispose()
+            cn.Dispose()
+        Else
+            Resultado = -1
+        End If
+
+        Return Resultado
+    End Function
+
+
+    Public Sub CargarRegistro(ByVal oLetes As LETESCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PLET0"
+        End If
+        If Tipo = "I" Then
+            Tabla = "ILET0"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oLetes.ValorNominal = drd.Item("ValNom")
+                oLetes.FechaOperacion = drd.Item("FOper")
+                oLetes.FechaLiquidacion = drd.Item("FLiq")
+
+                oLetes.Plazo = drd.Item("Plazo")
+                oLetes.CodigoCasa = drd.Item("CodCasa")
+                oLetes.Impuestos = drd.Item("Impuestos")
+                oLetes.Periodicidad = drd.Item("Periodic")
+                oLetes.RendimientoBruto = drd.Item("RendBruto")
+                oLetes.RendimientoNeto = drd.Item("RendNeto")
+                oLetes.IngresoBruto = drd.Item("IngrBruto")
+                oLetes.IngresoNeto = drd.Item("IngrNeto")
+                oLetes.ValorTransado = drd.Item("ValTrans")
+                oLetes.Precio = drd.Item("Precio")
+                oLetes.TotalaPagar = drd.Item("TotPagar")
+            End If
+
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+    End Sub
+    Public Function CargarRegistro(ByVal CodInversion As String) As LETESCE
+        Dim objCon As New Conexion
+        Dim oLETES As LETESCE
+        Dim cmd As SqlCommand
+        Dim drd As SqlDataReader
+        Dim vComprobar As Integer = 0
+        Dim sql As String
+        Dim vCodigoInversion As String = CodInversion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        vComprobar = Comprobar(vCodigoInversion)
+        If vComprobar > 0 Then
+            oLETES = New LETESCE
+
+            sql = "SELECT * FROM [dbo].[LET0] T0 WHERE T0.[CodInv]=@CodInv"
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+            cmd.Connection = cn
+
+            drd = cmd.ExecuteReader
+            If drd.HasRows Then
+                'SE ENCONTRO EL REGISTRO
+                If drd.Read Then
+                    'oLETES.ValorNominal = drd.Item("ValNom").ToString
+                    'oLETES.FechaOperacion = drd.Item("FOper").ToString
+                    'oLETES.FechaLiquidacion = drd.Item("FLiq").ToString
+                    'oLETES.Plazo = drd.Item("Plazo").ToString
+                    'oLETES.CodigoCasa = drd.Item("CodCasa").ToString
+                    'oLETES.Impuestos = drd.Item("Impuestos").ToString
+                    'oLETES.Periodicidad = drd.Item("Periodic").ToString
+                    'oLETES.RendimientoBruto = drd.Item("RendBruto").ToString
+                    'oLETES.RendimientoNeto = drd.Item("RendNeto").ToString
+                    'oLETES.IngresoBruto = drd.Item("IngrBruto").ToString
+                    'oLETES.IngresoNeto = drd.Item("IngrNeto").ToString
+                    'oLETES.ValorTransado = drd.Item("ValTrans").ToString
+                    'oLETES.Precio = drd.Item("Precio").ToString
+                    'oLETES.TotalaPagar = drd.Item("TotPagar").ToString
+                End If
+
+            Else
+                'NO SE ENCONTRO EL REGISTRO
+            End If
+            drd.Close()
+            cmd.Dispose()
+            cn.Dispose()
+
+        End If
+
+        Return oLETES
+    End Function
+    Public Function Comprobar(ByVal CodInversion As String) As Integer
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim count As Integer = 0
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT COUNT('A') FROM [dbo].[LET0] T0 WHERE T0.CodInv=@CodInversion"
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInversion", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        count = cmd.ExecuteScalar
+        cn.Close()
+        Return count
+    End Function
+    Public Function Cargar(ByVal CodInversion As String, ByVal Instrumento As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (Instrumento = "LETE") Then
+            sql = "SELECT * FROM [dbo].[LET0] WHERE CodInv=@CodInversion"
+        ElseIf (Instrumento = "PBUR") Then
+            sql = "SELECT * FROM [dbo].[PBUR] WHERE CodInv=@CodInversion"
+        ElseIf (Instrumento = "VCN") Then
+            sql = "SELECT * FROM [dbo].[VCN] WHERE CodInv=@CodInversion"
+        ElseIf (Instrumento = "CETE") Then
+            sql = "SELECT * FROM [dbo].[CET0] WHERE CodInv=@CodInversion"
+        End If
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInversion", SqlDbType.VarChar).Value = CodInversion
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+            If Datos.Read Then
+
+
+                Coleccion.Add(Datos.Item("ValNom"))
+                Coleccion.Add(Datos.Item("FOper"))
+                Coleccion.Add(Datos.Item("FLiq"))
+                Coleccion.Add(Datos.Item("Plazo"))
+                Coleccion.Add(Datos.Item("RendBruto"))
+                Coleccion.Add(Datos.Item("CodCasa"))
+                Coleccion.Add(Datos.Item("Periodic"))
+                Coleccion.Add(Datos.Item("AnioBase"))
+                Coleccion.Add(Datos.Item("ComisionCasa"))
+                Coleccion.Add(Datos.Item("ComisionBolsa"))
+                Coleccion.Add(Datos.Item("CodInv"))
+                Coleccion.Add(Datos.Item("CasasCorredoras"))
+                If (Instrumento = "PBUR" Or Instrumento = "VCN") Then
+                    Coleccion.Add(Datos.Item("ValorPar"))
+                    Coleccion.Add(Datos.Item("FechaUltima"))
+                ElseIf Instrumento = "CETE" Then
+
+                    Coleccion.Add(Datos.Item("FechaUltima"))
+                End If
+
+                If Instrumento = "VCN" Then
+                    Coleccion.Add(Datos.Item("OtrosCostos"))
+                End If
+                cn.Close()
+                Return Coleccion
+            End If
+        End If
+        Coleccion.Add(False)
+        cn.Close()
+        Return Coleccion
+    End Function
+End Class
+
+
+
+
+

+ 329 - 0
DAO/PoolTitulosDAO.vb

@@ -0,0 +1,329 @@
+
+Imports System.Data.SqlClient
+Public Class PoolTitulosDAO
+
+
+    Dim Operaciones As New Operaciones
+
+
+    Function NuevoCodigo()
+
+        Dim objCon As New Conexion
+        Dim valor As String = String.Empty
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+
+
+
+        Dim sql = "[dbo].[SP_GenerarCodigoAsociacion]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        valor = cmd.ExecuteScalar
+        cmd.Dispose()
+
+
+
+
+        cn.Dispose()
+
+        Return valor
+
+    End Function
+
+    Public Function FiltroReportoVenta(ByRef FechaVenOperacion1 As String, ByRef FechaVenOperacion2 As String, ByRef Estado As String, ByRef Empresa As String, ByRef Instrumento As String) As DataSet
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        Dim sql = "[dbo].[SP_PoolTitulos]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@FechaOperacion1", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(FechaVenOperacion1)
+        cmd.Parameters.Add("@FechaOperacion2", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(FechaVenOperacion2)
+        cmd.Parameters.Add("@Empresa", SqlDbType.VarChar).Value = Empresa
+        cmd.Parameters.Add("@Instrumento", SqlDbType.VarChar).Value = Instrumento
+        cmd.Parameters.Add("@Estado", SqlDbType.VarChar).Value = Estado
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds
+    End Function
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+
+
+
+
+
+            For Each DicRegistros As Dictionary(Of String, Object) In Coleccion
+
+
+                Dim CodigoTitulo = Function()
+                                       If DicRegistros.ContainsKey("CodigoTitulo") Then
+                                           Return DicRegistros.Item("CodigoTitulo")
+                                       Else
+                                           Return String.Empty
+                                       End If
+                                   End Function
+
+
+
+
+                Dim CodigoAsociacion = Function()
+                                           If DicRegistros.ContainsKey("CodigoAsociacion") Then
+                                               Return DicRegistros.Item("CodigoAsociacion")
+                                           Else
+                                               Return String.Empty
+                                           End If
+                                       End Function
+
+
+                Dim Instrumento = Function()
+                                      If DicRegistros.ContainsKey("Instrumento") Then
+                                          Return DicRegistros.Item("Instrumento")
+                                      Else
+                                          Return String.Empty
+                                      End If
+                                  End Function
+
+                Dim Empresa = Function()
+                                  If DicRegistros.ContainsKey("Empresa") Then
+                                      Return DicRegistros.Item("Empresa")
+                                  Else
+                                      Return String.Empty
+                                  End If
+                              End Function
+
+
+
+                Dim MontoTotal = Function()
+                                     If DicRegistros.ContainsKey("MontoTotal") Then
+                                         Return DicRegistros.Item("MontoTotal")
+                                     Else
+                                         Return 0
+                                     End If
+                                 End Function
+
+                Dim MontoUsado = Function()
+                                     If DicRegistros.ContainsKey("MontoUsado") Then
+                                         Return DicRegistros.Item("MontoUsado")
+                                     Else
+                                         Return 0
+                                     End If
+                                 End Function
+
+
+
+                Dim Porcentaje = Function()
+                                     If DicRegistros.ContainsKey("Porcentaje") Then
+                                         Return DicRegistros.Item("Porcentaje")
+                                     Else
+                                         Return 0
+                                     End If
+                                 End Function
+
+
+
+
+
+                Dim FechaCreacion = Function()
+                                        If DicRegistros.ContainsKey("FechaCreacion") Then
+                                            Return DicRegistros.Item("FechaCreacion")
+                                        Else
+                                            Return Date.Now.Date
+                                        End If
+                                    End Function
+
+
+
+                Dim Asociado = Function()
+                                   If DicRegistros.ContainsKey("Asociado") Then
+                                       Return DicRegistros.Item("Asociado")
+                                   Else
+                                       Return String.Empty
+                                   End If
+                               End Function
+
+                Dim IdFlujo = Function()
+                                  If DicRegistros.ContainsKey("IdFlujo") Then
+                                      Return DicRegistros.Item("IdFlujo")
+                                  Else
+                                      Return 0
+                                  End If
+                              End Function
+
+
+                Dim IdEspLR = Function()
+                                  If DicRegistros.ContainsKey("IdEspLR") Then
+                                      Return DicRegistros.Item("IdEspLR")
+                                  Else
+                                      Return 0
+                                  End If
+                              End Function
+
+
+
+
+                Dim ValorCodigoTitulo As String = CodigoTitulo().ToString
+                Dim ValorCodigoAsociacion As String = CodigoAsociacion().ToString
+                Dim ValorInstrumento As String = Instrumento().ToString
+                Dim ValorEmpresa As String = Empresa().ToString
+                Dim ValorMontoTotal As Double = Operaciones.ConvertirDecimal(MontoTotal().ToString)
+                Dim ValorMontoUsado As Double = Operaciones.ConvertirDecimal(MontoUsado().ToString)
+                Dim ValorPorcentaje As Double = Operaciones.ConvertirDecimal(Porcentaje().ToString)
+                Dim ValorFechaCreacion As Date = Operaciones.ConvertirFecha(FechaCreacion().ToString)
+                Dim ValorAsociado As String = Asociado().ToString
+                Dim ValorIdFlujo As Integer = Operaciones.ConvertirEntero(IdFlujo().ToString)
+                Dim ValorIdEspLR As Integer = Operaciones.ConvertirEntero(IdEspLR().ToString)
+
+
+
+
+
+
+
+
+
+                '###########################################################'
+                sql = "INSERT INTO [dbo].[ListTitREPO](
+                [CodigoAsociado]
+               ,[CodigoTitulos]
+               ,[CodigoEstado]
+               ,[Nombre]
+               ,[Descrip]
+               ,[MontoTotal]
+               ,[MontoUsado]
+               ,[Porcentaje]
+               ,[FechaCreacion]
+               ,[IdFlujo]
+               ,[IdEspLR]
+
+
+) VALUES(
+                @CodigoAsociado
+               ,@CodigoTitulos
+               ,@CodigoEstado
+               ,@Nombre
+               ,@Descrip
+               ,@MontoTotal
+               ,@MontoUsado
+               ,@Porcentaje
+               ,@FechaCreacion
+               ,@IdFlujo
+               ,@IdEspLR
+  
+)
+    "
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                With cmd.Parameters
+
+
+
+
+
+
+
+
+
+
+                    .Add("@CodigoAsociado", SqlDbType.VarChar).Value = ValorCodigoAsociacion
+                    .Add("@CodigoTitulos", SqlDbType.VarChar).Value = ValorCodigoTitulo
+                    .Add("@CodigoEstado", SqlDbType.VarChar).Value = "GRESP"
+                    .Add("@Nombre", SqlDbType.VarChar).Value = "Lista Titulos"
+                    .Add("@Descrip", SqlDbType.VarChar).Value = "Lista de Titulos en Espera de Reportear"
+                    .Add("@IdFlujo", SqlDbType.VarChar).Value = ValorIdFlujo
+                    .Add("@IdEspLR", SqlDbType.VarChar).Value = ValorIdEspLR
+
+
+
+                    .Add("@MontoTotal", SqlDbType.Float).Value = ValorMontoTotal
+                    .Add("@MontoUsado", SqlDbType.Float).Value = ValorMontoUsado
+                    .Add("@Porcentaje", SqlDbType.Float).Value = ValorPorcentaje
+                    .Add("@FechaCreacion", SqlDbType.Date).Value = ValorFechaCreacion
+                End With
+
+                retorno = cmd.ExecuteNonQuery
+
+                '#########################################################'
+
+
+
+                sql = "UPDATE IniFlu SET 
+                        [CodigoAsociado]=@CodigoAsociado
+                        where [IdFlujo]=@IdFlujo AND [CodigoTitulo]=@CodigoTitulo
+"
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                With cmd.Parameters
+                    .Add("@CodigoAsociado", SqlDbType.VarChar).Value = ValorCodigoAsociacion
+                    .Add("@IdFlujo", SqlDbType.VarChar).Value = ValorIdFlujo
+                    .Add("@CodigoTitulo", SqlDbType.VarChar).Value = ValorCodigoTitulo
+
+                End With
+
+                retorno = cmd.ExecuteNonQuery
+            Next
+
+
+
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+End Class

+ 684 - 0
DAO/PrestamoEmpresarialDAO.vb

@@ -0,0 +1,684 @@
+Imports System.Data.SqlClient
+Public Class PrestamoEmpresarialDAO
+
+
+
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario2 As Dictionary(Of String, Collection), ByVal Estado As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            If Estado = "Nuevo" Then
+
+
+                sql = "INSERT INTO [dbo].[PEMP0](
+           [CodInv]
+            ,[monto]
+            ,[fechaoper]
+            ,[fechaven]
+            ,[tasa]
+            ,[periodicidad]
+            ,[base]
+            ,[tipotasa]
+            ,[comisiondesembolso]
+            ,[plazodias]
+
+) VALUES(
+           @CodInv
+            ,@monto
+            ,@fechaoper
+            ,@fechaven
+            ,@tasa
+            ,@periodicidad
+            ,@base
+            ,@tipotasa
+            ,@comisiondesembolso
+            ,@plazodias
+)
+    "
+
+            Else
+                sql = "UPDATE [dbo].[PEMP0] SET
+          
+            [monto]=@monto
+            ,[fechaoper]=@fechaoper
+            ,[fechaven]=@fechaven
+            ,[tasa]=@tasa
+            ,[periodicidad]=@periodicidad
+            ,[base]=@base
+            ,[tipotasa]=@tipotasa
+            ,[comisiondesembolso]=@comisiondesembolso
+            ,[plazodias]=@plazodias
+            where  [CodInv]=@CodInv
+    "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@monto", SqlDbType.Float).Value = CDec(Coleccion(1))
+                .Add("@fechaoper", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+                .Add("@fechaven", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@tasa", SqlDbType.Float).Value = CDec(Coleccion(4))
+                .Add("@periodicidad", SqlDbType.VarChar).Value = Coleccion(5)
+                .Add("@base", SqlDbType.Int).Value = CInt(Coleccion(6))
+                .Add("@tipotasa", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@comisiondesembolso", SqlDbType.Float).Value = CDec(Coleccion(8))
+                .Add("@plazodias", SqlDbType.Int).Value = CInt(Coleccion(9))
+
+
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+
+
+
+
+            sql = "DELETE FROM [dbo].[PEMP1]
+            WHERE [CodInv]=@CodInv "
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+            If Not Diccionario2 Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario2
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[PEMP1](
+           [CodInv]
+            ,[correlativo]
+            ,[plazo]
+            ,[fechapago]
+            ,[ingresarcomision]
+            ,[ingresarinteres]
+            ,[IVA]
+            ,[amortizacion]
+            ,[montorecibir]
+            ,[saldopendiente]
+            ,[fechacorte]
+
+) VALUES(
+           @CodInv
+            ,@correlativo
+            ,@plazo
+            ,@fechapago
+            ,@ingresarcomision
+            ,@ingresarinteres
+            ,@IVA
+            ,@amortizacion
+            ,@montorecibir
+            ,@saldopendiente
+            ,@fechacorte
+
+)
+    "
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+                    With cmd.Parameters
+
+
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                        .Add("@correlativo", SqlDbType.Int).Value = Coleccion2(1)
+                        .Add("@plazo", SqlDbType.Int).Value = Coleccion2(2)
+                        .Add("@fechapago", SqlDbType.Date).Value = Coleccion2(3)
+                        .Add("@ingresarcomision", SqlDbType.Float).Value = Coleccion2(4)
+                        .Add("@ingresarinteres", SqlDbType.Float).Value = Coleccion2(5)
+                        .Add("@IVA", SqlDbType.Float).Value = Coleccion2(6)
+                        .Add("@amortizacion", SqlDbType.Float).Value = Coleccion2(7)
+                        .Add("@saldopendiente", SqlDbType.Float).Value = Coleccion2(8)
+                        .Add("@montorecibir", SqlDbType.Float).Value = Coleccion2(9)
+
+
+                    If Coleccion2(10) Is DBNull.Value Then
+                        .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+                    Else
+
+
+                        If String.IsNullOrEmpty(Coleccion2(10)) Then
+                            .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+                        Else
+                            .Add("@fechacorte", SqlDbType.Date).Value = Coleccion2(10)
+                        End If
+
+
+                    End If
+
+
+                End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+        myTrans.Rollback()
+        MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+    Public Function NuevoDato(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[PEMP0](
+           [CodInv]
+            ,[monto]
+            ,[fechaoper]
+            ,[fechaven]
+            ,[tasa]
+            ,[periodicidad]
+            ,[base]
+            ,[tipotasa]
+            ,[comisiondesembolso]
+            ,[plazodias]
+
+) VALUES(
+           @CodInv
+            ,@monto
+            ,@fechaoper
+            ,@fechaven
+            ,@tasa
+            ,@periodicidad
+            ,@base
+            ,@tipotasa
+            ,@comisiondesembolso
+            ,@plazodias
+)
+    "
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@monto", SqlDbType.Float).Value = CDec(Coleccion(1))
+            .Add("@fechaoper", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+            .Add("@fechaven", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+            .Add("@tasa", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@periodicidad", SqlDbType.VarChar).Value = Coleccion(5)
+            .Add("@base", SqlDbType.Int).Value = CInt(Coleccion(6))
+            .Add("@tipotasa", SqlDbType.VarChar).Value = Coleccion(7)
+            .Add("@comisiondesembolso", SqlDbType.Float).Value = CDec(Coleccion(8))
+            .Add("@plazodias", SqlDbType.Int).Value = CInt(Coleccion(9))
+
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+    Public Function ModificarDato(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[PEMP0] SET
+          
+            [monto]=@monto
+            ,[fechaoper]=@fechaoper
+            ,[fechaven]=@fechaven
+            ,[tasa]=@tasa
+            ,[periodicidad]=@periodicidad
+            ,[base]=@base
+            ,[tipotasa]=@tipotasa
+            ,[comisiondesembolso]=@comisiondesembolso
+            ,[plazodias]=@plazodias
+            where  [CodInv]=@CodInv
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@monto", SqlDbType.Float).Value = CDec(Coleccion(1))
+            .Add("@fechaoper", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+            .Add("@fechaven", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+            .Add("@tasa", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@periodicidad", SqlDbType.VarChar).Value = Coleccion(5)
+            .Add("@base", SqlDbType.Int).Value = CInt(Coleccion(6))
+            .Add("@tipotasa", SqlDbType.VarChar).Value = Coleccion(7)
+            .Add("@comisiondesembolso", SqlDbType.Float).Value = CDec(Coleccion(8))
+            .Add("@plazodias", SqlDbType.Int).Value = CInt(Coleccion(9))
+
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+    Public Function NuevoDetalle(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        sql = "INSERT INTO [dbo].[PEMP1](
+           [CodInv]
+            ,[correlativo]
+            ,[plazo]
+            ,[fechapago]
+            ,[ingresarcomision]
+            ,[ingresarinteres]
+            ,[IVA]
+            ,[amortizacion]
+            ,[montorecibir]
+            ,[saldopendiente]
+            ,[fechacorte]
+
+) VALUES(
+           @CodInv
+            ,@correlativo
+            ,@plazo
+            ,@fechapago
+            ,@ingresarcomision
+            ,@ingresarinteres
+            ,@IVA
+            ,@amortizacion
+            ,@montorecibir
+            ,@saldopendiente
+            ,@fechacorte
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+
+
+        With cmd.Parameters
+
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@correlativo", SqlDbType.Int).Value = Coleccion(1)
+                .Add("@plazo", SqlDbType.Int).Value = Coleccion(2)
+                .Add("@fechapago", SqlDbType.Date).Value = Coleccion(3)
+                .Add("@ingresarcomision", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@ingresarinteres", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@IVA", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@amortizacion", SqlDbType.Float).Value = Coleccion(7)
+                .Add("@saldopendiente", SqlDbType.Float).Value = Coleccion(8)
+                .Add("@montorecibir", SqlDbType.Float).Value = Coleccion(9)
+
+
+
+                If String.IsNullOrEmpty(Coleccion(10)) Then
+                    .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+                Else
+                    .Add("@fechacorte", SqlDbType.Date).Value = Coleccion(10)
+                End If
+
+
+
+
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+
+
+    Public Function ModificarDetalle(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[PEMP1] SET
+            [plazo]=@plazo
+            ,[fechapago]=@fechapago
+            ,[ingresarcomision]=@ingresarcomision
+            ,[ingresarinteres]=@ingresarinteres
+            ,[IVA]=@IVA
+            ,[amortizacion]=@amortizacion
+            ,[montorecibir]=@montorecibir
+            ,[saldopendiente]=@saldopendiente
+            ,[fechacorte]=@fechacorte
+            where [CodInv]=@CodInv AND [correlativo]=@correlativo
+          
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        Try
+
+
+
+            With cmd.Parameters
+
+
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@correlativo", SqlDbType.Int).Value = Coleccion(1)
+                .Add("@plazo", SqlDbType.Int).Value = Coleccion(2)
+                .Add("@fechapago", SqlDbType.Date).Value = Coleccion(3)
+                .Add("@ingresarcomision", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@ingresarinteres", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@IVA", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@amortizacion", SqlDbType.Float).Value = Coleccion(7)
+                .Add("@saldopendiente", SqlDbType.Float).Value = Coleccion(8)
+                .Add("@montorecibir", SqlDbType.Float).Value = Coleccion(9)
+
+
+                If Coleccion(10) Is DBNull.Value Then
+                    .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+
+
+                Else
+                    If String.IsNullOrEmpty(Coleccion(10)) Then
+                        .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+                    Else
+                        .Add("@fechacorte", SqlDbType.Date).Value = Coleccion(10)
+                    End If
+
+
+                End If
+
+
+
+            End With
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+        Catch ex As Exception
+            Return Nothing
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+    Public Function CargarDato(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[PEMP0] WHERE CodInv=@Codigo"
+
+
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+
+            If Datos.Read Then
+                Coleccion.Add(Datos.Item("monto"))
+                Coleccion.Add(Datos.Item("fechaoper"))
+                Coleccion.Add(Datos.Item("fechaven"))
+                Coleccion.Add(Datos.Item("tasa").ToString + "%")
+                Coleccion.Add(Datos.Item("periodicidad"))
+                Coleccion.Add(Datos.Item("base"))
+                Coleccion.Add(Datos.Item("tipotasa"))
+                Coleccion.Add(Datos.Item("comisiondesembolso").ToString + "%")
+                Coleccion.Add(Datos.Item("plazodias"))
+
+                cn.Close()
+                Return Coleccion
+            End If
+        End If
+        cn.Close()
+        Return False
+    End Function
+
+
+
+
+
+    Public Function CargarDetalles(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from PEMP1 where CodInv='" + codigo + "' order by Correlativo"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+
+
+
+        dr = cmd.ExecuteReader
+
+
+        Return dr
+    End Function
+
+
+    Public Sub Eliminar(ByVal Codigo As String)
+
+
+
+
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[PEMP0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[PEMP1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+    End Sub
+
+    Public Function EliminarDetalles(ByVal Correlativo As Integer, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[PEMP1]
+      WHERE [CodInv]=@CodInv and [Correlativo]=@Correlativo"
+
+
+
+        Try
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            cmd.Parameters.Add("@Correlativo", SqlDbType.VarChar).Value = Correlativo
+
+            cmd.Connection = cn
+
+            res = cmd.ExecuteNonQuery
+        Catch ex As Exception
+            cn.Close()
+            Return Nothing
+        End Try
+        cn.Close()
+        Return 1
+    End Function
+End Class

+ 929 - 0
DAO/PrestamoPersonalDAO.vb

@@ -0,0 +1,929 @@
+Imports System.Data.SqlClient
+Public Class PrestamoPersonalDAO
+
+
+
+
+
+
+
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection, ByVal Coleccion2 As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection), ByVal EstadoDeudor As String, ByVal EstadoDetalles As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            If EstadoDeudor = "Nuevo" Then
+
+
+                sql = "INSERT INTO [dbo].[PPER0](
+           [CodInv]
+           ,[nombredeudor]
+           ,[numerodeudor]
+           ,[fechaotorga]
+           ,[fechapago]
+           ,[periodogracia]
+) VALUES(
+           @CodInv
+           ,@nombredeudor
+           ,@numerodeudor
+           ,@fechaotorga
+           ,@fechapago
+           ,@periodogracia
+)
+    "
+
+            Else
+                sql = "UPDATE [dbo].[PPER0] SET
+           
+           [nombredeudor]=@nombredeudor
+           ,[numerodeudor]=@numerodeudor
+           ,[fechaotorga]=@fechaotorga
+           ,[fechapago]=@fechapago
+           ,[periodogracia]=@periodogracia
+           where [CodInv]=@CodInv
+
+    "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@nombredeudor", SqlDbType.VarChar).Value = Coleccion(1)
+                .Add("@numerodeudor", SqlDbType.VarChar).Value = Coleccion(2)
+                .Add("@fechaotorga", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+                .Add("@fechapago", SqlDbType.DateTime).Value = CDate(Coleccion(4))
+
+                .Add("@periodogracia", SqlDbType.Float).Value = CDec(Coleccion(5))
+
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+            If EstadoDetalles = "Nuevo" Then
+
+                sql = "INSERT INTO [dbo].[PPER1](        
+           [CodInv]
+           ,[tasainteres]
+           ,[duracionprestamo]
+           ,[totalcuotas]
+           ,[montoprestamo]
+           ,[seguro]
+            ,[CuotaSinSeguro]
+            ,[CuotaReal]
+
+) VALUES(
+           @CodInv
+           ,@tasainteres
+           ,@duracionprestamo
+           ,@totalcuotas
+           ,@montoprestamo
+           ,@seguro
+           ,@CuotaSinSeguro
+           ,@CuotaReal
+
+)
+    "
+
+            Else
+                sql = "UPDATE  [dbo].[PPER1] SET       
+           
+           [tasainteres]=@tasainteres
+           ,[duracionprestamo]=@duracionprestamo
+           ,[totalcuotas]=@totalcuotas
+           ,[montoprestamo]=@montoprestamo
+           ,[seguro]=@seguro
+            ,[CuotaSinSeguro]=@CuotaSinSeguro
+            ,[CuotaReal]=@CuotaReal
+           where [CodInv]=@CodInv
+ 
+
+
+    
+    "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@tasainteres", SqlDbType.Float).Value = CDec(Coleccion2(1))
+                .Add("@duracionprestamo", SqlDbType.Float).Value = CDec(Coleccion2(2))
+                .Add("@totalcuotas", SqlDbType.Float).Value = CDec(Coleccion2(3))
+                .Add("@montoprestamo", SqlDbType.Float).Value = CDec(Coleccion2(4))
+                .Add("@seguro", SqlDbType.Float).Value = CDec(Coleccion2(5))
+                .Add("@CuotaSinSeguro", SqlDbType.Float).Value = CDec(Coleccion2(6))
+                .Add("@CuotaReal", SqlDbType.Float).Value = CDec(Coleccion2(7))
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+            sql = "DELETE FROM [dbo].[PPER2]
+      WHERE [CodInv]=@CodInv "
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion3 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[PPER2](
+           [CodInv]
+           ,[fecha]
+           ,[Periodo]
+           ,[saldoinicial]
+           ,[pagocuota]
+           ,[pagointeresIVA]
+           ,[IVAinteres]
+           ,[pagointeres]
+           ,[abono]
+           ,[prestamoremanente]
+           ,[pagodanos]
+           ,[pagovivienta]
+           ,[totalcuota]
+           ,[totalpagado]
+           ,[abonoextra]
+           ,[correlativo]
+           ,[fechacorte]
+) VALUES(
+           @CodInv
+           ,@fecha
+           ,@Periodo
+           ,@saldoinicial
+           ,@pagocuota
+           ,@pagointeresIVA
+           ,@IVAinteres
+           ,@pagointeres
+           ,@abono
+           ,@prestamoremanente
+           ,@pagodanos
+           ,@pagovivienta
+           ,@totalcuota
+           ,@totalpagado
+           ,@abonoextra
+           ,@correlativo
+           ,@fechacorte
+
+)
+    "
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+
+                    With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                        .Add("@correlativo", SqlDbType.Int).Value = CInt(Coleccion3(1))
+                        .Add("@fecha", SqlDbType.DateTime).Value = CDate(Coleccion3(2))
+                        .Add("@Periodo", SqlDbType.Int).Value = CInt(Coleccion3(3))
+                        .Add("@saldoinicial", SqlDbType.Float).Value = CDec(Coleccion3(4))
+                        .Add("@pagocuota", SqlDbType.Float).Value = CDec(Coleccion3(5))
+                        .Add("@pagointeresIVA", SqlDbType.Float).Value = CDec(Coleccion3(6))
+                        .Add("@IVAinteres", SqlDbType.Float).Value = CDec(Coleccion3(7))
+                        .Add("@pagointeres", SqlDbType.Float).Value = CDec(Coleccion3(8))
+                        .Add("@abono", SqlDbType.Float).Value = CDec(Coleccion3(9))
+                        .Add("@prestamoremanente", SqlDbType.Float).Value = CDec(Coleccion3(10))
+                        .Add("@pagodanos", SqlDbType.Float).Value = CDec(Coleccion3(11))
+                        .Add("@pagovivienta", SqlDbType.Float).Value = CDec(Coleccion3(12))
+                        .Add("@totalcuota", SqlDbType.Float).Value = CDec(Coleccion3(13))
+                        .Add("@totalpagado", SqlDbType.Float).Value = CDec(Coleccion3(14))
+                        .Add("@abonoextra", SqlDbType.Float).Value = CDec(Coleccion3(15))
+                        If String.IsNullOrEmpty(Coleccion3(16).ToString) Then
+                            .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+                        Else
+
+                            .Add("@fechacorte", SqlDbType.Date).Value = Coleccion3(16)
+                        End If
+
+                    End With
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevoDeudor(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[PPER0](
+           [CodInv]
+           ,[nombredeudor]
+           ,[numerodeudor]
+           ,[fechaotorga]
+           ,[fechapago]
+           ,[periodogracia]
+) VALUES(
+           @CodInv
+           ,@nombredeudor
+           ,@numerodeudor
+           ,@fechaotorga
+           ,@fechapago
+           ,@periodogracia
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@nombredeudor", SqlDbType.VarChar).Value = Coleccion(1)
+            .Add("@numerodeudor", SqlDbType.VarChar).Value = Coleccion(2)
+            .Add("@fechaotorga", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+            .Add("@fechapago", SqlDbType.DateTime).Value = CDate(Coleccion(4))
+
+            .Add("@periodogracia", SqlDbType.Float).Value = CDec(Coleccion(5))
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Dispose()
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+    Public Function ModificarDeudor(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[PPER0] SET
+           
+           [nombredeudor]=@nombredeudor
+           ,[numerodeudor]=@numerodeudor
+           ,[fechaotorga]=@fechaotorga
+           ,[fechapago]=@fechapago
+           ,[periodogracia]=@periodogracia
+           where [CodInv]=@CodInv
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@nombredeudor", SqlDbType.VarChar).Value = Coleccion(1)
+            .Add("@numerodeudor", SqlDbType.VarChar).Value = Coleccion(2)
+            .Add("@fechaotorga", SqlDbType.DateTime).Value = CDate(Coleccion(3))
+            .Add("@fechapago", SqlDbType.DateTime).Value = CDate(Coleccion(4))
+            .Add("@periodogracia", SqlDbType.Float).Value = CDec(Coleccion(5))
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Dispose()
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevoDetalle(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[PPER1](        
+           [CodInv]
+           ,[tasainteres]
+           ,[duracionprestamo]
+           ,[totalcuotas]
+           ,[montoprestamo]
+           ,[seguro]
+            ,[CuotaSinSeguro]
+            ,[CuotaReal]
+
+) VALUES(
+           @CodInv
+           ,@tasainteres
+           ,@duracionprestamo
+           ,@totalcuotas
+           ,@montoprestamo
+           ,@seguro
+           ,@CuotaSinSeguro
+           ,@CuotaReal
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@tasainteres", SqlDbType.Float).Value = CDec(Coleccion(1))
+            .Add("@duracionprestamo", SqlDbType.Float).Value = CDec(Coleccion(2))
+            .Add("@totalcuotas", SqlDbType.Float).Value = CDec(Coleccion(3))
+            .Add("@montoprestamo", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@seguro", SqlDbType.Float).Value = CDec(Coleccion(5))
+            .Add("@CuotaSinSeguro", SqlDbType.Float).Value = CDec(Coleccion(6))
+            .Add("@CuotaReal", SqlDbType.Float).Value = CDec(Coleccion(7))
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+        cn.Dispose()
+        cn.Close()
+
+        Return retorno
+
+    End Function
+
+    Public Function ModificarDetalle(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE  [dbo].[PPER1] SET       
+           
+           [tasainteres]=@tasainteres
+           ,[duracionprestamo]=@duracionprestamo
+           ,[totalcuotas]=@totalcuotas
+           ,[montoprestamo]=@montoprestamo
+           ,[seguro]=@seguro
+            ,[CuotaSinSeguro]=@CuotaSinSeguro
+            ,[CuotaReal]=@CuotaReal
+           where [CodInv]=@CodInv
+ 
+
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@tasainteres", SqlDbType.Float).Value = CDec(Coleccion(1))
+            .Add("@duracionprestamo", SqlDbType.Float).Value = CDec(Coleccion(2))
+            .Add("@totalcuotas", SqlDbType.Float).Value = CDec(Coleccion(3))
+            .Add("@montoprestamo", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@seguro", SqlDbType.Float).Value = CDec(Coleccion(5))
+            .Add("@CuotaSinSeguro", SqlDbType.Float).Value = CDec(Coleccion(6))
+            .Add("@CuotaReal", SqlDbType.Float).Value = CDec(Coleccion(7))
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Dispose()
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+    Public Function NuevaAmortizacion(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[PPER2](
+           [CodInv]
+           ,[fecha]
+           ,[Periodo]
+           ,[saldoinicial]
+           ,[pagocuota]
+           ,[pagointeresIVA]
+           ,[IVAinteres]
+           ,[pagointeres]
+           ,[abono]
+           ,[prestamoremanente]
+           ,[pagodanos]
+           ,[pagovivienta]
+           ,[totalcuota]
+           ,[totalpagado]
+           ,[abonoextra]
+           ,[correlativo]
+           ,[fechacorte]
+) VALUES(
+           @CodInv
+           ,@fecha
+           ,@Periodo
+           ,@saldoinicial
+           ,@pagocuota
+           ,@pagointeresIVA
+           ,@IVAinteres
+           ,@pagointeres
+           ,@abono
+           ,@prestamoremanente
+           ,@pagodanos
+           ,@pagovivienta
+           ,@totalcuota
+           ,@totalpagado
+           ,@abonoextra
+           ,@correlativo
+           ,@fechacorte
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@correlativo", SqlDbType.Int).Value = CInt(Coleccion(1))
+            .Add("@fecha", SqlDbType.DateTime).Value = CDate(Coleccion(2))
+            .Add("@Periodo", SqlDbType.Int).Value = CInt(Coleccion(3))
+            .Add("@saldoinicial", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@pagocuota", SqlDbType.Float).Value = CDec(Coleccion(5))
+            .Add("@pagointeresIVA", SqlDbType.Float).Value = CDec(Coleccion(6))
+            .Add("@IVAinteres", SqlDbType.Float).Value = CDec(Coleccion(7))
+            .Add("@pagointeres", SqlDbType.Float).Value = CDec(Coleccion(8))
+            .Add("@abono", SqlDbType.Float).Value = CDec(Coleccion(9))
+            .Add("@prestamoremanente", SqlDbType.Float).Value = CDec(Coleccion(10))
+            .Add("@pagodanos", SqlDbType.Float).Value = CDec(Coleccion(11))
+            .Add("@pagovivienta", SqlDbType.Float).Value = CDec(Coleccion(12))
+            .Add("@totalcuota", SqlDbType.Float).Value = CDec(Coleccion(13))
+            .Add("@totalpagado", SqlDbType.Float).Value = CDec(Coleccion(14))
+            .Add("@abonoextra", SqlDbType.Float).Value = CDec(Coleccion(15))
+            If String.IsNullOrEmpty(Coleccion(16).ToString) Then
+                .Add("@fechacorte", SqlDbType.Date).Value = DBNull.Value
+            Else
+
+                .Add("@fechacorte", SqlDbType.date).Value = Coleccion(16)
+            End If
+
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+        cn.Dispose()
+        cn.Close()
+
+        Return retorno
+
+    End Function
+
+
+
+
+    Public Function ModificarAmortizacion(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[PPER2] SET
+           
+           [fecha]=@fecha
+           ,[Periodo]=@Periodo
+           ,[saldoinicial]=@saldoinicial
+           ,[pagocuota]=@pagocuota
+           ,[pagointeresIVA]=@pagointeresIVA
+           ,[IVAinteres]=@IVAinteres
+           ,[pagointeres]=@pagointeres
+           ,[abono]=@abono
+           ,[prestamoremanente]=@prestamoremanente
+           ,[pagodanos]=@pagodanos
+           ,[pagovivienta]=@pagovivienta
+           ,[totalcuota]=@totalcuota
+           ,[totalpagado]=@totalpagado
+           ,[abonoextra]=@abonoextra
+           ,[correlativo]=@correlativo
+           where [CodInv]=@CodInv 
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@fecha", SqlDbType.DateTime).Value = CDate(Coleccion(1))
+            .Add("@Periodo", SqlDbType.Int).Value = CInt(Coleccion(2))
+            .Add("@saldoinicial", SqlDbType.Float).Value = CDec(Coleccion(3))
+            .Add("@pagocuota", SqlDbType.Float).Value = CDec(Coleccion(4))
+            .Add("@pagointeresIVA", SqlDbType.Float).Value = CDec(Coleccion(5))
+            .Add("@IVAinteres", SqlDbType.Float).Value = CDec(Coleccion(6))
+            .Add("@pagointeres", SqlDbType.Float).Value = CDec(Coleccion(7))
+            .Add("@abono", SqlDbType.Float).Value = CDec(Coleccion(8))
+            .Add("@prestamoremanente", SqlDbType.Float).Value = CDec(Coleccion(9))
+            .Add("@pagodanos", SqlDbType.Float).Value = CDec(Coleccion(10))
+            .Add("@pagovivienta", SqlDbType.Float).Value = CDec(Coleccion(11))
+            .Add("@totalcuota", SqlDbType.Float).Value = CDec(Coleccion(12))
+            .Add("@totalpagado", SqlDbType.Float).Value = CDec(Coleccion(13))
+            .Add("@abonoextra", SqlDbType.Float).Value = CDec(Coleccion(14))
+            .Add("@correlativo", SqlDbType.Int).Value = CInt(Coleccion(15))
+
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+        cn.Dispose()
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+    Public Function CargarDeudor(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[PPER0] WHERE CodInv=@Codigo"
+        cmd = New SqlCommand
+
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+
+            If Datos.Read Then
+
+                Coleccion.Add(Datos.Item("nombredeudor"))
+                Coleccion.Add(Datos.Item("numerodeudor"))
+                Coleccion.Add(Datos.Item("fechaotorga"))
+                Coleccion.Add(Datos.Item("fechapago"))
+                Coleccion.Add(Datos.Item("periodogracia"))
+
+                cn.Close()
+                Return Coleccion
+            End If
+        End If
+        cn.Close()
+        Return False
+    End Function
+
+
+
+
+
+
+
+
+    Public Function CargarDetalles(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[PPER1] WHERE CodInv=@Codigo"
+
+
+        cmd = New SqlCommand
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+
+            If Datos.Read Then
+
+                Coleccion.Add(Datos.Item("tasainteres"))
+                Coleccion.Add(Datos.Item("duracionprestamo"))
+                Coleccion.Add(Datos.Item("totalcuotas"))
+                Coleccion.Add(Datos.Item("montoprestamo"))
+                Coleccion.Add(Datos.Item("seguro"))
+                cn.Close()
+                Return Coleccion
+            End If
+        End If
+        cn.Close()
+        Return False
+    End Function
+
+
+
+
+
+    Public Function CargarAmortizacion(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from PPER2 where CodInv='" + codigo + "' order by Correlativo"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+    Public Sub Eliminar(ByVal Codigo As String)
+
+
+
+
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[PPER0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[PPER1]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+            sql = "DELETE FROM [dbo].[PPER2]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+    End Sub
+
+    Public Sub EliminarDetalle(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[PPER1]
+      WHERE [CodInv]=@CodInv"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+    Public Sub EliminarAmortizacion(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[PPER2]
+      WHERE [CodInv]=@CodInv "
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+End Class

+ 239 - 0
DAO/RegistrosDAO.vb

@@ -0,0 +1,239 @@
+Imports System.Data.SqlClient
+Public Class RegistrosDAO
+
+
+
+
+
+
+
+    Public Function CargarInv(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a left join REP0 on REP0.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function CargarInvLETE(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join LET0 on LET0.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+
+    Public Function CargarInvVCN(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join VCN on VCN.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+    Public Function CargarInvPBUR(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join PBUR on PBUR.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function CargarInvPPER(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join PPER0 on PPER0.CodInv=a.CodInv right join PPER1 on PPER1.CodInv=a.CodInv right join PPER2 on PPER2.CodInv=a.CodInv  where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+
+    Public Function CargarInvFUTU(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join FUT0 on FUT0.CodInv=a.CodInv   where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function CargarInvOPC(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join OPC0 on OPC0.CodInv=a.CodInv   where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+    Public Function CargarInvACCC(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodIF Like '%" + codigo + "%') a inner join ACC0 on ACC0.CodInv=a.CodInv    where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+        ' Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodIF Like '%" + codigo + "%') a inner join ACC0 on ACC0.CodInv=a.CodInv inner join ACC1 on ACC1.CodInv=a.CodInv   where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+    Public Function CargarInvPEMP(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join PEMP0 on PEMP0.CodInv=a.CodInv inner join PEMP1 on PEMP1.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+
+
+
+    Public Function CargarInvFINV(ByVal codigo As String, ByVal Ini As Integer, ByVal final As Integer)
+        Dim objCon As New Conexion
+        If (Ini = 1) Then
+            Ini = Ini - 1
+        End If
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "Select * FROM( SELECT *, ROW_NUMBER() OVER (ORDER BY CodInv)  As row FROM INV0 where CodInv Like '%" + codigo + "%') a inner join FINV on FINV.CodInv=a.CodInv inner join FINV1 on FINV1.CodInv=a.CodInv where row > " + Ini.ToString + " and row <= " + final.ToString + ""
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function Contador(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim Cantidad As Integer
+        Dim sql As String
+        Dim Valor, tamaño
+        Dim cmd As SqlCommand = New SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "select count(*) from INV0 where CodInv Like '%" + codigo + "%'"
+        cmd.CommandText = sql
+        cmd.Connection = cn
+
+
+        Cantidad = cmd.ExecuteScalar
+        cn.Close()
+        Valor = Math.Round(Cantidad / 100, 0)
+        If (Cantidad > Valor) Then
+            tamaño = Valor + 1
+        Else
+            tamaño = Valor
+        End If
+        Return tamaño
+    End Function
+
+
+
+
+End Class

+ 1162 - 0
DAO/ReportosDAO.vb

@@ -0,0 +1,1162 @@
+Imports System.Data.SqlClient
+Public Class ReportosDAO
+
+
+
+    Dim Operaciones As New Operaciones
+
+    Public Function Nuevo(ByVal oReporto As ReportosCE) As Integer
+        Dim retorno As Integer
+
+
+        Return retorno
+    End Function
+
+
+    Public Function ProcesoDatos(ByVal Diccionario As Dictionary(Of String, Collection), ByVal Codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+
+            sql = "DELETE FROM " + Tabla + "
+            WHERE [CodInv]=@CodInv "
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+            If Not Diccionario Is Nothing Then
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion As Collection = DatosDiccionario.Value
+
+
+
+
+
+
+                    If Tabla = "REP0" Then
+                        sql = "INSERT INTO " + Tabla + "(
+           [CodInv]
+            ,[codigo]
+            ,[Nombre]
+            ,[FCompra]
+            ,[ValTrans]
+            ,[Dias]
+            ,[FVenc]
+            ,[Rend]
+            ,[CostoTransfr]
+            ,[ComisionCasa]
+            ,[ComisionBolsa]
+            ,[Casa]
+            ,[IOF]
+            ,[Renta]
+            ,[Base]
+            ,[ComisionCasaValor]
+            ,[ComisionBolsaValor]
+            ,[IOFValor]
+            ,[OtrosCostos]
+            ,[TotalCostos]
+            ,[MontoLiq]
+            ,[IntGenerar]
+            ,[RendAntImp]
+            ,[RendDesImp]
+            ,[ImpLiq]
+            ,[IngrNet]
+            ,[ValorNet]
+            ,[EstadoIOF]
+            ,[EstadoRenta]
+            
+
+) VALUES(
+           @CodInv
+            ,@codigo
+            ,@Nombre
+            ,@FCompra
+            ,@ValTrans
+            ,@Dias
+            ,@FVenc
+            ,@Rend
+            ,@CostoTransfr
+            ,@ComisionCasa
+            ,@ComisionBolsa
+            ,@Casa
+            ,@IOF
+            ,@Renta
+            ,@Base
+            ,@ComisionCasaValor
+            ,@ComisionBolsaValor
+            ,@IOFValor
+            ,@OtrosCostos
+            ,@TotalCostos
+            ,@MontoLiq
+            ,@IntGenerar
+            ,@RendAntImp
+            ,@RendDesImp
+            ,@ImpLiq
+            ,@IngrNet
+            ,@ValorNet
+            ,@EstadoIOF
+            ,@EstadoRenta
+     
+)
+    "
+                    Else
+
+                        sql = "INSERT INTO " + Tabla + "(
+           [CodInv]
+            ,[codigo]
+            ,[Nombre]
+            ,[FCompra]
+            ,[ValTrans]
+            ,[Dias]
+            ,[FVenc]
+            ,[Rend]
+            ,[CostoTransfr]
+            ,[ComisionCasa]
+            ,[ComisionBolsa]
+            ,[Casa]
+            ,[IOF]
+            ,[Renta]
+            ,[Base]
+            ,[ComisionCasaValor]
+            ,[ComisionBolsaValor]
+            ,[IOFValor]
+            ,[OtrosCostos]
+            ,[TotalCostos]
+            ,[MontoLiq]
+            ,[IntGenerar]
+            ,[RendAntImp]
+            ,[RendDesImp]
+            ,[ImpLiq]
+            ,[IngrNet]
+            ,[ValorNet]
+            ,[EstadoIOF]
+            ,[EstadoRenta]
+         
+
+) VALUES(
+           @CodInv
+            ,@codigo
+            ,@Nombre
+            ,@FCompra
+            ,@ValTrans
+            ,@Dias
+            ,@FVenc
+            ,@Rend
+            ,@CostoTransfr
+            ,@ComisionCasa
+            ,@ComisionBolsa
+            ,@Casa
+            ,@IOF
+            ,@Renta
+            ,@Base
+            ,@ComisionCasaValor
+            ,@ComisionBolsaValor
+            ,@IOFValor
+            ,@OtrosCostos
+            ,@TotalCostos
+            ,@MontoLiq
+            ,@IntGenerar
+            ,@RendAntImp
+            ,@RendDesImp
+            ,@ImpLiq
+            ,@IngrNet
+            ,@ValorNet
+            ,@EstadoIOF
+            ,@EstadoRenta
+          
+)
+    "
+
+
+                    End If
+
+
+
+
+
+
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+
+
+
+                    With cmd.Parameters
+                    .Add("@CodInv", SqlDbType.VarChar).Value = Codigo.ToString
+                    .Add("@Nombre", SqlDbType.VarChar).Value = Coleccion(1).ToString
+                    .Add("@FCompra", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(2).ToString)
+                    .Add("@ValTrans", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(3).ToString)
+                    .Add("@Dias", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(4).ToString)
+                    .Add("@FVenc", SqlDbType.Date).Value = Operaciones.ConvertirFecha(Coleccion(5).ToString)
+                    .Add("@Rend", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(6).ToString)
+                    .Add("@CostoTransfr", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(7).ToString)
+                    .Add("@codigo", SqlDbType.VarChar).Value = Coleccion(8).ToString
+                    .Add("@ComisionCasa", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion(9).ToString)
+                    .Add("@ComisionBolsa", SqlDbType.Decimal).Value = Operaciones.ConvertirDecimal(Coleccion(10).ToString)
+                    .Add("@Casa", SqlDbType.VarChar).Value = Coleccion(11).ToString
+                    .Add("@IOF", SqlDbType.Bit).Value = CByte(Coleccion(12))
+                    .Add("@Renta", SqlDbType.Bit).Value = CByte(Coleccion(13))
+                    .Add("@Base", SqlDbType.Int).Value = DBNull.Value
+                    .Add("@ComisionCasaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(14).ToString)
+                    .Add("@ComisionBolsaValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(15).ToString)
+                    .Add("@IOFValor", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(16).ToString)
+                    .Add("@OtrosCostos", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(17).ToString)
+                    .Add("@TotalCostos", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(18).ToString)
+                    .Add("@MontoLiq", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(19).ToString)
+                    .Add("@IntGenerar", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(20).ToString)
+                    .Add("@RendAntImp", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(21).ToString)
+                    .Add("@RendDesImp", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(22).ToString)
+                    .Add("@ImpLiq", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(23).ToString)
+                    .Add("@IngrNet", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(24).ToString)
+                    .Add("@ValorNet", SqlDbType.Float).Value = Operaciones.ConvertirDecimal(Coleccion(25).ToString)
+                    .Add("@EstadoIOF", SqlDbType.Bit).Value = CByte(Coleccion(27))
+                    .Add("@EstadoRenta", SqlDbType.Bit).Value = CByte(Coleccion(28))
+
+
+
+                    End With
+
+
+
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+        myTrans.Rollback()
+        MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function CargarReporto(ByVal codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from " + Tabla + " where CodInv='" + codigo + "' order by codigo"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+
+        dr = cmd.ExecuteReader
+
+        If (Not dr.HasRows) Then
+            cn.Close()
+            Return Nothing
+        End If
+
+
+        Return dr
+
+    End Function
+
+
+
+
+
+
+
+
+
+    Public Sub Eliminar(ByVal Codigo As String, ByVal clave As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (String.IsNullOrEmpty(clave)) Then
+            sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv AND codigo is null"
+
+        Else
+            sql = "DELETE FROM " + Tabla + "
+      WHERE [CodInv]=@CodInv AND codigo=@codigo"
+
+        End If
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@codigo", SqlDbType.VarChar).Value = clave
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+
+    Public Function Nuevo(ByVal oReporto As ReportosCE, DocId As Integer, Tipo As String) As Integer
+        Dim objCon As New Conexion
+        Dim retorno As Integer = -1
+        Dim Transaccion As SqlTransaction
+        Dim query As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim Tabla As String = ""
+
+
+        If Tipo = "P" Then
+            Tabla = "PREP"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IREP"
+        End If
+
+        Dim cmd As SqlCommand = cn.CreateCommand
+
+        Transaccion = cn.BeginTransaction("NuevoLete")
+        cmd.Connection = cn
+        cmd.Transaction = Transaccion
+
+        query = "INSERT INTO [dbo].[PREP]
+           ([DocId]
+           ,[CodInv]           
+           ,[ValTrans]
+           ,[Dias]
+           ,[FVenc]
+           ,[Rend]
+           ,[OtrosCostos]
+           ,[TotCostos]
+           ,[MontoLiq]
+           ,[InterGen]
+           ,[CostoTransfr]
+           ,[RendNetoAntImp]
+           ,[ValReCompra]
+           ,[ImpLiquidacion]
+           ,[IngrNeto]
+           ,[ValNeto]
+           ,[RendNetoDespImp])
+     VALUES
+           (@DocId
+           ,@CodInv
+           ,@ValTrans
+           ,@Dias
+           ,@FVenc
+           ,@Rend
+           ,@OtrosCostos
+           ,@TotCostos
+           ,@MontoLiq
+           ,@InterGen
+           ,@CostoTransfr
+           ,@RendNetoAntImp
+           ,@ValReCompra
+           ,@ImpLiquidacion
+           ,@IngrNeto
+           ,@ValNeto
+           ,@RendNetoDespImp
+		   )"
+
+
+        cmd.CommandText = query
+
+        With cmd.Parameters
+            .Add("@DocId", SqlDbType.Int).Value = DocId
+            .Add("@CodInv", SqlDbType.VarChar).Value = oReporto.ValorTransado
+            .Add("@ValTrans", SqlDbType.Decimal).Value = oReporto.ValorTransado
+            .Add("@Dias", SqlDbType.Int).Value = oReporto.Dias
+            .Add("@FVenc", SqlDbType.DateTime).Value = oReporto.FechaVencimiento
+            .Add("@Rend", SqlDbType.Decimal).Value = oReporto.Rendimiento
+            .Add("@OtrosCostos", SqlDbType.Decimal).Value = oReporto.OtrosCostos
+            .Add("@TotCostos", SqlDbType.Decimal).Value = oReporto.TotalCostos
+            .Add("@MontoLiq", SqlDbType.Decimal).Value = oReporto.MontoALiquidar
+            .Add("@InterGen", SqlDbType.Decimal).Value = oReporto.InteresAGenerar
+            .Add("@CostoTransfr", SqlDbType.Decimal).Value = oReporto.CostoDeTransferencia
+            .Add("@RendNetoAntImp", SqlDbType.Decimal).Value = oReporto.RendimientoNetoAntesDeImpuestos
+            .Add("@ValReCompra", SqlDbType.Decimal).Value = oReporto.ValorReCompra
+            .Add("@ImpLiquidacion", SqlDbType.Decimal).Value = oReporto.ImpuestosLiquidacion
+            .Add("@IngrNeto", SqlDbType.Decimal).Value = oReporto.IngresoNeto
+            .Add("@ValNeto", SqlDbType.Decimal).Value = oReporto.ValorNeto
+            .Add("@RendNetoDespImp", SqlDbType.Decimal).Value = oReporto.RendimientoNetoDespuesDeImpuestos
+        End With
+
+        Try
+            cmd.ExecuteNonQuery()
+            Transaccion.Commit()
+            retorno = 0
+        Catch ex As Exception
+            MsgBox("Error al Guardar Reporto : " & ex.GetType.ToString)
+            MsgBox("Mensaje: " & ex.Message)
+            retorno = 1
+            Try
+                Transaccion.Rollback()
+                retorno = 2
+            Catch ex2 As Exception
+                MsgBox("Error en Rollback: " & ex2.GetType.ToString)
+                MsgBox("Mensaje Rollbak: " & ex2.Message)
+                retorno = 3
+            End Try
+        End Try
+
+        cmd.Dispose()
+        cn.Dispose()
+        Return retorno
+    End Function
+
+    Public Sub CargarRegistro(ByVal oReportos As ReportosCE, Tipo As String, IdRegistro As Integer)
+        Dim objCon As New Conexion
+        Dim drd As SqlDataReader
+        Dim cmd As SqlCommand
+        Dim sql As String
+        Dim Tabla As String
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If Tipo = "P" Then
+            Tabla = "PREP"
+        End If
+        If Tipo = "I" Then
+            Tabla = "IREP"
+        End If
+
+        sql = "SELECT * FROM [dbo].[" & Tabla & "] T0 WHERE T0.[DocId]=@DocId"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@DocId", SqlDbType.Int).Value = IdRegistro
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oReportos.CodigoCasa = drd.Item("CodCasa")
+                oReportos.Nombre = drd.Item("Nombre")
+                oReportos.FechaDeCompra = drd.Item("FCompra")
+                oReportos.ValorTransado = drd.Item("ValTrans")
+                oReportos.Dias = drd.Item("Dias")
+                oReportos.FechaVencimiento = drd.Item("FVenc")
+                oReportos.Rendimiento = drd.Item("Rend")
+                oReportos.Impuestos = drd.Item("Impuestos")
+                oReportos.OtrosCostos = drd.Item("OtrosCostos")
+                'oReportos.TotalCostos = drd.Item("TotCostos")
+                oReportos.MontoALiquidar = drd.Item("MontoLiq")
+                'oReportos.InteresAGenerar = drd.Item("InterGen")
+                oReportos.CostoDeTransferencia = drd.Item("CostoTransfr")
+                'oReportos.RendimientoNetoAntesDeImpuestos = drd.Item("RendNetoAntImp")
+                oReportos.ValorReCompra = drd.Item("ValReCompra")
+                oReportos.ImpuestosLiquidacion = drd.Item("ImpLiquidacion")
+                'oReportos.IngresoNeto = drd.Item("IngrNeto")
+                oReportos.ValorNeto = drd.Item("ValNeto")
+                'oReportos.RendimientoNetoDespuesDeImpuestos = drd.Item("RendNetoDespImp")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+
+    End Sub
+
+    Public Function CargarRegistro(ByVal vCodigoInversion As String) As ReportosCE
+        Dim objCon As New Conexion
+        Dim oReportosCE As ReportosCE
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim drd As SqlDataReader
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        oReportosCE = New ReportosCE
+        sql = "SELECT * FROM [dbo].[REP0] T0 WHERE T0.[CodInv]=@CodInv"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = vCodigoInversion
+        cmd.Connection = cn
+
+        drd = cmd.ExecuteReader
+        If drd.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+            If drd.Read Then
+                oReportosCE.CodigoInversion = vCodigoInversion
+                oReportosCE.Nombre = drd.Item("Nombre")
+                oReportosCE.FechaDeCompra = drd.Item("FCompra")
+                oReportosCE.ValorTransado = drd.Item("ValTrans")
+                oReportosCE.Dias = drd.Item("Dias")
+                oReportosCE.FechaVencimiento = drd.Item("FVenc")
+                oReportosCE.Rendimiento = drd.Item("Rend")
+            End If
+        Else
+            'NO SE ENCONTRO EL REGISTRO
+        End If
+
+        drd.Close()
+        cmd.Dispose()
+        cn.Dispose()
+
+        Return oReportosCE
+    End Function
+
+
+    Public Function Nuevo(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        If Tabla = "REP0" Then
+            sql = "INSERT INTO " + Tabla + "(
+           [CodInv]
+            ,[codigo]
+            ,[Nombre]
+            ,[FCompra]
+            ,[ValTrans]
+            ,[Dias]
+            ,[FVenc]
+            ,[Rend]
+            ,[CostoTransfr]
+            ,[ComisionCasa]
+            ,[ComisionBolsa]
+            ,[Casa]
+            ,[IOF]
+            ,[Renta]
+            ,[Base]
+            ,[ComisionCasaValor]
+            ,[ComisionBolsaValor]
+            ,[IOFValor]
+            ,[OtrosCostos]
+            ,[TotalCostos]
+            ,[MontoLiq]
+            ,[IntGenerar]
+            ,[RendAntImp]
+            ,[RendDesImp]
+            ,[ImpLiq]
+            ,[IngrNet]
+            ,[ValorNet]
+            ,[EstadoIOF]
+            ,[EstadoRenta]
+
+) VALUES(
+           @CodInv
+            ,@codigo
+            ,@Nombre
+            ,@FCompra
+            ,@ValTrans
+            ,@Dias
+            ,@FVenc
+            ,@Rend
+            ,@CostoTransfr
+            ,@ComisionCasa
+            ,@ComisionBolsa
+            ,@Casa
+            ,@IOF
+            ,@Renta
+            ,@Base
+            ,@ComisionCasaValor
+            ,@ComisionBolsaValor
+            ,@IOFValor
+            ,@OtrosCostos
+            ,@TotalCostos
+            ,@MontoLiq
+            ,@IntGenerar
+            ,@RendAntImp
+            ,@RendDesImp
+            ,@ImpLiq
+            ,@IngrNet
+            ,@ValorNet
+            ,@EstadoIOF
+            ,@EstadoRenta
+)
+    "
+
+        Else
+
+
+            sql = "INSERT INTO " + Tabla + "(
+           [CodInv]
+            ,[codigo]
+            ,[Nombre]
+            ,[FCompra]
+            ,[ValTrans]
+            ,[Dias]
+            ,[FVenc]
+            ,[Rend]
+            ,[CostoTransfr]
+            ,[ComisionCasa]
+            ,[ComisionBolsa]
+            ,[Casa]
+            ,[IOF]
+            ,[Renta]
+            ,[Base]
+            ,[ComisionCasaValor]
+            ,[ComisionBolsaValor]
+            ,[IOFValor]
+            ,[OtrosCostos]
+            ,[TotalCostos]
+            ,[MontoLiq]
+            ,[IntGenerar]
+            ,[RendAntImp]
+            ,[RendDesImp]
+            ,[ImpLiq]
+            ,[IngrNet]
+            ,[ValorNet]
+            ,[EstadoIOF]
+            ,[EstadoRenta]
+         
+
+) VALUES(
+           @CodInv
+            ,@codigo
+            ,@Nombre
+            ,@FCompra
+            ,@ValTrans
+            ,@Dias
+            ,@FVenc
+            ,@Rend
+            ,@CostoTransfr
+            ,@ComisionCasa
+            ,@ComisionBolsa
+            ,@Casa
+            ,@IOF
+            ,@Renta
+            ,@Base
+            ,@ComisionCasaValor
+            ,@ComisionBolsaValor
+            ,@IOFValor
+            ,@OtrosCostos
+            ,@TotalCostos
+            ,@MontoLiq
+            ,@IntGenerar
+            ,@RendAntImp
+            ,@RendDesImp
+            ,@ImpLiq
+            ,@IngrNet
+            ,@ValorNet
+            ,@EstadoIOF
+            ,@EstadoRenta
+        
+
+)
+    "
+        End If
+
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+
+
+
+
+        With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                        .Add("@Nombre", SqlDbType.VarChar).Value = Coleccion(1)
+                        .Add("@FCompra", SqlDbType.DateTime).Value = Coleccion(2)
+                        .Add("@ValTrans", SqlDbType.Float).Value = Coleccion(3)
+                        .Add("@Dias", SqlDbType.Float).Value = Coleccion(4)
+                        .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(5)
+                        .Add("@Rend", SqlDbType.Float).Value = Coleccion(6)
+                        .Add("@CostoTransfr", SqlDbType.Float).Value = Coleccion(7)
+                        .Add("@codigo", SqlDbType.VarChar).Value = Coleccion(8)
+                        .Add("@ComisionCasa", SqlDbType.Decimal).Value = Coleccion(9)
+                        .Add("@ComisionBolsa", SqlDbType.Decimal).Value = Coleccion(10)
+                        .Add("@Casa", SqlDbType.VarChar).Value = Coleccion(11)
+                        .Add("@IOF", SqlDbType.Bit).Value = CByte(Coleccion(12))
+            .Add("@Renta", SqlDbType.Bit).Value = CByte(Coleccion(13))
+            .Add("@Base", SqlDbType.Int).Value = DBNull.Value
+            .Add("@ComisionCasaValor", SqlDbType.Float).Value = Coleccion(14)
+                .Add("@ComisionBolsaValor", SqlDbType.Float).Value = Coleccion(15)
+                .Add("@IOFValor", SqlDbType.Float).Value = Coleccion(16)
+                .Add("@OtrosCostos", SqlDbType.Float).Value = Coleccion(17)
+                .Add("@TotalCostos", SqlDbType.Float).Value = Coleccion(18)
+                .Add("@MontoLiq", SqlDbType.Float).Value = Coleccion(19)
+                .Add("@IntGenerar", SqlDbType.Float).Value = Coleccion(20)
+                .Add("@RendAntImp", SqlDbType.Float).Value = Coleccion(21)
+                .Add("@RendDesImp", SqlDbType.Float).Value = Coleccion(22)
+                .Add("@ImpLiq", SqlDbType.Float).Value = Coleccion(23)
+                .Add("@IngrNet", SqlDbType.Float).Value = Coleccion(24)
+            .Add("@ValorNet", SqlDbType.Float).Value = Coleccion(25)
+            .Add("@EstadoIOF", SqlDbType.Float).Value = Coleccion(24)
+            .Add("@EstadoRenta", SqlDbType.Float).Value = Coleccion(25)
+
+
+        End With
+
+
+
+
+        cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+    Public Function Modificar(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Tabla As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        If Tabla = "REP0" Then
+
+            sql = "UPDATE " + Tabla + " SET
+            [codigo]=@codigo
+            ,[Nombre]=@Nombre
+            ,[FCompra]=@FCompra
+            ,[ValTrans]=@ValTrans
+            ,[Dias]=@Dias
+            ,[FVenc]=@FVenc
+            ,[Rend]=@Rend
+            ,[CostoTransfr]=@CostoTransfr
+            ,[ComisionCasa]=@ComisionCasa
+            ,[ComisionBolsa]=@ComisionBolsa
+            ,[Casa]=@Casa
+            ,[IOF]=@IOF
+            ,[Renta]=@Renta
+            ,[Base]=@Base
+
+
+         ,[ComisionCasaValor]=@ComisionCasaValor
+            ,[ComisionBolsaValor]=@ComisionBolsaValor
+            ,[IOFValor]=@IOFValor
+            ,[OtrosCostos]=@OtrosCostos
+            ,[TotalCostos]=@TotalCostos
+            ,[MontoLiq]=@MontoLiq
+            ,[IntGenerar]=@IntGenerar
+            ,[RendAntImp]=@RendAntImp
+            ,[RendDesImp]=@RendDesImp
+            ,[ImpLiq]=@ImpLiq
+            ,[IngrNet]=@IngrNet
+            ,[ValorNet]=@ValorNet
+
+
+
+
+            where  [CodInv]=@CodInv AND ([codigo]=@codigo OR codigo is null)
+    "
+        Else
+
+            sql = "UPDATE " + Tabla + " SET
+   
+            [Monto]=@Monto
+            ,[FVenc]=@FVenc
+            ,[CostoFinanciero]=@CostoFinanciero
+            ,[Interes]=@Interes
+            ,[Bolsa]=@Bolsa
+            ,[TotPagar]=@TotPagar
+            ,[Nombre]=@Nombre
+            ,[FCompra]=@FCompra
+            ,[ComisionCasa]=@ComisionCasa
+            ,[ComisionBolsa]=@ComisionBolsa
+            ,[Casa]=@Casa
+            ,[Casa2]=@Casa2
+            ,[Dias]=@Dias
+            ,[Base]=@Base
+   where  [CodInv]=@CodInv AND ([codigo]=@codigo OR codigo is null)
+
+
+    "
+
+        End If
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        'Try
+
+        If Tabla = "REP0" Then
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@Nombre", SqlDbType.VarChar).Value = Coleccion(1)
+                .Add("@FCompra", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@ValTrans", SqlDbType.Float).Value = Coleccion(3)
+                .Add("@Dias", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@FVenc", SqlDbType.DateTime).Value = Coleccion(5)
+                .Add("@Rend", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@CostoTransfr", SqlDbType.Float).Value = Coleccion(7)
+                .Add("@codigo", SqlDbType.VarChar).Value = Coleccion(8)
+                .Add("@ComisionCasa", SqlDbType.Decimal).Value = Coleccion(9)
+                .Add("@ComisionBolsa", SqlDbType.Decimal).Value = Coleccion(10)
+                .Add("@Casa", SqlDbType.VarChar).Value = Coleccion(11)
+                .Add("@IOF", SqlDbType.Bit).Value = CByte(Coleccion(12))
+                .Add("@Renta", SqlDbType.Bit).Value = CByte(Coleccion(13))
+
+                If Coleccion(14) Is DBNull.Value Then
+                    '.Add("@Base", SqlDbType.Int).Value = 0
+                Else
+                    If String.IsNullOrEmpty(Coleccion(14)) Then
+                        '.Add("@Base", SqlDbType.Int).Value = 0
+                    Else
+                        '.Add("@Base", SqlDbType.Int).Value = Coleccion(14)
+                    End If
+
+                End If
+
+                .Add("@Base", SqlDbType.Int).Value = DBNull.Value
+
+
+                .Add("@ComisionCasaValor", SqlDbType.Float).Value = Coleccion(14)
+                .Add("@ComisionBolsaValor", SqlDbType.Float).Value = Coleccion(15)
+                .Add("@IOFValor", SqlDbType.Float).Value = Coleccion(16)
+                .Add("@OtrosCostos", SqlDbType.Float).Value = Coleccion(17)
+                .Add("@TotalCostos", SqlDbType.Float).Value = Coleccion(18)
+                .Add("@MontoLiq", SqlDbType.Float).Value = Coleccion(19)
+                .Add("@IntGenerar", SqlDbType.Float).Value = Coleccion(20)
+                .Add("@RendAntImp", SqlDbType.Float).Value = Coleccion(21)
+                .Add("@RendDesImp", SqlDbType.Float).Value = Coleccion(22)
+                .Add("@ImpLiq", SqlDbType.Float).Value = Coleccion(23)
+                .Add("@IngrNet", SqlDbType.Float).Value = Coleccion(24)
+                .Add("@ValorNet", SqlDbType.Float).Value = Coleccion(25)
+            End With
+
+        Else
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@Monto", SqlDbType.Float).Value = Coleccion(1)
+                .Add("@FVenc", SqlDbType.Date).Value = Coleccion(2)
+                .Add("@CostoFinanciero", SqlDbType.Float).Value = Coleccion(3)
+                .Add("@Interes", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@Bolsa", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@TotPagar", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@Nombre", SqlDbType.VarChar).Value = Coleccion(7)
+                .Add("@FCompra", SqlDbType.Date).Value = Coleccion(8)
+                .Add("@ComisionCasa", SqlDbType.Decimal).Value = Coleccion(9)
+                .Add("@ComisionBolsa", SqlDbType.Decimal).Value = Coleccion(10)
+                .Add("@Casa", SqlDbType.Float).Value = Coleccion(11)
+                .Add("@Casa2", SqlDbType.VarChar).Value = Coleccion(12)
+                .Add("@Dias", SqlDbType.Int).Value = Coleccion(13)
+                .Add("@codigo", SqlDbType.Int).Value = Coleccion(14)
+                If Coleccion(15) Is DBNull.Value Then
+                    '.Add("@Base", SqlDbType.Int).Value = 0
+                Else
+                    If String.IsNullOrEmpty(Coleccion(15)) Then
+                        '.Add("@Base", SqlDbType.Int).Value = 0
+                    Else
+                        '.Add("@Base", SqlDbType.Int).Value = Coleccion(15)
+                    End If
+
+                End If
+                .Add("@Base", SqlDbType.Int).Value = DBNull.Value
+
+            End With
+        End If
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        'Catch ex As Exception
+        '    MsgBox("Error al Modificar los registros")
+        '    Return Nothing
+        'End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+    Public Function TraerImpuesto(ByVal Codigo As String, ByVal codigoElemento As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        If (Not String.IsNullOrEmpty(Codigo)) Then
+
+
+            Dim sql As String
+            Dim cmd As SqlCommand
+            Dim Impuesto As String
+
+            sql = "SELECT * FROM REP0 WHERE CodInv=@Codigo and [codigo]=@codigoElemento"
+
+
+            cmd = New SqlCommand
+
+
+            cmd.CommandText = sql
+            cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+            cmd.Parameters.Add("@codigoElemento", SqlDbType.VarChar).Value = codigoElemento
+            cmd.Connection = cn
+
+            ' Dim Datos = cmd.ExecuteScalar
+            Dim Datos = cmd.ExecuteReader
+            cn.Close()
+            If Datos.HasRows Then
+                'SE ENCONTRO EL REGISTRO
+
+                Try
+
+
+                    If Datos.Read Then
+                        Impuesto = Datos.Item("Impuestos")
+                        Return Impuesto
+
+                    Else
+                        Return 0
+                    End If
+
+                Catch ex As Exception
+                    Return 0
+                End Try
+
+            Else
+                Return 0
+            End If
+        Else
+            Return 0
+        End If
+    End Function
+
+    Public Function AgregarImpuesto(ByVal CodigoInv As String, ByVal CodigoElemento As String, ByVal Impues As String, ByVal Flag As Integer)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim Impuestos As String = TraerImpuesto(CodigoInv, CodigoElemento)
+        If (String.IsNullOrEmpty(Impuestos) Or Impuestos = "0") Then
+            Impuestos = Impues
+        Else
+            If (Flag = 0) Then
+
+
+                If InStr(1, Impuestos, Impues) = 0 Then
+
+                    Impuestos = Impuestos.ToString + "-" + Impues.ToString
+                End If
+            Else
+                If Not InStr(1, Impuestos, Impues) = 0 Then
+
+                    Dim QuitarImpuesto = Impuestos.Split("-")
+                    Impuestos = String.Empty
+                    For Each i In QuitarImpuesto
+
+                        If (Not i = Impues) Then
+                            If (String.IsNullOrEmpty(Impuestos)) Then
+                                Impuestos = i
+                            Else
+                                Impuestos = Impuestos + "-" + i
+                            End If
+                        End If
+                    Next
+
+
+
+                End If
+
+            End If
+        End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        sql = "UPDATE [dbo].[REP0] SET
+           
+           [Impuestos]=@Impuestos
+           where [CodInv]=@CodInv and [codigo]=@codigo
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = CodigoInv
+            .Add("@codigo", SqlDbType.VarChar).Value = CodigoElemento
+            .Add("@Impuestos", SqlDbType.VarChar).Value = Impuestos
+        End With
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+    Public Function FiltroReportoVenta(ByRef FechaVenOperacion1 As String, ByRef FechaVenOperacion2 As String, ByRef Estado As String, ByRef Empresa As String, ByRef CasaCorredora As String) As DataSet
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SP_CargarReportoVentas"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@FechaOperacion1", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(FechaVenOperacion1)
+        cmd.Parameters.Add("@FechaOperacion2", SqlDbType.Date).Value = Operaciones.ConvertirFechaBaseDatos(FechaVenOperacion2)
+        cmd.Parameters.Add("@Empresa", SqlDbType.VarChar).Value = Empresa
+        cmd.Parameters.Add("@CasaCorredora", SqlDbType.VarChar).Value = CasaCorredora
+        cmd.Parameters.Add("@Estado", SqlDbType.VarChar).Value = Estado
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds
+    End Function
+
+
+    Public Function FiltroReportoCostos() As DataSet
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SP_CargarReportoCostos"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds
+    End Function
+
+    Public Function ReportoVentaFondo(ByRef Vigente As String, ByRef Vencido As String) As DataTable
+        Dim objCon As New Conexion
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "SP_CargarReportoVentaFondo"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@Vigente", SqlDbType.VarChar).Value = Vigente
+        cmd.Parameters.Add("@Vencido", SqlDbType.VarChar).Value = Vencido
+
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        cn.Close()
+        Return ds.Tables(0)
+    End Function
+End Class

+ 195 - 0
DAO/RequisicionDePagoDAO.vb

@@ -0,0 +1,195 @@
+Module RequisicionDePagoDAO
+    Dim Operaciones As New Operaciones
+    Public Function ExisteRequisicion(ByVal pCodigoInversion As String) As Boolean
+        Dim retorno As Boolean = False
+        Dim resultado As Integer
+        Dim query As String
+        Dim cmd As SqlClient.SqlCommand
+        Dim cn As SqlClient.SqlConnection
+        Dim oConexion = New Conexion
+
+        If String.IsNullOrEmpty(pCodigoInversion) Then
+            GoTo Salida
+        End If
+
+        query = "SELECT COUNT('A') FROM [dbo].[RPAG] T0 WHERE T0.[CodInv]=@CodInv"
+        cmd = New SqlClient.SqlCommand
+        cmd.CommandText = query
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = pCodigoInversion
+
+        cn = oConexion.Conectar
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        resultado = cmd.ExecuteScalar
+        If resultado = 1 Then retorno = True
+Salida:
+        Return retorno
+    End Function
+    Public Function CargarRegistro(ByVal pCodigoInversion As String) As RequisicionDePagoCE
+        Dim oRequisicionDePagoCE As New RequisicionDePagoCE
+        Dim cn As SqlClient.SqlConnection
+        Dim cmd As SqlClient.SqlCommand
+        Dim query As String
+        Dim dr As SqlClient.SqlDataReader
+        Dim oConexion As New Conexion
+
+        If ExisteRequisicion(pCodigoInversion) Then
+            oRequisicionDePagoCE = New RequisicionDePagoCE
+            query = "SELECT * FROM [dbo].[RPAG] T0  WHERE T0.[CodInv]=@CodInv"
+            cmd = New SqlClient.SqlCommand
+            cmd.CommandText = query
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = pCodigoInversion
+
+            cn = oConexion.Conectar
+            If Not cn.State = ConnectionState.Open Then
+                cn.Open()
+            End If
+
+            cmd.Connection = cn
+            dr = cmd.ExecuteReader
+
+            If dr.HasRows Then
+                While dr.Read
+                    oRequisicionDePagoCE.CodigoInversion = dr.Item("CodInv").ToString
+                    oRequisicionDePagoCE.CodigoReq = dr.Item("CodReq").ToString
+                    oRequisicionDePagoCE.UsuarioSolicitante = dr.Item("UCodigo").ToString
+                    oRequisicionDePagoCE.AFavorDe = dr.Item("AFavorDe").ToString
+                    oRequisicionDePagoCE.FormaDePago = dr.Item("FormaPagID").ToString
+                    oRequisicionDePagoCE.MontoDelPago = dr.Item("MontoPago").ToString
+                    oRequisicionDePagoCE.FechaDelPago = dr.Item("FechaPago").ToString
+                    oRequisicionDePagoCE.CodigoBanco = dr.Item("CodBanco")
+                    oRequisicionDePagoCE.NumeroCuenta = dr.Item("NumCuenta").ToString
+                    oRequisicionDePagoCE.Concepto = dr.Item("Concepto").ToString
+                    oRequisicionDePagoCE.SaldoContable = dr.Item("SaldoContable").ToString
+                End While
+            End If
+        End If
+
+
+        If String.IsNullOrEmpty(pCodigoInversion) Then
+            GoTo Salida
+        End If
+Salida:
+        Return oRequisicionDePagoCE
+    End Function
+
+    Public Function GuardarNuevaRequisicion(ByVal pRequisicionDePagoCE As RequisicionDePagoCE, ByVal TipoOperacion As String) As Integer
+        Dim query As String
+        Dim cmd As SqlClient.SqlCommand
+        Dim cn As SqlClient.SqlConnection
+        Dim oConexion As New Conexion
+        Dim retorno As Integer
+
+
+
+        If TipoOperacion = "N" Then
+            query = "INSERT INTO [dbo].[RPAG]
+	([UCodigo]
+	,[CodInv]
+    ,[CodReq]
+	,[AFavorDe]
+	,[FormaPagID]
+	,[MontoPago]
+	,[FechaPago]
+	,[CodBanco]
+	,[NumCuenta]
+	,[SaldoContable]
+	,[Concepto])
+VALUES
+	(@UCodigo
+	,@CodInv
+    ,@CodReq
+	,@AFavorDe
+	,@FormaPagID
+	,@MontoPago
+	,@FechaPago
+	,@CodBanco
+	,@NumCuenta
+	,@SaldoContable
+	,@Concepto
+)"
+
+        Else
+
+
+            query = "UPDATE [dbo].[RPAG] SET
+	[UCodigo]=	@UCodigo
+    ,[CodReq]=	@CodReq
+	,[AFavorDe]=@AFavorDe
+	,[FormaPagID]=@FormaPagID
+	,[MontoPago]=@MontoPago
+	,[FechaPago]=@FechaPago
+	,[CodBanco]=@CodBanco
+	,[NumCuenta]=@NumCuenta
+	,[SaldoContable]=@SaldoContable
+	,[Concepto]=@Concepto
+    WHERE [CodInv]=@CodInv
+"
+        End If
+
+        cmd = New SqlClient.SqlCommand
+        cmd.CommandText = query
+        cmd.Parameters.Add("@UCodigo", SqlDbType.VarChar).Value = pRequisicionDePagoCE.UsuarioSolicitante
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = pRequisicionDePagoCE.CodigoInversion
+        cmd.Parameters.Add("@AFavorDe", SqlDbType.VarChar).Value = pRequisicionDePagoCE.AFavorDe
+        cmd.Parameters.Add("@FormaPagID", SqlDbType.VarChar).Value = pRequisicionDePagoCE.FormaDePago
+        cmd.Parameters.Add("@MontoPago", SqlDbType.Float).Value = pRequisicionDePagoCE.MontoDelPago
+        cmd.Parameters.Add("@FechaPago", SqlDbType.DateTime).Value = pRequisicionDePagoCE.FechaDelPago
+        cmd.Parameters.Add("@CodBanco", SqlDbType.VarChar).Value = pRequisicionDePagoCE.CodigoBanco
+        cmd.Parameters.Add("@NumCuenta", SqlDbType.VarChar).Value = pRequisicionDePagoCE.NumeroCuenta
+        cmd.Parameters.Add("@SaldoContable", SqlDbType.Float).Value = pRequisicionDePagoCE.SaldoContable
+        cmd.Parameters.Add("@Concepto", SqlDbType.VarChar).Value = pRequisicionDePagoCE.Concepto
+        cmd.Parameters.Add("@CodReq", SqlDbType.VarChar).Value = pRequisicionDePagoCE.CodigoReq
+        cn = oConexion.Conectar
+        If Not cn.State = ConnectionState.Open Then
+            cn.Open()
+        End If
+
+        cmd.Connection = cn
+        retorno = cmd.ExecuteNonQuery
+
+
+
+Salida:
+        Return retorno
+    End Function
+
+
+    Function NuevoCodigo()
+        Dim objCon As New Conexion
+        Dim valor As String = String.Empty
+        Dim cn As SqlClient.SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_CodigoNuevoReq]"
+        Dim cmd As New SqlClient.SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        valor = cmd.ExecuteScalar
+        cmd.Dispose()
+        cn.Dispose()
+        Return valor
+    End Function
+
+
+
+    Function Monto(ByVal CodigoInversion As String)
+        Dim objCon As New Conexion
+        Dim valor As Double = 0
+        Dim cn As SqlClient.SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_MontoTituloUnico]"
+        Dim cmd As New SqlClient.SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@CodigoInversion", SqlDbType.VarChar).Value = CodigoInversion
+        valor = Operaciones.ConvertirDecimal(cmd.ExecuteScalar)
+        cmd.Dispose()
+        cn.Dispose()
+        Return valor
+    End Function
+End Module

+ 359 - 0
DAO/SeleccionTitulosReportosDAO.vb

@@ -0,0 +1,359 @@
+Imports System.Data.SqlClient
+
+Public Class SeleccionTitulosReportosDAO
+
+    Dim da As SqlDataAdapter
+    Dim Operaciones As New Operaciones
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            Dim PosicionCreacion As Integer = 0
+
+
+
+
+            For Each DicRegistros As Dictionary(Of String, Object) In Coleccion
+
+                PosicionCreacion += 1
+
+
+                Dim CodigoAsociado = Function()
+                                         If DicRegistros.ContainsKey("CodigoAsociado") Then
+                                             Return DicRegistros.Item("CodigoAsociado")
+                                         Else
+                                             Return String.Empty
+                                         End If
+                                     End Function
+
+
+
+
+                Dim NombreInstrumento = Function()
+                                            If DicRegistros.ContainsKey("NombreInstrumento") Then
+                                                Return DicRegistros.Item("NombreInstrumento")
+                                            Else
+                                                Return String.Empty
+                                            End If
+                                        End Function
+
+
+                Dim NombreEmpresa = Function()
+                                        If DicRegistros.ContainsKey("NombreEmpresa") Then
+                                            Return DicRegistros.Item("NombreEmpresa")
+                                        Else
+                                            Return String.Empty
+                                        End If
+                                    End Function
+
+
+
+                Dim TipoAsignacion = Function()
+                                         If DicRegistros.ContainsKey("TipoAsignacion") Then
+                                             Return DicRegistros.Item("TipoAsignacion")
+                                         Else
+                                             Return String.Empty
+                                         End If
+                                     End Function
+
+                Dim MontoInicial = Function()
+                                       If DicRegistros.ContainsKey("MontoInicial") Then
+                                           Return DicRegistros.Item("MontoInicial")
+                                       Else
+                                           Return 0
+                                       End If
+                                   End Function
+
+
+
+                Dim MontoTotalUsado = Function()
+                                          If DicRegistros.ContainsKey("MontoTotalUsado") Then
+                                              Return DicRegistros.Item("MontoTotalUsado")
+                                          Else
+                                              Return 0
+                                          End If
+                                      End Function
+
+
+
+
+                Dim PorcentajeRestante = Function()
+                                             If DicRegistros.ContainsKey("PorcentajeRestante") Then
+                                                 Return DicRegistros.Item("PorcentajeRestante")
+                                             Else
+                                                 Return 0
+                                             End If
+                                         End Function
+
+
+                Dim PorcentajeMontoUsado = Function()
+                                               If DicRegistros.ContainsKey("PorcentajeMontoUsado") Then
+                                                   Return DicRegistros.Item("PorcentajeMontoUsado")
+                                               Else
+                                                   Return 0
+                                               End If
+                                           End Function
+
+
+
+
+
+                Dim MontoDisponible = Function()
+                                          If DicRegistros.ContainsKey("MontoDisponible") Then
+                                              Return DicRegistros.Item("MontoDisponible")
+                                          Else
+                                              Return 0
+                                          End If
+                                      End Function
+
+
+                Dim MontoUsado = Function()
+                                     If DicRegistros.ContainsKey("MontoUsado") Then
+                                         Return DicRegistros.Item("MontoUsado")
+                                     Else
+                                         Return 0
+                                     End If
+                                 End Function
+
+
+
+
+
+                Dim MontoTitulo = Function()
+                                      If DicRegistros.ContainsKey("MontoTitulo") Then
+                                          Return DicRegistros.Item("MontoTitulo")
+                                      Else
+                                          Return 0
+                                      End If
+                                  End Function
+
+
+
+
+
+                Dim MontoNoUsado = Function()
+                                       If DicRegistros.ContainsKey("MontoNoUsado") Then
+                                           Return DicRegistros.Item("MontoNoUsado")
+                                       Else
+                                           Return 0
+                                       End If
+                                   End Function
+
+
+
+
+
+                Dim FechaCreado = Function()
+                                      If DicRegistros.ContainsKey("FechaCreado") Then
+                                          Return DicRegistros.Item("FechaCreado")
+                                      Else
+                                          Return Date.Now.Date
+                                      End If
+                                  End Function
+
+
+
+
+
+                Dim EstadoProceso = Function()
+                                        If DicRegistros.ContainsKey("EstadoProceso") Then
+                                            Return DicRegistros.Item("EstadoProceso")
+                                        Else
+                                            Return String.Empty
+                                        End If
+                                    End Function
+
+                Dim Asociado = Function()
+                                   If DicRegistros.ContainsKey("Asociado") Then
+                                       Return DicRegistros.Item("Asociado")
+                                   Else
+                                       Return "No"
+                                   End If
+                               End Function
+
+                Dim CodigoReporto = Function()
+                                        If DicRegistros.ContainsKey("CodigoReporto") Then
+                                            Return DicRegistros.Item("CodigoReporto")
+                                        Else
+                                            Return String.Empty
+                                        End If
+                                    End Function
+
+
+                Dim IdFlujo = Function()
+                                  If DicRegistros.ContainsKey("IdFlujo") Then
+                                      Return DicRegistros.Item("IdFlujo")
+                                  Else
+                                      Return 0
+                                  End If
+                              End Function
+
+
+
+                Dim ValorCodigoAsociado As String = CodigoAsociado().ToString
+                Dim ValorNombreInstrumento As String = NombreInstrumento().ToString
+                Dim ValorNombreEmpresa As String = NombreEmpresa().ToString
+                Dim ValorTipoAsignacion As String = TipoAsignacion().ToString
+                Dim ValorMontoInicial As Double = Operaciones.ConvertirDecimal(MontoInicial().ToString)
+                Dim ValorMontoTotalUsado As Double = Operaciones.ConvertirDecimal(MontoTotalUsado().ToString)
+                Dim ValorPorcentajeRestante As Double = Operaciones.ConvertirDecimal(PorcentajeRestante().ToString) / 100
+                Dim ValorPorcentajeMontoUsado As Double = Operaciones.ConvertirDecimal(PorcentajeMontoUsado().ToString) / 100
+                Dim ValorMontoDisponible As Double = Operaciones.ConvertirDecimal(MontoDisponible().ToString)
+                Dim ValorMontoUsado As Double = Operaciones.ConvertirDecimal(MontoUsado().ToString)
+                Dim ValorMontoTitulo As Double = Operaciones.ConvertirDecimal(MontoTitulo().ToString)
+                Dim ValorMontoNoUsado As Double = Operaciones.ConvertirDecimal(MontoNoUsado().ToString)
+                Dim ValorFechaCreado As Date = Operaciones.ConvertirFecha(FechaCreado().ToString)
+                Dim ValorEstadoProceso As String = EstadoProceso().ToString
+                Dim ValorAsociado As String = Asociado().ToString
+
+                Dim ValorCodigoReporto As String = CodigoReporto().ToString
+                Dim ValorIdFlujo As Integer = IdFlujo()
+
+
+
+
+
+
+
+
+
+
+                sql = "INSERT INTO EspCreTit(
+                                     [CodigoAsociado]
+                                    ,[CodigoReporto]
+                                    ,[Titulo]
+                                    ,[Empresa]
+                                    ,[Instrumento]
+                                    ,[CodigoEstado]
+                                    ,[Nombre]
+                                    ,[Descrip]
+                                    ,[IdFlujo]
+                                    ,[PosicionCreacion]
+                                    ,[TipoAsignacion]
+                                    ,[MontoInicial]
+                                    ,[MontoAplicadoPorcentajeCasa]
+                                    ,[PorcentajeRestante]
+                                    ,[PorcentajeGarantia]
+                                    ,[MontoDisponible]
+                                    ,[MontoUsado]
+                                    ,[SaldoAplicadoTitulo]
+                                    ,[SaldoValorTitulo]
+                                    ,[FechaCreado]
+                                    ,[EstadoProceso]
+
+
+
+)VALUES(
+                                     @CodigoAsociado
+                                    ,@CodigoReporto
+                                    ,@Titulo
+                                    ,@Empresa
+                                    ,@Instrumento
+                                    ,@CodigoEstado
+                                    ,@Nombre
+                                    ,@Descrip
+                                    ,@IdFlujo
+                                    ,@PosicionCreacion
+
+                                    ,@TipoAsignacion
+                                    ,@MontoInicial
+                                    ,@MontoAplicadoPorcentajeCasa
+                                    ,@PorcentajeRestante
+                                    ,@PorcentajeGarantia
+                                    ,@MontoDisponible
+                                    ,@MontoUsado
+                                    ,@SaldoAplicadoTitulo
+                                    ,@SaldoValorTitulo
+                                    ,@FechaCreado
+                                    ,@EstadoProceso
+
+)"
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodigoAsociado", SqlDbType.VarChar).Value = ValorCodigoAsociado
+                cmd.Parameters.Add("@CodigoReporto", SqlDbType.VarChar).Value = ValorCodigoReporto
+                cmd.Parameters.Add("@Titulo", SqlDbType.VarChar).Value = ValorNombreInstrumento
+                cmd.Parameters.Add("@Empresa", SqlDbType.VarChar).Value = ValorNombreEmpresa
+                cmd.Parameters.Add("@Instrumento", SqlDbType.VarChar).Value = ValorNombreInstrumento
+                cmd.Parameters.Add("@CodigoEstado", SqlDbType.VarChar).Value = "TA"
+                cmd.Parameters.Add("@Nombre", SqlDbType.VarChar).Value = "Titulos Asignados"
+                cmd.Parameters.Add("@Descrip", SqlDbType.VarChar).Value = "Titulos Asignados(En Espera de ser Generados)"
+                cmd.Parameters.Add("@IdFlujo", SqlDbType.Int).Value = ValorIdFlujo
+                cmd.Parameters.Add("@PosicionCreacion", SqlDbType.Int).Value = PosicionCreacion
+                cmd.Parameters.Add("@TipoAsignacion", SqlDbType.VarChar).Value = ValorTipoAsignacion
+                cmd.Parameters.Add("@MontoInicial", SqlDbType.Float).Value = ValorMontoInicial
+                cmd.Parameters.Add("@MontoAplicadoPorcentajeCasa", SqlDbType.Float).Value = ValorMontoTotalUsado
+                cmd.Parameters.Add("@PorcentajeRestante", SqlDbType.Float).Value = ValorPorcentajeRestante
+                cmd.Parameters.Add("@PorcentajeGarantia", SqlDbType.Float).Value = ValorPorcentajeMontoUsado
+                cmd.Parameters.Add("@MontoDisponible", SqlDbType.Float).Value = ValorMontoDisponible
+                cmd.Parameters.Add("@MontoUsado", SqlDbType.Float).Value = ValorMontoUsado
+                cmd.Parameters.Add("@SaldoAplicadoTitulo", SqlDbType.Float).Value = ValorMontoTitulo
+                cmd.Parameters.Add("@SaldoValorTitulo", SqlDbType.Float).Value = ValorMontoNoUsado
+                cmd.Parameters.Add("@FechaCreado", SqlDbType.Date).Value = ValorFechaCreado
+                cmd.Parameters.Add("@EstadoProceso", SqlDbType.VarChar).Value = ValorEstadoProceso
+
+
+
+
+
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+            Next
+
+
+
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+        myTrans.Rollback()
+        MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+End Class

+ 232 - 0
DAO/SeriesDAO.vb

@@ -0,0 +1,232 @@
+Imports System.Data.SqlClient
+Imports System.Text.RegularExpressions
+Public Module SeriesDAO
+
+
+
+    Public Function SiguienteCodigoInversion(ByVal vCodigoEmpresa As String, ByVal vCodigoInstrumentoFinanciero As String) As String
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim valor1 As Integer
+        Dim valor2 As Integer
+        Dim cmd As SqlCommand
+        Dim cmd2 As SqlCommand
+        Dim CodigoPIN As String = String.Empty
+        Dim CodigoINV As String = String.Empty
+        Dim CorrelativoPIN As Match
+        Dim CorrelativoINV As Match
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        'SELECT COUNT('A') FROM [dbo].[INV0] WHERE CodInv=@CodInv
+
+
+        ''''''''''''''''''''''''''
+        If (String.IsNullOrEmpty(vCodigoEmpresa) And Not String.IsNullOrEmpty(vCodigoInstrumentoFinanciero)) Then
+            cmd = New SqlCommand("SELECT CodInv FROM [dbo].[PIN0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[PIN0] where CodIF='" + vCodigoInstrumentoFinanciero + "')) AND (CodEmpr is NULL OR CodEmpr='' OR CodEmpr=' ')", cn)
+            CodigoPIN = cmd.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoPIN) Then
+                valor1 = 0
+
+            Else
+
+                CorrelativoPIN = Regex.Match(CodigoPIN, "\d+")
+                If CorrelativoPIN.Success Then
+                    valor1 = CInt(CorrelativoPIN.Value)
+                Else
+                    valor1 = 0
+                End If
+
+            End If
+
+
+            cmd.Dispose()
+
+            cmd2 = New SqlCommand("SELECT CodInv FROM [dbo].[INV0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[INV0] where CodIF='" + vCodigoInstrumentoFinanciero + "')) AND (CodEmpr is NULL OR CodEmpr='' OR CodEmpr=' ')", cn)
+            CodigoINV = cmd2.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoINV) Then
+                valor2 = 0
+
+            Else
+
+                CorrelativoINV = Regex.Match(CodigoINV, "\d+")
+                If CorrelativoINV.Success Then
+                    valor2 = CInt(CorrelativoINV.Value)
+                Else
+                    valor2 = 0
+                End If
+
+            End If
+
+
+            cmd2.Dispose()
+            If (valor1 < valor2) Then
+                retorno = valor2
+            ElseIf (valor1 > valor2) Then
+                retorno = valor1
+            ElseIf (valor1 = valor2) Then
+                retorno = valor1
+            End If
+            cn.Dispose()
+            Dim Codigo As String = String.Empty
+            Dim Correlativo As Integer = CInt(retorno) + 1
+            Codigo = Format(Correlativo, "00000")
+
+            Return (vCodigoInstrumentoFinanciero + Codigo)
+
+
+
+
+
+            ''''''''''''''''''''''''''''''''''''''''
+        ElseIf (String.IsNullOrEmpty(vCodigoInstrumentoFinanciero) And Not String.IsNullOrEmpty(vCodigoEmpresa)) Then
+            cmd = New SqlCommand("SELECT CodInv FROM [dbo].[PIN0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[PIN0] where CodEmpr='" + vCodigoEmpresa + "')) AND (CodIF is NULL OR CodIF='' OR CodIF=' ')", cn)
+            CodigoPIN = cmd.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoPIN) Then
+                valor1 = 0
+
+            Else
+
+                CorrelativoPIN = Regex.Match(CodigoPIN, "\d+")
+                If CorrelativoPIN.Success Then
+                    valor1 = CInt(CorrelativoPIN.Value)
+                Else
+                    valor1 = 0
+                End If
+
+            End If
+            cmd.Dispose()
+
+
+            cmd2 = New SqlCommand("SELECT CodInv FROM [dbo].[INV0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[INV0] where CodEmpr='" + vCodigoEmpresa + "')) AND (CodIF is NULL OR CodIF='' OR CodIF=' ')", cn)
+            CodigoINV = cmd2.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoINV) Then
+                valor2 = 0
+
+            Else
+
+                CorrelativoINV = Regex.Match(CodigoINV, "\d+")
+                If CorrelativoINV.Success Then
+                    valor2 = CInt(CorrelativoINV.Value)
+                Else
+                    valor2 = 0
+                End If
+
+            End If
+            cmd2.Dispose()
+
+            If (valor1 < valor2) Then
+                retorno = valor2
+            ElseIf (valor1 > valor2) Then
+                retorno = valor1
+            ElseIf (valor1 = valor2) Then
+                retorno = valor1
+            End If
+
+            cn.Dispose()
+
+
+
+            Dim Codigo As String = String.Empty
+            Dim Correlativo As Integer = CInt(retorno) + 1
+            Codigo = Format(Correlativo, "00000")
+
+            Return (vCodigoEmpresa + Codigo)
+
+
+
+
+
+            ''''''''''''''''''''''''''''''''''
+        ElseIf (String.IsNullOrEmpty(vCodigoEmpresa) And String.IsNullOrEmpty(vCodigoInstrumentoFinanciero)) Then
+                Return 0
+            ElseIf (Not String.IsNullOrEmpty(vCodigoEmpresa) And Not String.IsNullOrEmpty(vCodigoInstrumentoFinanciero)) Then
+                Dim suma As Integer
+
+            cmd = New SqlCommand("SELECT CodInv FROM [dbo].[PIN0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[PIN0] where CodInv like '%" + vCodigoEmpresa + vCodigoInstrumentoFinanciero + "%'))", cn)
+
+            CodigoPIN = cmd.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoPIN) Then
+                valor1 = 0
+
+            Else
+
+                CorrelativoPIN = Regex.Match(CodigoPIN, "\d+")
+                If CorrelativoPIN.Success Then
+                    valor1 = CInt(CorrelativoPIN.Value)
+                Else
+                    valor1 = 0
+                End If
+
+            End If
+
+            valor1 += 1
+
+                cmd2 = New SqlCommand("SELECT CodInv FROM [dbo].[INV0] WHERE (DocId = (SELECT MAX(DocId) FROM [dbo].[INV0] where CodInv like '%" + vCodigoEmpresa + vCodigoInstrumentoFinanciero + "%'))", cn)
+            CodigoINV = cmd2.ExecuteScalar
+            If String.IsNullOrEmpty(CodigoINV) Then
+                valor2 = 0
+
+            Else
+
+                CorrelativoINV = Regex.Match(CodigoINV, "\d+")
+                If CorrelativoINV.Success Then
+                    valor2 = CInt(CorrelativoINV.Value)
+                Else
+                    valor2 = 0
+                End If
+
+            End If
+            valor2 += 1
+
+                If (valor1 < valor2) Then
+                    suma = valor2
+                ElseIf (valor1 > valor2) Then
+                    suma = valor1
+                ElseIf (valor1 = valor2) Then
+                    suma = valor1
+                End If
+            Dim Codigo As String = String.Empty
+            Dim Correlativo As Integer = CInt(suma)
+            Codigo = Format(Correlativo, "00000")
+            Return (vCodigoEmpresa + vCodigoInstrumentoFinanciero + Codigo)
+        End If
+
+        '  cmd.CommandType = CommandType.StoredProcedure
+
+        '.Parameters.Add("@vCodEmpresa", SqlDbType.VarChar).Value = vCodigoEmpresa
+        'cmd.Parameters.Add("@vCodigoIF", SqlDbType.VarChar).Value = vCodigoInstrumentoFinanciero
+
+
+
+    End Function
+    Public Sub IncrementarCodigoInversion(ByVal vCodigoEmpresa As String, ByVal vCodigoInstrumentoFinanciero As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[SER0]
+   SET [Correlativo] = [Correlativo]+1
+ WHERE [CodEmpr] = @CodEmpr AND [CodIF] = @CodIF"
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodEmpr", SqlDbType.VarChar).Value = vCodigoEmpresa
+        cmd.Parameters.Add("@CodIF", SqlDbType.VarChar).Value = vCodigoInstrumentoFinanciero
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+
+        cmd.Dispose()
+        cn.Dispose()
+
+
+    End Sub
+End Module

+ 844 - 0
DAO/TitularizacionDAO.vb

@@ -0,0 +1,844 @@
+Imports System.Data.SqlClient
+
+Public Class TitularizacionDAO
+
+
+
+
+
+    Public Function ProcesoDatos(ByVal Coleccion As Collection, ByVal Codigo As String, ByVal Diccionario As Dictionary(Of String, Collection), ByVal Estado As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+
+            If Estado = "Nuevo" Then
+
+                sql = "INSERT INTO [dbo].[TIT0](
+           [CodInv]
+           ,[FechaEmision]
+           ,[Tasa]
+           ,[MontoCompra]
+           ,[MontoCompraPrimario]
+
+
+
+) VALUES(
+           @CodInv
+           ,@FechaEmision
+           ,@Tasa
+           ,@MontoCompra
+           ,@MontoCompraPrimario
+
+
+)
+    "
+
+
+
+
+
+            Else
+                sql = "UPDATE [dbo].[TIT0] SET
+
+           [FechaEmision]=@FechaEmision
+           ,[Tasa]=@Tasa
+           ,[MontoCompra]=@MontoCompra
+           ,[MontoCompraPrimario]=@MontoCompraPrimario
+         where [CodInv]=@CodInv
+           
+    "
+            End If
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+
+
+
+
+
+
+            cmd.Transaction = myTrans
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@FechaEmision", SqlDbType.DateTime).Value = Coleccion(1)
+                .Add("@Tasa", SqlDbType.Float).Value = Coleccion(2)
+                .Add("@MontoCompra", SqlDbType.Float).Value = Coleccion(3)
+
+                .Add("@MontoCompraPrimario", SqlDbType.Float).Value = Coleccion(4)
+
+
+            End With
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+            If Not Diccionario Is Nothing And Not Diccionario.Count = 0 Then
+
+
+
+                sql = "DELETE FROM [dbo].[TIT2]
+            WHERE [CodInv]=@CodInv "
+
+
+                cmd = New SqlCommand
+                cmd.CommandText = sql
+                cmd.Connection = cn
+                cmd.Transaction = myTrans
+                cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+                retorno = cmd.ExecuteNonQuery
+
+
+
+
+                For Each DatosDiccionario In Diccionario
+                    Dim Coleccion2 As Collection = DatosDiccionario.Value
+                    sql = "INSERT INTO [dbo].[TIT2](
+           [CodInv]
+           ,[Correlativo]
+           ,[Fecha] 
+           ,[Dias] 
+           ,[Cuota] 
+           ,[AmortCap] 
+           ,[Interes] 
+           ,[Saldos] 
+           ,[Porcentaje]
+           ,[Vigente]
+
+) VALUES(
+           @CodInv
+           ,@Correlativo
+           ,@Fecha
+           ,@Dias
+           ,@Cuota 
+           ,@AmortCap 
+           ,@Interes 
+           ,@Saldos 
+           ,@Porcentaje 
+           ,@Vigente
+
+)
+    "
+
+                    cmd = New SqlCommand
+                    cmd.CommandText = sql
+                    cmd.Connection = cn
+                    cmd.Transaction = myTrans
+
+                    With cmd.Parameters
+                        .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                        .Add("@Correlativo", SqlDbType.Float).Value = Coleccion2(1)
+                        .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion2(2)
+                        .Add("@Dias", SqlDbType.Int).Value = Coleccion2(3)
+                        .Add("@Cuota", SqlDbType.Float).Value = Coleccion2(4)
+                        .Add("@AmortCap", SqlDbType.Float).Value = Coleccion2(5)
+                        .Add("@Interes", SqlDbType.Float).Value = Coleccion2(6)
+                        .Add("@Saldos", SqlDbType.Float).Value = Coleccion2(7)
+                        .Add("@Porcentaje ", SqlDbType.Float).Value = Coleccion2(8)
+                        .Add("@Vigente", SqlDbType.VarChar).Value = Coleccion2(9)
+
+                    End With
+                    retorno = cmd.ExecuteNonQuery
+
+
+
+
+
+                Next
+
+
+            End If
+
+
+
+            ''''''''''''''''''
+
+
+
+
+
+
+
+
+
+
+
+
+            myTrans.Commit()
+            MsgBox("Datos Ingresados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+        End Try
+        cn.Close()
+
+        Return retorno
+
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function NuevaTIT(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[TIT0](
+           [CodInv]
+           ,[EmisTotal]
+           ,[FechaEmision]
+           ,[Tasa]
+           ,[Periodicidad]
+           ,[Periodos]
+           ,[MontoCompra]
+           ,[MontoCompraPrimario]
+           ,[CS1]
+           ,[CS2]
+           ,[CS3]
+           ,[CS4]
+           ,[CS5]
+           
+
+) VALUES(
+           @CodInv
+           ,@EmisTotal
+           ,@FechaEmision
+           ,@Tasa
+           ,@Periodicidad
+           ,@Periodos
+           ,@MontoCompra
+           ,@MontoCompraPrimario
+           ,@CS1
+           ,@CS2
+           ,@CS3
+           ,@CS4
+           ,@CS5
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@EmisTotal", SqlDbType.Float).Value = Coleccion(1)
+            .Add("@FechaEmision", SqlDbType.DateTime).Value = Coleccion(2)
+            .Add("@Tasa", SqlDbType.Float).Value = Coleccion(3)
+            .Add("@Periodicidad", SqlDbType.Int).Value = Coleccion(4)
+            .Add("@Periodos", SqlDbType.Int).Value = Coleccion(5)
+            .Add("@MontoCompra", SqlDbType.Float).Value = Coleccion(6)
+            .Add("@MontoCompraPrimario", SqlDbType.Float).Value = Coleccion(7)
+            .Add("@CS1", SqlDbType.Float).Value = Coleccion(8)
+            .Add("@CS2", SqlDbType.Float).Value = Coleccion(9)
+            .Add("@CS3", SqlDbType.Float).Value = Coleccion(10)
+            .Add("@CS4", SqlDbType.Float).Value = Coleccion(11)
+            .Add("@CS5", SqlDbType.Float).Value = Coleccion(12)
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+
+    Public Function ModificarTIT(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[TIT0] SET
+           [EmisTotal]=@EmisTotal
+           ,[FechaEmision]=@FechaEmision
+           ,[Tasa]=@Tasa
+           ,[Periodicidad]=@Periodicidad
+           ,[Periodos]=@Periodos
+           ,[MontoCompra]=@MontoCompra
+           ,[MontoCompraPrimario]=@MontoCompraPrimario
+           ,[CS1]=@CS1
+           ,[CS2]=@CS2
+           ,[CS3]=@CS3
+           ,[CS4]=@CS4
+           ,[CS5]=@CS5
+         where [CodInv]=@CodInv
+           
+        
+           
+           
+           
+           
+           
+           
+
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@EmisTotal", SqlDbType.Float).Value = Coleccion(1)
+            .Add("@FechaEmision", SqlDbType.DateTime).Value = Coleccion(2)
+            .Add("@Tasa", SqlDbType.Float).Value = Coleccion(3)
+            .Add("@Periodicidad", SqlDbType.Int).Value = Coleccion(4)
+            .Add("@Periodos", SqlDbType.Int).Value = Coleccion(5)
+            .Add("@MontoCompra", SqlDbType.Float).Value = Coleccion(6)
+            .Add("@MontoCompraPrimario", SqlDbType.Float).Value = Coleccion(7)
+            .Add("@CS1", SqlDbType.Float).Value = Coleccion(8)
+            .Add("@CS2", SqlDbType.Float).Value = Coleccion(9)
+            .Add("@CS3", SqlDbType.Float).Value = Coleccion(10)
+            .Add("@CS4", SqlDbType.Float).Value = Coleccion(11)
+            .Add("@CS5", SqlDbType.Float).Value = Coleccion(12)
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+    Public Function Eliminar(ByVal Codigo As String)
+
+
+
+        Dim objCon As New Conexion
+
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim myTrans As SqlTransaction
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+
+        myTrans = cn.BeginTransaction()
+        Try
+
+            sql = "DELETE FROM [dbo].[TIT0]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+
+
+            sql = "DELETE FROM [dbo].[TIT2]
+      WHERE [CodInv]=@CodInv"
+
+
+            cmd = New SqlCommand
+            cmd.CommandText = sql
+            cmd.Connection = cn
+            cmd.Transaction = myTrans
+            cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+
+
+            retorno = cmd.ExecuteNonQuery
+
+            myTrans.Commit()
+            MsgBox("Datos Eliminados")
+        Catch ex As Exception
+            myTrans.Rollback()
+            MsgBox(ex.Message)
+            cn.Close()
+            Return False
+        End Try
+        cn.Close()
+        Return True
+    End Function
+
+
+
+    Public Function NuevaAmortCap(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[TIT1](
+           [CodInv]
+           ,[Correlativo]
+           ,[Fecha]
+           ,[CSFlujo]
+           ,[AmortCap]
+           ,[Interes]
+           ,[Amort]
+           ,[Saldos]
+           
+
+) VALUES(
+           @CodInv
+           ,@Correlativo
+           ,@Fecha
+           ,@CSFlujo
+           ,@AmortCap
+           ,@Interes
+           ,@Amort
+           ,@Saldos
+
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(2)
+            .Add("@CSFlujo", SqlDbType.Float).Value = Coleccion(3)
+            .Add("@AmortCap", SqlDbType.Float).Value = Coleccion(4)
+            .Add("@Interes", SqlDbType.Float).Value = Coleccion(5)
+            .Add("@Amort", SqlDbType.Float).Value = Coleccion(6)
+            .Add("@Saldos", SqlDbType.Float).Value = Coleccion(7)
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+
+    Public Function ModificarAmortCap(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[TIT1] SET
+            [Fecha]=@Fecha
+           ,[CSFlujo]=@CSFlujo
+           ,[AmortCap]=@AmortCap
+           ,[Interes]=@Interes
+           ,[Amort]=@Amort
+           ,[Saldos]=@Saldos
+           where [CodInv]=@CodInv AND [Correlativo]=@Correlativo
+           
+           
+           
+           
+           
+           
+           
+           
+           
+
+
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+
+        With cmd.Parameters
+            .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+            .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+            .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(2)
+            .Add("@CSFlujo", SqlDbType.Float).Value = Coleccion(3)
+            .Add("@AmortCap", SqlDbType.Float).Value = Coleccion(4)
+            .Add("@Interes", SqlDbType.Float).Value = Coleccion(5)
+            .Add("@Amort", SqlDbType.Float).Value = Coleccion(6)
+            .Add("@Saldos", SqlDbType.Float).Value = Coleccion(7)
+
+        End With
+
+
+        cmd.Connection = cn
+
+        retorno = cmd.ExecuteNonQuery
+
+        cn.Close()
+        Return retorno
+
+    End Function
+
+    Public Sub EliminarAmortCap(ByVal Codigo As String, ByVal correlativo As Integer)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[TIT1]
+      WHERE [CodInv]=@CodInv AND Correlativo=@Correlativo"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@Correlativo", SqlDbType.Int).Value = correlativo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+
+
+
+
+
+
+    Public Function NuevaAmort(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "INSERT INTO [dbo].[TIT2](
+           [CodInv]
+           ,[Correlativo]
+           ,[Fecha] 
+           ,[Dias] 
+           ,[Cuota] 
+           ,[AmortCap] 
+           ,[Interes] 
+           ,[Saldos] 
+           ,[Porcentaje]
+
+) VALUES(
+           @CodInv
+           ,@Correlativo
+           ,@Fecha
+           ,@Dias
+           ,@Cuota 
+           ,@AmortCap 
+           ,@Interes 
+           ,@Saldos 
+           ,@Porcentaje 
+
+
+)
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        Try
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+                .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@Dias", SqlDbType.Int).Value = Coleccion(3)
+                .Add("@Cuota", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@AmortCap", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@Interes", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@Saldos", SqlDbType.Float).Value = Coleccion(7)
+                .Add("@Porcentaje ", SqlDbType.Float).Value = Coleccion(8)
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+            cn.Close()
+        Catch ex As Exception
+            MsgBox("Error al ingresar datos")
+            cn.Close()
+            Return Nothing
+        End Try
+
+        Return retorno
+
+    End Function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function ModificarAmort(ByVal Coleccion As Collection, ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim retorno As Integer
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "UPDATE [dbo].[TIT2] SET
+           [Fecha] =@Fecha
+           ,[Dias] =@Dias
+           ,[Cuota] =@Cuota
+           ,[AmortCap]= @AmortCap 
+           ,[Interes] =@Interes 
+           ,[Saldos] =@Saldos 
+           ,[Porcentaje] =@Porcentaje 
+           where  [CodInv]=@CodInv AND [Correlativo]=@Correlativo
+
+           
+           
+           
+           
+            
+           
+           
+           
+
+
+
+    "
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        Try
+
+
+            With cmd.Parameters
+                .Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+                .Add("@Correlativo", SqlDbType.Int).Value = Coleccion(1)
+                .Add("@Fecha", SqlDbType.DateTime).Value = Coleccion(2)
+                .Add("@Dias", SqlDbType.Int).Value = Coleccion(3)
+                .Add("@Cuota", SqlDbType.Float).Value = Coleccion(4)
+                .Add("@AmortCap", SqlDbType.Float).Value = Coleccion(5)
+                .Add("@Interes", SqlDbType.Float).Value = Coleccion(6)
+                .Add("@Saldos", SqlDbType.Float).Value = Coleccion(7)
+                .Add("@Porcentaje ", SqlDbType.Float).Value = Coleccion(8)
+
+            End With
+
+
+            cmd.Connection = cn
+
+            retorno = cmd.ExecuteNonQuery
+
+        Catch ex As Exception
+            MsgBox("Error de Modificación")
+            cn.Close()
+            Return Nothing
+        End Try
+        cn.Close()
+        Return retorno
+
+    End Function
+
+
+
+    Public Sub EliminarAmort(ByVal Codigo As String, ByVal correlativo As Integer)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim res As Integer
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "DELETE FROM [dbo].[TIT2]
+      WHERE [CodInv]=@CodInv AND Correlativo=@Correlativo"
+
+
+
+        cmd = New SqlCommand
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@CodInv", SqlDbType.VarChar).Value = Codigo
+        cmd.Parameters.Add("@Correlativo", SqlDbType.Int).Value = correlativo
+        cmd.Connection = cn
+
+        res = cmd.ExecuteNonQuery
+        cn.Close()
+    End Sub
+
+
+
+
+
+    Public Function CargarTIT(ByVal Codigo As String)
+        Dim objCon As New Conexion
+        Dim sql As String
+        Dim cmd As SqlCommand
+        Dim Coleccion As New Collection
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        sql = "SELECT * FROM [dbo].[TIT0] WHERE CodInv=@Codigo"
+
+
+        cmd = New SqlCommand
+
+        cmd.CommandText = sql
+        cmd.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+        cmd.Connection = cn
+
+        ' Dim Datos = cmd.ExecuteScalar
+        Dim Datos = cmd.ExecuteReader
+        If Datos.HasRows Then
+            'SE ENCONTRO EL REGISTRO
+
+
+            If Datos.Read Then
+
+                Coleccion.Add(Datos.Item("FechaEmision"))
+                Coleccion.Add(Datos.Item("Tasa"))
+                Coleccion.Add(Datos.Item("MontoCompra"))
+                Coleccion.Add(Datos.Item("MontoCompraPrimario"))
+
+
+                Return Coleccion
+            End If
+        End If
+        cn.Close()
+        Return Coleccion
+    End Function
+
+
+    Public Function CargarAmortCap(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from TIT1 where CodInv='" + codigo + "'"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+
+    Public Function CargarAmort(ByVal codigo As String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        If cn.State = ConnectionState.Closed Then
+            cn.Open()
+        End If
+        Dim sql = "select * from TIT2 where CodInv='" + codigo + "' order by Correlativo"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+
+        Return dr
+    End Function
+End Class

+ 205 - 0
DAO/frmRendimientos.vb

@@ -0,0 +1,205 @@
+Imports System.Data.SqlClient
+
+Public Class Rendimientos
+
+
+
+
+    Public Function TraerRendimientos(ByVal TipoFecha As String, ByVal FechaInicial As Date, ByVal FechaFinal As Date, ByVal Empresa As String, ByVal Instrumento As String, ByVal Renta As String, ByVal Lugar As String, ByVal Vigencia As String, ByVal AutEstado As String, ByVal Fecha As Date, Lista As String) As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim diccionario As New Dictionary(Of String, Collection)
+        Dim ConAgrupacion As String = "NO"
+        Dim dt As New DataTable
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        If Not String.IsNullOrEmpty(Lista) Then
+            ConAgrupacion = "SI"
+        End If
+
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "SP_CargarRendimientos"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@FechaInicial", SqlDbType.Date).Value = FechaInicial
+        cmd.Parameters.Add("@FechaFinal", SqlDbType.Date).Value = FechaFinal
+        cmd.Parameters.Add("@Empresa", SqlDbType.VarChar).Value = Empresa
+        cmd.Parameters.Add("@Instrumento ", SqlDbType.VarChar).Value = Instrumento
+        cmd.Parameters.Add("@TipoRenta", SqlDbType.VarChar).Value = Renta
+        cmd.Parameters.Add("@Nacionalidad", SqlDbType.VarChar).Value = Lugar
+        cmd.Parameters.Add("@Vigencia", SqlDbType.VarChar).Value = Vigencia
+        cmd.Parameters.Add("@Estado", SqlDbType.VarChar).Value = AutEstado
+        cmd.Parameters.Add("@Fecha", SqlDbType.Date).Value = Fecha
+        cmd.Parameters.Add("@TipoFecha", SqlDbType.VarChar).Value = TipoFecha
+        cmd.Parameters.Add("@ConAgrupacion", SqlDbType.VarChar).Value = ConAgrupacion
+        cmd.Parameters.Add("@Lista", SqlDbType.VarChar).Value = Lista
+
+        da = New SqlDataAdapter(cmd)
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        cn.Close()
+        Return dt
+
+    End Function
+
+
+
+
+
+
+
+
+    Public Function Instrumentos() As Dictionary(Of String, String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim diccionario As New Dictionary(Of String, String)
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "Select CodIF,Descrip from INFI"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        While dr.Read
+            diccionario.Add(dr("CodIF").ToString, dr("Descrip").ToString)
+        End While
+        cn.Close()
+        Return diccionario
+    End Function
+
+    Public Function Empresas() As Dictionary(Of String, String)
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim diccionario As New Dictionary(Of String, String)
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "select CodEmpr,Descrip from EMPR"
+
+        Dim cmd As New SqlCommand(sql, cn)
+        Dim dr As SqlDataReader
+        dr = cmd.ExecuteReader
+        While dr.Read
+            diccionario.Add(dr("CodEmpr").ToString, dr("Descrip").ToString)
+        End While
+        cn.Close()
+        Return diccionario
+    End Function
+
+
+
+    Public Function CargarPortafolioGeneral(ByVal Tipo As String) As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        Dim dt As New DataTable
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_PortafolioGeneral]"
+
+
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("Tipo", SqlDbType.VarChar).Value = Tipo
+        da = New SqlDataAdapter(cmd)
+
+        da.Fill(ds)
+        dt = ds.Tables(0)
+        cn.Close()
+        Return dt
+    End Function
+
+
+
+
+    Public Function CargarRendimientoDiario(ByVal FechaInicial As Date, ByVal FechaFinal As Date, ByVal TipoRendimiento As String,
+     ByVal ListaEmpresa As String, ByVal ListaInstrumento As String, ByVal ListaNacionalidad As String, ByVal ListaEstado As String,
+     ByVal ListaVigencia As String, ByVal ListaTipoRenta As String, ByVal ListaAgrupada As String, ByVal Agrupado As String) As DataTable
+        Dim objCon As New Conexion
+        Dim cn As SqlConnection = objCon.Conectar
+        Dim da As New SqlDataAdapter
+        Dim ds As New DataSet
+        If cn Is Nothing Then
+            cn = objCon.Conectar
+        End If
+        If cn.State = ConnectionState.Open Then
+            cn.Close()
+            cn.Dispose()
+            cn = objCon.Conectar
+            cn.Open()
+        Else
+            cn = objCon.Conectar
+            cn.Open()
+        End If
+        Dim sql = "[dbo].[SP_CargarRendimientoDiario]"
+        Dim cmd As New SqlCommand(sql, cn)
+        cmd.CommandType = CommandType.StoredProcedure
+        cmd.Parameters.Add("@FechaInicial", SqlDbType.Date).Value = FechaInicial
+        cmd.Parameters.Add("@FechaFinal", SqlDbType.Date).Value = FechaFinal
+        cmd.Parameters.Add("@TipoRendimiento", SqlDbType.VarChar).Value = TipoRendimiento
+
+
+
+
+
+
+
+
+        cmd.Parameters.Add("@Empresas", SqlDbType.VarChar).Value = ListaEmpresa
+        cmd.Parameters.Add("@Instrumentos", SqlDbType.VarChar).Value = ListaInstrumento
+        cmd.Parameters.Add("@Nacionalidad", SqlDbType.VarChar).Value = ListaNacionalidad
+        cmd.Parameters.Add("@Estado", SqlDbType.VarChar).Value = ListaEstado
+        cmd.Parameters.Add("@Vigencia", SqlDbType.VarChar).Value = ListaVigencia
+        cmd.Parameters.Add("@TipoRenta", SqlDbType.VarChar).Value = ListaTipoRenta
+        cmd.Parameters.Add("@Lista", SqlDbType.VarChar).Value = ListaAgrupada
+        cmd.Parameters.Add("@Agrupado", SqlDbType.VarChar).Value = Agrupado
+
+        da = New SqlDataAdapter(cmd)
+        da.Fill(ds)
+        cn.Close()
+        Return ds.Tables(0)
+    End Function
+End Class

+ 827 - 0
ENTI/AccionesCE.vb

@@ -0,0 +1,827 @@
+
+Public Class AccionesCE
+    Private _CodigoInversion As String
+    Private _TipoOperacion As String
+    Private _AccionPreferente As String
+    Private _OperacionEnBolsa As String
+    Private _FactorDeDividendo As Double
+    Private _IngresoBruto As Double
+    Private _IngresoBrutoPendiente As Double
+    Private _ISR As Double
+    Private _ISRPendiente As Double
+    Private _IngresoNeto As Double
+    Dim Operaciones As New Operaciones
+    Private _IngresoNetoPendiente As Double
+    'Private _Dividendos As New AccionesDetalleCE
+    Private _dtImpuestosYComisiones As DataTable
+    Private _dtDividendos As DataTable
+    Private _TipoInstrumento As String = "ACC"
+    Private _CodigoInstrumentoFinanciero As String
+    Private _DescripcionTipoInstrumento As String
+    Private _Registro As DataTable
+    Private _ComisionCompraCasa As Double
+    Private _ComisionCompraBolsa As Double
+    Private _ComisionVentaCasa As Double
+    Private _ComisionVentaBolsa As Double
+    Private _IOF As Boolean
+    Private _Renta As Boolean
+    Private _Tipo As String
+    Private _RetornoBruto As Double
+    Private _GananciaDeCapitalTotalVentasus As Double = 0
+    Private _RetornoAnualizadoBrutoVentasus As Double = 0
+    Private _MontoNetoVentasus As Double = 0
+    Private _PrecioSucioVentasus As Double = 0
+    Private _ComisionPorcentajeCompraCasa As Double = 0
+    Private _ComisionPorcentajeCompraBolsa As Double = 0
+    Private _ComisionPorcentajeVentaCasa As Double = 0
+    Private _ComisionPorcentajeVentaBolsa As Double = 0
+    Private _MontoNetoComprasus As Double = 0
+    Public ReadOnly Property TipoInstrumento As String
+        Get
+            Return _TipoInstrumento
+        End Get
+    End Property
+    Public Property DescripcionTipoInstrumento As String
+        Get
+            Return _DescripcionTipoInstrumento
+        End Get
+        Set(value As String)
+            _DescripcionTipoInstrumento = value
+        End Set
+    End Property
+    Public ReadOnly Property Registro As DataTable
+        Get
+            Return _Registro
+        End Get
+    End Property
+
+
+
+    'COMPRA
+    Private _CodigoCasaCompra As String
+    Private _PrecioLimpioCompra As Double
+    Private _FechaOperacionCompra As Date
+    Private _FechaLiquidacionCompra As Date
+    Private _DiasDeTenenciaCompra As Integer
+    Private _GananciaDeCapitalTotalCompra As Double
+    Private _GananciaDeCapitalUnitarioCompra As Double
+    Private _RetornoAnualizadoBrutoCompra As Double
+    Private _RetornoAnualizadoNetoCompra As Double
+    Private _CantidadCompra As Integer
+    Private _ValorTransadoCompra As Double
+    Private _MontoNetoCompra As Double
+    Private _PrecioSucioCompra As Double
+    Private _SumaImpuestosYComisionesCompra As Double
+
+
+    'VENTA
+    Private _CodigoCasaVenta As String
+    Private _PrecioLimpioVenta As Double
+    Private _FechaOperacionVenta As Date
+    Private _FechaLiquidacionVenta As Date
+    Private _DiasDeTenenciaVenta As Integer
+    Private _GananciaDeCapitalTotalVenta As Double
+    Private _GananciaDeCapitalUnitarioVenta As Double
+    Private _RetornoAnualizadoBrutoVenta As Double
+    Private _RetornoAnualizadoNetoVenta As Double
+    Private _CantidadVenta As Integer
+    Private _ValorTransadoVenta As Double
+    Private _MontoNetoVenta As Double
+    Private _PrecioSucioVenta As Double
+    Private _SumaImpuestosYComisionesVenta As Double
+
+
+
+    'GENERAL
+    Public Property CodigoInversion
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property AccionPreferente As String
+        Get
+            Return _AccionPreferente
+        End Get
+        Set(value As String)
+            _AccionPreferente = value
+        End Set
+    End Property
+    Public Property OperacionEnBolsa As String
+        Get
+            Return _OperacionEnBolsa
+        End Get
+        Set(value As String)
+            _OperacionEnBolsa = value
+        End Set
+    End Property
+
+    Public Property FactorDeDividendo As Double
+        Get
+            Return _FactorDeDividendo
+        End Get
+        Set(value As Double)
+            _FactorDeDividendo = value
+        End Set
+    End Property
+    Public Property IngresoBruto As Double
+        Get
+            Return _IngresoBruto
+        End Get
+        Set(value As Double)
+            _IngresoBruto = value
+            CalcularRetornoAnualBrutoVenta()
+
+        End Set
+    End Property
+    Public Property IngresoBrutoPendiente As Double
+        Get
+            Return _IngresoBrutoPendiente
+        End Get
+        Set(value As Double)
+            _IngresoBrutoPendiente = value
+            CalcularRetornoAnualBrutoVenta()
+
+        End Set
+    End Property
+    Public Property ISR As Double
+        Get
+            Return _ISR
+        End Get
+        Set(value As Double)
+            _ISR = value
+        End Set
+    End Property
+
+    Public Property ISRPendiente As Double
+        Get
+            Return _ISRPendiente
+        End Get
+        Set(value As Double)
+            _ISRPendiente = value
+        End Set
+    End Property
+    Public Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+        Set(value As Double)
+            _IngresoNeto = value
+            CalcularRetornoAnualNetoVenta()
+
+        End Set
+    End Property
+    Public Property IngresoNetoPendiente As Double
+        Get
+            Return _IngresoNetoPendiente
+        End Get
+        Set(value As Double)
+            _IngresoNetoPendiente = value
+            CalcularRetornoAnualNetoVenta()
+
+        End Set
+    End Property
+    Public Property ImpuestosYComisiones As DataTable
+        Get
+            Return _dtImpuestosYComisiones
+        End Get
+        Set(value As DataTable)
+            _dtImpuestosYComisiones = value
+            CalcularSumaImpuestosyComisiones()
+
+        End Set
+    End Property
+    Public Property Dividendos As DataTable
+        Get
+            Return _dtDividendos
+        End Get
+        Set(value As DataTable)
+            _dtDividendos = value
+            CalcularSumasDividendos()
+
+        End Set
+    End Property
+
+
+
+    'COMPRA
+    Public Property CodigoCasaCompra As String
+        Get
+            Return _CodigoCasaCompra
+        End Get
+        Set(value As String)
+            _CodigoCasaCompra = value
+        End Set
+    End Property
+    Public Property PrecioLimpioCompra As Double
+        Get
+            Return _PrecioLimpioCompra
+        End Get
+        Set(value As Double)
+            _PrecioLimpioCompra = value
+            CalculaValorTrasadoCompra()
+        End Set
+    End Property
+    Public Property FechaOperacionCompra As Date
+        Get
+            Return _FechaOperacionCompra
+        End Get
+        Set(value As Date)
+            _FechaOperacionCompra = value
+        End Set
+    End Property
+    Public Property FechaVencimientoCompra As Date
+        Get
+            Return _FechaLiquidacionCompra
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionCompra = value
+            CalcularDiasDeTenenciaVenta()
+        End Set
+    End Property
+    Public Property DiasDeTenenciaCompra As Integer
+        Get
+            Return _DiasDeTenenciaCompra
+        End Get
+        Set(value As Integer)
+            _DiasDeTenenciaCompra = value
+        End Set
+    End Property
+
+
+
+
+    Public Property ComisionVentaBolsa As Double
+        Get
+            Return _ComisionVentaBolsa
+        End Get
+        Set(value As Double)
+            _ComisionVentaBolsa = value
+        End Set
+    End Property
+
+
+    Public Property ComisionPorcentajeVentaBolsa As Double
+        Get
+            Return _ComisionPorcentajeVentaBolsa
+        End Get
+        Set(value As Double)
+            _ComisionPorcentajeVentaBolsa = value
+        End Set
+    End Property
+
+    Public Property ComisionVentaCasa As Double
+        Get
+            Return _ComisionVentaCasa
+        End Get
+        Set(value As Double)
+            _ComisionVentaCasa = value
+        End Set
+    End Property
+
+
+    Public Property ComisionPorcentajeVentaCasa As Double
+        Get
+            Return _ComisionPorcentajeVentaCasa
+        End Get
+        Set(value As Double)
+            _ComisionPorcentajeVentaCasa = value
+        End Set
+    End Property
+
+
+
+
+    Public Property ComisionCompraBolsa As Double
+        Get
+            Return _ComisionCompraBolsa
+        End Get
+        Set(value As Double)
+            _ComisionCompraBolsa = value
+        End Set
+    End Property
+
+
+    Public Property ComisionPorcentajeCompraBolsa As Double
+        Get
+            Return _ComisionPorcentajeCompraBolsa
+        End Get
+        Set(value As Double)
+            _ComisionPorcentajeCompraBolsa = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property ComisionCompraCasa As Double
+        Get
+            Return _ComisionCompraCasa
+        End Get
+        Set(value As Double)
+            _ComisionCompraCasa = value
+        End Set
+    End Property
+
+
+    Public Property ComisionPorcentajeCompraCasa As Double
+        Get
+            Return _ComisionPorcentajeCompraCasa
+        End Get
+        Set(value As Double)
+            _ComisionPorcentajeCompraCasa = value
+        End Set
+    End Property
+
+    Public Property IOF As Boolean
+        Get
+            Return _IOF
+        End Get
+        Set(value As Boolean)
+            _IOF = value
+        End Set
+    End Property
+
+
+    Public Property Renta As Boolean
+        Get
+            Return _Renta
+        End Get
+        Set(value As Boolean)
+            _Renta = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Property GananciaDeCapitalTotalCompra As Double
+        Get
+            Return _GananciaDeCapitalTotalCompra
+        End Get
+        Set(value As Double)
+            _GananciaDeCapitalTotalCompra = value
+        End Set
+    End Property
+    Public Property GananciaDeCapitalUnitarioCompra As Double
+        Get
+            Return _GananciaDeCapitalUnitarioCompra
+        End Get
+        Set(value As Double)
+            _GananciaDeCapitalUnitarioCompra = value
+        End Set
+    End Property
+    Public Property RetornoAnualizadoBrutoCompra As Double
+        Get
+            Return _RetornoAnualizadoBrutoCompra
+        End Get
+        Set(value As Double)
+            _RetornoAnualizadoBrutoCompra = value
+        End Set
+    End Property
+    Public Property RetornoAnualizadoNetoCompra As Double
+        Get
+            Return _RetornoAnualizadoNetoCompra
+        End Get
+        Set(value As Double)
+            _RetornoAnualizadoNetoCompra = value
+        End Set
+    End Property
+    Public Property CantidadCompra As Integer
+        Get
+            Return _CantidadCompra
+        End Get
+        Set(value As Integer)
+
+            _CantidadCompra = value
+            CalculaValorTrasadoCompra()
+            CalcularPrecioSucioCompra()
+
+        End Set
+    End Property
+    Public Property ValorTransadoCompra As Double
+        Get
+            Return _ValorTransadoCompra
+        End Get
+        Set(value As Double)
+            _ValorTransadoCompra = value
+        End Set
+    End Property
+
+    Public Property MontoNetoCompra As Double
+        Get
+
+            Return _MontoNetoCompra
+        End Get
+        Set(value As Double)
+
+            _MontoNetoCompra = value
+            CalcularMontoNetoCompra()
+        End Set
+    End Property
+
+    Public Property MontoNetoComprasus As Double
+        Get
+
+            Return _MontoNetoComprasus
+        End Get
+        Set(value As Double)
+
+            _MontoNetoComprasus = value
+
+        End Set
+    End Property
+    Public Property PrecioSucioCompra As Double
+        Get
+            Return _PrecioSucioCompra
+        End Get
+        Set(value As Double)
+            _PrecioSucioCompra = value
+        End Set
+    End Property
+    Public Property SumaImpuestosYComisionesCompra As Double
+        Get
+            Return _SumaImpuestosYComisionesCompra
+        End Get
+        Set(value As Double)
+            _SumaImpuestosYComisionesCompra = value
+            CalcularMontoNetoCompra()
+        End Set
+    End Property
+
+    'VENTA
+    Public Property CodigoCasaVenta As String
+        Get
+            Return _CodigoCasaVenta
+        End Get
+        Set(value As String)
+            _CodigoCasaVenta = value
+        End Set
+    End Property
+    Public Property PrecioLimpioVenta As Double
+        Get
+            Return _PrecioLimpioVenta
+        End Get
+        Set(value As Double)
+            _PrecioLimpioVenta = value
+            CalcularValorTransadoVenta()
+        End Set
+    End Property
+    Public Property FechaOperacionVenta As Date
+        Get
+            Return _FechaOperacionVenta
+        End Get
+        Set(value As Date)
+            _FechaOperacionVenta = value
+        End Set
+    End Property
+    Public Property FechaVencimientoVenta As Date
+        Get
+            Return _FechaLiquidacionVenta
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionVenta = value
+            CalcularDiasDeTenenciaVenta()
+        End Set
+    End Property
+    Public Property DiasDeTenenciaVenta As Integer
+        Get
+            Return _DiasDeTenenciaVenta
+        End Get
+        Set(value As Integer)
+            _DiasDeTenenciaVenta = value
+        End Set
+    End Property
+    Public Property GananciaDeCapitalTotalVenta As Double
+        Get
+            Return _GananciaDeCapitalTotalVenta
+        End Get
+        Set(value As Double)
+            _GananciaDeCapitalTotalVenta = value
+        End Set
+    End Property
+
+
+    Public Property GananciaDeCapitalTotalVentasus As Double
+        Get
+            Return _GananciaDeCapitalTotalVentasus
+        End Get
+        Set(value As Double)
+            _GananciaDeCapitalTotalVentasus = value
+        End Set
+    End Property
+    Public Property GananciaDeCapitalUnitarioVenta As Double
+        Get
+            Return _GananciaDeCapitalUnitarioVenta
+        End Get
+        Set(value As Double)
+            _GananciaDeCapitalUnitarioVenta = value
+        End Set
+    End Property
+    Public Property RetornoAnualizadoBrutoVenta As Double
+        Get
+            CalcularRetornoAnualBrutoVenta()
+            Return _RetornoAnualizadoBrutoVenta
+        End Get
+        Set(value As Double)
+            _RetornoAnualizadoBrutoVenta = value
+        End Set
+    End Property
+
+    Public Property RetornoAnualizadoBrutoVentasus As Double
+        Get
+
+            Return _RetornoAnualizadoBrutoVentasus
+        End Get
+        Set(value As Double)
+            _RetornoAnualizadoBrutoVentasus = value
+        End Set
+    End Property
+    Public Property RetornoAnualizadoNetoVenta As Double
+        Get
+            CalcularRetornoAnualNetoVenta()
+            Return _RetornoAnualizadoNetoVenta
+        End Get
+        Set(value As Double)
+            _RetornoAnualizadoNetoVenta = value
+        End Set
+    End Property
+    Public Property CantidadVenta As Integer
+        Get
+            Return _CantidadVenta
+        End Get
+        Set(value As Integer)
+            _CantidadVenta = value
+            CalcularValorTransadoVenta()
+            CalcularGananciaDeCapitalUnitarioVenta()
+            CalcularPrecioSucioVenta()
+
+        End Set
+    End Property
+
+    Public Property Tipo As String
+        Get
+            Return _Tipo
+        End Get
+        Set(value As String)
+            _Tipo = value
+
+
+        End Set
+    End Property
+    Public Property RetornoBruto As Double
+        Get
+            Return _RetornoBruto
+        End Get
+        Set(value As Double)
+            _RetornoBruto = value
+
+
+        End Set
+    End Property
+    Public Property ValorTransadoVenta As Double
+        Get
+            Return _ValorTransadoVenta
+        End Get
+        Set(value As Double)
+            _ValorTransadoVenta = value
+        End Set
+    End Property
+
+    Public Property MontoNetoVenta As Double
+        Get
+            Return _MontoNetoVenta
+        End Get
+        Set(value As Double)
+            _MontoNetoVenta = value
+        End Set
+    End Property
+
+
+    Public Property MontoNetoVentasus As Double
+        Get
+            Return _MontoNetoVentasus
+        End Get
+        Set(value As Double)
+            _MontoNetoVentasus = value
+        End Set
+    End Property
+
+    Public Property PrecioSucioVenta As Double
+        Get
+            Return _PrecioSucioVenta
+        End Get
+        Set(value As Double)
+            _PrecioSucioVenta = value
+        End Set
+    End Property
+
+    Public Property PrecioSucioVentasus As Double
+        Get
+            Return _PrecioSucioVentasus
+        End Get
+        Set(value As Double)
+            _PrecioSucioVentasus = value
+        End Set
+    End Property
+    Public Property SumaImpuestosYComisionesVenta As Double
+        Get
+            Return _SumaImpuestosYComisionesVenta
+        End Get
+        Set(value As Double)
+            _SumaImpuestosYComisionesVenta = value
+            CalcularMontoNetoVenta()
+        End Set
+    End Property
+    Public Sub New()
+        'GENERAL
+        _IngresoBruto = 0
+        _IngresoBrutoPendiente = 0
+        _ISR = 0
+        _ISRPendiente = 0
+        _IngresoNeto = 0
+        _IngresoNetoPendiente = 0
+        _dtImpuestosYComisiones = New DataTable
+        _dtDividendos = New DataTable
+        _Registro = New DataTable
+
+        'COMPRA
+        _PrecioLimpioCompra = 0
+        _FechaOperacionCompra = Date.Now.Date
+        _FechaLiquidacionCompra = Date.Now.Date
+        _CantidadCompra = 1
+
+        _DiasDeTenenciaCompra = 0
+        _GananciaDeCapitalTotalCompra = 0
+        _GananciaDeCapitalUnitarioCompra = 0
+        _RetornoAnualizadoBrutoCompra = 0
+        _RetornoAnualizadoNetoCompra = 0
+        _ValorTransadoCompra = 0
+        _MontoNetoCompra = 0
+        _PrecioSucioCompra = 0
+
+
+        'VENTA
+        _PrecioLimpioVenta = 0
+        _FechaOperacionVenta = Date.Now.Date
+        _FechaLiquidacionVenta = Date.Now.Date
+        _CantidadVenta = 1
+
+        _DiasDeTenenciaVenta = 0
+        _GananciaDeCapitalTotalVenta = 0
+        _GananciaDeCapitalUnitarioVenta = 0
+        _RetornoAnualizadoBrutoVenta = 0
+        _RetornoAnualizadoNetoVenta = 0
+        _CantidadVenta = 0
+        _ValorTransadoVenta = 0
+        _MontoNetoVenta = 0
+        _PrecioSucioVenta = 0
+
+    End Sub
+
+
+    'CALCULOS COMPRA
+    Private Sub CalculaValorTrasadoCompra()
+
+        _ValorTransadoCompra = _CantidadCompra * _PrecioLimpioCompra
+        CalcularMontoNetoCompra()
+    End Sub
+    Private Sub CalcularMontoNetoCompra()
+        _MontoNetoCompra = _ValorTransadoCompra + _SumaImpuestosYComisionesCompra
+        CalcularPrecioSucioCompra()
+
+        CalcularGananciaDeCapitalTotalVenta()
+        CalcularRetornoAnualBrutoVenta()
+        CalcularRetornoAnualNetoVenta()
+        CalcularSumasDividendos()
+
+    End Sub
+    Private Sub CalcularPrecioSucioCompra()
+        If (String.IsNullOrEmpty(_CantidadCompra.ToString) Or _CantidadCompra.ToString = "0") Then
+            _PrecioSucioCompra = "0.0"
+        Else
+            _PrecioSucioCompra = _MontoNetoCompra / _CantidadCompra
+        End If
+
+    End Sub
+
+
+    'CALCULOS VENTA
+    Private Sub CalcularDiasDeTenenciaVenta()
+        Dim valor As Integer
+        If _FechaLiquidacionVenta > Date.Today.Date Then
+            valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, Date.Today.Date)
+        Else
+            valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, _FechaLiquidacionVenta)
+        End If
+
+        _DiasDeTenenciaVenta = valor
+        CalcularRetornoAnualBrutoVenta()
+        CalcularRetornoAnualNetoVenta()
+        CalcularSumasDividendos()
+
+    End Sub
+    Private Sub CalcularValorTransadoVenta()
+        _ValorTransadoVenta = _PrecioLimpioVenta * _CantidadVenta
+        CalcularMontoNetoVenta()
+    End Sub
+    Private Sub CalcularMontoNetoVenta()
+        _MontoNetoVenta = _ValorTransadoVenta - _SumaImpuestosYComisionesVenta
+        CalcularGananciaDeCapitalTotalVenta()
+        CalcularPrecioSucioVenta()
+
+    End Sub
+    Private Sub CalcularGananciaDeCapitalTotalVenta()
+        _GananciaDeCapitalTotalVenta = _MontoNetoVenta - _MontoNetoCompra
+        CalcularGananciaDeCapitalUnitarioVenta()
+        CalcularRetornoAnualBrutoVenta()
+        CalcularRetornoAnualNetoVenta()
+        CalcularSumasDividendos()
+
+    End Sub
+    Private Sub CalcularGananciaDeCapitalUnitarioVenta()
+
+        _GananciaDeCapitalUnitarioVenta = _GananciaDeCapitalTotalVenta / _CantidadVenta
+        _GananciaDeCapitalUnitarioVenta = Format(_GananciaDeCapitalUnitarioVenta, "0.0000")
+
+
+    End Sub
+    Private Sub CalcularRetornoAnualBrutoVenta()
+        If _DiasDeTenenciaVenta = 0 Or _MontoNetoCompra = 0 Then
+            _RetornoAnualizadoBrutoVenta = 0
+
+        Else
+            _RetornoAnualizadoBrutoVenta = ((_GananciaDeCapitalTotalVenta + Variables.IngresoBruto) / _MontoNetoCompra) * 365 / _DiasDeTenenciaVenta
+
+
+        End If
+
+
+
+    End Sub
+    Private Sub CalcularRetornoAnualNetoVenta()
+
+
+        If _DiasDeTenenciaVenta = 0 Or _MontoNetoCompra Then
+
+            _RetornoAnualizadoNetoVenta = 0
+        Else
+            _RetornoAnualizadoNetoVenta = ((_GananciaDeCapitalTotalVenta + Variables.IngresoNeto) / _MontoNetoCompra) * 365 / _DiasDeTenenciaVenta
+
+
+        End If
+
+
+    End Sub
+    Private Sub CalcularPrecioSucioVenta()
+
+        _PrecioSucioVenta = _MontoNetoVenta / _CantidadVenta
+
+
+    End Sub
+    Private Sub CalcularSumaImpuestosyComisiones()
+        If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='C'").ToString, _SumaImpuestosYComisionesCompra) Then
+            _SumaImpuestosYComisionesCompra = 0
+        End If
+
+        If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='V'").ToString, _SumaImpuestosYComisionesVenta) Then
+            _SumaImpuestosYComisionesVenta = 0
+        End If
+
+        CalcularMontoNetoCompra()
+        CalcularMontoNetoVenta()
+    End Sub
+    Private Sub CalcularSumasDividendos()
+        'If Not Double.TryParse(_dtDividendos.Compute("SUM(IngresoBruto)", "").ToString, _IngresoBruto) Then
+        '    _IngresoBruto = 0
+        'End If
+
+        'If Not Double.TryParse(_dtDividendos.Compute("SUM(ISR)", "").ToString, _ISR) Then
+        '    _ISR = 0
+        'End If
+
+        'If Not Double.TryParse(_dtDividendos.Compute("SUM(IngresoNeto)", "").ToString, _IngresoNeto) Then
+        '    _IngresoNeto = 0
+        'End If
+
+
+    End Sub
+    Private Sub PrepararRegistro()
+
+    End Sub
+
+
+
+
+End Class

+ 21 - 0
ENTI/AccionesInternacionalesCE.vb

@@ -0,0 +1,21 @@
+Public Class AccionesInternacionalesCE
+    Inherits AccionesCE
+
+    Private _CodigoInstrumentoFinanciero As String = "ACCI"
+    Private _DescripcionInstrumentoFinanciero As String = "Acciones Internacionales"
+
+    Public ReadOnly Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+    End Property
+    Public ReadOnly Property DescripcionInstrumentoFinanciero As String
+        Get
+            Return _DescripcionInstrumentoFinanciero
+        End Get
+    End Property
+
+
+
+
+End Class

+ 20 - 0
ENTI/AccionesNacionalesComunesCE.vb

@@ -0,0 +1,20 @@
+Public Class AccionesNacionalesComunesCE
+    Inherits AccionesCE
+
+    Private _CodigoInstrumentoFinanciero As String = "ACCNC"
+    Private _DescripcionInstrumentoFinanciero As String = "Acciones Nacionales"
+
+    Public ReadOnly Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+    End Property
+    Public ReadOnly Property DescripcionInstrumentoFinanciero As String
+        Get
+            Return _DescripcionInstrumentoFinanciero
+        End Get
+    End Property
+
+
+
+End Class

+ 20 - 0
ENTI/AccionesNacionalesPreferentesCE.vb

@@ -0,0 +1,20 @@
+Public Class AccionesNacionalesPreferentesCE
+    Inherits AccionesCE
+
+    Private _CodigoInstrumentoFinanciero As String = "ACCNP"
+    Private _DescripcionInstrumentoFinanciero As String = "Acciones Preferentes"
+
+    Public ReadOnly Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+    End Property
+    Public ReadOnly Property DescripcionInstrumentoFinanciero As String
+        Get
+            Return _DescripcionInstrumentoFinanciero
+        End Get
+    End Property
+
+
+
+End Class

+ 1168 - 0
ENTI/BonosCE.vb

@@ -0,0 +1,1168 @@
+Public Class BonosCE
+    Private _CodigoInversion As String
+    Private _DocumentoBase As String
+    Private _TipoBase As String
+    Private _CodigoEmpresa As String
+    Private _CodigoInstrumentoFinanciero As String = "BONO"
+    Private _DescripcionInstrumentoFinanciero As String = "Bonos"
+    Private _dtImpuestosYComisiones As DataTable
+    Private _SumaImpuestosYComisionesVenta As Double
+    Private _dtIngresos As DataTable
+    Private _SumaIngresos As Double
+    Private _SumaImpuestosIngresos As Double
+    Private _SumaliquidoIngresos As Double
+    Private Operaciones As New Operaciones
+
+    Public Overridable ReadOnly Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+    End Property
+    Public Overridable ReadOnly Property DescripcionInstrumentoFinanciero
+        Get
+            Return _DescripcionInstrumentoFinanciero
+        End Get
+    End Property
+
+    Public Property CodigoEmpresa As String
+        Get
+            Return _CodigoEmpresa
+        End Get
+        Set(value As String)
+            _CodigoEmpresa = value
+        End Set
+    End Property
+    Public ReadOnly Property SumaIngresos As Double
+        Get
+            Return _SumaIngresos
+        End Get
+    End Property
+    Public ReadOnly Property SumaImpuestosIngresos As Double
+        Get
+            Return _SumaImpuestosIngresos
+        End Get
+    End Property
+    Public ReadOnly Property SumaliquidoIngresos As Double
+        Get
+            Return _SumaliquidoIngresos
+        End Get
+    End Property
+    Public Property Ingresos As DataTable
+        Get
+            Return _dtIngresos
+        End Get
+        Set(value As DataTable)
+            _dtIngresos = value
+        End Set
+    End Property
+
+    Private _PeriodicidadCompra As String
+    'Private _CodigoCasaCompra As String
+    Private _ValorNominalCompra As Double
+    Private _UltimaFechaCuponCompra As Date
+    Private _SiguienteFechaCuponCompra As Date
+    Private _FechaLiquidacionCompra As Date
+    Private _FechaVencimientoCompra As Date
+    Private _PorcentajeCuponCompra As Double
+    Private _YTMAlVencimientoComisionCompra As Double
+    Private _YTMAlVencimientoCompra As Double
+    Private _PrecioAlVencimientoCompra As Double
+    Private _PrecioCompra As Double
+    Private _DiasBaseCompra As Integer
+    Private _DiasAcumuladosCompra As Integer
+    Private _DiasAlVencimientoCompra As Integer
+    Private _PorcentajeInteresAcumuladoCompra As Double
+    Private _InteresAcumuladoCompra As Double
+    Private _PrecioSucioCompra As Double
+    Private _ValorTransadoCompra As Double
+    Private _MontoAPagarCompra As Double
+    Private _CostoDeTransferenciaCompra As Double
+    Private _SumaImpuestosyComisionesCompra As Double
+
+
+    'Private _CodigoCasaVenta As String
+    Private _ValorNominalVenta As Double
+    Private _UltimaFechaCuponVenta As Date
+    Private _SiguienteFechaCuponVenta As Date
+    Private _FechaLiquidacionVenta As Date
+    Private _FechaVencimientoVenta As Date
+    Private _PorcentajeCuponVenta As Double
+    Private _YTMAlVencimientoComisionVenta As Double
+    Private _YTMAlVencimientoVenta As Double
+    Private _PrecioAlVencimientoVenta As Double
+    Private _PrecioVenta As Double
+    Private _DiasBaseVenta As Integer
+    Private _DiasAcumuladosVenta As Integer
+    Private _DiasAlVencimientoVenta As Integer
+    'Private _PorcentajeInteresAcumuladoVenta As Double
+    Private _InteresAcumuladoVenta As Double
+    Private _InteresAcumuladoPorcentajeVenta As Double
+    Private _PrecioSucioVenta As Double
+    Private _ValorTransadoVenta As Double
+    Private _MontoARecibirVenta As Double
+    Private _PeriodicidadVenta As String
+    Private _PorcentajeComisionCasaVenta As Double
+    Private _PorcentajeComisionBolsaVenta As Double
+    Private _CostoDeTransferenciaVenta As Double
+
+    Private _ComisionBolsaVenta As Double
+    Private _ComisionCasaVenta As Double
+
+    Private _ValorNominalRO As Double
+    Private _DiasPlazoRO As Integer
+    Private _PrecioCompraRO As Double
+    Private _PrecioVentaRO As Double
+    Private _GananciaPerdidaDeCapital As Double
+    Private _IngresoPorInteres As Double
+    Private _CostosTotales As Double
+    Private _GananciaPerdidaTotal As Double
+    Private _RendimientoGananciaPerdida As Double
+    Private _RendimientoDeIntereses As Double
+    Private _RendimientoAntesImpuestos As Double
+    Private _RendimientoDespuesImpuestos As Double
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property DocumentoBase As String
+        Get
+            Return _DocumentoBase
+        End Get
+        Set(value As String)
+            _DocumentoBase = value
+        End Set
+    End Property
+    Public Property TipoBase As String
+        Get
+            Return _TipoBase
+        End Get
+        Set(value As String)
+            _TipoBase = value
+        End Set
+    End Property
+    Public Property ImpuestosYComisiones As DataTable
+        Get
+            Return _dtImpuestosYComisiones
+        End Get
+        Set(value As DataTable)
+            _dtImpuestosYComisiones = value
+            CalcularSumaImpuestosyComisiones()
+
+        End Set
+    End Property
+    Public Property SumaImpuestosYComisionesVenta As Double
+        Get
+            Return _SumaImpuestosYComisionesVenta
+        End Get
+        Set(value As Double)
+            _SumaImpuestosYComisionesVenta = value
+
+        End Set
+    End Property
+
+    'COMPRA
+    Public Property PeriodicidadCompra As String
+        Get
+            Return _PeriodicidadCompra
+        End Get
+        Set(value As String)
+            _PeriodicidadCompra = value
+        End Set
+    End Property
+
+    Public Property ValorNominalCompra As Double
+        Get
+            Return _ValorNominalCompra
+        End Get
+        Set(value As Double)
+            _ValorNominalCompra = value
+
+            CalcularInteresAcumuladoCompra()
+            CalcularPorcentajeInteresAcumuladoCompra()
+            CalcularValorTransadoCompra()
+
+
+        End Set
+    End Property
+    Public Property UltimaFechaCuponCompra As Date
+        Get
+            Return _UltimaFechaCuponCompra
+        End Get
+        Set(value As Date)
+            _UltimaFechaCuponCompra = value
+            CalcularDiasAcumuladosCompra()
+
+        End Set
+    End Property
+    Public Property SiguienteFechaCuponCompra As Date
+        Get
+            Return _SiguienteFechaCuponCompra
+        End Get
+        Set(value As Date)
+            _SiguienteFechaCuponCompra = value
+            CalcularDiasAcumuladosCompra()
+            CalcularUltimaFechaCuponVenta()
+            'CalcularTablaIngresos()
+        End Set
+    End Property
+    Public Property FechaLiquidacionCompra As Date
+        Get
+            Return _FechaLiquidacionCompra
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionCompra = value
+            CalcularYTMAlVencimientoCompra()
+            CalcularDiasAcumuladosCompra()
+            CalcularDiasPlazoRO()
+
+        End Set
+    End Property
+    Public Property FechaVencimientoCompra As Date
+        Get
+            Return _FechaVencimientoCompra
+        End Get
+        Set(value As Date)
+            _FechaVencimientoCompra = value
+            CalcularYTMAlVencimientoCompra()
+        End Set
+    End Property
+    Public Property PorcentajeCuponCompra As Double
+        Get
+            Return _PorcentajeCuponCompra
+        End Get
+        Set(value As Double)
+            _PorcentajeCuponCompra = value
+            CalcularYTMAlVencimientoCompra()
+            CalcularInteresAcumuladoCompra()
+
+        End Set
+    End Property
+    Public ReadOnly Property PorcentajeCuponCompra_x100 As Double
+        Get
+            Return _PorcentajeCuponCompra * 100
+        End Get
+    End Property
+    Public ReadOnly Property YTMAlVencimientoComisionCompra As Double
+        Get
+            Return _YTMAlVencimientoComisionCompra
+        End Get
+    End Property
+    Public ReadOnly Property YTMAlVencimientoCompra As Double
+        Get
+            Return _YTMAlVencimientoCompra
+        End Get
+    End Property
+    Public Property PrecioAlVencimientoCompra As Double
+        Get
+            Return _PrecioAlVencimientoCompra
+        End Get
+        Set(value As Double)
+            _PrecioAlVencimientoCompra = value
+            CalcularYTMAlVencimientoCompra()
+
+        End Set
+    End Property
+    Public Property PrecioCompra As Double
+        Get
+            Return _PrecioCompra
+        End Get
+        Set(value As Double)
+            _PrecioCompra = value
+            CalcularYTMAlVencimientoCompra()
+            CalcularPrecioSucioCompra()
+            CalcularValorTransadoCompra()
+
+        End Set
+    End Property
+    Public Property DiasBaseCompra As Integer
+        Get
+            Return _DiasBaseCompra
+        End Get
+        Set(value As Integer)
+            _DiasBaseCompra = value
+            CalcularInteresAcumuladoCompra()
+            CalcularDiasAlVencimientoCompra()
+            CalcularDiasAcumuladosCompra()
+            CalcularYTMAlVencimientoComisionCompra()
+            CalcularPorcentajeInteresAcumuladoCompra()
+            CalcularDiasPlazoRO()
+            CalcularRendimientoGananciaPerdida()
+            CalcularRendimientoDeIntereses()
+            CalcularRendimientoDespuesImpuestos()
+
+        End Set
+    End Property
+    Public ReadOnly Property DiasAcumuladosCompra As Integer
+        Get
+            Return _DiasAcumuladosCompra
+        End Get
+    End Property
+    Public ReadOnly Property DiasAlVencimientoCompra As Integer
+        Get
+            Return _DiasAlVencimientoCompra
+        End Get
+    End Property
+    Public ReadOnly Property PorcentajeInteresAcumuladoCompra As Double
+        Get
+            Return _PorcentajeInteresAcumuladoCompra
+        End Get
+    End Property
+    Public ReadOnly Property InteresAcumuladoCompra As Double
+        Get
+            Return _InteresAcumuladoCompra
+        End Get
+    End Property
+    Public ReadOnly Property PrecioSucioCompra As Double
+        Get
+            Return _PrecioSucioCompra
+        End Get
+    End Property
+    Public ReadOnly Property ValorTransadoCompra As Double
+        Get
+            Return _ValorTransadoCompra
+        End Get
+    End Property
+    Public ReadOnly Property MontoAPagarCompra As Double
+        Get
+            Return _MontoAPagarCompra
+        End Get
+    End Property
+    Public Property CostoDeTransferenciaCompra As Double
+        Get
+            Return _CostoDeTransferenciaCompra
+        End Get
+        Set(value As Double)
+            _CostoDeTransferenciaCompra = value
+            CalcularMontoAPagarCompra()
+
+        End Set
+    End Property
+    Public ReadOnly Property SumaImpuestosyComisionesCompra As Double
+        Get
+            Return _SumaImpuestosyComisionesCompra
+        End Get
+
+    End Property
+
+    'VENTA
+
+    Public Property ValorNominalVenta As Double
+        Get
+            Return _ValorNominalVenta
+        End Get
+        Set(value As Double)
+            _ValorNominalVenta = value
+            CalcularInteresAcumuladoVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+            CalcularValorTransadoVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+
+        End Set
+    End Property
+    Public Property UltimaFechaCuponVenta As Date
+        Get
+            Return _UltimaFechaCuponVenta
+        End Get
+        Set(value As Date)
+            _UltimaFechaCuponVenta = value
+        End Set
+    End Property
+    Public Property SiguienteFechaCuponVenta As Date
+        Get
+            Return _SiguienteFechaCuponVenta
+        End Get
+        Set(value As Date)
+            _SiguienteFechaCuponVenta = value
+        End Set
+    End Property
+    Public Property FechaLiquidacionVenta As Date
+        Get
+            Return _FechaLiquidacionVenta
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionVenta = value
+            CalcularDiasAcumuladosVenta()
+            CalcularDiasAlVencimientoVenta()
+            CalcularYTMAlVencimientoVenta()
+            CalcularDiasPlazoRO()
+
+        End Set
+    End Property
+    Public Property FechaVencimientoVenta As Date
+        Get
+            Return _FechaVencimientoVenta
+        End Get
+        Set(value As Date)
+            _FechaVencimientoVenta = value
+            CalcularDiasAlVencimientoVenta()
+            CalcularYTMAlVencimientoVenta()
+
+        End Set
+    End Property
+    Public Property PorcentajeCuponVenta As Double
+        Get
+            Return _PorcentajeCuponVenta
+        End Get
+        Set(value As Double)
+            _PorcentajeCuponVenta = value
+            CalcularYTMAlVencimientoVenta()
+            CalcularInteresAcumuladoVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+
+        End Set
+    End Property
+    Public ReadOnly Property YTMAlVencimientoComisionVenta As Double
+        Get
+            Return _YTMAlVencimientoComisionVenta
+        End Get
+
+    End Property
+    Public ReadOnly Property YTMAlVencimientoVenta As Double
+        Get
+            Return _YTMAlVencimientoVenta
+        End Get
+        'Set(value As Double)
+        '    _YTMAlVencimientoVenta = value
+        'End Set
+    End Property
+    Public Property PrecioAlVencimientoVenta As Double
+        Get
+            Return _PrecioAlVencimientoVenta
+        End Get
+        Set(value As Double)
+            _PrecioAlVencimientoVenta = value
+            CalcularYTMAlVencimientoVenta()
+        End Set
+    End Property
+    Public Property PrecioVenta As Double
+        Get
+            Return _PrecioVenta
+        End Get
+        Set(value As Double)
+            _PrecioVenta = value
+            CalcularYTMAlVencimientoVenta()
+            CalcularPrecioSucioVenta()
+            CalcularValorTransadoVenta()
+
+        End Set
+    End Property
+    Public Property DiasBaseVenta As Integer
+        Get
+            Return _DiasBaseVenta
+        End Get
+        Set(value As Integer)
+            _DiasBaseVenta = value
+            CalcularYTMAlVencimientoComisionVenta()
+            CalcularDiasAcumuladosVenta()
+            CalcularDiasAlVencimientoVenta()
+            CalcularInteresAcumuladoVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+
+        End Set
+    End Property
+    Public ReadOnly Property DiasAcumuladosVenta As Integer
+        Get
+            Return _DiasAcumuladosVenta
+        End Get
+
+    End Property
+    Public ReadOnly Property DiasAlVencimientoVenta As Integer
+        Get
+            Return _DiasAlVencimientoVenta
+        End Get
+    End Property
+    'Public ReadOnly Property PorcentajeInteresAcumuladoVenta As Double
+    '    Get
+    '        Return _PorcentajeInteresAcumuladoVenta
+    '    End Get
+    'End Property
+
+    Public ReadOnly Property InteresAcumuladoVenta As Double
+        Get
+            Return _InteresAcumuladoVenta
+        End Get
+
+    End Property
+    Public ReadOnly Property InteresAcumuladoPorcentajeVenta As Double
+        Get
+            Return _InteresAcumuladoPorcentajeVenta
+        End Get
+    End Property
+    Public ReadOnly Property PrecioSucioVenta As Double
+        Get
+            Return _PrecioSucioVenta
+        End Get
+    End Property
+
+    Public ReadOnly Property ValorTransadoVenta As Double
+        Get
+            Return _ValorTransadoVenta
+        End Get
+    End Property
+    Public ReadOnly Property MontoARecibirVenta As Double
+        Get
+            Return _MontoARecibirVenta
+        End Get
+    End Property
+    Public Property CostoDeTransferenciaVenta As Double
+        Get
+            Return _CostoDeTransferenciaVenta
+        End Get
+        Set(value As Double)
+            _CostoDeTransferenciaVenta = value
+        End Set
+    End Property
+    Public ReadOnly Property ValorNominalRO As Double
+        Get
+            Return _ValorNominalRO
+        End Get
+    End Property
+    Public ReadOnly Property DiasPlazoRO As Integer
+        Get
+            Return _DiasPlazoRO
+        End Get
+
+    End Property
+    Public ReadOnly Property PrecioCompraRO As Double
+        Get
+            Return _PrecioCompraRO
+        End Get
+
+    End Property
+    Public ReadOnly Property PrecioVentaRO As Double
+        Get
+            Return _PrecioVentaRO
+        End Get
+
+    End Property
+    Public ReadOnly Property GananciaPerdidaDeCapital As Double
+        Get
+            Return _GananciaPerdidaDeCapital
+        End Get
+
+    End Property
+    Public ReadOnly Property IngresoPorInteres As Double
+        Get
+            Return _IngresoPorInteres
+        End Get
+
+    End Property
+
+    Public ReadOnly Property CostosTotales As Double
+        Get
+            Return _CostosTotales
+        End Get
+
+    End Property
+    Public ReadOnly Property GananciaPerdidaTotal As Double
+        Get
+            Return _GananciaPerdidaTotal
+        End Get
+
+    End Property
+    Public ReadOnly Property RendimientoGananciaPerdida As Double
+        Get
+            Return _RendimientoGananciaPerdida
+        End Get
+
+    End Property
+    Public ReadOnly Property RendimientoDeIntereses As Double
+        Get
+            Return _RendimientoDeIntereses
+        End Get
+
+    End Property
+
+    Public ReadOnly Property RendimientoAntesImpuestos As Double
+        Get
+            Return _RendimientoAntesImpuestos
+        End Get
+
+    End Property
+    Public ReadOnly Property RendimientoDespuesImpuestos As Double
+        Get
+            Return _RendimientoDespuesImpuestos
+        End Get
+
+    End Property
+    Public Property PeriodicidadVenta As String
+        Get
+            Return _PeriodicidadVenta
+        End Get
+        Set(value As String)
+            _PeriodicidadVenta = value
+            CalcularYTMAlVencimientoVenta()
+            CalcularInteresAcumuladoPorcentajeVenta()
+
+        End Set
+    End Property
+
+    Public Sub New()
+        _ValorNominalCompra = 0
+        _UltimaFechaCuponCompra = Date.Now.Date
+        _SiguienteFechaCuponCompra = Date.Now.Date
+        _FechaLiquidacionCompra = Date.Now.Date
+        _FechaVencimientoCompra = Date.Now.Date
+
+        _ValorNominalVenta = 0
+        _SiguienteFechaCuponVenta = Date.Now.Date
+        _FechaLiquidacionVenta = Date.Now.Date
+        _FechaVencimientoVenta = Date.Now.Date
+    End Sub
+
+
+    'CALCULOS
+    Private Sub CalcularYTMAlVencimientoComisionCompra()
+        Dim valor As Double
+        Try
+            valor = _YTMAlVencimientoCompra - (_SumaImpuestosyComisionesCompra * _DiasBaseCompra / _DiasAlVencimientoCompra)
+        Catch ex As Exception
+            valor = 0
+        End Try
+        _YTMAlVencimientoComisionCompra = valor
+
+    End Sub
+
+    Private Sub CalcularDiasAcumuladosCompra()
+        Dim valor As Integer
+        valor = Utilidades.Days360(_UltimaFechaCuponCompra, _FechaLiquidacionCompra)
+        _DiasAcumuladosCompra = valor
+
+        CalcularInteresAcumuladoCompra()
+    End Sub
+    Private Sub CalcularDiasAlVencimientoCompra()
+        Dim valor As Integer
+
+        If _DiasBaseCompra = 360 Then
+            valor = Utilidades.Days360(_FechaLiquidacionCompra, _FechaVencimientoCompra)
+        Else
+            valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, _FechaVencimientoCompra)
+        End If
+        _DiasAlVencimientoCompra = valor
+
+        CalcularYTMAlVencimientoComisionCompra()
+        CalcularYTMAlVencimientoCompra()
+    End Sub
+    Private Sub CalcularInteresAcumuladoCompra()
+        Dim valor As Double
+        Try
+            valor = _ValorNominalCompra * _PorcentajeCuponCompra * _DiasAcumuladosCompra / _DiasBaseCompra
+
+        Catch ex As Exception
+            valor = 0
+        End Try
+        _InteresAcumuladoCompra = valor
+        'CalcularDiasAcumuladosCompra()
+        CalcularPorcentajeInteresAcumuladoCompra()
+        CalcularMontoAPagarCompra()
+    End Sub
+    Private Sub CalcularPorcentajeInteresAcumuladoCompra()
+        Dim valor As Double
+
+        Dim vDiasPeriodo As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadCompra)
+        Try
+            valor = _InteresAcumuladoCompra / _ValorNominalCompra * _DiasBaseCompra / vDiasPeriodo
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _PorcentajeInteresAcumuladoCompra = valor
+        CalcularPrecioSucioCompra()
+
+    End Sub
+    Private Sub CalcularPrecioSucioCompra()
+        Dim valor As Double
+        Try
+            'valor = _PrecioCompra * 0.01 + _PorcentajeInteresAcumuladoCompra
+            valor = _PrecioCompra + _PorcentajeInteresAcumuladoCompra
+        Catch ex As Exception
+            valor = 0
+        End Try
+        _PrecioSucioCompra = valor
+    End Sub
+    Private Sub CalcularValorTransadoCompra()
+        Dim valor As Double
+
+        valor = (_PrecioCompra) * _ValorNominalCompra
+        _ValorTransadoCompra = valor
+
+        CalcularMontoAPagarCompra()
+        CalcularGananciaPerdidaDeCapital()
+        CalcularRendimientoGananciaPerdida()
+        CalcularRendimientoDeIntereses()
+        CalcularRendimientoDespuesImpuestos()
+
+    End Sub
+    Private Sub CalcularMontoAPagarCompra()
+        Dim valor As Double
+        Try
+            valor = _ValorTransadoCompra + _SumaImpuestosyComisionesCompra + _InteresAcumuladoCompra + _CostoDeTransferenciaCompra
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _MontoAPagarCompra = valor
+    End Sub
+
+    'CALCULOS VENTA
+    Private Sub CalcularUltimaFechaCuponVenta()
+        Dim valor As Date
+        Dim vDiasPeriodo As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadVenta)
+
+        Try
+            _SiguienteFechaCuponCompra.AddDays(vDiasPeriodo + 1)
+            valor = _SiguienteFechaCuponCompra
+        Catch ex As Exception
+            valor = Date.Now.Date
+        End Try
+
+        _UltimaFechaCuponVenta = valor
+        CalcularSiguienteFechaCuponVenta()
+        CalcularDiasAcumuladosVenta()
+
+    End Sub
+    Private Sub CalcularSiguienteFechaCuponVenta()
+        Dim valor As Date
+        Dim vDiasPeriodo As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadVenta)
+
+        valor = _UltimaFechaCuponVenta.AddDays(vDiasPeriodo + 1)
+        _SiguienteFechaCuponVenta = valor
+    End Sub
+    Private Sub CalcularFechaLiquidacionVenta()
+        Dim valor As Date
+
+        valor = DateTime.Now.Date + DateTime.Now.AddDays(3)
+        _FechaLiquidacionVenta = valor
+
+    End Sub
+    Private Sub CalcularYTMAlVencimientoComisionVenta()
+        Dim valor As Double
+
+        Try
+            valor = _YTMAlVencimientoVenta - (_PorcentajeComisionCasaVenta * _DiasBaseVenta / _DiasAlVencimientoVenta) - (_PorcentajeComisionBolsaVenta * _DiasBaseVenta / _DiasAlVencimientoVenta)
+            'valor = valor * 100
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _YTMAlVencimientoComisionVenta = valor
+    End Sub
+
+    Private Sub CalcularDiasAcumuladosVenta()
+        Dim valor As Integer
+
+        If _DiasBaseVenta = 360 Then
+            valor = Utilidades.Days360(_UltimaFechaCuponVenta, _FechaLiquidacionVenta)
+        Else
+            valor = DateDiff(DateInterval.Day, _UltimaFechaCuponVenta, _FechaLiquidacionVenta)
+        End If
+
+        _DiasAcumuladosVenta = valor
+        CalcularYTMAlVencimientoVenta()
+        CalcularInteresAcumuladoVenta()
+        CalcularInteresAcumuladoPorcentajeVenta()
+
+    End Sub
+    Private Sub CalcularDiasAlVencimientoVenta()
+        Dim valor As Integer
+
+        If _DiasBaseVenta = 360 Then
+            valor = Utilidades.Days360(_FechaLiquidacionVenta, _FechaVencimientoVenta)
+        Else
+            valor = DateDiff(DateInterval.Day, _FechaLiquidacionVenta, _FechaVencimientoVenta)
+        End If
+
+        _DiasAlVencimientoVenta = valor
+        CalcularYTMAlVencimientoVenta()
+        CalcularYTMAlVencimientoComisionVenta()
+
+    End Sub
+    Private Sub CalcularInteresAcumuladoVenta()
+        Dim valor As Double
+
+        Try
+            valor = _ValorNominalVenta * _PorcentajeCuponVenta * _DiasAcumuladosVenta / _DiasBaseVenta
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _InteresAcumuladoVenta = valor
+        CalcularInteresAcumuladoPorcentajeVenta()
+        CalcularMontoARecibirVenta()
+
+    End Sub
+    Private Sub CalcularInteresAcumuladoPorcentajeVenta()
+        Dim valor As Double
+        Dim vDiasPeriodo As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadVenta)
+
+        Try
+            valor = _InteresAcumuladoVenta / _ValorNominalVenta * _DiasBaseVenta / vDiasPeriodo
+            valor = valor * 100
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _InteresAcumuladoPorcentajeVenta = valor
+        CalcularPrecioSucioVenta()
+    End Sub
+    Private Sub CalcularPrecioSucioVenta()
+        Dim valor As Double
+        Try
+            valor = _PrecioVenta + _InteresAcumuladoPorcentajeVenta
+            valor = valor
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _PrecioSucioVenta = valor
+    End Sub
+    Private Sub CalcularValorTransadoVenta()
+        Dim valor As Double
+
+        Try
+            valor = _PrecioVenta * _ValorNominalVenta
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _ValorTransadoVenta = valor
+        CalcularMontoARecibirVenta()
+        CalcularGananciaPerdidaDeCapital()
+
+    End Sub
+    Private Sub CalcularMontoARecibirVenta()
+        Dim valor As Double
+
+        Try
+            valor = _ValorTransadoVenta - _ComisionBolsaVenta - _ComisionCasaVenta + _InteresAcumuladoVenta
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _MontoARecibirVenta = valor
+    End Sub
+    Private Sub CalcularDiasPlazoRO()
+        Dim valor As Integer
+
+        If _DiasBaseCompra = 360 Then
+            valor = Utilidades.Days360(_FechaLiquidacionCompra, _FechaLiquidacionVenta)
+        Else
+            valor = DateDiff(DateInterval.Day, _FechaLiquidacionCompra, _FechaLiquidacionVenta)
+        End If
+
+        _DiasPlazoRO = valor
+        CalcularRendimientoGananciaPerdida()
+        CalcularRendimientoDeIntereses()
+        CalcularRendimientoDespuesImpuestos()
+
+    End Sub
+    Private Sub CalcularGananciaPerdidaDeCapital()
+        Dim valor As Double
+        valor = _ValorTransadoVenta - _ValorTransadoCompra
+
+        _GananciaPerdidaDeCapital = valor
+        CalcularGananciaPerdidaTotal()
+        CalcularRendimientoGananciaPerdida()
+
+    End Sub
+    Private Sub CalcularIngresoPorInteres()
+        Dim valor As Double
+        'Dim vCuponesPagados As Double = 0 'FALTA VALOR
+        'Dim vInteresAcumulado As Double = GetInteresAcumuladoCompra()
+
+        'valor = vCuponesPagados + vInteresAcumulado
+        valor = 0
+
+        _IngresoPorInteres = valor
+        CalcularGananciaPerdidaTotal()
+        CalcularRendimientoDeIntereses()
+
+
+    End Sub
+    Private Sub CalcularGananciaPerdidaTotal()
+        Dim valor As Double
+        valor = _GananciaPerdidaDeCapital + _IngresoPorInteres
+
+        _GananciaPerdidaTotal = valor
+        CalcularRendimientoDespuesImpuestos()
+
+    End Sub
+    Private Sub CalcularRendimientoGananciaPerdida()
+        Dim valor As Double
+        Try
+            valor = _GananciaPerdidaDeCapital / _ValorTransadoCompra * _DiasBaseCompra / _DiasPlazoRO
+            'valor = valor * 100
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _RendimientoGananciaPerdida = valor
+    End Sub
+    Private Sub CalcularRendimientoDeIntereses()
+        Dim valor As Double
+        Try
+            valor = _IngresoPorInteres / _ValorTransadoCompra * _DiasBaseCompra / _DiasPlazoRO
+            'valor = valor * 100
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _RendimientoDeIntereses = valor
+    End Sub
+    Private Sub CalcularRendimientoDespuesImpuestos()
+        Dim valor As Double
+        Try
+            valor = _GananciaPerdidaTotal / _ValorTransadoCompra * _DiasBaseCompra / _DiasPlazoRO
+            valor = valor * 100
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        _RendimientoDespuesImpuestos = valor
+    End Sub
+
+
+    Private Sub CalcularSiguienteFechaCuponCompra()
+        Dim valor As Date
+        Dim vUltimaFechCupon As Date = _UltimaFechaCuponCompra
+        Dim vPeriodicidad As String = _PeriodicidadCompra
+        Dim vDiasPeriodo As Integer = Utilidades.DiasDeUnPeriodo(vPeriodicidad)
+
+        valor = vUltimaFechCupon.AddDays(vDiasPeriodo + 1)
+
+        _SiguienteFechaCuponCompra = valor
+    End Sub
+    Private Sub CalcularSumaImpuestosyComisionesCompra()
+        _SumaImpuestosyComisionesCompra = 0
+    End Sub
+    'Private Sub CalcularPorcentajeInteresAcumuladoVenta()
+    '    Dim valor As Double
+
+    '    Try
+    '        valor = _ValorNominalVenta * _PorcentajeCuponVenta * _DiasAcumuladosVenta / _DiasBaseVenta
+    '    Catch ex As Exception
+    '        valor = 0
+    '    End Try
+    '    _PorcentajeInteresAcumuladoVenta = valor
+    '    CalcularPrecioSucioVenta()
+
+    'End Sub
+    Private Sub CalcularComisionBolsaVenta()
+        _ComisionBolsaVenta = 0
+        CalcularMontoARecibirVenta()
+
+    End Sub
+    Private Sub CalcularComisionCasaVenta()
+        _ComisionCasaVenta = 0
+        CalcularMontoARecibirVenta()
+
+    End Sub
+    Private Sub CalcularSumaImpuestosyComisiones()
+        If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='C'").ToString, _SumaImpuestosyComisionesCompra) Then
+            _SumaImpuestosyComisionesCompra = 0
+        End If
+
+        If Not Double.TryParse(_dtImpuestosYComisiones.Compute("SUM(MontoImp)", "TipoOper='V'").ToString, _SumaImpuestosYComisionesVenta) Then
+            _SumaImpuestosYComisionesVenta = 0
+        End If
+
+    End Sub
+    Private Sub CalcularSumasIngresos()
+        If Not Double.TryParse(_dtIngresos.Compute("SUM(Ingreso)", "").ToString, _SumaIngresos) Then
+            _SumaIngresos = 0
+        End If
+        If Not Double.TryParse(_dtIngresos.Compute("SUM(MontoImpuesto)", "").ToString, _SumaImpuestosIngresos) Then
+            _SumaImpuestosIngresos = 0
+        End If
+        If Not Double.TryParse(_dtIngresos.Compute("SUM(Liquido)", "").ToString, _SumaliquidoIngresos) Then
+            _SumaliquidoIngresos = 0
+        End If
+
+    End Sub
+    Private Sub CalcularYTMAlVencimientoCompra()
+
+        Dim vRedemption As Double = (_PrecioAlVencimientoCompra * 100) 'Amortizacion,Precio al vencimiento
+        Dim vRate As Double = _PorcentajeCuponCompra 'Porcentaje de cupon, tasa
+        Dim vFrecuency As Integer = 0 'For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.
+        Dim vPar As Double = (_PrecioCompra * 100) 'Precio de Compra
+        Dim vA As Integer = _DiasAcumuladosCompra 'Dias Acumulados
+        Dim vE As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadCompra) 'número de días en el período del cupón.
+        Dim vDSR As Integer = _DiasAlVencimientoCompra 'número de días desde la fecha de liquidación hasta la fecha de amortización.
+
+        'If vA = 0 Then vA = 1
+
+        If _PeriodicidadCompra = "A" Then vFrecuency = 1
+        If _PeriodicidadCompra = "S" Then vFrecuency = 2
+        If _PeriodicidadCompra = "T" Then vFrecuency = 4
+
+        _YTMAlVencimientoCompra = (vRedemption / 100) + (vRate / vFrecuency)
+        _YTMAlVencimientoCompra = _YTMAlVencimientoCompra - ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        _YTMAlVencimientoCompra = _YTMAlVencimientoCompra / ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        _YTMAlVencimientoCompra = _YTMAlVencimientoCompra * ((vFrecuency * vE) / vDSR)
+
+    End Sub
+
+    Public Function CalcularYTMAl(ByVal PrecioVencimiento As Double, ByVal PorcentajeCupon As Double, ByVal PrecioCompra As Double, ByVal DiasAcumulados As Integer, ByVal Periodicidad As String, ByVal DiasVencimiento As Integer)
+
+        'Dim vRedemption As Double = (PrecioVencimiento * 100) 'Amortizacion,Precio al vencimiento
+        'Dim vRate As Double = PorcentajeCupon 'Porcentaje de cupon, tasa
+        'Dim vFrecuency As Integer = 0 'For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.
+        'Dim vPar As Double = (PrecioCompra * 100) 'Precio de Compra
+        'Dim vA As Integer = DiasAcumulados 'Dias Acumulados
+        'Dim vE As Integer = Utilidades.DiasDeUnPeriodo(Periodicidad) 'número de días en el período del cupón.
+        'Dim vDSR As Integer = DiasVencimiento 'número de días desde la fecha de liquidación hasta la fecha de amortización.
+        'Dim Vencimiento
+        'If vA = 0 Then vA = 1
+        Dim vFrecuency As Integer
+        If Periodicidad = "A" Then vFrecuency = 1
+        If Periodicidad = "S" Then vFrecuency = 2
+        If Periodicidad = "T" Then vFrecuency = 4
+
+        Dim vRedemption As Double = PrecioVencimiento 'Amortizacion,Precio al vencimiento
+        Dim vRate As Double = PorcentajeCupon 'Porcentaje de cupon, tasa
+        'Dim vFrecuency As Integer =  'For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.
+        Dim vPar As Double = PrecioCompra   'Precio de Compra
+        Dim vA As Integer = DiasAcumulados 'Dias Acumulados
+        Dim vE As Integer = Utilidades.DiasDeUnPeriodo(Periodicidad)  'número de días en el período del cupón.
+        Dim vDSR As Integer = DiasVencimiento 'número de días desde la fecha de liquidación hasta la fecha de amortización.
+        Dim Vencimiento
+        'If vA = 0 Then vA = 1
+
+
+        Vencimiento = (vRedemption / 100) + (vRate / vFrecuency)
+        Vencimiento = Vencimiento - ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        Vencimiento = Vencimiento / ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        Vencimiento = Vencimiento * ((vFrecuency * vE) / vDSR)
+
+        'Dim pr = (vRedemption / (1 + Vencimiento / vFrecuency) ^ (50 - 1 + (vDSR / vE))) + (100 * (vRate / vFrecuency)) / (1 + (Vencimiento / vFrecuency)) ^ (vDSR / vE) - (100 * (vRate / vFrecuency) * vA / vE)
+
+        Return Vencimiento
+    End Function
+
+    Public Function CalcularYTMComision(ByVal YTMVen As Double, ByVal ComisionCasa As Double, ByVal DiasVencimiento As Integer, ByVal ComisionBolsa As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0.0
+
+
+        If (DiasVencimiento <> 0) Then
+
+
+
+            If (IndexBase = 0) Then
+                Valor = YTMVen - ((ComisionCasa) * 360 / DiasVencimiento) - ((ComisionBolsa) * 360 / DiasVencimiento)
+                Return Valor
+            ElseIf (IndexBase = 1) Then
+                Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+                Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+                If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    PrOpc1 = ((ComisionCasa) * 366 / DiasPrimeraFecha) - ((ComisionBolsa) * 366 / DiasPrimeraFecha)
+                    PrOpc2 = ((ComisionCasa) * 365 / DiasSegundaFecha) - ((ComisionBolsa) * 365 / DiasSegundaFecha)
+                    Valor = YTMVen - PrOpc1 + PrOpc2
+                ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 365 / DiasSegundaFecha) - ((ComisionBolsa) * 365 / DiasSegundaFecha)
+                ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 366 / DiasPrimeraFecha) - ((ComisionBolsa) * 366 / DiasPrimeraFecha)
+                Else
+                    Valor = 0
+                End If
+                Return Valor
+
+
+
+            ElseIf (IndexBase = 2) Then
+                Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+                Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+                If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    PrOpc1 = ((ComisionCasa) * 366 / DiasPrimeraFecha) - ((ComisionBolsa) * 366 / DiasPrimeraFecha)
+                    PrOpc2 = ((ComisionCasa) * 365 / DiasSegundaFecha) - ((ComisionBolsa) * 365 / DiasSegundaFecha)
+                    Valor = YTMVen - PrOpc1 + PrOpc2
+                ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 365 / DiasSegundaFecha) - ((ComisionBolsa) * 365 / DiasSegundaFecha)
+                ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 366 / DiasPrimeraFecha) - ((ComisionBolsa) * 366 / DiasPrimeraFecha)
+                Else
+                    Valor = 0
+                End If
+                Return Valor
+
+
+
+
+
+
+            Else
+                Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+                Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+                If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    PrOpc1 = ((ComisionCasa) * 360 / DiasPrimeraFecha) - ((ComisionBolsa) * 360 / DiasPrimeraFecha)
+                    PrOpc2 = ((ComisionCasa) * 360 / DiasSegundaFecha) - ((ComisionBolsa) * 360 / DiasSegundaFecha)
+                    Valor = YTMVen - PrOpc1 + PrOpc2
+                ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 360 / DiasSegundaFecha) - ((ComisionBolsa) * 360 / DiasSegundaFecha)
+                ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                    Valor = YTMVen - ((ComisionCasa) * 360 / DiasPrimeraFecha) - ((ComisionBolsa) * 360 / DiasPrimeraFecha)
+                Else
+                    Valor = 0
+                End If
+                Return Valor
+
+            End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        End If
+
+
+        Return Valor
+    End Function
+    Private Sub CalcularYTMAlVencimientoVenta()
+
+        Dim vRedemption As Double = (_PrecioAlVencimientoVenta * 100) 'Amortizacion,Precio al vencimiento
+        Dim vRate As Double = _PorcentajeCuponVenta 'Porcentaje de cupon, tasa
+        Dim vFrecuency As Integer = 0 'For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.
+        Dim vPar As Double = (_PrecioVenta * 100) 'Precio de Compra
+        Dim vA As Integer = _DiasAcumuladosVenta 'Dias Acumulados
+        Dim vE As Integer = Utilidades.DiasDeUnPeriodo(_PeriodicidadVenta) 'número de días en el período del cupón.
+        Dim vDSR As Integer = _DiasAlVencimientoVenta 'número de días desde la fecha de liquidación hasta la fecha de amortización.
+
+        'If vA = 0 Then vA = 1
+
+        If _PeriodicidadVenta = "A" Then vFrecuency = 1
+        If _PeriodicidadVenta = "S" Then vFrecuency = 2
+        If _PeriodicidadVenta = "T" Then vFrecuency = 4
+
+        _YTMAlVencimientoVenta = (vRedemption / 100) + (vRate / vFrecuency)
+        _YTMAlVencimientoVenta = _YTMAlVencimientoVenta - ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        _YTMAlVencimientoVenta = _YTMAlVencimientoVenta / ((vPar / 100) + ((vA / vE) * (vRate / vFrecuency)))
+        _YTMAlVencimientoVenta = _YTMAlVencimientoVenta * ((vFrecuency * vE) / vDSR)
+
+    End Sub
+
+
+End Class

+ 378 - 0
ENTI/CEPropuestaInversion.vb

@@ -0,0 +1,378 @@
+Public Class CEPropuestaInversion
+    Private _IdDeDocumento As Integer = 0
+    Private _CodigoInversion As String = String.Empty
+    Private _EstadoDocumento As String = String.Empty
+    Private _EstadoAutorizacion As String = String.Empty
+    Private _Asunto As String = String.Empty
+    Private _CodigoEmpresa As String = String.Empty
+    Private _CodigoIF As String = String.Empty
+    Private _TipoIF As String = String.Empty
+    Private _CodigoEmisor As Integer = 0
+    Private _CodigoCalificacionDeRiesgo As String = String.Empty
+    Private _CodigoCalificadoraDeRiesgo As String = String.Empty
+    Private _OrigendeFondos As String = String.Empty
+    Private _Comentarios As String = String.Empty
+    Private _Justificacion As String = String.Empty
+    Private _TipoOperacion As String = String.Empty
+    Private _DocumentoBase As Integer = 0
+    Private _CodigoAsociado As String = String.Empty
+    Private _NombreManual As String = String.Empty
+    Private _TipoRenta As String = String.Empty
+    Private _TipoTasa As String = String.Empty
+    Private _Periodicidad As String = String.Empty
+
+    Private _MontoInversion As Double = 0
+    Private _Rendimiento As Double = 0
+    Private _Ingresos As Double = 0
+    Private _Precio As Double = 0
+    Private _PlazoNumero As Integer = 0
+    Private _Plazofactor As String = String.Empty
+    Private _FechaDocumento As Date = Date.Today.Date
+    Private _Pais As String = String.Empty
+    Private _TipoMercado As String = String.Empty
+    Private _CodigoCompra As String = String.Empty
+    Private _EstadoReporto As String = String.Empty
+    Private _IdFlujo As Integer = 0
+    Private _IdEA As Integer = 0
+    Private _IdProInv As Integer = 0
+    Public Property IdDeDocumento As Integer
+        Get
+            Return _IdDeDocumento
+        End Get
+        Set(value As Integer)
+            _IdDeDocumento = value
+        End Set
+    End Property
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property CodigoEmisor As Integer
+        Get
+            Return _CodigoEmisor
+        End Get
+        Set(value As Integer)
+            _CodigoEmisor = value
+        End Set
+    End Property
+    Public Property CodigoCalificacionDeRiesgo As String
+        Get
+            If _CodigoCalificacionDeRiesgo Is Nothing Then Return String.Empty Else Return _CodigoCalificacionDeRiesgo
+        End Get
+        Set(value As String)
+            _CodigoCalificacionDeRiesgo = value
+        End Set
+    End Property
+    Public Property CodigoEmpresaCalificadora As String
+        Get
+            If _CodigoCalificadoraDeRiesgo Is Nothing Then Return String.Empty Else Return _CodigoCalificadoraDeRiesgo
+        End Get
+        Set(value As String)
+            _CodigoCalificadoraDeRiesgo = value
+        End Set
+    End Property
+    Public Property Asunto As String
+        Get
+            Return _Asunto
+        End Get
+        Set(value As String)
+            _Asunto = value
+        End Set
+    End Property
+    Public Property CodigoInstrumentoFinanciero As String
+        Get
+            If _CodigoIF Is Nothing Then Return String.Empty Else Return _CodigoIF
+        End Get
+        Set(value As String)
+            _CodigoIF = value
+            ObtenerTipoIF()
+        End Set
+    End Property
+    Public ReadOnly Property TipoInstrumentoFinanciero As String
+        Get
+            Return _TipoIF
+        End Get
+    End Property
+    Public Property CodigoEmpresa As String
+        Get
+            If _CodigoEmpresa Is Nothing Then Return String.Empty Else Return _CodigoEmpresa
+        End Get
+        Set(value As String)
+            _CodigoEmpresa = value
+        End Set
+    End Property
+
+    Public Property NombreManual As String
+        Get
+            If _NombreManual Is Nothing Then Return String.Empty Else Return _NombreManual
+        End Get
+        Set(value As String)
+            _NombreManual = value
+        End Set
+    End Property
+
+
+    Public Property CodigoCompra As String
+        Get
+            If _CodigoCompra Is Nothing Then Return String.Empty Else Return _CodigoCompra
+        End Get
+        Set(value As String)
+            _CodigoCompra = value
+        End Set
+    End Property
+
+    Public Property CodigoAsociado As String
+        Get
+            If _CodigoAsociado Is Nothing Then Return String.Empty Else Return _CodigoAsociado
+        End Get
+        Set(value As String)
+            _CodigoAsociado = value
+        End Set
+    End Property
+
+
+    Public Property EstadoReporto As String
+        Get
+            If _EstadoReporto Is Nothing Then Return String.Empty Else Return _EstadoReporto
+        End Get
+        Set(value As String)
+            _EstadoReporto = value
+        End Set
+    End Property
+
+
+
+    Public Property IdEA As Integer
+        Get
+            Return _IdEA
+        End Get
+        Set(value As Integer)
+            _IdEA = value
+        End Set
+    End Property
+
+
+
+    Public Property IdProInv As Integer
+        Get
+            Return _IdProInv
+        End Get
+        Set(value As Integer)
+            _IdProInv = value
+        End Set
+    End Property
+
+
+    Public Property IdFlujo As Integer
+        Get
+            Return _IdFlujo
+        End Get
+        Set(value As Integer)
+            _IdFlujo = value
+        End Set
+    End Property
+
+
+
+
+    Public Property TipoRenta As String
+        Get
+            If _TipoRenta Is Nothing Then Return String.Empty Else Return _TipoRenta
+        End Get
+        Set(value As String)
+            _TipoRenta = value
+        End Set
+    End Property
+
+
+
+    Public Property TipoTasa As String
+        Get
+            If _TipoTasa Is Nothing Then Return String.Empty Else Return _TipoTasa
+        End Get
+        Set(value As String)
+            _TipoTasa = value
+        End Set
+    End Property
+
+
+
+
+    Public Property Periodicidad As String
+        Get
+            If _Periodicidad Is Nothing Then Return String.Empty Else Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public Property OrigenDeFondos As String
+        Get
+            If _OrigendeFondos Is Nothing Then Return String.Empty Else Return _OrigendeFondos
+        End Get
+        Set(value As String)
+            _OrigendeFondos = value
+        End Set
+    End Property
+    Public Property PlazoNumero As Integer
+        Get
+            Return _PlazoNumero
+        End Get
+        Set(value As Integer)
+            _PlazoNumero = value
+        End Set
+    End Property
+    Public Property PlazoFactor As String
+        Get
+            If _Plazofactor Is Nothing Then Return String.Empty Else Return _Plazofactor
+        End Get
+        Set(value As String)
+            _PlazoFactor = value
+        End Set
+    End Property
+    Public Property MontoInversion As Double
+        Get
+            Return _MontoInversion
+        End Get
+        Set(value As Double)
+            _MontoInversion = value
+        End Set
+    End Property
+    Public Property Precio As Double
+        Get
+            Return _Precio
+        End Get
+        Set(value As Double)
+            _Precio = value
+        End Set
+    End Property
+    Public Property Rendimiento As Double
+        Get
+            Return _Rendimiento
+        End Get
+        Set(value As Double)
+            _Rendimiento = value
+        End Set
+    End Property
+    Public Property Ingresos As Double
+        Get
+            Return _Ingresos
+        End Get
+        Set(value As Double)
+            _Ingresos = value
+        End Set
+    End Property
+    Public Property TipoOperacion As String
+        Get
+            Return _TipoOperacion
+            If _TipoOperacion Is Nothing Then Return String.Empty Else Return _TipoOperacion
+        End Get
+        Set(value As String)
+            _TipoOperacion = value
+        End Set
+    End Property
+    Public Property EstadoDocumento As String
+        Get
+            If _EstadoDocumento Is Nothing Then Return String.Empty Else Return _EstadoDocumento
+        End Get
+        Set(value As String)
+            _EstadoDocumento = value
+        End Set
+    End Property
+    Public Property EstadoAutorizacion As String
+        Get
+            If _EstadoAutorizacion Is Nothing Then Return String.Empty Else Return _EstadoAutorizacion
+        End Get
+        Set(value As String)
+            _EstadoAutorizacion = value
+        End Set
+    End Property
+    Public Property Justificacion As String
+        Get
+            Return _Justificacion
+        End Get
+        Set(value As String)
+            _Justificacion = value
+        End Set
+    End Property
+    Public Property Comentarios As String
+        Get
+            Return _Comentarios
+        End Get
+        Set(value As String)
+            _Comentarios = value
+        End Set
+    End Property
+
+    Public Property DocumentoBase As Integer
+        Get
+            Return _DocumentoBase
+        End Get
+        Set(value As Integer)
+            _DocumentoBase = value
+        End Set
+    End Property
+    Public Property FechaDocumento As Date
+        Get
+            Return _FechaDocumento
+        End Get
+        Set(value As Date)
+            _FechaDocumento = value
+        End Set
+    End Property
+    Public Property Pais As String
+        Get
+            Return _Pais
+        End Get
+        Set(value As String)
+            _Pais = value
+        End Set
+    End Property
+    Public Property TipoMercado As String
+        Get
+            Return _TipoMercado
+        End Get
+        Set(value As String)
+            _TipoMercado = value
+        End Set
+    End Property
+
+
+
+
+    Public Sub New()
+        CodigoEmpresa = String.Empty
+        Asunto = String.Empty
+        CodigoInstrumentoFinanciero = String.Empty
+        MontoInversion = 0
+        Precio = 0
+        Rendimiento = 0
+        PlazoNumero = 0
+        PlazoFactor = String.Empty
+        Ingresos = 0
+        OrigenDeFondos = String.Empty
+        CodigoEmisor = 0
+        CodigoCalificacionDeRiesgo = String.Empty
+        CodigoEmpresaCalificadora = String.Empty
+        Justificacion = String.Empty
+        Comentarios = String.Empty
+        CodigoInversion = String.Empty
+        EstadoDocumento = String.Empty
+        FechaDocumento = Date.Now.Date
+
+
+    End Sub
+
+    Private Sub ObtenerTipoIF()
+        Dim oDAOGenral As New DAOGeneral
+
+        _TipoIF = oDAOGenral.TipoDeInstrumento(_CodigoIF)
+
+    End Sub
+
+End Class

+ 34 - 0
ENTI/CambiarEstArbCE.vb

@@ -0,0 +1,34 @@
+Public Class CambiarEstArbCE
+    Private CambiarEstArb As New CambiarEstArbDAO
+
+    Public Function ProcesarCambio(ByVal CodigoInversion As String, ByVal Accion As String, ByRef cn As Object, ByRef Transaccion As Object)
+
+        Dim TerminadoCompleto As String = String.Empty
+        Dim InicioAprobacion As String = String.Empty
+        Dim Respuesta As String = "NO"
+        TerminadoCompleto = CambiarEstArb.CambiatEstArb(CodigoInversion, "TerminadoCreado", cn, Transaccion)
+        InicioAprobacion = CambiarEstArb.CambiatEstArb(CodigoInversion, "InicioAprobacion", cn, Transaccion)
+        If TerminadoCompleto = "SI" Then
+
+            If InicioAprobacion = "NO" Then
+                If (Accion = "CambiarRechazado") Then
+
+                    Respuesta = CambiarEstArb.CambiatEstArb(CodigoInversion, "Cancelar", cn, Transaccion)
+
+                ElseIf (Accion = "CambiarAprobacion") Then
+                    Respuesta = "SI"
+                End If
+
+            Else
+                If (Accion = "CambiarAprobacion") Then
+                    Respuesta = "SI"
+                End If
+            End If
+
+        ElseIf TerminadoCompleto = "Continuar" Then
+
+            Respuesta = "SI"
+        End If
+        Return Respuesta
+    End Function
+End Class

+ 27 - 0
ENTI/CertificadoDeInversionCE.vb

@@ -0,0 +1,27 @@
+Public Class CertificadoDeInversionCE
+    Inherits BonosCE
+    Private _CodigoInstrumentoFinanciero As String = "CINV"
+    Private _DescripcionInstrumentoFinanciero As String = "Certificados de Inversión"
+
+    Public Overrides ReadOnly Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+    End Property
+    Public Overrides ReadOnly Property DescripcionInstrumentoFinanciero
+        Get
+            Return _DescripcionInstrumentoFinanciero
+        End Get
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+End Class

+ 15 - 0
ENTI/Controldores.vb

@@ -0,0 +1,15 @@
+Public Class Controldores
+
+    Private _TInstrumento As Integer
+
+    Public Property TInstrumento As Integer
+        Get
+            Return _TInstrumento
+        End Get
+        Set(value As Integer)
+            _TInstrumento = value
+        End Set
+    End Property
+
+
+End Class

+ 344 - 0
ENTI/DepositosAPlazoCE.vb

@@ -0,0 +1,344 @@
+Public Class DepositosAPlazoCE
+    Private _DocId As Integer
+    Private _CodigoInversion As String
+    Private _MontoDeInversion As Double
+    Private _FechaOperacion As Date
+    Private _FechaVencimiento As Date
+    Private _Tasa As Double
+    Private _Plazo As Double
+    Private _AnioBase As Integer
+    Private _Periodicidad As String
+    Private _RendimientoBruto As Double
+    Private _RendimientoNeto As Double
+    Private _IngresoBruto As Double
+    Private _Impuestos As Double
+    Private _IngresoNeto As Double
+    Private _dtIntereses As DataTable
+    Dim Operaciones As New Operaciones
+
+    Public Property dtIntereses As DataTable
+        Get
+            Return _dtIntereses
+        End Get
+        Set(value As DataTable)
+            _dtIntereses = value
+            CalcularSumaIngresoBruto()
+            CalcularSumaISR()
+            CalcularIngresoNeto()
+
+        End Set
+    End Property
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property MontoDeInversion As Double
+        Get
+            Return _MontoDeInversion
+        End Get
+        Set(value As Double)
+            _MontoDeInversion = value
+            CalcularRendimientoBruto()
+            CalcularRendimientoNeto()
+
+        End Set
+    End Property
+    Public Property FechaOperacion As Date
+        Get
+            Return _FechaOperacion
+        End Get
+        Set(value As Date)
+            _FechaOperacion = value
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property Tasa As Double
+        Get
+            Return _Tasa
+        End Get
+        Set(value As Double)
+            _Tasa = value
+        End Set
+    End Property
+    Public Property Plazo As Double
+        Get
+            Return _Plazo
+        End Get
+        Set(value As Double)
+            _Plazo = value
+            CalcularRendimientoBruto()
+            CalcularRendimientoNeto()
+        End Set
+    End Property
+    Public Property AnioBase As Integer
+        Get
+            Return _AnioBase
+        End Get
+        Set(value As Integer)
+            _AnioBase = value
+        End Set
+    End Property
+    Public Property Periodicidad As String
+        Get
+            Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public ReadOnly Property RendimientoBruto As Double
+        Get
+            Return _RendimientoBruto
+        End Get
+
+    End Property
+    Public ReadOnly Property RendimientoNeto As Double
+        Get
+            Return _RendimientoNeto
+        End Get
+
+    End Property
+    Public Property IngresoBruto As Double
+        Get
+            Return _IngresoBruto
+        End Get
+        Set(value As Double)
+            _IngresoBruto = value
+        End Set
+    End Property
+    Public Property Impuestos As Double
+        Get
+            Return _Impuestos
+        End Get
+        Set(value As Double)
+            _Impuestos = value
+        End Set
+    End Property
+    Public Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+        Set(value As Double)
+            _IngresoNeto = value
+        End Set
+    End Property
+
+
+    Public Sub New()
+        _MontoDeInversion = 0.00
+        _FechaOperacion = Date.Now.Date
+        _FechaVencimiento = Date.Now.Date
+        _Tasa = 0.00
+        _Plazo = 0
+        _Periodicidad = "M"
+        PreparaTablaIntereses()
+
+    End Sub
+
+    Private Sub PreparaTablaIntereses()
+        _dtIntereses = New DataTable
+        Dim column As DataColumn
+
+        column = New DataColumn()
+        column.DataType = GetType(String)
+        column.ColumnName = "CodInv"
+        column.Caption = "Codigo Inversion"
+        column.ReadOnly = True
+        _dtIntereses.Columns.Add(column)
+
+
+        column = New DataColumn()
+        column.DataType = GetType(Integer)
+        column.ColumnName = "Correlativo"
+        column.Caption = "Correlativo"
+        column.ReadOnly = True
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Integer)
+        column.ColumnName = "Plazo"
+        column.Caption = "Plazo"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Date)
+        column.ColumnName = "Fecha"
+        column.Caption = "Fecha"
+  
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "IngrBruto"
+        column.Caption = "Ingreso Bruto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "PorcImp"
+        column.Caption = "Porc. de Impuesto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "MontoImp"
+        column.Caption = "Impuesto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "IngrNeto"
+        column.Caption = "Ingreso Neto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(String)
+        column.ColumnName = "Estado"
+        column.Caption = "Estado"
+        _dtIntereses.Columns.Add(column)
+
+
+    End Sub
+    Private Sub CalcularSumaIngresoBruto()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(IngrBruto)", "").ToString, _IngresoBruto) Then
+            _IngresoBruto = 0
+        End If
+        CalcularRendimientoBruto()
+
+    End Sub
+    Private Sub CalcularSumaISR()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(MontoImp)", "").ToString, _Impuestos) Then
+            _Impuestos = 0
+        End If
+    End Sub
+    Private Sub CalcularIngresoNeto()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(IngrNeto)", "").ToString, _IngresoNeto) Then
+            _IngresoNeto = 0
+        End If
+        CalcularRendimientoNeto()
+
+    End Sub
+    Private Sub CalcularRendimientoBruto()
+        Dim valor As Double
+        Dim vIngresoBruto As Double = _IngresoBruto
+        Dim vMontoInversion As Double = _MontoDeInversion
+        Dim vDiasDelAnio As Integer = Utilidades.CalcularDiasDelAnio(_FechaVencimiento)
+        Dim vPlazo As Integer = _Plazo
+
+        valor = (vIngresoBruto / vMontoInversion) * (vDiasDelAnio / vPlazo)
+        _RendimientoBruto = valor
+
+    End Sub
+    Private Sub CalcularRendimientoNeto()
+        Dim valor As Double
+        Dim vIngresoNeto As Double = _IngresoNeto
+        Dim vMontoInversion As Double = _MontoDeInversion
+        Dim vDiasDelAnio As Integer = Utilidades.CalcularDiasDelAnio(_FechaVencimiento)
+        Dim vPlazo As Integer = _Plazo
+
+        valor = (vIngresoNeto / vMontoInversion) * (vDiasDelAnio / vPlazo)
+        _RendimientoNeto = valor
+
+
+    End Sub
+
+
+
+
+
+    Function CalcularPlazo(ByVal ValorPlazo As String)
+        Dim Dias As Integer = 0
+        If (ValorPlazo = "M") Then
+            Dias = 30
+        ElseIf (ValorPlazo = "T") Then
+            Dias = 90
+        ElseIf (ValorPlazo = "S") Then
+            Dias = 180
+        ElseIf (ValorPlazo = "A") Then
+            Dias = 365
+        End If
+        Return Dias
+    End Function
+    Function CalcularIteraciones(ByVal PlazoGlobal As Integer, ByVal Plazo As Integer)
+        Dim Cantidad As Integer = 0
+        If (Not String.IsNullOrEmpty(Plazo.ToString) And Not Plazo.ToString = "0") Then
+            Cantidad = PlazoGlobal / Plazo
+        End If
+
+        Return Cantidad
+    End Function
+    Function CalcularFecha(ByVal Dias As Integer, ByVal Fecha As Date)
+        Return Fecha.AddDays(Dias)
+    End Function
+
+    Function CalculosIngrBruto(ByVal FechaInicial As Date, FechaFinal As Date, ByVal MontoInv As Double, ByVal Tasa As Double, ByVal Plazo As Integer)
+        Dim IngresoBruto = 0.0, IngresoBrutoOpc1 = 0.0, IngresoBrutoOpc2 = 0.0
+
+        Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
+
+        Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
+
+        Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
+        Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+        If (Not CambioDeFecha = 0) Then
+
+
+            If CambioDeFecha = 1 Then
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                IngresoBrutoOpc1 = (MontoInv * Tasa * DiasPrimeraFecha) / 366
+                IngresoBrutoOpc2 = (MontoInv * Tasa * DiasSegundaFecha) / 365
+            ElseIf CambioDeFecha = 2 Then
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                IngresoBrutoOpc1 = (MontoInv * Tasa * DiasPrimeraFecha) / 365
+                IngresoBrutoOpc2 = (MontoInv * Tasa * DiasSegundaFecha) / 366
+            End If
+
+            IngresoBruto = IngresoBrutoOpc1 + IngresoBrutoOpc2
+
+        Else
+
+            If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
+
+                IngresoBruto = (MontoInv * Tasa * Plazo) / 365
+
+            End If
+
+            If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
+
+                IngresoBruto = (MontoInv * Tasa * Plazo) / 366
+            End If
+
+        End If
+        Return IngresoBruto
+    End Function
+    Function Renta(ByVal PorcentajeRent As Double, ByVal IngBruto As Double)
+        Dim DescuentoRenta As Double
+        DescuentoRenta = IngBruto * PorcentajeRent
+        Return DescuentoRenta
+    End Function
+
+
+    Function CalculosIngNeto(ByVal IngBruto As Double, ByVal Renta As Double)
+        Dim CalculoIngrNeto As Double
+        CalculoIngrNeto = IngBruto - Renta
+        Return CalculoIngrNeto
+    End Function
+
+
+
+End Class

+ 3 - 0
ENTI/FondoInversionCE.vb

@@ -0,0 +1,3 @@
+Public Class FondoInversionCE
+
+End Class

+ 323 - 0
ENTI/FondosDeInversionCE.vb

@@ -0,0 +1,323 @@
+Public Class FondosDeInversionCE
+    Private _ValorNominal As Double
+    Private _CuotasDeParticipacion As Double
+    Private _ValorDeParticipacion As Double
+    Private _PorcentajeComisionCasa As Double
+    Private _ComisionCasa As Double
+    Private _PorcentajeComisionBolsa As Double
+    Private _ComisionBolsa As Double
+    Private _ValorTransado As Double
+    Private _FechaOperacion As Date
+    Private _FechaLiquidacion As Date
+    Private _FechaVencimiento As Date
+    Private _RendimientoOfrecido As Double
+    Private _Periodicidad As String
+    Private _AnioBase As Integer
+    Private _Plazo As Integer
+    Private _Dividendo As Double
+    Public FondoInversionDAO = New FondoInversionDAO
+
+    Public Property ValorNominal As Double
+        Get
+            Return _ValorNominal
+        End Get
+        Set(value As Double)
+            _ValorNominal = value
+            CalcularValorTransado()
+        End Set
+    End Property
+    Public Property CuotasDeParticipacion As Double
+        Get
+            Return _CuotasDeParticipacion
+        End Get
+        Set(value As Double)
+            _CuotasDeParticipacion = value
+            CalcularValorNominal()
+        End Set
+    End Property
+    Public Property ValorDeParticipacion As Double
+        Get
+            Return _ValorDeParticipacion
+        End Get
+        Set(value As Double)
+            _ValorDeParticipacion = value
+            CalcularValorNominal()
+        End Set
+    End Property
+    Public Property PorcentajeComisionCasa As Double
+        Get
+            Return _PorcentajeComisionCasa
+        End Get
+        Set(value As Double)
+            _PorcentajeComisionCasa = value
+        End Set
+    End Property
+    Public Property ComisionCasa As Double
+        Get
+            Return _ComisionCasa
+        End Get
+        Set(value As Double)
+            _ComisionCasa = value
+            CalcularValorTransado()
+        End Set
+    End Property
+    Public Property PorcentajeComisionBolsa As Double
+        Get
+            Return _PorcentajeComisionBolsa
+        End Get
+        Set(value As Double)
+            _PorcentajeComisionBolsa = value
+        End Set
+    End Property
+    Public Property ComisionBolsa As Double
+        Get
+            Return _ComisionBolsa
+        End Get
+        Set(value As Double)
+            _ComisionBolsa = value
+            CalcularValorTransado()
+        End Set
+    End Property
+    Public Property ValorTransado As Double
+        Get
+            Return _ValorTransado
+        End Get
+        Set(value As Double)
+            _ValorTransado = value
+        End Set
+    End Property
+    Public Property FechaOperacion As Date
+        Get
+            Return _FechaOperacion
+        End Get
+        Set(value As Date)
+            _FechaOperacion = value
+        End Set
+    End Property
+    Public Property FechaLiquidacion As Date
+        Get
+            Return _FechaLiquidacion
+        End Get
+        Set(value As Date)
+            _FechaLiquidacion = value
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property RendimientoOfrecido As Double
+        Get
+            Return _RendimientoOfrecido
+        End Get
+        Set(value As Double)
+            _RendimientoOfrecido = value
+        End Set
+    End Property
+    Public Property Periodicidad As String
+        Get
+            Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public Property AnioBase As Integer
+        Get
+            Return _AnioBase
+        End Get
+        Set(value As Integer)
+            _AnioBase = value
+        End Set
+    End Property
+    Public Property Plazo As Integer
+        Get
+            Return _Plazo
+        End Get
+        Set(value As Integer)
+            _Plazo = value
+        End Set
+    End Property
+    Public Property Dividendo As Double
+        Get
+            Return _Dividendo
+        End Get
+        Set(value As Double)
+            _Dividendo = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Sub New()
+        ValorNominal = 0
+        CuotasDeParticipacion = 0
+        ValorDeParticipacion = 0
+        PorcentajeComisionCasa = 0
+        ComisionCasa = 0
+        PorcentajeComisionBolsa = 0
+        ComisionBolsa = 0
+        ValorTransado = 0
+        FechaOperacion = Date.Now.Date
+        FechaLiquidacion = Date.Now.Date
+        FechaVencimiento = Date.Now.Date
+        RendimientoOfrecido = 0
+        Periodicidad = ""
+        AnioBase = 365
+        Plazo = 0
+        Dividendo = 0
+    End Sub
+
+    Public Sub CalcularValorNominal()
+        Dim valor As Double
+        Dim vCuotasParticipacion As Double = CuotasDeParticipacion
+        Dim vValorDeParticipacion As Double = ValorDeParticipacion
+
+        Try
+            valor = vCuotasParticipacion * vValorDeParticipacion
+        Catch ex As Exception
+            valor = 0
+        End Try
+
+        ValorNominal = valor
+
+    End Sub
+    Public Sub CalcularComisionCasa()
+
+    End Sub
+    Public Sub CalcularComisionBolsa()
+
+    End Sub
+    Public Sub CalcularValorTransado()
+        Dim valor As Double
+        Dim vValorNominal As Double = ValorNominal
+        Dim vComisionCasa As Double = ComisionCasa
+        Dim vComisionBolsa As Double = ComisionBolsa
+
+        Try
+            valor = vValorNominal + vComisionCasa + vComisionBolsa
+        Catch ex As Exception
+            valor = 0
+        End Try
+        ValorTransado = valor
+    End Sub
+
+    Public Function TablaIngresos() As DataTable
+        Dim dtIngresos As DataTable
+        Dim vFilas As DataRow
+        Dim vColumnas As DataColumn
+
+        Dim vFechaInicial As Date
+        Dim vSiguienteFecha As Date
+        Dim vDias As Integer
+        Dim vDividendo As Double = Dividendo
+        Dim vIngreso As Double
+        Dim vRendimiento As Double
+        Dim vCuotasDeParticipacion As Double = CuotasDeParticipacion
+        Dim vValorNominal As Double = ValorNominal
+        Dim vAnioBase As Integer = AnioBase
+        Dim vDiasDelMes As Integer
+        Dim vEstaFecha As Date
+        Dim vPrimerCalculo As Boolean = True
+
+
+        dtIngresos = New DataTable
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Date)
+        vColumnas.ColumnName = "Fecha"
+        vColumnas.Caption = "Fecha de Corte"
+        vColumnas.AllowDBNull = False
+        dtIngresos.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Integer)
+        vColumnas.ColumnName = "Dias"
+        vColumnas.Caption = "Dias"
+        vColumnas.AllowDBNull = False
+        dtIngresos.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Double)
+        vColumnas.ColumnName = "Dividendo"
+        vColumnas.Caption = "Dividendo"
+        vColumnas.AllowDBNull = False
+        dtIngresos.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Double)
+        vColumnas.ColumnName = "Ingreso"
+        vColumnas.Caption = "Ingreso"
+        vColumnas.AllowDBNull = False
+        dtIngresos.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Double)
+        vColumnas.ColumnName = "Rendimiento"
+        vColumnas.Caption = "Rendimiento"
+        vColumnas.AllowDBNull = False
+        dtIngresos.Columns.Add(vColumnas)
+
+        vFechaInicial = FechaOperacion
+        vDiasDelMes = Date.DaysInMonth(vFechaInicial.Year, vFechaInicial.Month)
+        vSiguienteFecha = New Date(vFechaInicial.Year, vFechaInicial.Month, vDiasDelMes)
+        vDias = DateDiff(DateInterval.Day, vFechaInicial, vSiguienteFecha)
+
+
+        While vSiguienteFecha.Date <= FechaVencimiento.Date
+            If vPrimerCalculo Then
+                vIngreso = ((vDividendo * vCuotasDeParticipacion) / 30) * vDias
+                vPrimerCalculo = False
+            Else
+                vIngreso = vDividendo * vCuotasDeParticipacion
+            End If
+            vRendimiento = vIngreso / vValorNominal * vAnioBase / vDias
+
+            vFilas = dtIngresos.NewRow
+            vFilas("Fecha") = vSiguienteFecha
+            vFilas("Dias") = vDias
+            vFilas("Dividendo") = vDividendo
+            vFilas("Ingreso") = vIngreso
+            vFilas("Rendimiento") = vRendimiento
+            dtIngresos.Rows.Add(vFilas)
+
+            vEstaFecha = vSiguienteFecha
+            vSiguienteFecha = vSiguienteFecha.AddDays(1)
+            vDiasDelMes = Date.DaysInMonth(vSiguienteFecha.Year, vSiguienteFecha.Month)
+            vSiguienteFecha = New Date(vSiguienteFecha.Year, vSiguienteFecha.Month, vDiasDelMes)
+            vDias = DateDiff(DateInterval.Day, vEstaFecha, vSiguienteFecha)
+        End While
+
+
+
+
+        Return dtIngresos
+        dtIngresos.Dispose()
+    End Function
+    Public Function CalculoValorNominal(ByVal CuotasParticipacion As Double, ByVal ValorParticipacion As Double)
+        Dim Total = CuotasParticipacion * ValorParticipacion
+        Return Total
+    End Function
+    Public Function CalculoFechaLiq(ByVal FechaOperaciones As Date, ByVal Dias As Integer)
+        Dim fecha = FechaOperaciones.AddDays(Dias)
+        Return fecha
+    End Function
+    Public Sub Modificar(ByVal Coleccion As Collection, ByVal Codigo As String)
+        FondoInversionDAO.Modificar(Coleccion, Codigo)
+    End Sub
+    Public Sub Nuevo(ByVal Coleccion As Collection, ByVal Codigo As String)
+        FondoInversionDAO.Nuevo(Coleccion, Codigo)
+    End Sub
+    Public Sub Eliminar(ByVal Codigo As String)
+        FondoInversionDAO.Eliminar(Codigo)
+    End Sub
+
+
+End Class

+ 331 - 0
ENTI/FormulasBonoCE.vb

@@ -0,0 +1,331 @@
+Public Class FormulasBonoCE
+
+
+    Dim ElementosConsulta As New CargarElementosDAO
+    Dim V_CodEmpr = ElementosConsulta.CodEmpr
+    'Dim V_CodIF = ElementosConsulta.CodIF
+    Dim V_CodEmis = ElementosConsulta.CodEmis
+    Dim V_CodECalRi = ElementosConsulta.CodECalRi
+    Dim V_CodPais = ElementosConsulta.CodPais
+    Dim V_ListaPlazo = ElementosConsulta.ListaPlazosFactor
+    Dim V_ListaTiposMercados = ElementosConsulta.ListaTiposMercado
+    Dim V_ListaPeriodos = ElementosConsulta.ListaPeriodos
+    Dim V_ListaTipoTasa = ElementosConsulta.ListaTipoTasa
+    Dim V_ListaTipoRenta = ElementosConsulta.ListaTipoRenta
+    Dim V_ListaEstado = ElementosConsulta.ListaEstado
+    Dim Operaciones As New Operaciones
+    Dim V_ListaCasasCorredoras = ElementosConsulta.ListaCasasCorredoras
+
+
+    Public ReadOnly Property ListaCasasCorredoras
+
+        Get
+
+            Return V_ListaCasasCorredoras
+        End Get
+    End Property
+
+
+
+
+    Public ReadOnly Property ListaEstado
+
+        Get
+
+            Return V_ListaEstado
+        End Get
+    End Property
+
+
+
+
+    Public ReadOnly Property ListaTipoRenta
+        Get
+            Return V_ListaTipoRenta
+        End Get
+    End Property
+
+
+
+
+
+    Public ReadOnly Property ListaTipoTasa
+        Get
+            Return V_ListaTipoTasa
+        End Get
+    End Property
+
+
+    Public ReadOnly Property ListaPeriodos
+        Get
+            Return V_ListaPeriodos
+        End Get
+    End Property
+
+
+    Public ReadOnly Property CodPais
+        Get
+            Return V_CodPais
+        End Get
+    End Property
+
+
+
+    Public ReadOnly Property CodEmpr
+        Get
+            Return V_CodEmpr
+        End Get
+    End Property
+    Public ReadOnly Property ListaTiposMercados
+        Get
+            Return V_ListaTiposMercados
+        End Get
+    End Property
+
+    Public ReadOnly Property ListaPlazo
+        Get
+            Return V_ListaPlazo
+        End Get
+    End Property
+
+    Public ReadOnly Property CodEmis
+        Get
+            Return V_CodEmis
+        End Get
+    End Property
+
+    Public ReadOnly Property CodECalRi
+        Get
+            Return V_CodECalRi
+        End Get
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Function DiasVencimiento(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime, ByVal Base As Integer)
+        fecha1 = Format(fecha1, "dd/MM/yyyy")
+        fecha2 = Format(fecha2, "dd/MM/yyyy")
+        Dim Total As Integer
+
+        If (Base = 0 Or Base = 2) Then
+            Total = Base360(fecha1, fecha2)
+
+        ElseIf (Base = 1 Or Base = 3) Then
+            Total = Base365(fecha1, fecha2)
+
+        Else
+            Total = 0
+
+        End If
+
+        Return Total
+    End Function
+    Public Function DiasAcumulados(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime, ByVal Base As Integer)
+
+        Dim Total As Integer
+
+        If (Base = 0 Or Base = 2) Then
+            Total = Base360(fecha1, fecha2)
+
+        ElseIf (Base = 1 Or Base = 3) Then
+            Total = Base365(fecha1, fecha2)
+
+        Else
+            Total = 0
+
+        End If
+
+        Return Total
+    End Function
+
+    Public Function InteresAcumulado(ByVal ValorNominal As Double, ByVal Cupon As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal DiasAcumulados As Double, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+
+
+
+        If (IndexBase = 0) Then
+            Valor = ValorNominal * Cupon * DiasAcumulados / 360
+            Return Valor
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+
+
+
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * Cupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorNominal * Cupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * Cupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorNominal * Cupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * Cupon * DiasPrimeraFecha / 360
+                PrOpc2 = ValorNominal * Cupon * DiasSegundaFecha / 360
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasSegundaFecha / 360
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * Cupon * DiasPrimeraFecha / 360
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+        End If
+    End Function
+    Public Function InteresAcumuladoPor(ByVal InteresAcumulado As Double, ByVal ValorNominal As Double, ByVal Periodicidad As Double, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0 Or IndexBase = 2) Then
+
+
+            Valor = ((InteresAcumulado / ValorNominal) * 360) / (Periodicidad * 30)
+
+
+            Return Valor
+
+
+        ElseIf (IndexBase = 1 Or IndexBase = 3) Then
+
+
+            Valor = ((InteresAcumulado / ValorNominal) * 365) / (Periodicidad * 30)
+            Return Valor
+
+        End If
+
+
+
+
+
+
+
+        Return Valor
+    End Function
+
+
+    Public Function PrecioSucio(ByVal PrecioCompra As Double, ByVal InteresAcumulado As Double)
+        Dim Proceso = (PrecioCompra * 0.01 + InteresAcumulado) * 100
+        Return Proceso
+    End Function
+    Public Function ValorTrasado(ByVal PrecioCompra As Double, ByVal ValorNominal As Double)
+        Dim Proceso = (PrecioCompra / 100) * ValorNominal
+        Return Proceso
+    End Function
+
+
+    Public Function Comisiones(ByVal Comision As Double, ByVal ValorTrasado As Double)
+        Dim Valor = CDec(Comision) * CDec(ValorTrasado)
+
+        Return Valor / 100
+    End Function
+
+    Public Function MontoPagar(ByVal ValorTrasado As Double, ByVal ComisionBolsa As Double, ByVal ComisionCasa As Double, ByVal InteresAcumulado As Double, ByVal CostoTransferencias As Double)
+        Dim Valor = ValorTrasado + ComisionBolsa + ComisionCasa + InteresAcumulado + CostoTransferencias
+
+        Return Valor
+
+    End Function
+
+    Public Function MontoRecibir(ByVal ValorTrasado As Double, ByVal ComisionBolsa As Double, ByVal ComisionCasa As Double, ByVal InteresAcumulado As Double)
+        Dim Valor = ValorTrasado - ComisionBolsa - ComisionCasa + InteresAcumulado
+        Return Valor
+
+    End Function
+
+    Public Function MontoRecibir(ByVal ValorTrasado As Double, ByVal ComisionBolsa As Double, ByVal ComisionCasa As Double, ByVal InteresAcumulado As Double, ByVal InteresGenerado As Double)
+        Dim Valor = ValorTrasado - ComisionBolsa - ComisionCasa + InteresAcumulado + InteresGenerado
+        Return Valor
+
+    End Function
+    Public Function Base360(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim dia As Integer
+        Dim dias31 As Integer
+        Dim febreros As Integer
+        Dim bisiesto As Integer
+
+
+
+
+        While (Fecha1 < Fecha2)
+            dia = dia + 1
+
+            If (Fecha1.Day = 31) Then
+                dias31 = dias31 + 1
+
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 28) Then
+                febreros = febreros + 2
+
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 29) Then
+                bisiesto = bisiesto + 1
+
+            End If
+
+            Fecha1 = Fecha1.AddDays(1)
+        End While
+
+        Dim Total = dia - dias31 + febreros - bisiesto
+        Return Total
+    End Function
+    Public Function Base365(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+
+        Dim dias = DateDiff(DateInterval.Day, Fecha1, Fecha2)
+
+
+        Return dias
+    End Function
+
+End Class

+ 184 - 0
ENTI/FuturosCE.vb

@@ -0,0 +1,184 @@
+Public Class FuturosCE
+    Private _TipoOperacion As String
+    Private _IdDelContrato As String
+    Private _CantidadContratos As Integer
+    Private _Unidades As Integer
+    Private _ValorUnitario As Double
+    Private _ValorTransado As Double
+    Private _ComisionBroker As Double
+    Private _ValorDeLaOperacion As Double
+    Private _FechaOperacion As Date
+    Private _FechaLiquidacion As Date
+    Private _FechaVencimiento As Date
+    Private _ValorTransadoCompra As Double
+    Private _Ganancia As Double
+    Private _Rendimiento As Double
+
+    Public Property TipoOperacion As String
+        Get
+            Return _TipoOperacion
+        End Get
+        Set(value As String)
+            _TipoOperacion = value
+        End Set
+    End Property
+    Public Property IdDelContrato As String
+        Get
+            Return _IdDelContrato
+        End Get
+        Set(value As String)
+            _IdDelContrato = value
+        End Set
+    End Property
+    Public Property CantidadContratos As Integer
+        Get
+            Return _CantidadContratos
+        End Get
+        Set(value As Integer)
+            _CantidadContratos = value
+            CalcularValorTransado()
+            CalcularValorDeLaOperacion()
+        End Set
+    End Property
+    Public Property Unidades As Integer
+        Get
+            Return _Unidades
+        End Get
+        Set(value As Integer)
+            _Unidades = value
+            CalcularValorTransado()
+        End Set
+    End Property
+    Public Property ValorUnitario As Double
+        Get
+            Return _ValorUnitario
+        End Get
+        Set(value As Double)
+            _ValorUnitario = value
+            CalcularValorTransado()
+        End Set
+    End Property
+    Public Property ValorTransado As Double
+        Get
+            Return _ValorTransado
+        End Get
+        Set(value As Double)
+            _ValorTransado = value
+            CalcularValorDeLaOperacion()
+        End Set
+    End Property
+    Public Property ComisionBroker As Double
+        Get
+            Return _ComisionBroker
+        End Get
+        Set(value As Double)
+            _ComisionBroker = value
+            CalcularValorDeLaOperacion()
+        End Set
+    End Property
+    Public Property ValorDeLaOperacion As Double
+        Get
+            Return _ValorDeLaOperacion
+        End Get
+        Set(value As Double)
+            _ValorDeLaOperacion = value
+            CalcularGanancia()
+        End Set
+    End Property
+    Public Property FechaOperacion As Date
+        Get
+            Return _FechaOperacion
+        End Get
+        Set(value As Date)
+            _FechaOperacion = value
+        End Set
+    End Property
+    Public Property FechaLiquidacion As Date
+        Get
+            Return _FechaLiquidacion
+        End Get
+        Set(value As Date)
+            _FechaLiquidacion = value
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property ValorTransadoCompra As Double
+        Get
+            Return _ValorTransadoCompra
+        End Get
+        Set(value As Double)
+            _ValorTransadoCompra = value
+            CalcularGanancia()
+        End Set
+    End Property
+    Public Property Ganancia As Double
+        Get
+            Return _Ganancia
+        End Get
+        Set(value As Double)
+            _Ganancia = value
+        End Set
+    End Property
+    Public Property Rendimiento As Double
+        Get
+            Return _Rendimiento
+        End Get
+        Set(value As Double)
+            _Rendimiento = value
+        End Set
+    End Property
+
+
+
+    Private Sub CalcularValorTransado()
+        Dim valor As Double
+        Dim vCantidad As Integer = CantidadContratos
+        Dim vUnidades As Integer = Unidades
+        Dim vValorUnitario As Double = ValorUnitario
+
+        Try
+            valor = vCantidad * vUnidades * vValorUnitario
+        Catch ex As Exception
+            valor = 0
+        End Try
+        ValorTransado = valor
+    End Sub
+
+    Private Sub CalcularValorDeLaOperacion()
+        Dim valor As Double
+        Dim vCantidad As Integer = CantidadContratos
+        Dim vValorTransado As Double = ValorTransado
+        Dim vComisionBroker As Double = ComisionBroker
+
+        Try
+            valor = vCantidad + vValorTransado + vComisionBroker
+        Catch ex As Exception
+            valor = 0
+        End Try
+        ValorDeLaOperacion = valor
+    End Sub
+    Private Sub CalcularGanancia()
+        Dim valor As Double
+        Dim vValorTransadoCompra As Double = ValorTransadoCompra
+        Dim vValorDeOperacion As Double = ValorDeLaOperacion
+        Try
+            valor = vValorTransadoCompra - vValorDeOperacion
+        Catch ex As Exception
+            valor = 0
+        End Try
+        Ganancia = valor
+    End Sub
+    Private Sub CalcularRendimiento()
+        Dim valor As Double
+        Dim vGanancias As Double = Ganancia
+
+    End Sub
+
+End Class

+ 180 - 0
ENTI/IngresoDetalleCE.vb

@@ -0,0 +1,180 @@
+Public Class IngresoDetalleCE
+    Private _CodigoInversion As String
+    Private _CodigoInstrumentoFinanciero As String
+    Private _CodigoEmpresa As String
+    Private _CodigoEmisor As Integer
+    Private _CodigoEmpresaCalificadora As String
+    Private _NombreManualIF As String
+    Private _CodigoManualIF As String
+    Private _FechaVencimiento As DateTime
+    Private _MontoCapitalProyectado As Double
+    Private _MontoIngresoBrutoProyectado As Double
+    Private _MontoISRProyectado As Double
+    Private _MontoIngresoNetoProyectado As Double
+    Private _MontoIngresoLiquidoProyectado As Double
+    Private _IngresoId As Integer
+    Private _SAP_BD As String
+    Private _EstadoDelIngreso As String
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(ByVal Value As String)
+            _CodigoInversion = Value
+        End Set
+    End Property
+
+    Public Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+        Set(ByVal Value As String)
+            _CodigoInstrumentoFinanciero = Value
+        End Set
+    End Property
+
+    Public Property CodigoEmpresa As String
+        Get
+            Return _CodigoEmpresa
+        End Get
+        Set(ByVal Value As String)
+            _CodigoEmpresa = Value
+        End Set
+    End Property
+
+    Public Property CodigoEmisor As Integer
+        Get
+            Return _CodigoEmisor
+        End Get
+        Set(ByVal Value As Integer)
+            _CodigoEmisor = Value
+        End Set
+    End Property
+
+    Public Property CodigoEmpresaCalificadora As String
+        Get
+            Return _CodigoEmpresaCalificadora
+        End Get
+        Set(ByVal Value As String)
+            _CodigoEmpresaCalificadora = Value
+        End Set
+    End Property
+
+    Public Property NombreManualIF As String
+        Get
+            Return _NombreManualIF
+        End Get
+        Set(ByVal Value As String)
+            _NombreManualIF = Value
+        End Set
+    End Property
+
+    Public Property CodigoManualIF As String
+        Get
+            Return _CodigoManualIF
+        End Get
+        Set(ByVal Value As String)
+            _CodigoManualIF = Value
+        End Set
+    End Property
+
+    Public Property FechaVencimiento As DateTime
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(ByVal Value As DateTime)
+            _FechaVencimiento = Value
+        End Set
+    End Property
+
+    Public Property MontoCapitalProyectado As Double
+        Get
+            Return _MontoCapitalProyectado
+        End Get
+        Set(ByVal Value As Double)
+            _MontoCapitalProyectado = Value
+        End Set
+    End Property
+
+    Public Property MontoIngresoBrutoProyectado As Double
+        Get
+            Return _MontoIngresoBrutoProyectado
+        End Get
+        Set(ByVal Value As Double)
+            _MontoIngresoBrutoProyectado = Value
+        End Set
+    End Property
+
+    Public Property MontoISRProyectado As Double
+        Get
+            Return _MontoISRProyectado
+        End Get
+        Set(ByVal Value As Double)
+            _MontoISRProyectado = Value
+        End Set
+    End Property
+
+    Public Property MontoIngresoNetoProyectado As Double
+        Get
+            Return _MontoIngresoNetoProyectado
+        End Get
+        Set(ByVal Value As Double)
+            _MontoIngresoNetoProyectado = Value
+        End Set
+    End Property
+
+    Public Property MontoIngresoLiquidoProyectado As Double
+        Get
+            Return _MontoIngresoLiquidoProyectado
+        End Get
+        Set(ByVal Value As Double)
+            _MontoIngresoLiquidoProyectado = Value
+        End Set
+    End Property
+
+    Public Property IngresoId As Integer
+        Get
+            Return _IngresoId
+        End Get
+        Set(ByVal Value As Integer)
+            _IngresoId = Value
+        End Set
+    End Property
+    Public Property EstadoDelIngreso As String
+        Get
+            Return _EstadoDelIngreso
+        End Get
+        Set(ByVal Value As String)
+            _EstadoDelIngreso = Value
+        End Set
+    End Property
+    Public Property SAP_BD As String
+        Get
+            Return _SAP_BD
+        End Get
+        Set(ByVal Value As String)
+            _SAP_BD = Value
+        End Set
+    End Property
+
+    Public Sub New()
+        _CodigoInversion = String.Empty
+        _CodigoInstrumentoFinanciero = String.Empty
+        _CodigoEmpresa = String.Empty
+        _CodigoEmisor = 0
+        _CodigoEmpresaCalificadora = String.Empty
+        _NombreManualIF = String.Empty
+        _CodigoManualIF = String.Empty
+        _FechaVencimiento = Date.MinValue.Date
+        _MontoCapitalProyectado = 0
+        _MontoIngresoBrutoProyectado = 0
+        _MontoISRProyectado = 0
+        _MontoIngresoNetoProyectado = 0
+        _MontoIngresoLiquidoProyectado = 0
+        _IngresoId = 0
+        _SAP_BD = String.Empty
+        _EstadoDelIngreso = ""
+    End Sub
+
+End Class

+ 3 - 0
ENTI/Interface1.vb

@@ -0,0 +1,3 @@
+Public Interface Interface1
+
+End Interface

+ 375 - 0
ENTI/InversionesCE.vb

@@ -0,0 +1,375 @@
+Public Class InversionesCE
+    Private _IdDeDocumento As Integer = 0
+    Private _CodigoInversion As String = String.Empty
+    Private _EstadoDocumento As String = String.Empty
+    Private _EstadoAutorizacion As String = String.Empty
+    'Private _Asunto As String
+    Private _CodigoEmpresa As String = String.Empty
+    Private _CodigoIF As String = String.Empty
+    Private _TipoIF As String = String.Empty
+    Private _CodigoEmisor As Integer = 0
+    Private _CodigoCalificacionDeRiesgo As String = String.Empty
+    Private _CodigoCalificadoraDeRiesgo As String = String.Empty
+    'Private _OrigendeFondos As String
+    Private _Comentarios As String = String.Empty
+    'Private _Justificacion As String
+    Private _TipoOperacion As String = String.Empty
+    Private _DocumentoBase As Integer = 0
+    Private _CodigoAsociado As String = String.Empty
+    Private _MontoInversion As Double = 0
+    Private _Rendimiento As Double = 0
+    Private _Ingresos As Double = 0
+    Private _Precio As Double = 0
+    Private _PlazoNumero As Integer = 0
+    Private _PlazoFactor As String = 0
+    Private _FechaDocumento As Date = Date.Today.Date
+    Private _Pais As String = String.Empty
+    Private _TipoMercado As String = String.Empty
+    Private _NombreManual As String = String.Empty
+    Private _CodigoManual As String = String.Empty
+    Private _Periodicidad As String = String.Empty
+    Private _TipoTasa As String = String.Empty
+    Private _TipoRenta As String = String.Empty
+    Private _OFondo As String = String.Empty
+    Private _EstadoProceso As String = String.Empty
+    Private _CodigoCompra As String = String.Empty
+    Private _EstadoReporto As String = String.Empty
+    Private _IdFlujo As Integer = 0
+    Private _IdEA As Integer = 0
+    Private _IdProInv As Integer = 0
+
+
+
+    Public Property IdDeDocumento As Integer
+        Get
+            Return _IdDeDocumento
+        End Get
+        Set(value As Integer)
+            _IdDeDocumento = value
+        End Set
+    End Property
+
+    Public Property CodigoIversion As String
+        Get
+            If _CodigoInversion Is Nothing Then Return "" Else Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+
+
+    Public Property EstadoProceso As String
+        Get
+            If _EstadoProceso Is Nothing Then Return "" Else Return _EstadoProceso
+        End Get
+        Set(value As String)
+            _EstadoProceso = value
+        End Set
+    End Property
+    Public Property CodigoEmisor As Integer
+        Get
+            Return _CodigoEmisor
+        End Get
+        Set(value As Integer)
+            _CodigoEmisor = value
+        End Set
+    End Property
+    Public Property CodigoCalificacionDeRiesgo As String
+        Get
+            If _CodigoCalificacionDeRiesgo Is Nothing Then Return String.Empty Else Return _CodigoCalificacionDeRiesgo
+        End Get
+        Set(value As String)
+            _CodigoCalificacionDeRiesgo = value
+        End Set
+    End Property
+    Public Property CodigoEmpresaCalificadora As String
+        Get
+            If _CodigoCalificadoraDeRiesgo Is Nothing Then Return String.Empty Else Return _CodigoCalificadoraDeRiesgo
+        End Get
+        Set(value As String)
+            _CodigoCalificadoraDeRiesgo = value
+        End Set
+    End Property
+    'Public Property Asunto As String
+    '    Get
+    '        Return _Asunto
+    '    End Get
+    '    Set(value As String)
+    '        _Asunto = value
+    '    End Set
+    'End Property
+    Public Property CodigoInstrumentoFinanciero As String
+        Get
+            If _CodigoIF Is Nothing Then Return String.Empty Else Return _CodigoIF
+        End Get
+        Set(value As String)
+            _CodigoIF = value
+        End Set
+    End Property
+    Public Property TipoInstrumentoFinanciero As String
+        Get
+            Return _TipoIF
+        End Get
+        Set(value As String)
+            _TipoIF = value
+        End Set
+    End Property
+    Public Property CodigoEmpresa As String
+        Get
+            If _CodigoEmpresa Is Nothing Then Return String.Empty Else Return _CodigoEmpresa
+        End Get
+        Set(value As String)
+            _CodigoEmpresa = value
+        End Set
+    End Property
+    'Public Property OrigenDeFondos As String
+    '    Get
+    '        If _OrigendeFondos Is Nothing Then Return String.Empty Else Return _OrigendeFondos
+    '    End Get
+    '    Set(value As String)
+    '        _OrigendeFondos = value
+    '    End Set
+    'End Property
+    Public Property PlazoNumero As Integer
+        Get
+            Return _PlazoNumero
+        End Get
+        Set(value As Integer)
+            _PlazoNumero = value
+        End Set
+    End Property
+    Public Property PlazoFactor As String
+        Get
+            If _Plazofactor Is Nothing Then Return String.Empty Else Return _Plazofactor
+        End Get
+        Set(value As String)
+            _Plazofactor = value
+        End Set
+    End Property
+    Public Property MontoInversion As Double
+        Get
+            Return _MontoInversion
+        End Get
+        Set(value As Double)
+            _MontoInversion = value
+        End Set
+    End Property
+    Public Property Precio As Double
+        Get
+            Return _Precio
+        End Get
+        Set(value As Double)
+            _Precio = value
+        End Set
+    End Property
+    Public Property Rendimiento As Double
+        Get
+            Return _Rendimiento
+        End Get
+        Set(value As Double)
+            _Rendimiento = value
+        End Set
+    End Property
+    Public Property Ingresos As Double
+        Get
+            Return _Ingresos
+        End Get
+        Set(value As Double)
+            _Ingresos = value
+        End Set
+    End Property
+    Public Property TipoOperacion As String
+        Get
+            Return _TipoOperacion
+        End Get
+        Set(value As String)
+            _TipoOperacion = value
+        End Set
+    End Property
+
+
+    Public Property OFondo As String
+        Get
+
+            If _OFondo Is Nothing Then Return String.Empty Else Return _OFondo
+        End Get
+        Set(value As String)
+            _OFondo = value
+        End Set
+    End Property
+
+
+    Public Property CodigoCompra As String
+        Get
+
+            If _CodigoCompra Is Nothing Then Return String.Empty Else Return _CodigoCompra
+        End Get
+        Set(value As String)
+            _CodigoCompra = value
+        End Set
+    End Property
+    Public Property EstadoDocumento As String
+        Get
+            If _EstadoDocumento Is Nothing Then Return String.Empty Else Return _EstadoDocumento
+        End Get
+        Set(value As String)
+            'If IsDBNull(value) Then _EstadoDocumento = String.Empty Else _EstadoDocumento = value
+            _EstadoDocumento = value
+        End Set
+    End Property
+    Public Property EstadoAutorizacion As String
+        Get
+            If _EstadoAutorizacion Is Nothing Then Return String.Empty Else Return _EstadoAutorizacion
+        End Get
+        Set(value As String)
+            _EstadoAutorizacion = value
+        End Set
+    End Property
+    'Public Property Justificacion As String
+    '    Get
+    '        Return _Justificacion
+    '    End Get
+    '    Set(value As String)
+    '        _Justificacion = value
+    '    End Set
+    'End Property
+    Public Property Comentarios As String
+        Get
+            Return _Comentarios
+        End Get
+        Set(value As String)
+            _Comentarios = value
+        End Set
+    End Property
+
+
+    Public Property CodigoAsociado As String
+        Get
+            Return _CodigoAsociado
+        End Get
+        Set(value As String)
+            _CodigoAsociado = value
+        End Set
+    End Property
+
+    Public Property EstadoReporto As String
+        Get
+            Return _EstadoReporto
+        End Get
+        Set(value As String)
+            _EstadoReporto = value
+        End Set
+    End Property
+
+    Public Property IdFlujo As Integer
+        Get
+            Return _IdFlujo
+        End Get
+        Set(value As Integer)
+            _IdFlujo = value
+        End Set
+    End Property
+
+    Public Property IdEA As Integer
+        Get
+            Return _IdEA
+        End Get
+        Set(value As Integer)
+            _IdEA = value
+        End Set
+    End Property
+
+
+
+    Public Property IdProInv As Integer
+        Get
+            Return _IdProInv
+        End Get
+        Set(value As Integer)
+            _IdProInv = value
+        End Set
+    End Property
+
+
+    Public Property DocumentoBase As Integer
+        Get
+            Return _DocumentoBase
+        End Get
+        Set(value As Integer)
+            _DocumentoBase = value
+        End Set
+    End Property
+    Public Property FechaDocumento As Date
+        Get
+            Return _FechaDocumento
+        End Get
+        Set(value As Date)
+            _FechaDocumento = value
+        End Set
+    End Property
+    Public Property Pais As String
+        Get
+            Return _Pais
+        End Get
+        Set(value As String)
+            _Pais = value
+        End Set
+    End Property
+    Public Property TipoMercado As String
+        Get
+
+            Return _TipoMercado
+        End Get
+        Set(value As String)
+            _TipoMercado = value
+        End Set
+    End Property
+    Public Property NombreManual As String
+        Get
+            Return _NombreManual
+        End Get
+        Set(value As String)
+            _NombreManual = value
+        End Set
+    End Property
+    Public Property CodigoManual As String
+        Get
+            Return _CodigoManual
+        End Get
+        Set(value As String)
+            _CodigoManual = value
+        End Set
+    End Property
+    Public Property Periodicidad As String
+        Get
+            Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public Property TipoTasa As String
+        Get
+            Return _TipoTasa
+        End Get
+        Set(value As String)
+            _TipoTasa = value
+        End Set
+    End Property
+    Public Property TipoRenta As String
+        Get
+            Return _TipoRenta
+        End Get
+        Set(value As String)
+            _TipoRenta = value
+        End Set
+    End Property
+
+    Public Sub New()
+        _CodigoManual = String.Empty
+        _TipoOperacion = String.Empty
+        _Comentarios = String.Empty
+    End Sub
+
+End Class

+ 161 - 0
ENTI/LETESCE.vb

@@ -0,0 +1,161 @@
+Public Class LETESCE
+    Private _DocId As Integer
+    Private _CodigoInversion As String
+    Private _CodigoCasa As String
+    Private _ValorNominal As Double
+    Private _ValorTransado As Double
+    Private _Precio As Double
+    Private _Impuestos As Double
+    Private _TotalaPagar As Double
+    Private _FechaOperacion As Date
+    Private _FechaLiquidacion As Date
+    Private _FechaVencimiento As Date
+    Private _RendimientoBruto As Double
+    Private _RendimientoNeto As Double
+    Private _Periodicidad As String
+    Private _Plazo As Integer
+    Private _IngresoBruto As Double
+    Private _IngresoNeto As Double
+
+
+    Public Property DocId As Integer
+        Get
+            Return _DocId
+        End Get
+        Set(value As Integer)
+            _DocId = value
+        End Set
+    End Property
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+
+    Public Property CodigoCasa As String
+        Get
+            Return _CodigoCasa
+        End Get
+        Set(value As String)
+            _CodigoCasa = value
+        End Set
+    End Property
+    Public Property ValorNominal As Double
+        Get
+            Return _ValorNominal
+        End Get
+        Set(value As Double)
+            _ValorNominal = value
+        End Set
+    End Property
+    Public Property ValorTransado As Double
+        Get
+            Return _ValorTransado
+        End Get
+        Set(value As Double)
+            _ValorTransado = value
+        End Set
+    End Property
+    Public Property Precio As Double
+        Get
+            Return _Precio
+        End Get
+        Set(value As Double)
+            _Precio = value
+        End Set
+    End Property
+    Public Property Impuestos As Double
+        Get
+            Return _Impuestos
+        End Get
+        Set(value As Double)
+            _Impuestos = value
+        End Set
+    End Property
+    Public Property TotalaPagar As Double
+        Get
+            Return _TotalaPagar
+        End Get
+        Set(value As Double)
+            _TotalaPagar = value
+        End Set
+    End Property
+    Public Property FechaOperacion As Date
+        Get
+            Return _FechaOperacion
+        End Get
+        Set(value As Date)
+            _FechaOperacion = value
+        End Set
+    End Property
+    Public Property FechaLiquidacion As Date
+        Get
+            Return _FechaLiquidacion
+        End Get
+        Set(value As Date)
+            _FechaLiquidacion = value
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property RendimientoBruto As Double
+        Get
+            Return _RendimientoBruto
+        End Get
+        Set(value As Double)
+            _RendimientoBruto = value
+        End Set
+    End Property
+    Public Property RendimientoNeto As Double
+        Get
+            Return _RendimientoNeto
+        End Get
+        Set(value As Double)
+            _RendimientoNeto = value
+        End Set
+    End Property
+    Public Property Periodicidad As String
+        Get
+            Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public Property Plazo As Integer
+        Get
+            Return _Plazo
+        End Get
+        Set(value As Integer)
+            _Plazo = value
+        End Set
+    End Property
+    Public Property IngresoBruto As Double
+        Get
+            Return _IngresoBruto
+        End Get
+        Set(value As Double)
+            _IngresoBruto = value
+        End Set
+    End Property
+    Public Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+        Set(value As Double)
+            _IngresoNeto = value
+        End Set
+    End Property
+
+
+
+End Class

+ 344 - 0
ENTI/NotaEstructuradaCE.vb

@@ -0,0 +1,344 @@
+Public Class NotaEstructuradaCE
+    Private _DocId As Integer
+    Private _CodigoInversion As String
+    Private _MontoDeInversion As Double
+    Private _FechaOperacion As Date
+    Private _FechaVencimiento As Date
+    Private _Tasa As Double
+    Private _Plazo As Double
+    Private _AnioBase As Integer
+    Private _Periodicidad As String
+    Private _RendimientoBruto As Double
+    Private _RendimientoNeto As Double
+    Private _IngresoBruto As Double
+    Private _Impuestos As Double
+    Private _IngresoNeto As Double
+    Private _dtIntereses As DataTable
+    Dim Operaciones As New Operaciones
+
+    Public Property dtIntereses As DataTable
+        Get
+            Return _dtIntereses
+        End Get
+        Set(value As DataTable)
+            _dtIntereses = value
+            CalcularSumaIngresoBruto()
+            CalcularSumaISR()
+            CalcularIngresoNeto()
+
+        End Set
+    End Property
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property MontoDeInversion As Double
+        Get
+            Return _MontoDeInversion
+        End Get
+        Set(value As Double)
+            _MontoDeInversion = value
+            CalcularRendimientoBruto()
+            CalcularRendimientoNeto()
+
+        End Set
+    End Property
+    Public Property FechaOperacion As Date
+        Get
+            Return _FechaOperacion
+        End Get
+        Set(value As Date)
+            _FechaOperacion = value
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property Tasa As Double
+        Get
+            Return _Tasa
+        End Get
+        Set(value As Double)
+            _Tasa = value
+        End Set
+    End Property
+    Public Property Plazo As Double
+        Get
+            Return _Plazo
+        End Get
+        Set(value As Double)
+            _Plazo = value
+            CalcularRendimientoBruto()
+            CalcularRendimientoNeto()
+        End Set
+    End Property
+    Public Property AnioBase As Integer
+        Get
+            Return _AnioBase
+        End Get
+        Set(value As Integer)
+            _AnioBase = value
+        End Set
+    End Property
+    Public Property Periodicidad As String
+        Get
+            Return _Periodicidad
+        End Get
+        Set(value As String)
+            _Periodicidad = value
+        End Set
+    End Property
+    Public ReadOnly Property RendimientoBruto As Double
+        Get
+            Return _RendimientoBruto
+        End Get
+
+    End Property
+    Public ReadOnly Property RendimientoNeto As Double
+        Get
+            Return _RendimientoNeto
+        End Get
+
+    End Property
+    Public Property IngresoBruto As Double
+        Get
+            Return _IngresoBruto
+        End Get
+        Set(value As Double)
+            _IngresoBruto = value
+        End Set
+    End Property
+    Public Property Impuestos As Double
+        Get
+            Return _Impuestos
+        End Get
+        Set(value As Double)
+            _Impuestos = value
+        End Set
+    End Property
+    Public Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+        Set(value As Double)
+            _IngresoNeto = value
+        End Set
+    End Property
+
+
+    Public Sub New()
+        _MontoDeInversion = 0.00
+        _FechaOperacion = Date.Now.Date
+        _FechaVencimiento = Date.Now.Date
+        _Tasa = 0.00
+        _Plazo = 0
+        _Periodicidad = "M"
+        PreparaTablaIntereses()
+
+    End Sub
+
+    Private Sub PreparaTablaIntereses()
+        _dtIntereses = New DataTable
+        Dim column As DataColumn
+
+        column = New DataColumn()
+        column.DataType = GetType(String)
+        column.ColumnName = "CodInv"
+        column.Caption = "Codigo Inversion"
+        column.ReadOnly = True
+        _dtIntereses.Columns.Add(column)
+
+
+        column = New DataColumn()
+        column.DataType = GetType(Integer)
+        column.ColumnName = "Correlativo"
+        column.Caption = "Correlativo"
+        column.ReadOnly = True
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Integer)
+        column.ColumnName = "Plazo"
+        column.Caption = "Plazo"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Date)
+        column.ColumnName = "Fecha"
+        column.Caption = "Fecha"
+
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "IngrBruto"
+        column.Caption = "Ingreso Bruto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "PorcImp"
+        column.Caption = "Porc. de Impuesto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "MontoImp"
+        column.Caption = "Impuesto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(Double)
+        column.ColumnName = "IngrNeto"
+        column.Caption = "Ingreso Neto"
+        _dtIntereses.Columns.Add(column)
+
+        column = New DataColumn()
+        column.DataType = GetType(String)
+        column.ColumnName = "Estado"
+        column.Caption = "Estado"
+        _dtIntereses.Columns.Add(column)
+
+
+    End Sub
+    Private Sub CalcularSumaIngresoBruto()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(IngrBruto)", "").ToString, _IngresoBruto) Then
+            _IngresoBruto = 0
+        End If
+        CalcularRendimientoBruto()
+
+    End Sub
+    Private Sub CalcularSumaISR()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(MontoImp)", "").ToString, _Impuestos) Then
+            _Impuestos = 0
+        End If
+    End Sub
+    Private Sub CalcularIngresoNeto()
+        If Not Double.TryParse(_dtIntereses.Compute("SUM(IngrNeto)", "").ToString, _IngresoNeto) Then
+            _IngresoNeto = 0
+        End If
+        CalcularRendimientoNeto()
+
+    End Sub
+    Private Sub CalcularRendimientoBruto()
+        Dim valor As Double
+        Dim vIngresoBruto As Double = _IngresoBruto
+        Dim vMontoInversion As Double = _MontoDeInversion
+        Dim vDiasDelAnio As Integer = Utilidades.CalcularDiasDelAnio(_FechaVencimiento)
+        Dim vPlazo As Integer = _Plazo
+
+        valor = (vIngresoBruto / vMontoInversion) * (vDiasDelAnio / vPlazo)
+        _RendimientoBruto = valor
+
+    End Sub
+    Private Sub CalcularRendimientoNeto()
+        Dim valor As Double
+        Dim vIngresoNeto As Double = _IngresoNeto
+        Dim vMontoInversion As Double = _MontoDeInversion
+        Dim vDiasDelAnio As Integer = Utilidades.CalcularDiasDelAnio(_FechaVencimiento)
+        Dim vPlazo As Integer = _Plazo
+
+        valor = (vIngresoNeto / vMontoInversion) * (vDiasDelAnio / vPlazo)
+        _RendimientoNeto = valor
+
+
+    End Sub
+
+
+
+
+
+    Function CalcularPlazo(ByVal ValorPlazo As String)
+        Dim Dias As Integer = 0
+        If (ValorPlazo = "M") Then
+            Dias = 30
+        ElseIf (ValorPlazo = "T") Then
+            Dias = 90
+        ElseIf (ValorPlazo = "S") Then
+            Dias = 180
+        ElseIf (ValorPlazo = "A") Then
+            Dias = 365
+        End If
+        Return Dias
+    End Function
+    Function CalcularIteraciones(ByVal PlazoGlobal As Integer, ByVal Plazo As Integer)
+        Dim Cantidad As Integer = 0
+        If (Not String.IsNullOrEmpty(Plazo.ToString) And Not Plazo.ToString = "0") Then
+            Cantidad = PlazoGlobal / Plazo
+        End If
+
+        Return Cantidad
+    End Function
+    Function CalcularFecha(ByVal Dias As Integer, ByVal Fecha As Date)
+        Return Fecha.AddDays(Dias)
+    End Function
+
+    Function CalculosIngrBruto(ByVal FechaInicial As Date, FechaFinal As Date, ByVal MontoInv As Double, ByVal Tasa As Double, ByVal Plazo As Integer)
+        Dim IngresoBruto = 0.0, IngresoBrutoOpc1 = 0.0, IngresoBrutoOpc2 = 0.0
+
+        Dim CambioDeFecha As Integer = Operaciones.CambioBase(FechaInicial, FechaFinal)
+
+        Dim PrimeraFechaUltima = Operaciones.PrimeraFechaCambioBase(FechaInicial)
+
+        Dim UltimaFechaPrimero = Operaciones.FinalFechaCambioBase(FechaFinal)
+        Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+        If (Not CambioDeFecha = 0) Then
+
+
+            If CambioDeFecha = 1 Then
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                IngresoBrutoOpc1 = (MontoInv * Tasa * DiasPrimeraFecha) / 366
+                IngresoBrutoOpc2 = (MontoInv * Tasa * DiasSegundaFecha) / 365
+            ElseIf CambioDeFecha = 2 Then
+                DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                IngresoBrutoOpc1 = (MontoInv * Tasa * DiasPrimeraFecha) / 365
+                IngresoBrutoOpc2 = (MontoInv * Tasa * DiasSegundaFecha) / 366
+            End If
+
+            IngresoBruto = IngresoBrutoOpc1 + IngresoBrutoOpc2
+
+        Else
+
+            If (Operaciones.AñoBisiesto(FechaInicial) = 364) Then
+
+                IngresoBruto = (MontoInv * Tasa * Plazo) / 365
+
+            End If
+
+            If (Operaciones.AñoBisiesto(FechaInicial) = 365) Then
+
+                IngresoBruto = (MontoInv * Tasa * Plazo) / 366
+            End If
+
+        End If
+        Return IngresoBruto
+    End Function
+    Function Renta(ByVal PorcentajeRent As Double, ByVal IngBruto As Double)
+        Dim DescuentoRenta As Double
+        DescuentoRenta = IngBruto * PorcentajeRent
+        Return DescuentoRenta
+    End Function
+
+
+    Function CalculosIngNeto(ByVal IngBruto As Double, ByVal Renta As Double)
+        Dim CalculoIngrNeto As Double
+        CalculoIngrNeto = IngBruto - Renta
+        Return CalculoIngrNeto
+    End Function
+
+
+
+End Class

+ 1449 - 0
ENTI/Operaciones.vb

@@ -0,0 +1,1449 @@
+Public Class Operaciones
+    Private V_TipoOperacion As String
+    Dim dia As Integer
+    Dim dias31 As Integer
+    Dim febreros As Integer
+    Dim bisiesto As Integer
+    Dim V_IngresoBruto As Double = 0.0
+    Dim V_FechaInicial As Date
+    Dim V_FechaCorte As Date
+    Dim ElementosConsulta As New CargarElementosDAO
+    Dim V_CodEmpr = ElementosConsulta.CodEmpr
+    'Dim V_CodIF = ElementosConsulta.CodIF
+    Dim V_CodEmis = ElementosConsulta.CodEmis
+    Dim V_CodECalRi = ElementosConsulta.CodECalRi
+    Dim V_CodPais = ElementosConsulta.CodPais
+    Dim V_ListaPlazo = ElementosConsulta.ListaPlazosFactor
+    Dim V_ListaTiposMercados = ElementosConsulta.ListaTiposMercado
+    Dim V_ListaPeriodos = ElementosConsulta.ListaPeriodos
+    Dim V_ListaTipoTasa = ElementosConsulta.ListaTipoTasa
+    Dim V_ListaTipoRenta = ElementosConsulta.ListaTipoRenta
+    Dim V_ListaEstado = ElementosConsulta.ListaEstado
+
+    Dim V_ListaCasasCorredoras = ElementosConsulta.ListaCasasCorredoras
+
+
+
+
+
+
+
+    Public ReadOnly Property ListaCasasCorredoras
+
+        Get
+
+            Return V_ListaCasasCorredoras
+        End Get
+    End Property
+
+
+
+
+    Public ReadOnly Property ListaEstado
+
+        Get
+
+            Return V_ListaEstado
+        End Get
+    End Property
+
+
+
+
+    Public ReadOnly Property ListaTipoRenta
+        Get
+            Return V_ListaTipoRenta
+        End Get
+    End Property
+
+
+
+
+
+    Public ReadOnly Property ListaTipoTasa
+        Get
+            Return V_ListaTipoTasa
+        End Get
+    End Property
+
+
+    Public ReadOnly Property ListaPeriodos
+        Get
+            Return V_ListaPeriodos
+        End Get
+    End Property
+
+
+    Public ReadOnly Property CodPais
+        Get
+            Return V_CodPais
+        End Get
+    End Property
+
+
+
+    Public ReadOnly Property CodEmpr
+        Get
+            Return V_CodEmpr
+        End Get
+    End Property
+    Public ReadOnly Property ListaTiposMercados
+        Get
+            Return V_ListaTiposMercados
+        End Get
+    End Property
+
+    Public ReadOnly Property ListaPlazo
+        Get
+            Return V_ListaPlazo
+        End Get
+    End Property
+
+    Public ReadOnly Property CodEmis
+        Get
+            Return V_CodEmis
+        End Get
+    End Property
+
+    Public ReadOnly Property CodECalRi
+        Get
+            Return V_CodECalRi
+        End Get
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Property TipoOperacion() As String
+        Get
+            Return V_TipoOperacion
+        End Get
+        Set(value As String)
+            V_TipoOperacion = value
+        End Set
+    End Property
+
+    Public Function DiasVencimiento(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime)
+
+        Dim rango = DateDiff(DateInterval.Day, fecha2, fecha1)
+        Return rango
+    End Function
+    Public Function DiasAcumulados(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime, ByVal Base As Integer)
+        Dim Total As Integer = 0
+        fecha1 = Format(fecha1, "dd/MM/yyyy")
+        fecha2 = Format(fecha2, "dd/MM/yyyy")
+        If (Base = 0 Or Base = 2) Then
+
+            Total = Base360(fecha1, fecha2)
+        ElseIf (Base = 1 Or Base = 3) Then
+            Total = Base365(fecha1, fecha2)
+        Else
+            Total = 0
+        End If
+        Return Total
+    End Function
+
+    Public Function Dias(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime, ByVal Base As Integer)
+        Dim Total As Integer = 0
+
+        If (Base = 0 Or Base = 2) Then
+
+            Total = Base360(fecha1, fecha2)
+        ElseIf (Base = 1 Or Base = 3) Then
+            Total = Base365(fecha1, fecha2)
+        Else
+            Total = 0
+        End If
+        Return Total
+    End Function
+
+    Public Function CantidadDiasAgregar(ByVal fecha1 As DateTime, ByVal fecha2 As DateTime)
+        Dim Total As Integer = 0
+
+        Total = Dias360(fecha1, fecha2)
+        Total = 0
+        Return Total
+    End Function
+
+    Public Function InteresAcumulado(ByVal ValorNominal As Double, ByVal Cupon As Double, ByVal DiasAcumulados As Double, ByVal BaseDias As Integer)
+        Dim Proceso = ValorNominal * Cupon * DiasAcumulados / BaseDias
+        Return Proceso
+    End Function
+
+    Public Function InteresAcumuladoPBUR(ByVal ValorNominal As Double, ByVal PorcCupon As Double, ByVal DiasAcumulados As Integer, ByVal IndexBase As Integer, ByVal FechaInicial As Date, FechaFinal As Date)
+        Dim Proceso As Double = 0
+        If (IndexBase = 0) Then
+            Proceso = ValorNominal * PorcCupon * DiasAcumulados / 360
+        ElseIf IndexBase = 1 Then
+
+
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+
+            Dim CambioDeFecha As Integer = CambioBase(FechaInicial, FechaFinal)
+
+            Dim PrimeraFechaUltima = PrimeraFechaCambioBase(FechaInicial)
+            Dim UltimaFechaPrimero = FinalFechaCambioBase(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+            If (Not CambioDeFecha = 0) Then
+
+
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = DiasDespuesCambioPrimeraFecha366(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = DiasDespuesCambioPrimeraFecha365(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+                    PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = DiasDespuesCambioPrimeraFecha365(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = DiasDespuesCambioPrimeraFecha366(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 365
+                    PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 366
+                End If
+
+                Proceso = PrOpc1 + PrOpc2
+
+            Else
+
+                If (AñoBisiesto(FechaInicial) = 364) Then
+
+                    Proceso = ValorNominal * PorcCupon * DiasAcumulados / 365
+
+                End If
+
+                If (AñoBisiesto(FechaInicial) = 365) Then
+
+                    Proceso = ValorNominal * PorcCupon * DiasAcumulados / 366
+                End If
+
+            End If
+
+
+
+
+
+
+
+
+
+        ElseIf IndexBase = 2 Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+
+            Dim CambioDeFecha As Integer = CambioBase(FechaInicial, FechaFinal)
+
+            Dim PrimeraFechaUltima = PrimeraFechaCambioBase360(FechaInicial)
+            Dim UltimaFechaPrimero = FinalFechaCambioBase360(FechaFinal)
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+
+
+            If (Not CambioDeFecha = 0) Then
+
+
+                If CambioDeFecha = 1 Then
+                    DiasPrimeraFecha = DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+                    PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+                ElseIf CambioDeFecha = 2 Then
+                    DiasPrimeraFecha = DiasDespuesCambioPrimeraFecha360(FechaInicial, PrimeraFechaUltima, CambioDeFecha)
+                    DiasSegundaFecha = DiasDespuesCambioPrimeraFecha360(UltimaFechaPrimero, FechaFinal, CambioDeFecha)
+                    PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 365
+                    PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 366
+                End If
+
+                Proceso = PrOpc1 + PrOpc2
+
+            Else
+
+                If (AñoBisiesto(FechaInicial) = 364) Then
+
+                    Proceso = ValorNominal * PorcCupon * DiasAcumulados / 365
+
+                End If
+
+                If (AñoBisiesto(FechaInicial) = 365) Then
+
+                    Proceso = ValorNominal * PorcCupon * DiasAcumulados / 366
+                End If
+
+            End If
+
+        ElseIf IndexBase = 3 Then
+            Proceso = ValorNominal * PorcCupon * DiasAcumulados / 360
+        End If
+
+
+
+        Return Proceso
+    End Function
+    Public Function InteresAcumuladoPor(ByVal InteresAcumulado As Double, ByVal ValorNominal As Double)
+        Dim Proceso = InteresAcumulado / ValorNominal * 360 * 180
+        Return Proceso
+    End Function
+
+
+    Public Function PrecioSucio(ByVal PrecioCompra As Double, ByVal InteresAcumulado As Double)
+
+        Dim Proceso = PrecioCompra * 0.01 + InteresAcumulado
+
+        Return Proceso
+    End Function
+    Public Function ValorTrasado(ByVal PrecioCompra As Double, ByVal ValorNominal As Double)
+        Dim Proceso = (PrecioCompra / 100) * ValorNominal
+        Return Proceso
+    End Function
+
+
+    Public Function Comisiones(ByVal Comision As Double, ByVal ValorTrasado As Double)
+        Dim Valor = CDec(Comision) * CDec(ValorTrasado)
+
+
+        Return Valor
+    End Function
+
+    Public Function MontoPagar(ByVal ValorTrasado As Double, ByVal ComisionBolsa As Double, ByVal ComisionCasa As Double, ByVal InteresAcumulado As Double, ByVal CostoTransferencias As Double)
+
+        Dim Valor = ValorTrasado + ComisionBolsa + ComisionCasa + InteresAcumulado + CostoTransferencias
+        Return Valor
+
+    End Function
+
+    Public Function MontoRecibir(ByVal ValorTrasado As Double, ByVal ComisionBolsa As Double, ByVal ComisionCasa As Double, ByVal InteresAcumulado As Double)
+        Dim Valor = ValorTrasado - ComisionBolsa - ComisionCasa + InteresAcumulado
+        Return Valor
+
+    End Function
+    Public Function Base360(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Total As Integer = 0
+        Dim dias = DateDiff(DateInterval.Day, Fecha1, Fecha2)
+        Dim dia As Integer
+        Dim dias31 As Integer
+        Dim febreros As Integer
+        Dim bisiesto As Integer
+        While (Fecha1 < Fecha2)
+            dia = dia + 1
+
+            If (Fecha1.Day = 31) Then
+                dias31 = dias31 + 1
+
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 28) Then
+                febreros = febreros + 2
+
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 29) Then
+                bisiesto = bisiesto + 1
+
+            End If
+
+            Fecha1 = Fecha1.AddDays(1)
+        End While
+        Total = dia - dias31 + febreros - bisiesto
+
+        Return Total
+    End Function
+
+
+
+    Public Function Dias360(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Total As Integer = 0
+        Dim dias = DateDiff(DateInterval.Day, Fecha1, Fecha2)
+        Dim dia As Integer = 0
+        Dim dias31 As Integer = 0
+        Dim febreros As Integer = 0
+        Dim bisiesto As Integer = 0
+        Dim PasaFebrero As Integer = 0
+        Dim PasaBisiesto As Integer = 0
+
+
+        While (Fecha1 < Fecha2)
+            dia = dia + 1
+
+            If (Fecha1.Day = 31) Then
+                dias31 = dias31 + 1
+
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 28) Then
+                febreros = febreros + 2
+                PasaFebrero += 1
+            End If
+            If (Fecha1.Month = 2 And Fecha1.Day = 29) Then
+                bisiesto = bisiesto + 1
+                PasaBisiesto += 1
+            End If
+
+            Fecha1 = Fecha1.AddDays(1)
+        End While
+
+
+        Total = dia + dias31 - febreros - bisiesto
+
+        Return Total
+    End Function
+
+
+    Public Function FechaDias360(ByVal Fecha1 As Date, ByVal Day As Integer)
+        Dim CorrelativoDias As Integer = 1
+        Dim Dias As Integer = Day
+        Dim Fecha As Date = Fecha1
+
+        While CorrelativoDias <= Dias
+            Dim Bisiesto As Integer = AñoBisiesto(Fecha)
+            If Bisiesto = 365 Then
+                If Fecha.Day = 31 Then
+                    Fecha = Fecha.AddDays(2)
+                    CorrelativoDias += 1
+
+                ElseIf Fecha.Day = 29 And Fecha.Month = 2 Then
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 2
+
+                Else
+
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 1
+
+                End If
+            Else
+                If Fecha.Day = 31 Then
+                    Fecha = Fecha.AddDays(2)
+                    CorrelativoDias += 1
+
+                ElseIf Fecha.Day = 28 And Fecha.Month = 2 Then
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 3
+
+
+                Else
+
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 1
+
+                End If
+            End If
+
+
+
+
+
+        End While
+
+
+        Return Fecha
+    End Function
+
+
+
+
+    Public Function FechaDias3602829(ByVal Fecha1 As Date, ByVal Day As Integer,Byval DiaFijo As integer)
+        Dim CorrelativoDias As Integer = 1
+        Dim Dias As Integer = Day
+        Dim Fecha As Date = Fecha1
+        Dim Conteo As Integer = 0
+        While CorrelativoDias <= Dias
+            Conteo += 1
+            Dim Bisiesto As Integer = AñoBisiesto(Fecha)
+            If Bisiesto = 365 Then
+                If Fecha.Day = 31 Then
+                    Fecha = Fecha.AddDays(2)
+                    CorrelativoDias += 1
+
+                ElseIf Fecha.Day = 29 And Fecha.Month = 2 Then
+                    If DiaFijo = 30 Then
+                        If CorrelativoDias = Dias Then
+                            CorrelativoDias += 2
+                        Else
+                            Fecha = Fecha.AddDays(1)
+                            If Conteo = 1 Then
+                                CorrelativoDias += 1
+                            Else
+                                CorrelativoDias += 2
+                            End If
+
+
+                        End If
+
+                    Else
+                        Fecha = Fecha.AddDays(1)
+                        CorrelativoDias += 2
+                    End If
+
+
+                Else
+
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 1
+
+                End If
+            Else
+                If Fecha.Day = 31 Then
+                    Fecha = Fecha.AddDays(2)
+                    CorrelativoDias += 1
+
+                ElseIf Fecha.Day = 28 And Fecha.Month = 2 Then
+
+
+
+                    If DiaFijo = 30 Then
+                        If (CorrelativoDias + 1) = Dias Then
+                            CorrelativoDias += 3
+                        Else
+                            Fecha = Fecha.AddDays(1)
+                            If Conteo = 1 Then
+                                CorrelativoDias += 1
+                            Else
+                                CorrelativoDias += 3
+                            End If
+                        End If
+
+
+
+                    ElseIf DiaFijo = 29 Then
+                        If CorrelativoDias = Dias Then
+                            CorrelativoDias += 3
+                        Else
+                            Fecha = Fecha.AddDays(1)
+                            If Conteo = 1 Then
+                                CorrelativoDias += 2
+                            Else
+                                CorrelativoDias += 3
+                            End If
+
+
+                        End If
+
+
+
+
+
+                    Else
+                        Fecha = Fecha.AddDays(1)
+                        CorrelativoDias += 3
+                    End If
+
+                Else
+
+                    Fecha = Fecha.AddDays(1)
+                    CorrelativoDias += 1
+
+                End If
+            End If
+
+
+
+
+
+        End While
+
+
+        Return Fecha
+    End Function
+    Public Function Base365(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+
+        Dim dias = DateDiff(DateInterval.Day, Fecha1, Fecha2)
+
+
+        Return dias
+    End Function
+
+    Function AñoBisiesto(ByVal Fecha As Date)
+        Dim Año As String = Fecha.Year
+        Dim Dias As Integer = 0
+        Dim FechaPrimero As Date = "01/01/" + Año
+        Dim FechaFinal As Date = "31/12/" + Año
+
+        Dias = DateDiff(DateInterval.Day, FechaPrimero, FechaFinal)
+
+        Return Dias
+    End Function
+
+    Function CambioBase(ByVal FechaInicial As Date, ByVal FechaFinal As Date)
+        Dim AñoInicial = FechaInicial.Year
+        Dim AñoFinal = FechaFinal.Year
+        Dim CambioDeBase As Integer = 0
+
+        If (Not AñoInicial = AñoFinal) Then
+            If (AñoBisiesto(FechaInicial) = 365) Then
+                CambioDeBase = 1
+            ElseIf (AñoBisiesto(FechaFinal) = 365) Then
+                CambioDeBase = 2
+            End If
+        End If
+            Return CambioDeBase
+    End Function
+    Function PrimeraFechaCambioBase(ByVal FechaInicial As Date)
+        Dim AñoInicial As String = FechaInicial.Year
+
+        Dim FechaPrimerCorte As Date = "31/12/" + AñoInicial
+
+        Return FechaPrimerCorte
+    End Function
+
+
+
+
+    Function PrimeraFechaCambioBase360(ByVal FechaInicial As Date)
+        Dim AñoInicial As String = FechaInicial.Year
+
+        Dim FechaPrimerCorte As Date = "30/12/" + AñoInicial
+
+        Return FechaPrimerCorte
+    End Function
+
+    Function FinalFechaCambioBase(ByVal FechaFinal As Date)
+        Dim AñoFinal As String = FechaFinal.Year
+        Dim FechaInicialSegundoCorte As Date = "01/01/" + AñoFinal
+        Return FechaInicialSegundoCorte
+
+    End Function
+    Function FinalFechaCambioBase360(ByVal FechaFinal As Date)
+        Dim AñoFinal As String = FechaFinal.Year
+        Dim FechaInicialSegundoCorte As Date = "01/01/" + AñoFinal
+        Return FechaInicialSegundoCorte
+
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha365(ByVal FechaIncial As Date, ByVal FechaFinal As Date, ByVal CambioDeFecha As Integer)
+        Dim Dias As Integer
+        If (CambioDeFecha = 1) Then
+            Dias = DateDiff(DateInterval.Day, FechaIncial, FechaFinal) + 1
+        Else
+            Dias = DateDiff(DateInterval.Day, FechaIncial, FechaFinal)
+        End If
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha366(ByVal FechaIncial As Date, ByVal FechaFinal As Date, ByVal CambioDeFecha As Integer)
+        Dim Dias As Integer
+
+        If (CambioDeFecha = 2) Then
+            Dias = DateDiff(DateInterval.Day, FechaIncial, FechaFinal) + 1
+        Else
+            Dias = DateDiff(DateInterval.Day, FechaIncial, FechaFinal)
+        End If
+
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha366Varios(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Dias As Integer = 0
+
+        While (Fecha1 < Fecha2)
+
+            If AñoBisiesto(Fecha1) = 365 Then
+                Dias += 1
+            End If
+            Fecha1 = Fecha1.AddDays(1)
+        End While
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha365Varios(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Dias As Integer = 0
+
+        While (Fecha1 < Fecha2)
+            If AñoBisiesto(Fecha1) = 364 Then
+                Dias += 1
+            End If
+            Fecha1 = Fecha1.AddDays(1)
+
+        End While
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha360Bi(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Dias As Integer = 0
+
+        While (Fecha1 < Fecha2)
+            If AñoBisiesto(Fecha1) = 365 Then
+                If (Not Fecha1.Day = 31) Then
+                    If (Fecha1.Day = 29) Then
+                        Dias += 1
+                    End If
+
+                    Dias += 1
+                End If
+            End If
+            Fecha1 = Fecha1.AddDays(1)
+
+        End While
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha360(ByVal Fecha1 As Date, ByVal Fecha2 As Date)
+        Dim Dias As Integer = 0
+
+        While (Fecha1 < Fecha2)
+            If AñoBisiesto(Fecha1) = 364 Then
+                If (Not Fecha1.Day = 31) Then
+                    If (Fecha1.Day = 28) Then
+                        Dias += 2
+                    End If
+
+                    Dias += 1
+                End If
+            End If
+            Fecha1 = Fecha1.AddDays(1)
+
+        End While
+
+        Return Dias
+    End Function
+
+    Function DiasDespuesCambioPrimeraFecha360(ByVal FechaIncial As Date, ByVal FechaFinal As Date, ByVal CambioDeFecha As Integer)
+        Dim Dias As Integer
+
+        Dias = Base360(FechaInicial, FechaFinal)
+
+
+        Return Dias
+    End Function
+
+
+    'Public Sub ValidarEntrada(sender As Object, e As KeyPressEventArgs)
+    '    If (Char.IsNumber(e.KeyChar)) Then
+    '        e.Handled = False
+
+    '    ElseIf Char.IsSeparator(e.KeyChar) Then
+    '        e.Handled = True
+    '    ElseIf Char.IsLetter(e.KeyChar) Then
+    '        e.Handled = True
+
+
+
+
+    '    ElseIf Char.IsSymbol(e.KeyChar) Then
+    '        e.Handled = True
+
+    '    ElseIf Char.IsWhiteSpace(e.KeyChar) Then
+    '        e.Handled = True
+    '    End If
+    'End Sub
+
+    Public Sub ValidarEntrada(sender As Object, e As KeyPressEventArgs, ByVal NoAgregar As Boolean)
+        If (Char.IsNumber(e.KeyChar)) Then
+            e.Handled = False
+
+        ElseIf Char.IsSeparator(e.KeyChar) Then
+            e.Handled = True
+        ElseIf Char.IsLetter(e.KeyChar) Then
+            e.Handled = True
+
+        ElseIf Char.IsPunctuation(e.KeyChar) Then
+            If Not e.KeyChar = "." Then
+                e.Handled = True
+            End If
+
+
+
+        ElseIf Char.IsSymbol(e.KeyChar) Then
+            e.Handled = True
+
+        ElseIf Char.IsWhiteSpace(e.KeyChar) Then
+            e.Handled = True
+        End If
+
+        If NoAgregar Then
+
+            e.Handled = True
+        End If
+    End Sub
+
+
+
+
+
+
+
+
+
+
+    Function Meses(ByVal CantidadMeses As Integer, ByVal Fecha As Date, ByVal MesFijo As Date)
+        Dim i As Integer = 0
+        Dim DiaInicial As Integer = 0
+        Dim Dia = MesFijo.Day
+
+        DiaInicial = Dia
+
+
+        Fecha = Fecha.AddMonths(CantidadMeses)
+
+        Dim Mes = Fecha.Month
+
+        Mes = Fecha.Month
+
+        If (DiaInicial = 31) Then
+            If ((Mes = 1 Or Mes = 3 Or Mes = 5 Or Mes = 7 Or Mes = 8 Or Mes = 10 Or Mes = 12)) Then
+
+
+                Dim Año = Fecha.Year
+                Fecha = CDate(("31/" + Mes.ToString + "/" + Año.ToString))
+
+            ElseIf (Mes = 2) Then
+
+                Dim Año = Fecha.Year
+                If (AñoBisiesto(Fecha) = 364) Then
+
+                    Fecha = CDate(("28/" + Mes.ToString + "/" + Año.ToString))
+
+                End If
+
+                If (AñoBisiesto(Fecha) = 365) Then
+
+                    Fecha = CDate(("29/" + Mes.ToString + "/" + Año.ToString))
+                End If
+
+
+
+
+
+
+            Else
+
+                Dim Año = Fecha.Year
+                Fecha = CDate(("30/" + Mes.ToString + "/" + Año.ToString))
+
+
+            End If
+
+        ElseIf (DiaInicial = 30) Then
+            If (Mes = 2) Then
+                Dim Año = Fecha.Year
+                Fecha = CDate(("28/" + Mes.ToString + "/" + Año.ToString))
+            Else
+
+                Dim Año = Fecha.Year
+                Fecha = CDate(("30/" + Mes.ToString + "/" + Año.ToString))
+            End If
+        ElseIf (DiaInicial = 29) Then
+            If (Mes = 2) Then
+                Dim Año = Fecha.Year
+                Fecha = CDate(("28/" + Mes.ToString + "/" + Año.ToString))
+            Else
+
+                Dim Año = Fecha.Year
+                Fecha = CDate(("29/" + Mes.ToString + "/" + Año.ToString))
+            End If
+
+
+        End If
+
+
+        Return Fecha
+    End Function
+
+
+
+
+
+
+
+    Function FechaFinMes(ByVal FechaPri As Date, ByVal Periodicidad As String, ByVal Base As Integer)
+
+        Dim Dias As Integer = 0
+
+        Dim Meses As Integer = 0
+        If Periodicidad = "M" Then
+            Meses = 1
+        ElseIf Periodicidad = "T" Then
+            Meses = 3
+        ElseIf Periodicidad = "S" Then
+            Meses = 6
+        ElseIf Periodicidad = "A" Then
+            Meses = 12
+        End If
+        If Base = 365 Then
+
+
+
+            Dim FechaAnterior As Date = Format(FechaPri, "dd/MM/yyyy")
+            Dim FechaCreada As Date = Format(FechaPri, "dd/MM/yyyy")
+            Dim DiaAnterior As Integer = FechaAnterior.Day
+            Dim MesAnterior As Integer = FechaAnterior.Month
+            Dim DiaDiferenciaAnterior31 As Integer = 31 - DiaAnterior
+            Dim FechaTemporal31 As Date = FechaAnterior.AddDays(DiaDiferenciaAnterior31)
+            Dim DiaDiferenciaAnterior30 As Integer = 30 - DiaAnterior
+            Dim FechaTemporal30 As Date = FechaAnterior.AddDays(DiaDiferenciaAnterior30)
+            Dim DiaDiferenciaAnterior29 As Integer = 29 - DiaAnterior
+            Dim FechaTemporal29 As Date = FechaAnterior.AddDays(DiaDiferenciaAnterior29)
+            Dim DiaDiferenciaAnterior28 As Integer = 28 - DiaAnterior
+            Dim FechaTemporal28 As Date = FechaAnterior.AddDays(DiaDiferenciaAnterior28)
+            ''''''''
+            If FechaTemporal31.Month = MesAnterior Then
+
+                If Periodicidad = "M" Then
+                    If DiaDiferenciaAnterior31 > 0 Then
+                        FechaCreada = FechaTemporal31
+
+                    Else
+
+                        FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior31, 0, Base)
+                    End If
+
+                Else
+                    FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior31, 0, Base)
+                End If
+
+
+            ElseIf FechaTemporal30.Month = MesAnterior Then
+                If Periodicidad = "M" Then
+                    If DiaDiferenciaAnterior30 > 0 Then
+                        FechaCreada = FechaTemporal30
+
+                    Else
+                        FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior30, 0, Base)
+                    End If
+
+                Else
+                    FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior30, 0, Base)
+                End If
+
+
+            ElseIf FechaTemporal29.Month = MesAnterior Then
+
+                If Periodicidad = "M" Then
+                    If DiaDiferenciaAnterior29 > 0 Then
+                        FechaCreada = FechaTemporal29
+
+                    Else
+                        FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior29, 0, Base)
+                    End If
+
+                Else
+                    FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior29, 0, Base)
+
+                End If
+
+            ElseIf FechaTemporal28.Month = MesAnterior Then
+
+                If Periodicidad = "M" Then
+                    If DiaDiferenciaAnterior28 > 0 Then
+                        FechaCreada = FechaTemporal28
+
+                    Else
+                        FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior28, 0, Base)
+                    End If
+
+                Else
+                    FechaCreada = FechaMensual(FechaAnterior, Periodicidad, "FinMes", DiaDiferenciaAnterior28, 0, Base)
+                End If
+
+
+            End If
+
+
+
+            Return FechaCreada
+        ElseIf Base = 360 Then
+            Dim FechaAnterior As Date = FechaPri
+            Dim FechaCreada As Date = FechaPri
+            Dim DiasAnterior As Integer = FechaAnterior.Day
+            Dim DiasFaltantes As Integer = 30 - FechaAnterior.Day
+            Dim FechaTemporalValidarDiasMes As Date = Date.Today.Date
+            Dim CantidadDiasMes As Integer = 0
+            Dim MesAnterior As Integer = FechaAnterior.Month
+            If Periodicidad = "M" Then
+                If DiasFaltantes > 0 Then
+                    FechaTemporalValidarDiasMes = Format(CDate("01/" + MesAnterior.ToString + "/" + FechaAnterior.Year.ToString), "dd/MM/yyyy")
+
+                    If FechaTemporalValidarDiasMes.AddDays(30).Month = MesAnterior Then
+                        'Tiene 31 Dias
+                        CantidadDiasMes = 31
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(29).Month = MesAnterior Then
+                        'Tiene 30 Dias
+                        CantidadDiasMes = 30
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(28).Month = MesAnterior Then
+                        'Tiene 29 Dias
+                        CantidadDiasMes = 29
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(27).Month = MesAnterior Then
+                        'Tiene 28 Dias
+                        CantidadDiasMes = 28
+                    End If
+
+                    If CantidadDiasMes = 31 Or CantidadDiasMes = 30 Then
+                        FechaCreada = FechaCreada.AddDays(DiasFaltantes)
+
+                    ElseIf CantidadDiasMes = 29 Then
+                        If DiasFaltantes = 1 Then
+                            FechaCreada = FechaCreada.AddDays(30)
+                        Else
+                            FechaCreada = FechaCreada.AddDays(DiasFaltantes - 1)
+                        End If
+
+
+                    ElseIf CantidadDiasMes = 28 Then
+                        If DiasFaltantes = 2 Then
+                            FechaCreada = FechaCreada.AddDays(30)
+                        Else
+                            FechaCreada = FechaCreada.AddDays(DiasFaltantes - 2)
+                        End If
+                    End If
+
+
+
+
+                Else
+
+
+                    FechaCreada = FechaCreada.AddMonths(Meses)
+
+
+
+                End If
+
+            Else
+
+
+                Dim DiasCreada As Integer = 0
+                Dim MesCreada As Integer = 0
+
+
+                If DiasFaltantes > 0 Then
+
+                    FechaCreada = FechaAnterior.AddMonths(Meses - 1)
+                    DiasCreada = FechaCreada.Day
+                    DiasFaltantes = 30 - FechaCreada.Day
+                    MesCreada = FechaCreada.Month
+
+                    FechaTemporalValidarDiasMes = Format(CDate("01/" + MesCreada.ToString + "/" + FechaCreada.Year.ToString), "dd/MM/yyyy")
+
+                    If FechaTemporalValidarDiasMes.AddDays(30).Month = MesCreada Then
+                        'Tiene 31 Dias
+                        CantidadDiasMes = 31
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(29).Month = MesCreada Then
+                        'Tiene 30 Dias
+                        CantidadDiasMes = 30
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(28).Month = MesCreada Then
+                        'Tiene 29 Dias
+                        CantidadDiasMes = 29
+                    ElseIf FechaTemporalValidarDiasMes.AddDays(27).Month = MesCreada Then
+                        'Tiene 28 Dias
+                        CantidadDiasMes = 28
+                    End If
+
+                    If CantidadDiasMes = 31 Or CantidadDiasMes = 30 Then
+                        FechaCreada = FechaCreada.AddDays(DiasFaltantes)
+
+                    ElseIf CantidadDiasMes = 29 Then
+
+
+                        If DiasFaltantes = 1 Then
+                            FechaCreada = FechaCreada.AddDays(30)
+                        Else
+                            FechaCreada = FechaCreada.AddDays(DiasFaltantes - 1)
+                        End If
+                    ElseIf CantidadDiasMes = 28 Then
+                        If DiasFaltantes = 2 Then
+                            FechaCreada = FechaCreada.AddDays(30)
+                        Else
+                            FechaCreada = FechaCreada.AddDays(DiasFaltantes - 2)
+                        End If
+                    End If
+
+
+                Else
+                    FechaCreada = FechaAnterior.AddMonths(Meses)
+
+                End If
+
+
+
+            End If
+
+
+            Return FechaCreada
+
+
+        End If
+    End Function
+
+
+    Function FechaMensual(ByRef Fecha As Date, ByRef Periodicidad As String, ByVal TipoCalculo As String, ByVal DiasSobrantes As Integer, ByVal DiaFijo As Integer, ByVal Base As Integer)
+
+        Dim Meses As Integer = 0
+        If Periodicidad = "M" Then
+            Meses = 1
+        ElseIf Periodicidad = "T" Then
+            Meses = 3
+        ElseIf Periodicidad = "S" Then
+            Meses = 6
+        ElseIf Periodicidad = "A" Then
+            Meses = 12
+        End If
+
+
+        If Base = 365 Then
+
+
+            'TipoCalculo: FinMes,Mensual'
+            Dim FechaAnterior As Date = Format(Fecha, "dd/MM/yyyy")
+            Dim FechaCreada As Date = Format(Fecha, "dd/MM/yyyy")
+
+
+
+            If DiasSobrantes > 0 Then
+                FechaCreada = FechaCreada.AddMonths(Meses - 1)
+            Else
+                FechaCreada = FechaCreada.AddMonths(Meses)
+            End If
+            Dim DiaCreada As Integer = FechaCreada.Day
+            Dim MesCreada As Integer = FechaCreada.Month
+
+
+            Dim DiaDiferenciaAnterior31 As Integer = 31 - DiaCreada
+            Dim FechaTemporal31 As Date = FechaCreada.AddDays(DiaDiferenciaAnterior31)
+            Dim DiaDiferenciaAnterior30 As Integer = 30 - DiaCreada
+            Dim FechaTemporal30 As Date = FechaCreada.AddDays(DiaDiferenciaAnterior30)
+            Dim DiaDiferenciaAnterior29 As Integer = 29 - DiaCreada
+            Dim FechaTemporal29 As Date = FechaCreada.AddDays(DiaDiferenciaAnterior29)
+            Dim DiaDiferenciaAnterior28 As Integer = 28 - DiaCreada
+            Dim FechaTemporal28 As Date = FechaCreada.AddDays(DiaDiferenciaAnterior28)
+
+
+            If TipoCalculo = "FinMes" Then
+
+
+                If FechaTemporal31.Month = MesCreada Then
+                    If DiaDiferenciaAnterior31 > 0 Then
+                        FechaCreada = FechaTemporal31
+
+
+                    End If
+
+                ElseIf FechaTemporal30.Month = MesCreada Then
+
+                    If DiaDiferenciaAnterior30 > 0 Then
+                        FechaCreada = FechaTemporal30
+
+                    End If
+
+                ElseIf FechaTemporal29.Month = MesCreada Then
+
+
+                    If DiaDiferenciaAnterior29 > 0 Then
+                        FechaCreada = FechaTemporal29
+
+
+                    End If
+                ElseIf FechaTemporal28.Month = MesCreada Then
+
+
+                    If DiaDiferenciaAnterior28 > 0 Then
+                        FechaCreada = FechaTemporal28
+
+
+
+                    End If
+
+
+
+                End If
+                Return FechaCreada
+            ElseIf TipoCalculo = "Mensual" Then
+                FechaAnterior = Fecha
+                FechaCreada = Fecha.AddMonths(Meses)
+                MesCreada = FechaCreada.Month
+                DiaCreada = FechaCreada.Day
+
+
+
+
+                DiaDiferenciaAnterior31 = 31 - DiaCreada
+                FechaTemporal31 = FechaCreada.AddDays(DiaDiferenciaAnterior31)
+                DiaDiferenciaAnterior30 = 30 - DiaCreada
+                FechaTemporal30 = FechaCreada.AddDays(DiaDiferenciaAnterior30)
+                DiaDiferenciaAnterior29 = 29 - DiaCreada
+                FechaTemporal29 = FechaCreada.AddDays(DiaDiferenciaAnterior29)
+
+
+
+                If DiaFijo = 31 Then
+                    If MesCreada = FechaTemporal31.Month Then
+                        FechaCreada = FechaTemporal31
+                    ElseIf MesCreada = FechaTemporal30.Month Then
+
+                        FechaCreada = FechaTemporal30
+
+                    ElseIf MesCreada = FechaTemporal29.Month Then
+                        FechaCreada = FechaTemporal29
+
+                    Else
+
+                        FechaCreada = FechaTemporal28
+
+                    End If
+
+                ElseIf DiaFijo = 30 Then
+
+
+                    If MesCreada = FechaTemporal30.Month Then
+
+                        FechaCreada = FechaTemporal30
+
+                    ElseIf MesCreada = FechaTemporal29.Month Then
+                        FechaCreada = FechaTemporal29
+
+                    Else
+
+                        FechaCreada = FechaTemporal28
+
+                    End If
+
+                ElseIf DiaFijo = 29 Then
+
+
+
+                    If MesCreada = FechaTemporal29.Month Then
+                        FechaCreada = FechaTemporal29
+
+                    Else
+
+                        FechaCreada = FechaTemporal28
+
+                    End If
+                Else
+                    Dim DiaAgregar As Integer = DiaFijo - FechaCreada.Day
+                    FechaCreada = FechaCreada.AddDays(DiaAgregar)
+
+
+                End If
+
+
+
+
+                Return FechaCreada
+
+
+            End If
+        ElseIf Base = 360 Then
+
+            Dim Dias As Integer = Meses * 30
+            Dim FechaAnterior As Date = Fecha
+
+            FechaAnterior = FechaDias3602829(FechaAnterior, Dias, DiaFijo)
+
+
+            Return FechaAnterior
+        End If
+
+    End Function
+
+
+    Function ConvertirDecimal(ByVal Dec As String)
+        Dim value As Double = 0
+        If Dec Is Nothing Then
+            Dec = 0
+        End If
+
+        Dec = Dec.ToString.Trim("%")
+        If (Decimal.TryParse(Dec, value)) Then Return value Else Return 0
+    End Function
+
+
+    Function ConvertirEntero(ByVal Int As String)
+        Dim value As Integer = 0
+        If Int Is Nothing Then
+            Int = 0
+        End If
+
+
+        Int = Int.ToString.Trim("%")
+        If (Integer.TryParse(Int, value)) Then Return value Else Return 0
+    End Function
+
+    Function ConvertirFecha(ByVal Fecha As String)
+        Dim value As Date = Date.Today.Date
+
+        If (Date.TryParse(Fecha, value)) Then Return value Else Return Date.Today.Date
+    End Function
+
+
+
+    Function ConvertirFechaBaseDatos(ByVal Fecha As String)
+        Dim value As Date = Date.Today.Date
+        If (Date.TryParse(Fecha, value)) Then Return value Else Return DBNull.Value
+    End Function
+    Sub TraspasarDatos(ByVal CodigoExiste As String, ByVal CodigoInstrumentoExiste As String,
+ ByVal IsNueva As String, ByVal TipoTransaccionCompraVenta As String,
+ ByVal FamiliaTitulo As String, ByVal Monto As Double,
+ ByVal Precio As Double, ByVal RendimientoEsperado As Double,
+ ByVal IngresosEsperados As Double)
+        If IsNueva = "N" Then
+            Dim General As New DAOGeneral
+            Dim Tabla As String = String.Empty
+
+            If CodigoInstrumentoExiste = "ACCI" Or CodigoInstrumentoExiste = "ACCNC" Or
+               CodigoInstrumentoExiste = "ACCNP" Then
+                Tabla = "ACC0"
+            ElseIf CodigoInstrumentoExiste = "PPER" Then
+                Tabla = "PPER0"
+            ElseIf CodigoInstrumentoExiste = "DAP" Then
+                Tabla = "DAP0"
+            ElseIf CodigoInstrumentoExiste = "NEST" Then
+                Tabla = "NETS0"
+            ElseIf CodigoInstrumentoExiste = "FUTU" Then
+                Tabla = "FUT0"
+            ElseIf CodigoInstrumentoExiste = "OPC" Then
+                Tabla = "OPC0"
+            ElseIf CodigoInstrumentoExiste = "PEMP" Then
+                Tabla = "PEMP0"
+            ElseIf CodigoInstrumentoExiste = "LETE" Then
+                Tabla = "LET0"
+            ElseIf CodigoInstrumentoExiste = "CETE" Then
+                Tabla = "CET0"
+            ElseIf CodigoInstrumentoExiste = "PBUR" Then
+                Tabla = "PBUR"
+            ElseIf CodigoInstrumentoExiste = "VCN" Then
+                Tabla = "VCN"
+
+            ElseIf CodigoInstrumentoExiste = "BONO" Then
+                Tabla = "BON0"
+            ElseIf CodigoInstrumentoExiste = "CINV" Then
+                Tabla = "CIN0"
+
+            ElseIf CodigoInstrumentoExiste = "EURB" Then
+                Tabla = "EURB0"
+
+            ElseIf CodigoInstrumentoExiste = "TIT" Then
+                Tabla = "TIT"
+            ElseIf CodigoInstrumentoExiste = "FINV" Then
+                Tabla = "FINV"
+            ElseIf CodigoInstrumentoExiste = "REPO" Then
+                Tabla = "REP0"
+            ElseIf CodigoInstrumentoExiste = "REPOVENTA" Then
+                Tabla = "REPOVENTA"
+            End If
+
+
+
+            Dim RetCodigoInversionExiste As Boolean = General.ExisteTitulo(CodigoExiste, Tabla)
+            If Not RetCodigoInversionExiste Then
+
+
+                Dim RetMonto As Double = 0
+                Dim RetPrecio As Double = 0
+                Dim RetRendimiento As Double = 0
+                Dim RetIngresosEsp As Double = 0
+
+
+                Dim RetUnidadesAcciones As Integer = 0
+                Dim RetUnidadesContratosFuturos As Integer = 0
+                Dim RetCantidadContratosFuturos As Integer = 0
+                Dim RetCuotaParticipacionFINV As Integer = 0
+                Dim RetValorParticipacionFINV As Integer = 0
+
+                If FamiliaTitulo = "FamiliaAcciones" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = ConvertirDecimal(Precio.ToString)
+                    RetRendimiento = 0
+                    RetIngresosEsp = 0
+                    RetUnidadesAcciones = ConvertirDecimal((RetMonto / RetPrecio).ToString)
+                    Variables.RetMonto = RetMonto
+                    Variables.RetPrecio = RetPrecio
+                    Variables.RetUnidadesAcciones = RetUnidadesAcciones
+
+                ElseIf FamiliaTitulo = "FamiliaPrestamoPersonal" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = 0
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+                ElseIf FamiliaTitulo = "FamiliaDAP" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = 0
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+
+                ElseIf FamiliaTitulo = "FamiliaFuturos" Then
+
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = ConvertirDecimal(Precio.ToString)
+                    RetRendimiento = 0
+                    RetIngresosEsp = 0
+                    RetUnidadesContratosFuturos = 1
+                    RetCantidadContratosFuturos = ConvertirDecimal((RetMonto / (RetUnidadesContratosFuturos * RetPrecio)))
+                    Variables.RetMonto = RetMonto
+                    Variables.RetPrecio = RetPrecio
+                    Variables.RetUnidadesContratosFuturos = RetUnidadesContratosFuturos
+                    Variables.RetCantidadContratosFuturos = RetCantidadContratosFuturos
+
+                ElseIf FamiliaTitulo = "FamiliaEmpresas" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = 0
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+
+
+                ElseIf FamiliaTitulo = "FamiliaLetes" Then
+
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = 0
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+                ElseIf FamiliaTitulo = "FamiliaCINV" Then
+
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = ConvertirDecimal(Precio.ToString)
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+                    Variables.RetPrecio = RetPrecio
+
+                ElseIf FamiliaTitulo = "FamiliaFINV" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    RetPrecio = 0
+                    RetRendimiento = ConvertirDecimal(RendimientoEsperado.ToString)
+                    RetIngresosEsp = 0
+                    Variables.RetMonto = RetMonto
+                    Variables.RetRendimiento = RetRendimiento
+                    RetValorParticipacionFINV = 1
+                    RetCuotaParticipacionFINV = ConvertirDecimal(RetMonto / RetValorParticipacionFINV)
+                    Variables.RetValorParticipacionFINV = RetValorParticipacionFINV
+                    Variables.RetCuotaParticipacionFINV = RetCuotaParticipacionFINV
+                ElseIf FamiliaTitulo = "FamiliaReporto" Then
+                    RetMonto = ConvertirDecimal(Monto.ToString)
+                    Variables.RetMonto = RetMonto
+                End If
+
+
+                Variables.TipoTransaccionCompraVenta = TipoTransaccionCompraVenta
+            End If
+
+
+
+
+
+
+
+        Else
+            RetCodigoInversionExiste = True
+
+        End If
+        Variables.RetCodigoInversionExiste = RetCodigoInversionExiste
+    End Sub
+
+
+End Class

+ 14 - 0
ENTI/PrestamoEmpresarialCE.vb

@@ -0,0 +1,14 @@
+Public Class PrestamoEmpresarialCE
+    Public Function FechaDias(ByVal fecha1 As Date, ByVal fecha2 As Date)
+
+
+
+        Dim Total As Integer = DateDiff(DateInterval.Day, fecha1, fecha2)
+        Return Total
+    End Function
+
+
+
+
+
+End Class

+ 40 - 0
ENTI/PrestamoPersonalCE.vb

@@ -0,0 +1,40 @@
+Public Class PrestamoPersonalCE
+
+    Public Function TIR(ByVal VP As Double, ByVal n As Double, ByVal i As Double)
+        Dim Periodicidad As String = Variables.Periodicidad
+        Dim numero As Integer = 0
+        If (Periodicidad = "M") Then
+            numero = 12
+        ElseIf (Periodicidad = "T") Then
+            numero = 4
+        ElseIf (Periodicidad = "S") Then
+            numero = 2
+        ElseIf (Periodicidad = "A") Then
+            numero = 1
+        End If
+        If (numero = 0) Then
+
+            Return 0
+        Else
+
+            i = i / numero
+            Dim ValorTIR As Double = VP * ((((1 + i) ^ n) * i) / (((1 + i) ^ n) - 1))
+
+            Return ValorTIR
+
+        End If
+    End Function
+
+    Public Function SumarCuota(ByVal Cuota As Double, ByVal Seguro As Double)
+        Dim Suma As Double = 0.0
+        Suma = Cuota + Seguro
+        Return Suma
+    End Function
+
+    Public Function Periodo(ByVal FechaPago As Date, ByVal Fecha As Date)
+
+        Dim Dias = DateDiff(DateInterval.Day, FechaPago, Fecha)
+        Return Dias
+    End Function
+
+End Class

+ 185 - 0
ENTI/RegistroIngresoCE.vb

@@ -0,0 +1,185 @@
+Public Class RegistroIngresoCE
+    Private _CodigoEmpresa As String
+    Private _CodigoInstrumento As String
+    Private _CodigoBanco As String
+    Private _CodigoInversion As String
+    Private _IngresoID As Integer
+    Private _CodigoInstitucionFinanciera As String
+    Private _FormaDePago As String
+    Private _CuentaBancaria As String
+    Private _FechaDelIngreso As DateTime
+    Private _FechaRegistro As DateTime
+    Private _Validado As String
+    Private _FechaValidacion As DateTime
+    Private _Conciliado As String
+    Private _FechaConciliacion As DateTime
+    Private _MontoCapital As Double
+    Private _MontoIngresoBruto As Double
+    Private _MontoISR As Double
+    Private _MontoIngresoNeto As Double
+    Private _MontoIngresoLiquido As Double
+    Private _TransId As String
+
+
+    Public Property CodigoEmpresa As String
+        Get
+            Return _CodigoEmpresa
+        End Get
+        Set(value As String)
+            _CodigoEmpresa = value
+        End Set
+    End Property
+    Public Property CodigoInstrumento As String
+        Get
+            Return _CodigoInstrumento
+        End Get
+        Set(value As String)
+            _CodigoInstrumento = value
+        End Set
+    End Property
+    Public Property CodigoBanco As String
+        Get
+            Return _CodigoBanco
+        End Get
+        Set(value As String)
+            _CodigoBanco = value
+        End Set
+    End Property
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property IngresoID As Integer
+        Get
+            Return _IngresoID
+        End Get
+        Set(value As Integer)
+            _IngresoID = value
+        End Set
+    End Property
+    Public Property CodigoInstitucionFinanciera As String
+        Get
+            Return _CodigoInstitucionFinanciera
+        End Get
+        Set(value As String)
+            _CodigoInstitucionFinanciera = value
+        End Set
+    End Property
+    Public Property FormaDePago As String
+        Get
+            Return _FormaDePago
+        End Get
+        Set(value As String)
+            _FormaDePago = value
+        End Set
+    End Property
+    Public Property CuentaBancaria As String
+        Get
+            Return _CuentaBancaria
+        End Get
+        Set(value As String)
+            _CuentaBancaria = value
+        End Set
+    End Property
+    Public Property FechaDelIngreso As DateTime
+        Get
+            Return _FechaDelIngreso
+        End Get
+        Set(value As DateTime)
+            _FechaDelIngreso = value
+        End Set
+    End Property
+    Public Property FechaRegistro As DateTime
+        Get
+            Return _FechaRegistro
+        End Get
+        Set(value As DateTime)
+            _FechaRegistro = value
+        End Set
+    End Property
+    Public Property Validado As String
+        Get
+            Return _Validado
+        End Get
+        Set(value As String)
+            _Validado = value
+        End Set
+    End Property
+    Public Property FechaValidacion As DateTime
+        Get
+            Return _FechaValidacion
+        End Get
+        Set(value As DateTime)
+            _FechaValidacion = value
+        End Set
+    End Property
+    Public Property Conciliado As String
+        Get
+            Return _Conciliado
+        End Get
+        Set(value As String)
+            _Conciliado = value
+        End Set
+    End Property
+    Public Property FechaConciliacion As DateTime
+        Get
+            Return _FechaConciliacion
+        End Get
+        Set(value As DateTime)
+            _FechaConciliacion = value
+        End Set
+    End Property
+    Public Property MontoCapital As Double
+        Get
+            Return _MontoCapital
+        End Get
+        Set(value As Double)
+            _MontoCapital = value
+        End Set
+    End Property
+    Public Property MontoIngresoBruto As Double
+        Get
+            Return _MontoIngresoBruto
+        End Get
+        Set(value As Double)
+            _MontoIngresoBruto = value
+        End Set
+    End Property
+    Public Property MontoISR As Double
+        Get
+            Return _MontoISR
+        End Get
+        Set(value As Double)
+            _MontoISR = value
+        End Set
+    End Property
+    Public Property MontoIngresoNeto As Double
+        Get
+            Return _MontoIngresoNeto
+        End Get
+        Set(value As Double)
+            _MontoIngresoNeto = value
+        End Set
+    End Property
+    Public Property MontoIngresoLiquido As Double
+        Get
+            Return _MontoIngresoLiquido
+        End Get
+        Set(value As Double)
+            _MontoIngresoLiquido = value
+        End Set
+    End Property
+
+    Public Property TransId As String
+        Get
+            Return _TransId
+        End Get
+        Set(value As String)
+            _TransId = value
+        End Set
+    End Property
+End Class

+ 778 - 0
ENTI/ReportosCE.vb

@@ -0,0 +1,778 @@
+Public Class ReportosCE
+    Private _CodigoInversion As String
+    Private _CodigoCasa As String
+    Private _Nombre As String
+    Private _FechaDeCompra As Date
+    Private _ValorTransado As Double
+    Private _Dias As Integer
+    Private _FechaVencimiento As Date
+    Private _Rendimiento As Double
+    Private _Impuestos As Double
+    Private _OtrosCostos As Double
+    Private _TotalCostos As Double
+    Private _MontoALiquidar As Double
+    Private _InteresAGenerar As Double
+    Private _CostoDeTransferencia As Double
+    Private _RendimientoNetoAntesDeImpuestos As Double
+    Private _ValorReCompra As Double
+    Private _ImpuestosLiquidacion As Double
+    Private _IngresoNeto As Double
+    Private _ValorNeto As Double
+    Private _RendimientoNetoDespuesDeImpuestos As Double
+    Private Operaciones As New Operaciones
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+
+    Public Property CodigoCasa As String
+        Get
+            Return _CodigoCasa
+        End Get
+        Set(value As String)
+            _CodigoCasa = value
+        End Set
+    End Property
+    Public Property Nombre As String
+        Get
+            Return _Nombre
+        End Get
+        Set(value As String)
+            _Nombre = value
+        End Set
+    End Property
+    Public Property FechaDeCompra As Date
+        Get
+            Return _FechaDeCompra
+        End Get
+        Set(value As Date)
+            _FechaDeCompra = value
+        End Set
+    End Property
+    Public Property ValorTransado As Double
+        Get
+            Return _ValorTransado
+        End Get
+        Set(value As Double)
+            _ValorTransado = value
+            Calcular_MontoALiquidar()
+            Calcular_InteresAGenerar()
+            Caluclar_RendimientoNetoAntesImpuestos()
+            Calcular_ValorRecompra()
+            Calcular_ValorNeto()
+            Calcular_RendimientoNetoDespuesImpuestos()
+
+
+        End Set
+    End Property
+    Public Property Dias As Integer
+        Get
+            Return _Dias
+        End Get
+        Set(value As Integer)
+            _Dias = value
+            Calcular_InteresAGenerar()
+            Caluclar_RendimientoNetoAntesImpuestos()
+            Calcular_RendimientoNetoDespuesImpuestos()
+
+        End Set
+    End Property
+    Public Property FechaVencimiento As Date
+        Get
+            Return _FechaVencimiento
+        End Get
+        Set(value As Date)
+            _FechaVencimiento = value
+        End Set
+    End Property
+    Public Property Rendimiento As Double
+        Get
+            Return _Rendimiento
+        End Get
+        Set(value As Double)
+            _Rendimiento = value
+            Calcular_InteresAGenerar()
+
+        End Set
+    End Property
+    Public Property Impuestos As Double
+        Get
+            Return _Impuestos
+        End Get
+        Set(value As Double)
+            _Impuestos = value
+        End Set
+    End Property
+    Public Property OtrosCostos As Double
+        Get
+            Return _OtrosCostos
+        End Get
+        Set(value As Double)
+            _OtrosCostos = value
+        End Set
+    End Property
+    Public ReadOnly Property TotalCostos As Double
+        Get
+            Return _TotalCostos
+        End Get
+    End Property
+    Public Property MontoALiquidar As Double
+        Get
+            Return _MontoALiquidar
+        End Get
+        Set(value As Double)
+            _MontoALiquidar = value
+        End Set
+    End Property
+    Public ReadOnly Property InteresAGenerar As Double
+        Get
+            Return _InteresAGenerar
+        End Get
+    End Property
+    Public Property CostoDeTransferencia As Double
+        Get
+            Return _CostoDeTransferencia
+        End Get
+        Set(value As Double)
+            _CostoDeTransferencia = value
+            Calcular_ValorNeto()
+
+        End Set
+    End Property
+    Public ReadOnly Property RendimientoNetoAntesDeImpuestos As Double
+        Get
+            Return _RendimientoNetoAntesDeImpuestos
+        End Get
+    End Property
+    Public Property ValorReCompra As Double
+        Get
+            Return _ValorReCompra
+        End Get
+        Set(value As Double)
+            _ValorReCompra = value
+        End Set
+    End Property
+    Public Property ImpuestosLiquidacion As Double
+        Get
+            Return _ImpuestosLiquidacion
+        End Get
+        Set(value As Double)
+            _ImpuestosLiquidacion = value
+        End Set
+    End Property
+    Public ReadOnly Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+    End Property
+    Public Property ValorNeto As Double
+        Get
+            Return _ValorNeto
+        End Get
+        Set(value As Double)
+            _ValorNeto = value
+        End Set
+    End Property
+    Public ReadOnly Property RendimientoNetoDespuesDeImpuestos As Double
+        Get
+            Return _RendimientoNetoDespuesDeImpuestos
+        End Get
+    End Property
+
+
+
+
+    Private Sub Calcular_TotalCostos()
+        Dim valor As Double
+
+        valor = 0
+        _TotalCostos = valor
+        Calcular_MontoALiquidar()
+        Caluclar_RendimientoNetoAntesImpuestos()
+        Calcular_RendimientoNetoDespuesImpuestos()
+
+    End Sub
+    Private Sub Calcular_MontoALiquidar()
+        Dim valor As Double
+
+        valor = _ValorTransado + _TotalCostos
+        _MontoALiquidar = valor
+
+    End Sub
+
+    Private Sub Calcular_InteresAGenerar()
+        Dim valor As Double
+        valor = _ValorTransado * (_Rendimiento / 100) * _Dias / 365
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        _InteresAGenerar = valor
+
+        Caluclar_RendimientoNetoAntesImpuestos()
+        Calcular_ValorRecompra()
+        Calcular_ISR()
+        Calcular_IngresoNeto()
+
+    End Sub
+    Private Sub Caluclar_RendimientoNetoAntesImpuestos()
+        Dim valor As Double
+
+        valor = ((_InteresAGenerar - _TotalCostos) / _ValorTransado) * (365 / _Dias)
+        _RendimientoNetoAntesDeImpuestos = valor * 100
+    End Sub
+    Private Sub Calcular_ValorRecompra()
+        Dim valor As Double
+
+        valor = _ValorTransado + _InteresAGenerar
+        _ValorReCompra = valor
+
+    End Sub
+    Private Sub Calcular_ISR()
+        Dim valor As Double
+
+        valor = _InteresAGenerar * 0.1
+        _ImpuestosLiquidacion = valor
+
+        Calcular_IngresoNeto()
+
+    End Sub
+    Private Sub Calcular_IngresoNeto()
+        Dim valor As Double
+
+        valor = _InteresAGenerar - _ImpuestosLiquidacion
+        _IngresoNeto = valor
+
+        Calcular_ValorNeto()
+        Calcular_RendimientoNetoDespuesImpuestos()
+
+    End Sub
+    Private Sub Calcular_ValorNeto()
+        Dim valor As Double
+
+        valor = _ValorTransado + _IngresoNeto - _CostoDeTransferencia
+        _ValorNeto = valor
+
+    End Sub
+    Private Sub Calcular_RendimientoNetoDespuesImpuestos()
+        Dim valor As Double
+
+        valor = (_IngresoNeto - _TotalCostos) / _ValorTransado * 365 / _Dias
+        _RendimientoNetoDespuesDeImpuestos = valor * 100
+
+
+    End Sub
+
+
+    Function FechaDeVencimiento(ByVal fecha As Date, ByVal dias As Integer)
+        Dim Valor = fecha.AddDays(dias)
+        Return Valor
+
+    End Function
+
+
+    Function Comision(ByVal valortrasado As String, ByVal dias As Integer, ByVal por As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+
+
+
+
+
+
+
+
+
+        Dim Valor As Double = 0
+        Valor = valortrasado * dias * por / 365
+        Return Valor
+        'If (IndexBase = 0) Then
+        '    Valor = valortrasado * dias * (por / 100) / 360
+        '    Return Valor
+        'ElseIf (IndexBase = 1) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = valortrasado * DiasPrimeraFecha * (por / 100) / 366
+        '        PrOpc2 = valortrasado * DiasSegundaFecha * (por / 100) / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasSegundaFecha * (por / 100) / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasPrimeraFecha * (por / 100) / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+        'ElseIf (IndexBase = 2) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = valortrasado * DiasPrimeraFecha * (por / 100) / 366
+        '        PrOpc2 = valortrasado * DiasSegundaFecha * (por / 100) / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasSegundaFecha * (por / 100) / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasPrimeraFecha * (por / 100) / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+
+
+
+        'Else
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = valortrasado * DiasPrimeraFecha * (por / 100) / 360
+        '        PrOpc2 = valortrasado * DiasSegundaFecha * (por / 100) / 360
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasSegundaFecha * (por / 100) / 360
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = valortrasado * DiasPrimeraFecha * (por / 100) / 360
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+        'End If
+        'Return Valor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+    Function IOF(ByVal valortrasado As Double, comisioncasa As Double, ByVal comisionbolsa As Double, ByVal dias As Integer, ByVal VALIOF As Double, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+
+        Dim Valor As Double = 0
+        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (dias * VALIOF)) / 365
+
+        Return Valor
+        'If (IndexBase = 0) Then
+        '    Valor = ((valortrasado + comisioncasa + comisionbolsa) * (dias * VALIOF)) / 360
+        '    Return Valor
+        'ElseIf (IndexBase = 1) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 366
+        '        PrOpc2 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+        'ElseIf (IndexBase = 2) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 366
+        '        PrOpc2 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+
+
+
+        'Else
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 360
+        '        PrOpc2 = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 360
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasSegundaFecha * VALIOF)) / 360
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((valortrasado + comisioncasa + comisionbolsa) * (DiasPrimeraFecha * VALIOF)) / 360
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+        'End If
+        'Return Valor
+
+
+
+    End Function
+
+    Function TotCostos(ByVal ComisionCasa As Double, ByVal ComisionBolsa As Double, ByVal IOF As Double, ByVal OC As Double, ByVal ValorTransado As Double, ByVal Instrumento As String)
+        Dim Valor As Double = 0
+
+        Valor = ComisionCasa + ComisionBolsa + IOF + OC
+
+
+
+        Return Valor
+    End Function
+    Function MontoLiquidacion(ByVal ValorTrasado As Double, ByVal totalcosto As Double)
+        Dim Valor = ValorTrasado + totalcosto
+
+        Return Valor
+    End Function
+
+    Function InteresGenerar(ByVal ValorTrasado As Double, ByVal rendimiento As Double, ByVal dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+        Valor = ValorTrasado * rendimiento * dias / 365
+        Return Valor
+        'If (IndexBase = 0) Then
+        '    Valor = ValorTrasado * rendimiento * dias / 360
+
+        '    Return Valor
+        'ElseIf (IndexBase = 1) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ValorTrasado * rendimiento * DiasPrimeraFecha / 366
+        '        PrOpc2 = ValorTrasado * rendimiento * DiasSegundaFecha / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasSegundaFecha / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasPrimeraFecha / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+        'ElseIf (IndexBase = 2) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ValorTrasado * rendimiento * DiasPrimeraFecha / 366
+        '        PrOpc2 = ValorTrasado * rendimiento * DiasSegundaFecha / 365
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasSegundaFecha / 365
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasPrimeraFecha / 366
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+
+
+
+
+
+        'Else
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ValorTrasado * rendimiento * DiasPrimeraFecha / 360
+        '        PrOpc2 = ValorTrasado * rendimiento * DiasSegundaFecha / 360
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasSegundaFecha / 360
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ValorTrasado * rendimiento * DiasPrimeraFecha / 360
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor
+
+        'End If
+        'Return Valor
+
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+    Function RendimientoAntes(ByVal interesgenerar As Double, ByVal totcostos As Double, ByVal valortra As Double, ByVal dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer, ByVal Tabla As String)
+        Dim Valor As Double = 0
+        If Tabla = "REP0" Then
+            Valor = ((interesgenerar - totcostos) / valortra) * (365 / dias)
+        Else
+            Valor = ((interesgenerar + totcostos) / valortra) * (365 / dias)
+        End If
+
+
+
+        'If (IndexBase = 0) Then
+        '    Valor = ((interesgenerar - totcostos) / valortra) * (360 / dias)
+        '    Return Valor * 100
+        'ElseIf (IndexBase = 1) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((interesgenerar - totcostos) / valortra) * (366 / DiasPrimeraFecha)
+        '        PrOpc2 = ((interesgenerar - totcostos) / valortra) * (365 / DiasSegundaFecha)
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (365 / DiasSegundaFecha)
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (366 / DiasPrimeraFecha)
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+
+
+        'ElseIf (IndexBase = 2) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((interesgenerar - totcostos) / valortra) * (366 / DiasPrimeraFecha)
+        '        PrOpc2 = ((interesgenerar - totcostos) / valortra) * (365 / DiasSegundaFecha)
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (365 / DiasSegundaFecha)
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (366 / DiasPrimeraFecha)
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+
+
+
+
+
+        'Else
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = ((interesgenerar - totcostos) / valortra) * (360 / DiasPrimeraFecha)
+        '        PrOpc2 = ((interesgenerar - totcostos) / valortra) * (360 / DiasSegundaFecha)
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (360 / DiasSegundaFecha)
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = ((interesgenerar - totcostos) / valortra) * (360 / DiasPrimeraFecha)
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+        'End If
+        'Return Valor * 100
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        Return Valor * 100
+    End Function
+
+    Function ValorRecompras(ByVal Valortrasado As Double, ByVal InteresGenerar As Double)
+        Dim Valor = Valortrasado + InteresGenerar
+        Return Valor
+    End Function
+
+    Function Renta(ByVal InteresGenerar As Double, ByVal Porcentaje As Double)
+        Dim Valor = InteresGenerar * Porcentaje
+        Return Valor
+    End Function
+
+    Function IngresoNet(ByVal InteresGenerar As Double, ByVal Renta As Double)
+        Dim Valor = InteresGenerar - Renta
+        Return Valor
+    End Function
+
+    Function ValorNet(ByVal ValorTrasado As Double, ByVal IngresoNeto As Double, ByVal CostoTrans As Double)
+        Dim Valor = ValorTrasado + IngresoNeto - CostoTrans
+        Return Valor
+    End Function
+
+    Function RendimientoDespues(ByVal IngresoNeto As Double, ByVal totalcosto As Double, ByVal valortrasado As Double, ByVal dias As Integer, ByVal Fecha1 As Date, Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+        Valor = (IngresoNeto - totalcosto) / valortrasado * 365 / dias
+        'If (IndexBase = 0) Then
+        '    Valor = (IngresoNeto - totalcosto) / valortrasado * 360 / dias
+        '    Return Valor * 100
+        'ElseIf (IndexBase = 1) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = (IngresoNeto - totalcosto) / valortrasado * 366 / DiasPrimeraFecha
+        '        PrOpc2 = (IngresoNeto - totalcosto) / valortrasado * 365 / DiasSegundaFecha
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 365 / DiasSegundaFecha
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 366 / DiasPrimeraFecha
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+
+
+        'ElseIf (IndexBase = 2) Then
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = (IngresoNeto - totalcosto) / valortrasado * 366 / DiasPrimeraFecha
+        '        PrOpc2 = (IngresoNeto - totalcosto) / valortrasado * 365 / DiasSegundaFecha
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 365 / DiasSegundaFecha
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 366 / DiasPrimeraFecha
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+
+
+
+
+
+        'Else
+        '    Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+        '    Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        '    DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+        '    DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+        '    If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        PrOpc1 = (IngresoNeto - totalcosto) / valortrasado * 360 / DiasPrimeraFecha
+        '        PrOpc2 = (IngresoNeto - totalcosto) / valortrasado * 360 / DiasSegundaFecha
+        '        Valor = PrOpc1 + PrOpc2
+        '    ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 360 / DiasSegundaFecha
+        '    ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+        '        Valor = (IngresoNeto - totalcosto) / valortrasado * 360 / DiasPrimeraFecha
+        '    Else
+        '        Valor = 0
+        '    End If
+        '    Return Valor * 100
+
+        'End If
+        'Return Valor * 100
+
+
+
+
+
+
+        Return Valor * 100
+    End Function
+End Class

+ 131 - 0
ENTI/RequisicionDePagoCE.vb

@@ -0,0 +1,131 @@
+Public Class RequisicionDePagoCE
+    Private _CodigoInversion As String = String.Empty
+    Private _AFavorDe As String = String.Empty
+    Private _FormaDePago As String = String.Empty
+    Private _MontoDelPago As Double = 0
+    Private _FechaDelPago As Date = Date.Now.Date
+    Private _CodigoBanco As String = String.Empty
+    Private _NumeroCuenta As String = String.Empty
+    Private _SaldoContable As Double = 0
+    Private _Concepto As String = String.Empty
+    Private _UsuarioSolicitante As String = String.Empty
+    Private _CodigoReq As String = String.Empty
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(ByVal Value As String)
+            If (_CodigoInversion <> Value) Then
+                _CodigoInversion = Value
+            End If
+        End Set
+    End Property
+
+    Public Property AFavorDe As String
+        Get
+            Return _AFavorDe
+        End Get
+        Set(ByVal Value As String)
+            If (_AFavorDe <> Value) Then
+                _AFavorDe = Value
+            End If
+        End Set
+    End Property
+
+    Public Property FormaDePago As String
+        Get
+            Return _FormaDePago
+        End Get
+        Set(ByVal Value As String)
+            If (_FormaDePago <> Value) Then
+                _FormaDePago = Value
+            End If
+        End Set
+    End Property
+
+    Public Property MontoDelPago As Double
+        Get
+            Return _MontoDelPago
+        End Get
+        Set(ByVal Value As Double)
+            If (_MontoDelPago <> Value) Then
+                _MontoDelPago = Value
+            End If
+        End Set
+    End Property
+
+    Public Property FechaDelPago As DateTime
+        Get
+            Return _FechaDelPago
+        End Get
+        Set(ByVal Value As DateTime)
+            If (_FechaDelPago <> Value) Then
+                _FechaDelPago = Value
+            End If
+        End Set
+    End Property
+
+    Public Property CodigoBanco As String
+        Get
+            Return _CodigoBanco
+        End Get
+        Set(ByVal Value As String)
+            If (_CodigoBanco <> Value) Then
+                _CodigoBanco = Value
+            End If
+        End Set
+    End Property
+
+    Public Property NumeroCuenta As String
+        Get
+            Return _NumeroCuenta
+        End Get
+        Set(ByVal Value As String)
+            If (_NumeroCuenta <> Value) Then
+                _NumeroCuenta = Value
+            End If
+        End Set
+    End Property
+
+    Public Property SaldoContable As Double
+        Get
+            Return _SaldoContable
+        End Get
+        Set(ByVal Value As Double)
+            If (_SaldoContable <> Value) Then
+                _SaldoContable = Value
+            End If
+        End Set
+    End Property
+
+    Public Property Concepto As String
+        Get
+            Return _Concepto
+        End Get
+        Set(ByVal Value As String)
+            If (_Concepto <> Value) Then
+                _Concepto = Value
+            End If
+        End Set
+    End Property
+    Public Property UsuarioSolicitante As String
+        Get
+            Return _UsuarioSolicitante
+        End Get
+        Set(value As String)
+            _UsuarioSolicitante = value
+        End Set
+    End Property
+
+
+
+    Public Property CodigoReq As String
+        Get
+            Return _CodigoReq
+        End Get
+        Set(value As String)
+            _CodigoReq = value
+        End Set
+    End Property
+End Class

+ 42 - 0
ENTI/SeriesCE.vb

@@ -0,0 +1,42 @@
+Public Class SeriesCE
+    Private _CodigoEmpresa As String
+    Private _CodigoInstrumentoFinanciero As String
+    Private _Tipo As String
+    Private _Numero As Integer
+
+
+    Public Property CodigoEmpresa As String
+        Get
+            Return _CodigoEmpresa
+        End Get
+        Set(value As String)
+            _CodigoEmpresa = value
+        End Set
+    End Property
+    Public Property CodigoInstrumentoFinanciero As String
+        Get
+            Return _CodigoInstrumentoFinanciero
+        End Get
+        Set(value As String)
+            _CodigoInstrumentoFinanciero = value
+        End Set
+    End Property
+    Public Property Tipo As String
+        Get
+            Return _Tipo
+        End Get
+        Set(value As String)
+            _Tipo = value
+        End Set
+    End Property
+    Public Property Numero As Integer
+        Get
+            Return _Numero
+        End Get
+        Set(value As Integer)
+            _Numero = value
+        End Set
+    End Property
+
+
+End Class

+ 421 - 0
ENTI/TrasladarDatosCMVTA.vb

@@ -0,0 +1,421 @@
+Public Class TrasladarDatosCMVTA
+    Private _PrecioLimpioACC As Double = 0
+    Private _FechaOperacionACC As Date = Date.Now.Date
+    Private _FechaVencimientoACC As Date = Date.Now.Date
+    Private _UnidadesACC As Integer = 0
+    Private _PorcentajeCasaACC As Double = 0
+    Private _PorcentajeBolsaACC As Double = 0
+
+
+    Private _FechaOperacionFUTU As Date = Date.Now.Date
+    Private _FechaLiquidacionFUTU As Date = Date.Now.Date
+    Private _FechaVencimientoFUTU As Date = Date.Now.Date
+    Private _PrecioUnitarioFUTU As Double = 0
+    Private _ComisionBrokerFUTU As Double = 0
+    Private _IdContratoFUTU As Double = 0
+    Private _CantidadContratosFUTU As Double = 0
+    Private _UnidadesPorContratoFUTU As Double = 0
+
+    Private _PeriodicidadCINV As String = String.Empty
+    Private _ValorNominalCINV As Double = 0
+    Private _UltimaFechaCuponCINV As Date = Date.Now.Date
+    Private _FechaLiquidacionCINV As Date = Date.Now.Date
+    Private _FechaVencimientoCINV As Date = Date.Now.Date
+    Private _BaseCINV As Integer = 0
+    Private _CuponCINV As Double = 0
+    Private _YTMVencimientoCINV As Double = 0
+    Private _PrecioVencimientoCINV As Double = 0
+    Private _PrecioCompraCINV As Double = 0
+    Private _PorcentajeComisionCasaCINV As Double = 0
+    Private _PorcentajeComisionBolsaCINV As Double = 0
+    Private _NombreInstrumento As String = String.Empty
+    Private _AgregarCMVTA As Boolean = False
+
+    Public Property AgregarCMVTA As Boolean
+        Get
+            Return _AgregarCMVTA
+        End Get
+        Set(value As Boolean)
+            _AgregarCMVTA = value
+        End Set
+    End Property
+
+
+    Public Property NombreInstrumento As String
+        Get
+            Return _NombreInstrumento
+        End Get
+        Set(value As String)
+            _NombreInstrumento = value
+        End Set
+    End Property
+
+
+    Public Property PorcentajeBolsaACC As Double
+        Get
+            Return _PorcentajeBolsaACC
+        End Get
+        Set(value As Double)
+            _PorcentajeBolsaACC = value
+        End Set
+    End Property
+
+
+    Public Property PorcentajeCasaACC As Double
+        Get
+            Return _PorcentajeCasaACC
+        End Get
+        Set(value As Double)
+            _PorcentajeCasaACC = value
+        End Set
+    End Property
+
+
+
+
+    Public Property PrecioLimpioACC As Double
+        Get
+            Return _PrecioLimpioACC
+        End Get
+        Set(value As Double)
+            _PrecioLimpioACC = value
+        End Set
+    End Property
+
+
+
+    Public Property FechaOperacionACC As Date
+        Get
+            Return _FechaOperacionACC
+        End Get
+        Set(value As Date)
+            _FechaOperacionACC = value
+        End Set
+    End Property
+
+
+
+    Public Property FechaVencimientoACC As Date
+        Get
+            Return _FechaVencimientoACC
+        End Get
+        Set(value As Date)
+            _FechaVencimientoACC = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property UnidadesACC As Integer
+        Get
+            Return _UnidadesACC
+        End Get
+        Set(value As Integer)
+            _UnidadesACC = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+    Public Property FechaOperacionFUTU As Date
+        Get
+            Return _FechaOperacionFUTU
+        End Get
+        Set(value As Date)
+            _FechaOperacionFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property FechaLiquidacionFUTU As Date
+        Get
+            Return _FechaLiquidacionFUTU
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property FechaVencimientoFUTU As Date
+        Get
+            Return _FechaVencimientoFUTU
+        End Get
+        Set(value As Date)
+            _FechaVencimientoFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property PrecioUnitarioFUTU As Double
+        Get
+            Return _PrecioUnitarioFUTU
+        End Get
+        Set(value As Double)
+            _PrecioUnitarioFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property ComisionBrokerFUTU As Double
+        Get
+            Return _ComisionBrokerFUTU
+        End Get
+        Set(value As Double)
+            _ComisionBrokerFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property IdContratoFUTU As Double
+        Get
+            Return _IdContratoFUTU
+        End Get
+        Set(value As Double)
+            _IdContratoFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property CantidadContratosFUTU As Integer
+        Get
+            Return _CantidadContratosFUTU
+        End Get
+        Set(value As Integer)
+            _CantidadContratosFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Public Property UnidadesPorContratoFUTU As Double
+        Get
+            Return _UnidadesPorContratoFUTU
+        End Get
+        Set(value As Double)
+            _UnidadesPorContratoFUTU = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Public Property PeriodicidadCINV As String
+        Get
+            Return _PeriodicidadCINV
+        End Get
+        Set(value As String)
+            _PeriodicidadCINV = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property ValorNominalCINV As Double
+        Get
+            Return _ValorNominalCINV
+        End Get
+        Set(value As Double)
+            _ValorNominalCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Public Property UltimaFechaCuponCINV As Date
+        Get
+            Return _UltimaFechaCuponCINV
+        End Get
+        Set(value As Date)
+            _UltimaFechaCuponCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Public Property FechaLiquidacionCINV As Date
+        Get
+            Return _FechaLiquidacionCINV
+        End Get
+        Set(value As Date)
+            _FechaLiquidacionCINV = value
+        End Set
+    End Property
+
+
+
+
+
+    Public Property FechaVencimientoCINV As Date
+        Get
+            Return _FechaVencimientoCINV
+        End Get
+        Set(value As Date)
+            _FechaVencimientoCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Public Property BaseCINV As Integer
+        Get
+            Return _BaseCINV
+        End Get
+        Set(value As Integer)
+            _BaseCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property CuponCINV As Double
+        Get
+            Return _CuponCINV
+        End Get
+        Set(value As Double)
+            _CuponCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+
+    Public Property YTMVencimientoCINV As Double
+        Get
+            Return _YTMVencimientoCINV
+        End Get
+        Set(value As Double)
+            _YTMVencimientoCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property PrecioVencimientoCINV As Double
+        Get
+            Return _PrecioVencimientoCINV
+        End Get
+        Set(value As Double)
+            _PrecioVencimientoCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property PrecioCompraCINV As Double
+        Get
+            Return _PrecioCompraCINV
+        End Get
+        Set(value As Double)
+            _PrecioCompraCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+    Public Property PorcentajeComisionCasaCINV As Double
+        Get
+            Return _PorcentajeComisionCasaCINV
+        End Get
+        Set(value As Double)
+            _PorcentajeComisionCasaCINV = value
+        End Set
+    End Property
+
+
+
+
+
+
+
+    Public Property PorcentajeComisionBolsaCINV As Double
+        Get
+            Return _PorcentajeComisionBolsaCINV
+        End Get
+        Set(value As Double)
+            _PorcentajeComisionBolsaCINV = value
+        End Set
+    End Property
+
+End Class

+ 80 - 0
ENTI/zAccionesDetalleCE.vb

@@ -0,0 +1,80 @@
+Public Class zAccionesDetalleCE
+    Private _CodigoInversion As String
+    Private _Fecha As Date
+    Private _Dividendo As Double
+    Private _IngresoBruto As Double
+    Private _PorcentajeISR As Double
+    Private _ValorISR As Double
+    Private _IngresoNeto As Double
+    Private _Estado As String
+
+    Public Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Public Property Fecha As Date
+        Get
+            Return _Fecha
+        End Get
+        Set(value As Date)
+            _Fecha = value
+        End Set
+    End Property
+    Public Property Dividendo As Double
+        Get
+            Return _Dividendo
+        End Get
+        Set(value As Double)
+            _Dividendo = value
+        End Set
+    End Property
+    Public ReadOnly Property IngresoBruto As Double
+        Get
+            Return _IngresoBruto
+        End Get
+    End Property
+    Public Property PorcentajeISR As Double
+        Get
+            Return _PorcentajeISR
+        End Get
+        Set(value As Double)
+            _PorcentajeISR = value
+        End Set
+    End Property
+    Public ReadOnly Property ValorISR As Double
+        Get
+            Return _ValorISR
+        End Get
+    End Property
+    Public ReadOnly Property IngresoNeto As Double
+        Get
+            Return _IngresoNeto
+        End Get
+    End Property
+    Public Property Estado As String
+        Get
+            Return _Estado
+        End Get
+        Set(value As String)
+            _Estado = value
+        End Set
+    End Property
+
+    'Public Sub New()
+    '    _Fecha = Date.Now.Date
+    '    _IngresoBruto = 0
+    '    _PorcentajeISR = 0
+    '    _ValorISR = 0
+    '    _IngresoNeto = 0
+    'End Sub
+
+
+
+
+
+
+End Class

+ 4 - 0
FRM/InstrumentosFinancieros.vb

@@ -0,0 +1,4 @@
+Module InstrumentosFinancieros
+
+
+End Module

+ 37 - 0
FRM/JSON.Designer.vb

@@ -0,0 +1,37 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class JSON
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.SuspendLayout()
+        '
+        'JSON
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.ClientSize = New System.Drawing.Size(800, 450)
+        Me.Name = "JSON"
+        Me.Text = "JSON"
+        Me.ResumeLayout(False)
+
+    End Sub
+End Class

+ 120 - 0
FRM/JSON.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
FRM/JSON.vb

@@ -0,0 +1,29 @@
+Imports System.Web.Script.Serialization
+Imports System.IO
+
+
+Public Class JSON
+    Dim ser As JavaScriptSerializer = New JavaScriptSerializer()
+
+
+    Private Sub JSON_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        Dim playerA As New player
+
+        If (File.Exists("jsconfig1.json")) Then
+            MsgBox("Existe")
+        End If
+        Dim Carpeta As String = My.Computer.FileSystem.CurrentDirectory
+        MsgBox(Carpeta)
+        Dim json As String = File.ReadAllText("../../FRM/jsconfig1.json")
+
+        playerA = ser.Deserialize(Of player)(json)
+        Dim primero = playerA.primero
+        MsgBox(primero)
+    End Sub
+
+
+End Class
+
+Class player
+    Public Property primero As String
+End Class

+ 0 - 0
FRM/Model1.Context.cs


+ 575 - 0
FRM/Model1.Context.tt

@@ -0,0 +1,575 @@
+<#@ template language="VB" debug="false" hostspecific="true"#>
+<#@ include file="EF6.Utility.VB.ttinclude"#><#@
+ output extension=".vb"#><#
+
+Const inputFile As String = "$edmxInputFile$"
+Dim textTransform As DynamicTextTransformation = DynamicTextTransformation.Create(Me)
+Dim code As CodeGenerationTools = New CodeGenerationTools(Me)
+Dim ef As MetadataTools = New MetadataTools(Me)
+Dim typeMapper As TypeMapper = New TypeMapper(code, ef, textTransform.Errors)
+Dim loader As EdmMetadataLoader = New EdmMetadataLoader(textTransform.Host, textTransform.Errors)
+Dim itemCollection As IEnumerable(Of GlobalItem) = loader.CreateEdmItemCollection(inputFile)
+Dim modelNamespace As String = loader.GetModelNamespace(inputFile)
+Dim codeStringGenerator As CodeStringGenerator = New CodeStringGenerator(code, typeMapper, ef)
+
+Dim container As EntityContainer = ItemCollection.OfType(Of EntityContainer)().FirstOrDefault()
+If container Is Nothing Then
+    Return String.Empty
+End If
+#>
+'------------------------------------------------------------------------------
+' <auto-generated>
+' <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
+'
+' <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
+' <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Imports System
+Imports System.Data.Entity
+Imports System.Data.Entity.Infrastructure
+<#
+If container.FunctionImports.Any()
+#>
+Imports System.Data.Entity.Core.Objects
+Imports System.Linq
+<#
+End If
+#>
+
+<#
+Dim codeNamespace As String = code.VsNamespaceSuggestion()
+If Not String.IsNullOrEmpty(codeNamespace) Then
+#>
+Namespace <#=code.EscapeNamespace(codeNamespace)#>
+
+<#
+    PushIndent("    ")
+End If
+
+#>
+Partial <#=Accessibility.ForType(container)#> Class <#=code.Escape(container)#>
+    Inherits DbContext
+
+    Public Sub New()
+        MyBase.New("name=<#=container.Name#>")
+<#
+If Not loader.IsLazyLoadingEnabled(container) Then
+#>
+        MyBase.Configuration.LazyLoadingEnabled = False
+<#
+End If
+
+For Each entitySet As EntitySet In container.BaseEntitySets.OfType(Of EntitySet)()
+    ''' Note: the DbSet members are defined below such that the getter and
+    ''' setter always have the same accessibility as the DbSet definition
+    If Not Accessibility.ForReadOnlyProperty(entitySet) = "Public"
+#>
+        <#=codeStringGenerator.DbSetInitializer(entitySet)#>
+<#
+    End If
+Next
+#>
+    End Sub
+
+    Protected Overrides Sub OnModelCreating(modelBuilder As DbModelBuilder)
+        Throw New UnintentionalCodeFirstException()
+    End Sub
+
+<#
+    For Each entitySet As EntitySet In container.BaseEntitySets.OfType(Of EntitySet)()
+#>
+    <#=codeStringGenerator.DbSet(entitySet)#>
+<#
+    Next
+
+    For Each edmFunction As EdmFunction In container.FunctionImports
+        WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption := False)
+    Next
+#>
+
+End Class
+<#
+
+If Not String.IsNullOrEmpty(codeNamespace) Then
+    PopIndent()
+#>
+
+End Namespace
+<#
+End If
+#>
+<#+
+Public Sub WriteFunctionImport(typeMapper As TypeMapper, codeStringGenerator As CodeStringGenerator, edmFunction As EdmFunction, modelNamespace As String, includeMergeOption As Boolean)
+    If typeMapper.IsComposable(edmFunction) Then
+#>
+
+    <DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")>
+    <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, AddressOf WriteFunctionParameter)
+#>
+         <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
+    End Function
+<#+
+    Else
+#>
+
+    <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, AddressOf WriteFunctionParameter)
+#>
+        <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
+    End Function
+<#+
+        If typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption) Then
+            WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption := True)
+        End If
+    End If
+End Sub
+
+Public Sub WriteFunctionParameter(name As String, isNotNull As String, notNullInit As String, nullInit As String)
+#>
+        Dim <#=name#> As ObjectParameter = If(<#=isNotNull#>, <#=notNullInit#>, <#=nullInit#>)
+
+<#+
+End Sub
+
+Public Const TemplateId As String = "VB_DbContext_Context_EF6"
+
+Public Class CodeStringGenerator
+    Private ReadOnly _code As CodeGenerationTools
+    Private ReadOnly _typeMapper As TypeMapper
+    Private ReadOnly _ef As MetadataTools
+
+    Public Sub New(code As CodeGenerationTools, typeMapper As TypeMapper, ef As MetadataTools)
+        ArgumentNotNull(code, "code")
+        ArgumentNotNull(typeMapper, "typeMapper")
+        ArgumentNotNull(ef, "ef")
+
+        _code = code
+        _typeMapper = typeMapper
+        _ef = ef
+    End Sub
+
+    Public Function SimpleProperty(edmProperty As EdmProperty) As String
+        Return SimpleOrComplexProperty(edmProperty, _code.StringBefore(" = ", _typeMapper.CreateLiteral(edmProperty.DefaultValue)))
+    End Function
+
+    Public Function ComplexProperty(edmProperty As EdmProperty) As String
+        Return SimpleOrComplexProperty(edmProperty, " = New " & _typeMapper.GetTypeName(edmProperty.TypeUsage))
+    End Function
+
+    Public Function SimpleOrComplexProperty(edmProperty As EdmProperty, defaultValue As String) As String
+        Return AnyProperty(
+            Accessibility.ForProperty(edmProperty), _
+            _typeMapper.GetTypeName(edmProperty.TypeUsage), _
+            _code.Escape(edmProperty), _
+            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), _
+            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)), _
+            defaultValue)
+    End Function
+
+    Public Function NavigationProperty(navProp As NavigationProperty) As String
+        Dim endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType())
+        Dim defaultValue = ""
+        Dim propertyType = endType
+
+        If(navProp.ToEndMember.RelationshipMultiplicity = RelationshipMultiplicity.Many)
+            defaultValue = " = New HashSet(Of " & endType & ")"
+            propertyType = "ICollection(Of " & endType & ")"
+        End If
+
+        Return AnyProperty(
+            AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), _
+            propertyType, _
+            _code.Escape(navProp), _
+            _code.SpaceAfter(Accessibility.ForGetter(navProp)), _
+            _code.SpaceAfter(Accessibility.ForSetter(navProp)), _
+            defaultValue)
+    End Function
+
+    Public Function AccessibilityAndVirtual(accessibility As String) As String
+        Return accessibility & (If(accessibility <> "Private", " Overridable", ""))
+    End Function
+
+    Public Function AnyProperty(accessibility As String, type As String, name As String, getterAccessibility As String, setterAccessibility As String, defaultValue As String)
+        If (String.IsNullOrEmpty(getterAccessibility) AndAlso String.IsNullOrEmpty(setterAccessibility))
+            Return String.Format( _
+                CultureInfo.InvariantCulture, _
+                "    {0} Property {1} As {2}{3}", _
+                accessibility, _
+                name, _
+                type, _
+                defaultValue)
+        Else
+            Return String.Format( _
+                CultureInfo.InvariantCulture, _
+                "{6}    Private _{0} As {1}{2}{6}" & _
+                "    {3} Property {0} As {1}{6}" & _
+                "        {4}Get{6}" & _
+                "            Return _{0}{6}" & _
+                "        End Get{6}" & _
+                "        {5}Set(ByVal value As {1}){6}" & _
+                "            _{0} = value{6}" & _
+                "        End Set{6}" & _
+                "    End Property",  _
+                name, _
+                type, _
+                defaultValue, _
+                accessibility, _
+                getterAccessibility, _
+                setterAccessibility, _
+                Environment.NewLine)
+        End If
+    End Function
+
+    Public Function PropertyAccessibilityAndVirtual(ByVal member As EdmMember) As String
+        Dim propertyAccess As String = Accessibility.ForProperty(member)
+        Dim setAccess as String = Accessibility.ForSetter(member)
+        Dim getAccess as String = Accessibility.ForGetter(member)
+        If propertyAccess <> "Private" AndAlso setAccess <> "Private" AndAlso getAccess <> "Private" Then
+            Return propertyAccess & " Overridable"
+        End If
+
+        Return propertyAccess
+    End Function
+
+    Public Function EntityClassOpening(entity As EntityType) As String
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "Partial {0} {1}Class {2}{3}", _
+            Accessibility.ForType(entity), _
+            _code.SpaceAfter(_code.MustInheritOption(entity)), _
+            _code.Escape(entity), _
+            _code.StringBefore(Environment.NewLine & "         Inherits ", _typeMapper.GetTypeName(entity.BaseType)))
+    End Function
+
+    Public Function EnumOpening(enumType As SimpleType) As String
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "{0} Enum {1} As {2}", _
+            Accessibility.ForType(enumType),
+            _code.Escape(enumType),
+            _code.Escape(_typeMapper.UnderlyingClrType(enumType)))
+    End Function
+
+    Public Sub WriteFunctionParameters(edmFunction As EdmFunction, writeParameter As Action(Of String, String, String, String))
+        Dim parameters as IEnumerable(Of FunctionImportParameter) = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef)
+        For Each parameter As FunctionImportParameter In parameters.Where(Function(p) p.NeedsLocalVariable)
+            Dim isNotNull as String = If(parameter.IsNullableOfT, parameter.FunctionParameterName & ".HasValue", parameter.FunctionParameterName & " IsNot Nothing")
+            Dim notNullInit as String = "New ObjectParameter(""" & parameter.EsqlParameterName & """, " & parameter.FunctionParameterName & ")"
+            Dim nullInit as String = "New ObjectParameter(""" & parameter.EsqlParameterName & """, GetType(" & TypeMapper.FixNamespaces(parameter.RawClrTypeName) & "))"
+            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit)
+        Next
+    End Sub
+
+    Public Function ComposableFunctionMethod(edmFunction As EdmFunction, modelNamespace As String) As String
+        Dim parameters as IEnumerable(Of FunctionImportParameter) = _typeMapper.GetParameters(edmFunction)
+
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "{0} Function {1}({2}) As IQueryable(Of {3})", _
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), _
+            _code.Escape(edmFunction), _
+            String.Join(", ", parameters.Select(Function(p) p.FunctionParameterName & " As " & TypeMapper.FixNamespaces(p.FunctionParameterType)).ToArray()), _
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace))
+    End Function
+
+    Public Function ComposableCreateQuery(edmFunction As EdmFunction, modelNamespace As String) As String
+        Dim parameters as IEnumerable(Of FunctionImportParameter) = _typeMapper.GetParameters(edmFunction)
+
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "Return DirectCast(Me, IObjectContextAdapter).ObjectContext.CreateQuery(Of {0})(""[{1}].[{2}]({3})""{4})", _
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), _
+            edmFunction.NamespaceName, _
+            edmFunction.Name, _
+            String.Join(", ", parameters.Select(Function(p) "@" & Convert.ToString(p.EsqlParameterName)).ToArray()), _
+            _code.StringBefore(", ", String.Join(", ", parameters.Select(Function(p) p.ExecuteParameterName).ToArray())))
+    End Function
+
+    Public Function FunctionMethod(edmFunction As EdmFunction, modelNamespace As String, includeMergeOption As Boolean) As String
+        Dim parameters as IEnumerable(Of FunctionImportParameter) = _typeMapper.GetParameters(edmFunction)
+        Dim returnType as TypeUsage = _typeMapper.GetReturnType(edmFunction)
+
+        Dim paramList as String = String.Join(", ", parameters.Select(Function(p) p.FunctionParameterName & " As " & TypeMapper.FixNamespaces(p.FunctionParameterType)).ToArray())
+        If includeMergeOption Then
+            paramList = _code.StringAfter(paramList, ", ") & "mergeOption As MergeOption"
+        End If
+
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "{0} Function {1}({2}) As {3}", _
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), _
+            _code.Escape(edmFunction), _
+            paramList, _
+            If(returnType Is Nothing, "Integer", "ObjectResult(Of " & _typeMapper.GetTypeName(returnType, modelNamespace) & ")"))
+    End Function
+
+    Public Function ExecuteFunction(edmFunction As EdmFunction, modelNamespace As String, includeMergeOption As Boolean) As String
+        Dim parameters as IEnumerable(Of FunctionImportParameter) = _typeMapper.GetParameters(edmFunction)
+        Dim returnType as TypeUsage = _typeMapper.GetReturnType(edmFunction)
+
+        Dim callParams as String = _code.StringBefore(", ", String.Join(", ", parameters.Select(Function(p) p.ExecuteParameterName).ToArray()))
+        If includeMergeOption Then
+            callParams = ", mergeOption" & callParams
+        End If
+
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "Return DirectCast(Me, IObjectContextAdapter).ObjectContext.ExecuteFunction{0}(""{1}""{2})", _
+            If(returnType Is Nothing, "", "(Of " & _typeMapper.GetTypeName(returnType, ModelNamespace) & ")"), _
+            edmFunction.Name, _
+            callParams)
+    End Function
+
+    Public Function DbSet(entitySet As EntitySet) As String
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "{0} Overridable Property {1}() As DbSet(Of {2})", _
+            Accessibility.ForReadOnlyProperty(entitySet), _
+            _code.Escape(entitySet), _
+            _typeMapper.GetTypeName(entitySet.ElementType))
+    End Function
+
+    Public Function DbSetInitializer(entitySet As EntitySet) As String
+        Return String.Format( _
+            CultureInfo.InvariantCulture, _
+            "{0} = Me.Set(Of {1})()", _
+            _code.Escape(entitySet), _
+            _typeMapper.GetTypeName(entitySet.ElementType))
+    End Function
+End Class
+
+Public Class TypeMapper
+    Private Const ExternalTypeNameAttributeName As String = "http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"
+
+    Private ReadOnly _errors As System.Collections.IList
+    Private ReadOnly _code As CodeGenerationTools
+    Private ReadOnly _ef As MetadataTools
+
+    Public Sub New(code As CodeGenerationTools, ef As MetadataTools, errors As System.Collections.IList)
+        ArgumentNotNull(code, "code")
+        ArgumentNotNull(ef, "ef")
+        ArgumentNotNull(errors, "errors")
+
+        _code = code
+        _ef = ef
+        _errors = errors
+    End Sub
+
+    Public Shared Function FixNamespaces(typeName As String) As String
+        Return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.")
+    End Function
+
+    Public Function GetTypeName(typeUsage As TypeUsage) As String
+        Return If(typeUsage Is Nothing, Nothing, GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace := Nothing))
+    End Function
+
+    Public Function GetTypeName(edmType As EdmType) As String
+        Return GetTypeName(edmType, isNullable := Nothing, modelNamespace := Nothing)
+    End Function
+
+    Public Function GetTypeName(typeUsage As TypeUsage, modelNamespace As String) As String
+        Return If(typeUsage Is Nothing, Nothing, GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace))
+    End Function
+
+    Public Function GetTypeName(edmType As EdmType, modelNamespace As String) As String
+        Return GetTypeName(edmType, isNullable := Nothing, modelNamespace := modelNamespace)
+    End Function
+
+    Public Function GetTypeName(edmType As EdmType, isNullable As System.Nullable(Of Boolean), modelNamespace As String) As String
+        If edmType Is Nothing Then
+            Return Nothing
+        End If
+
+        Dim collectionType = TryCast(edmType, CollectionType)
+        If collectionType IsNot Nothing Then
+            Return String.Format(CultureInfo.InvariantCulture, "ICollection( Of {0})", GetTypeName(collectionType.TypeUsage, modelNamespace))
+        End If
+
+        Dim typeName = If(_code.Escape(edmType.MetadataProperties.Where(Function(p) p.Name = ExternalTypeNameAttributeName).Select(Function(p) DirectCast(p.Value, String)).FirstOrDefault()), (If(modelNamespace IsNot Nothing AndAlso edmType.NamespaceName <> modelNamespace, _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)), _code.Escape(edmType))))
+
+        If TypeOf edmType Is StructuralType Then
+            Return typeName
+        End If
+
+        If TypeOf edmType Is SimpleType Then
+            Dim clrType = UnderlyingClrType(edmType)
+            If Not (IsEnumType(edmType)) Then
+                typeName = _code.Escape(clrType)
+            End If
+
+            typeName = FixNamespaces(typeName)
+
+            Return If(clrType.IsValueType AndAlso isNullable = True, String.Format(CultureInfo.InvariantCulture, "Nullable(Of {0})", typeName), typeName)
+        End If
+
+        Throw New ArgumentException("edmType")
+    End Function
+
+    Public Function UnderlyingClrType(edmType As EdmType) As Type
+        ArgumentNotNull(edmType, "edmType")
+
+        Dim primitiveType as PrimitiveType = TryCast(edmType, PrimitiveType)
+        If primitiveType IsNot Nothing Then
+            Return primitiveType.ClrEquivalentType
+        End If
+
+        If IsEnumType(edmType) Then
+            Return GetEnumUnderlyingType(edmType).ClrEquivalentType
+        End If
+
+        Return GetType(Object)
+    End Function
+
+    Public Function GetEnumMemberValue(enumMember As MetadataItem) As Object
+        ArgumentNotNull(enumMember, "enumMember")
+
+        Dim valueProperty As PropertyInfo = enumMember.GetType().GetProperty("Value")
+        Return If(valueProperty Is Nothing, Nothing, valueProperty.GetValue(enumMember, Nothing))
+    End Function
+
+    Public Function GetEnumMemberName(enumMember As MetadataItem) As String
+        ArgumentNotNull(enumMember, "enumMember")
+
+        Dim nameProperty As PropertyInfo = enumMember.GetType().GetProperty("Name")
+        Return If(nameProperty Is Nothing, Nothing, DirectCast(nameProperty.GetValue(enumMember, Nothing), String))
+    End Function
+
+    Public Function GetEnumMembers(enumType As EdmType) As System.Collections.IEnumerable
+        ArgumentNotNull(enumType, "enumType")
+
+        Dim membersProperty As PropertyInfo = enumType.GetType().GetProperty("Members")
+        Return If(membersProperty IsNot Nothing, DirectCast(membersProperty.GetValue(enumType, Nothing), System.Collections.IEnumerable), Enumerable.Empty(Of MetadataItem)())
+    End Function
+
+    Public Function EnumIsFlags(enumType As EdmType) As Boolean
+        ArgumentNotNull(enumType, "enumType")
+
+        Dim isFlagsProperty As PropertyInfo = enumType.GetType().GetProperty("IsFlags")
+        Return isFlagsProperty IsNot Nothing AndAlso CBool(isFlagsProperty.GetValue(enumType, Nothing))
+    End Function
+
+    Public Function IsEnumType(edmType As GlobalItem) As Boolean
+        ArgumentNotNull(edmType, "edmType")
+
+        Return edmType.GetType().Name = "EnumType"
+    End Function
+
+    Public Function GetEnumUnderlyingType(enumType As EdmType) As PrimitiveType
+        ArgumentNotNull(enumType, "enumType")
+
+        Return DirectCast(enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, Nothing), PrimitiveType)
+    End Function
+
+    Public Function CreateLiteral(value As Object) As String
+        If value Is Nothing OrElse value.GetType() IsNot GetType(TimeSpan) Then
+            Return _code.CreateLiteral(value)
+        End If
+
+        Return String.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", DirectCast(value, TimeSpan).Ticks)
+    End Function
+
+    Public Function VerifyCaseInsensitiveTypeUniqueness(types As IEnumerable(Of String), sourceFile As String) As Boolean
+        ArgumentNotNull(types, "types")
+        ArgumentNotNull(sourceFile, "sourceFile")
+
+        Dim hash As HashSet(Of String) = New HashSet(Of String)(StringComparer.InvariantCultureIgnoreCase)
+        If types.Any(Function(item) Not hash.Add(item)) Then
+            _errors.Add(New CompilerError(sourceFile, -1, -1, "6023", String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))))
+            Return False
+        End If
+        Return True
+    End Function
+
+    Public Function GetEnumItemsToGenerate(itemCollection As IEnumerable(Of GlobalItem)) As IEnumerable(Of SimpleType)
+        Return GetItemsToGenerate(Of SimpleType)(itemCollection).Where(Function(e) IsEnumType(e))
+    End Function
+
+    Public Function GetItemsToGenerate(Of T As EdmType)(itemCollection As IEnumerable(Of GlobalItem)) As IEnumerable(Of T)
+        Return itemCollection.OfType(Of T)().Where(Function(i) Not i.MetadataProperties.Any(Function(p) p.Name = ExternalTypeNameAttributeName)).OrderBy(Function(i) i.Name)
+    End Function
+
+    Public Function GetAllGlobalItems(itemCollection As IEnumerable(Of GlobalItem)) As IEnumerable(Of String)
+        Return itemCollection.Where(Function(i) TypeOf i Is EntityType OrElse TypeOf i Is ComplexType OrElse TypeOf i Is EntityContainer OrElse IsEnumType(i)).Select(Function(g) GetGlobalItemName(g))
+    End Function
+
+    Public Function GetGlobalItemName(item As GlobalItem) As String
+        If TypeOf item Is EdmType Then
+            Return DirectCast(item, EdmType).Name
+        Else
+            Return DirectCast(item, EntityContainer).Name
+        End If
+    End Function
+
+    Public Function GetSimpleProperties(type As EntityType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is SimpleType AndAlso p.DeclaringType.Equals(type))
+    End Function
+
+    Public Function GetSimpleProperties(type As ComplexType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is SimpleType AndAlso p.DeclaringType.Equals(type))
+    End Function
+
+    Public Function GetComplexProperties(type As EntityType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is ComplexType AndAlso p.DeclaringType.Equals(type))
+    End Function
+
+    Public Function GetComplexProperties(type As ComplexType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is ComplexType AndAlso p.DeclaringType.Equals(type))
+    End Function
+
+    Public Function GetPropertiesWithDefaultValues(type As EntityType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is SimpleType AndAlso p.DeclaringType.Equals(type) AndAlso p.DefaultValue IsNot Nothing)
+    End Function
+
+    Public Function GetPropertiesWithDefaultValues(type As ComplexType) As IEnumerable(Of EdmProperty)
+        Return type.Properties.Where(Function(p) TypeOf p.TypeUsage.EdmType Is SimpleType AndAlso p.DeclaringType.Equals(type) AndAlso p.DefaultValue IsNot Nothing)
+    End Function
+
+    Public Function GetNavigationProperties(type As EntityType) As IEnumerable(Of NavigationProperty)
+        Return type.NavigationProperties.Where(Function(np) np.DeclaringType.Equals(type))
+    End Function
+
+    Public Function GetCollectionNavigationProperties(type As EntityType) As IEnumerable(Of NavigationProperty)
+        Return type.NavigationProperties.Where(Function(np) np.DeclaringType.Equals(type) AndAlso np.ToEndMember.RelationshipMultiplicity = RelationshipMultiplicity.Many)
+    End Function
+
+    Public Function GetReturnParameter(edmFunction As EdmFunction) As FunctionParameter
+        ArgumentNotNull(edmFunction, "edmFunction")
+
+        Dim returnParamsProperty As PropertyInfo = edmFunction.GetType().GetProperty("ReturnParameters")
+        Return If(returnParamsProperty Is Nothing, edmFunction.ReturnParameter, DirectCast(returnParamsProperty.GetValue(edmFunction, Nothing), IEnumerable(Of FunctionParameter)).FirstOrDefault())
+    End Function
+
+    Public Function IsComposable(edmFunction As EdmFunction) As Boolean
+        ArgumentNotNull(edmFunction, "edmFunction")
+
+        Dim isComposableProperty As PropertyInfo = edmFunction.GetType().GetProperty("IsComposableAttribute")
+        Return isComposableProperty IsNot Nothing AndAlso CBool(isComposableProperty.GetValue(edmFunction, Nothing))
+    End Function
+
+    Public Function GetParameters(edmFunction As EdmFunction) As IEnumerable(Of FunctionImportParameter)
+        Return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef)
+    End Function
+
+    Public Function GetReturnType(edmFunction As EdmFunction) As TypeUsage
+        Dim returnParam As FunctionParameter = GetReturnParameter(edmFunction)
+        Return If(returnParam Is Nothing, Nothing, _ef.GetElementType(returnParam.TypeUsage))
+    End Function
+
+    Public Function GenerateMergeOptionFunction(edmFunction As EdmFunction, includeMergeOption As Boolean) As Boolean
+        Dim returnType As TypeUsage = GetReturnType(edmFunction)
+        Return Not includeMergeOption AndAlso returnType IsNot Nothing AndAlso returnType.EdmType.BuiltInTypeKind = BuiltInTypeKind.EntityType
+    End Function
+End Class
+
+Public Shared Sub ArgumentNotNull(Of T As Class)(arg As T, name As String)
+    If arg Is Nothing Then
+        Throw New ArgumentNullException(name)
+    End If
+End Sub
+
+#>

+ 981 - 0
FRM/SplashScreen1.resx

@@ -0,0 +1,981 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="MainLayoutPanel.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+        qlpB8g3QLgAAAABJRU5ErkJggg==
+</value>
+  </data>
+</root>

+ 1163 - 0
FRM/frmAcciones.Designer.vb

@@ -0,0 +1,1163 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
+Partial Class frmAcciones
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()>
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()>
+    Private Sub InitializeComponent()
+        Me.components = New System.ComponentModel.Container()
+        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAcciones))
+        Me.btnAceptar = New System.Windows.Forms.Button()
+        Me.btnCancelar = New System.Windows.Forms.Button()
+        Me.lblTitulo = New System.Windows.Forms.Label()
+        Me.BindingNavigator1 = New System.Windows.Forms.BindingNavigator(Me.components)
+        Me.BindingNavigatorSeparator = New System.Windows.Forms.ToolStripSeparator()
+        Me.navModificar = New System.Windows.Forms.ToolStripButton()
+        Me.navNuevo = New System.Windows.Forms.ToolStripButton()
+        Me.navEliminar = New System.Windows.Forms.ToolStripButton()
+        Me.TbDividendos = New System.Windows.Forms.TabPage()
+        Me.btnQuitar = New System.Windows.Forms.Button()
+        Me.btnActualizar = New System.Windows.Forms.Button()
+        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
+        Me.rdbEfectivo = New System.Windows.Forms.RadioButton()
+        Me.rdbPorcentaje = New System.Windows.Forms.RadioButton()
+        Me.dgvDividendos = New System.Windows.Forms.DataGridView()
+        Me.TbOperacion = New System.Windows.Forms.TabPage()
+        Me.btnVenderTitulo = New System.Windows.Forms.Button()
+        Me.GrpDatos = New System.Windows.Forms.GroupBox()
+        Me.Label2 = New System.Windows.Forms.Label()
+        Me.Label9 = New System.Windows.Forms.Label()
+        Me.Label8 = New System.Windows.Forms.Label()
+        Me.Label11 = New System.Windows.Forms.Label()
+        Me.Label6 = New System.Windows.Forms.Label()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.Label12 = New System.Windows.Forms.Label()
+        Me.Label3 = New System.Windows.Forms.Label()
+        Me.Label13 = New System.Windows.Forms.Label()
+        Me.Label16 = New System.Windows.Forms.Label()
+        Me.Label1 = New System.Windows.Forms.Label()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.Label14 = New System.Windows.Forms.Label()
+        Me.Label17 = New System.Windows.Forms.Label()
+        Me.Label15 = New System.Windows.Forms.Label()
+        Me.GrpBotonos = New System.Windows.Forms.GroupBox()
+        Me.GrpCompra = New System.Windows.Forms.GroupBox()
+        Me.txtRetornoAnualNetoCompra = New System.Windows.Forms.TextBox()
+        Me.dtpFechaVencimientoCompra = New System.Windows.Forms.DateTimePicker()
+        Me.txtComisionPorcentajeBolsaCompra = New System.Windows.Forms.TextBox()
+        Me.dtpFechaOperacionCompra = New System.Windows.Forms.DateTimePicker()
+        Me.txtComisionPorcentajeCasaCompra = New System.Windows.Forms.TextBox()
+        Me.txtUnidadesCompra = New System.Windows.Forms.TextBox()
+        Me.txtComisionBolsaCompra = New System.Windows.Forms.TextBox()
+        Me.txtValorTransadoCompra = New System.Windows.Forms.TextBox()
+        Me.txtComisionCasaCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioLimpioCompra = New System.Windows.Forms.TextBox()
+        Me.txtRetornoAnualBrutoCompra = New System.Windows.Forms.TextBox()
+        Me.txtMontoNetoCompra = New System.Windows.Forms.TextBox()
+        Me.txtImpuestosYComisionesCompra = New System.Windows.Forms.TextBox()
+        Me.Label18 = New System.Windows.Forms.Label()
+        Me.txtGananciaCapitalTotalCompra = New System.Windows.Forms.TextBox()
+        Me.txtDiasDeTenenciaCompra = New System.Windows.Forms.TextBox()
+        Me.txtGananciaCapitalUnitarioCompra = New System.Windows.Forms.TextBox()
+        Me.GrpVenta = New System.Windows.Forms.GroupBox()
+        Me.txtValorTransadoVenta = New System.Windows.Forms.TextBox()
+        Me.dtpFechaOperacionVenta = New System.Windows.Forms.DateTimePicker()
+        Me.txtComisionPorcentajeBolsaVenta = New System.Windows.Forms.TextBox()
+        Me.dtpFechaVencimientoVenta = New System.Windows.Forms.DateTimePicker()
+        Me.txtComisionPorcentajeCasaVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioLimpioVenta = New System.Windows.Forms.TextBox()
+        Me.txtDiasDeTenenciaVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioVenta = New System.Windows.Forms.TextBox()
+        Me.txtComisionBolsaVenta = New System.Windows.Forms.TextBox()
+        Me.txtMontoNetoVenta = New System.Windows.Forms.TextBox()
+        Me.txtGananciaCapitalTotalVenta = New System.Windows.Forms.TextBox()
+        Me.txtComisionCasaVenta = New System.Windows.Forms.TextBox()
+        Me.txtGananciaCapitalUnitarioVenta = New System.Windows.Forms.TextBox()
+        Me.txtRetornoAnualBrutoVenta = New System.Windows.Forms.TextBox()
+        Me.txtUnidadesVenta = New System.Windows.Forms.TextBox()
+        Me.Label19 = New System.Windows.Forms.Label()
+        Me.txtRetornoAnualNetoVenta = New System.Windows.Forms.TextBox()
+        Me.txtImpuestosYComisionesVenta = New System.Windows.Forms.TextBox()
+        Me.GrpImpuesto = New System.Windows.Forms.GroupBox()
+        Me.ChkIOF = New System.Windows.Forms.CheckBox()
+        Me.lblCompra2 = New System.Windows.Forms.Label()
+        Me.Label7 = New System.Windows.Forms.Label()
+        Me.lblVenta1 = New System.Windows.Forms.Label()
+        Me.ChkRenta = New System.Windows.Forms.CheckBox()
+        Me.lblVenta2 = New System.Windows.Forms.Label()
+        Me.txtIOFCompra = New System.Windows.Forms.TextBox()
+        Me.lblCompra1 = New System.Windows.Forms.Label()
+        Me.txtRentaVenta = New System.Windows.Forms.TextBox()
+        Me.txtIOFVenta = New System.Windows.Forms.TextBox()
+        Me.txtRentaCompra = New System.Windows.Forms.TextBox()
+        Me.TabAcciones = New System.Windows.Forms.TabControl()
+        Me.Panel1 = New System.Windows.Forms.Panel()
+        Me.btnAsociarAccion = New System.Windows.Forms.Button()
+        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.BindingNavigator1.SuspendLayout()
+        Me.TbDividendos.SuspendLayout()
+        Me.GroupBox1.SuspendLayout()
+        CType(Me.dgvDividendos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.TbOperacion.SuspendLayout()
+        Me.GrpDatos.SuspendLayout()
+        Me.GrpBotonos.SuspendLayout()
+        Me.GrpCompra.SuspendLayout()
+        Me.GrpVenta.SuspendLayout()
+        Me.GrpImpuesto.SuspendLayout()
+        Me.TabAcciones.SuspendLayout()
+        Me.Panel1.SuspendLayout()
+        Me.SuspendLayout()
+        '
+        'btnAceptar
+        '
+        Me.btnAceptar.DialogResult = System.Windows.Forms.DialogResult.OK
+        Me.btnAceptar.Location = New System.Drawing.Point(33, 40)
+        Me.btnAceptar.Name = "btnAceptar"
+        Me.btnAceptar.Size = New System.Drawing.Size(98, 40)
+        Me.btnAceptar.TabIndex = 66
+        Me.btnAceptar.Text = "Aceptar"
+        Me.btnAceptar.UseVisualStyleBackColor = True
+        '
+        'btnCancelar
+        '
+        Me.btnCancelar.DialogResult = System.Windows.Forms.DialogResult.OK
+        Me.btnCancelar.Location = New System.Drawing.Point(173, 40)
+        Me.btnCancelar.Name = "btnCancelar"
+        Me.btnCancelar.Size = New System.Drawing.Size(93, 40)
+        Me.btnCancelar.TabIndex = 79
+        Me.btnCancelar.Text = "Cancelar"
+        Me.btnCancelar.UseVisualStyleBackColor = True
+        '
+        'lblTitulo
+        '
+        Me.lblTitulo.Anchor = System.Windows.Forms.AnchorStyles.Top
+        Me.lblTitulo.AutoSize = True
+        Me.lblTitulo.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblTitulo.Location = New System.Drawing.Point(40, 17)
+        Me.lblTitulo.Name = "lblTitulo"
+        Me.lblTitulo.Size = New System.Drawing.Size(89, 24)
+        Me.lblTitulo.TabIndex = 80
+        Me.lblTitulo.Text = "Acciones"
+        '
+        'BindingNavigator1
+        '
+        Me.BindingNavigator1.AddNewItem = Nothing
+        Me.BindingNavigator1.CountItem = Nothing
+        Me.BindingNavigator1.DeleteItem = Nothing
+        Me.BindingNavigator1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorSeparator, Me.navModificar, Me.navNuevo, Me.navEliminar})
+        Me.BindingNavigator1.Location = New System.Drawing.Point(0, 0)
+        Me.BindingNavigator1.MoveFirstItem = Nothing
+        Me.BindingNavigator1.MoveLastItem = Nothing
+        Me.BindingNavigator1.MoveNextItem = Nothing
+        Me.BindingNavigator1.MovePreviousItem = Nothing
+        Me.BindingNavigator1.Name = "BindingNavigator1"
+        Me.BindingNavigator1.PositionItem = Nothing
+        Me.BindingNavigator1.Size = New System.Drawing.Size(1157, 25)
+        Me.BindingNavigator1.TabIndex = 158
+        Me.BindingNavigator1.Text = "BindingNavigator1"
+        '
+        'BindingNavigatorSeparator
+        '
+        Me.BindingNavigatorSeparator.Name = "BindingNavigatorSeparator"
+        Me.BindingNavigatorSeparator.Size = New System.Drawing.Size(6, 25)
+        '
+        'navModificar
+        '
+        Me.navModificar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navModificar.Image = CType(resources.GetObject("navModificar.Image"), System.Drawing.Image)
+        Me.navModificar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navModificar.Name = "navModificar"
+        Me.navModificar.Size = New System.Drawing.Size(23, 22)
+        Me.navModificar.Text = "Modificar"
+        '
+        'navNuevo
+        '
+        Me.navNuevo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navNuevo.Image = CType(resources.GetObject("navNuevo.Image"), System.Drawing.Image)
+        Me.navNuevo.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navNuevo.Name = "navNuevo"
+        Me.navNuevo.Size = New System.Drawing.Size(23, 22)
+        Me.navNuevo.Text = "Nuevo"
+        '
+        'navEliminar
+        '
+        Me.navEliminar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navEliminar.Image = CType(resources.GetObject("navEliminar.Image"), System.Drawing.Image)
+        Me.navEliminar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navEliminar.Name = "navEliminar"
+        Me.navEliminar.Size = New System.Drawing.Size(23, 22)
+        Me.navEliminar.Text = "Eliminar"
+        '
+        'TbDividendos
+        '
+        Me.TbDividendos.Controls.Add(Me.btnQuitar)
+        Me.TbDividendos.Controls.Add(Me.btnActualizar)
+        Me.TbDividendos.Controls.Add(Me.GroupBox1)
+        Me.TbDividendos.Controls.Add(Me.dgvDividendos)
+        Me.TbDividendos.Location = New System.Drawing.Point(4, 22)
+        Me.TbDividendos.Name = "TbDividendos"
+        Me.TbDividendos.Size = New System.Drawing.Size(1149, 519)
+        Me.TbDividendos.TabIndex = 2
+        Me.TbDividendos.Text = "Dividendos"
+        Me.TbDividendos.UseVisualStyleBackColor = True
+        '
+        'btnQuitar
+        '
+        Me.btnQuitar.Location = New System.Drawing.Point(281, 11)
+        Me.btnQuitar.Name = "btnQuitar"
+        Me.btnQuitar.Size = New System.Drawing.Size(96, 30)
+        Me.btnQuitar.TabIndex = 118
+        Me.btnQuitar.Text = "Quitar"
+        Me.btnQuitar.UseVisualStyleBackColor = True
+        '
+        'btnActualizar
+        '
+        Me.btnActualizar.Location = New System.Drawing.Point(555, 8)
+        Me.btnActualizar.Name = "btnActualizar"
+        Me.btnActualizar.Size = New System.Drawing.Size(118, 36)
+        Me.btnActualizar.TabIndex = 22
+        Me.btnActualizar.Text = "Actualizar calculos"
+        Me.btnActualizar.UseVisualStyleBackColor = True
+        '
+        'GroupBox1
+        '
+        Me.GroupBox1.Controls.Add(Me.rdbEfectivo)
+        Me.GroupBox1.Controls.Add(Me.rdbPorcentaje)
+        Me.GroupBox1.Location = New System.Drawing.Point(0, 3)
+        Me.GroupBox1.Name = "GroupBox1"
+        Me.GroupBox1.Size = New System.Drawing.Size(244, 45)
+        Me.GroupBox1.TabIndex = 21
+        Me.GroupBox1.TabStop = False
+        Me.GroupBox1.Text = "Tipo de Calculos Dividendos"
+        '
+        'rdbEfectivo
+        '
+        Me.rdbEfectivo.AutoSize = True
+        Me.rdbEfectivo.Location = New System.Drawing.Point(173, 19)
+        Me.rdbEfectivo.Name = "rdbEfectivo"
+        Me.rdbEfectivo.Size = New System.Drawing.Size(37, 17)
+        Me.rdbEfectivo.TabIndex = 1
+        Me.rdbEfectivo.Text = "$$"
+        Me.rdbEfectivo.UseVisualStyleBackColor = True
+        '
+        'rdbPorcentaje
+        '
+        Me.rdbPorcentaje.AutoSize = True
+        Me.rdbPorcentaje.Checked = True
+        Me.rdbPorcentaje.Location = New System.Drawing.Point(34, 19)
+        Me.rdbPorcentaje.Name = "rdbPorcentaje"
+        Me.rdbPorcentaje.Size = New System.Drawing.Size(33, 17)
+        Me.rdbPorcentaje.TabIndex = 0
+        Me.rdbPorcentaje.TabStop = True
+        Me.rdbPorcentaje.Text = "%"
+        Me.rdbPorcentaje.UseVisualStyleBackColor = True
+        '
+        'dgvDividendos
+        '
+        Me.dgvDividendos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvDividendos.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
+        Me.dgvDividendos.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised
+        Me.dgvDividendos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvDividendos.Location = New System.Drawing.Point(2, 50)
+        Me.dgvDividendos.Name = "dgvDividendos"
+        Me.dgvDividendos.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
+        Me.dgvDividendos.Size = New System.Drawing.Size(961, 344)
+        Me.dgvDividendos.TabIndex = 18
+        '
+        'TbOperacion
+        '
+        Me.TbOperacion.Controls.Add(Me.btnVenderTitulo)
+        Me.TbOperacion.Controls.Add(Me.GrpDatos)
+        Me.TbOperacion.Controls.Add(Me.lblTitulo)
+        Me.TbOperacion.Controls.Add(Me.GrpBotonos)
+        Me.TbOperacion.Controls.Add(Me.GrpCompra)
+        Me.TbOperacion.Controls.Add(Me.GrpVenta)
+        Me.TbOperacion.Controls.Add(Me.GrpImpuesto)
+        Me.TbOperacion.Location = New System.Drawing.Point(4, 22)
+        Me.TbOperacion.Name = "TbOperacion"
+        Me.TbOperacion.Padding = New System.Windows.Forms.Padding(3)
+        Me.TbOperacion.Size = New System.Drawing.Size(1149, 519)
+        Me.TbOperacion.TabIndex = 0
+        Me.TbOperacion.Text = "Operación"
+        Me.TbOperacion.UseVisualStyleBackColor = True
+        '
+        'btnVenderTitulo
+        '
+        Me.btnVenderTitulo.Location = New System.Drawing.Point(468, 17)
+        Me.btnVenderTitulo.Name = "btnVenderTitulo"
+        Me.btnVenderTitulo.Size = New System.Drawing.Size(75, 35)
+        Me.btnVenderTitulo.TabIndex = 174
+        Me.btnVenderTitulo.Text = "Vender Titulo"
+        Me.btnVenderTitulo.UseVisualStyleBackColor = True
+        Me.btnVenderTitulo.Visible = False
+        '
+        'GrpDatos
+        '
+        Me.GrpDatos.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpDatos.Controls.Add(Me.Label2)
+        Me.GrpDatos.Controls.Add(Me.Label9)
+        Me.GrpDatos.Controls.Add(Me.Label8)
+        Me.GrpDatos.Controls.Add(Me.Label11)
+        Me.GrpDatos.Controls.Add(Me.Label6)
+        Me.GrpDatos.Controls.Add(Me.Label5)
+        Me.GrpDatos.Controls.Add(Me.Label12)
+        Me.GrpDatos.Controls.Add(Me.Label3)
+        Me.GrpDatos.Controls.Add(Me.Label13)
+        Me.GrpDatos.Controls.Add(Me.Label16)
+        Me.GrpDatos.Controls.Add(Me.Label1)
+        Me.GrpDatos.Controls.Add(Me.Label4)
+        Me.GrpDatos.Controls.Add(Me.Label14)
+        Me.GrpDatos.Controls.Add(Me.Label17)
+        Me.GrpDatos.Controls.Add(Me.Label15)
+        Me.GrpDatos.Location = New System.Drawing.Point(39, 54)
+        Me.GrpDatos.Name = "GrpDatos"
+        Me.GrpDatos.Size = New System.Drawing.Size(200, 397)
+        Me.GrpDatos.TabIndex = 98
+        Me.GrpDatos.TabStop = False
+        '
+        'Label2
+        '
+        Me.Label2.AutoSize = True
+        Me.Label2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label2.Location = New System.Drawing.Point(17, 158)
+        Me.Label2.Name = "Label2"
+        Me.Label2.Size = New System.Drawing.Size(75, 18)
+        Me.Label2.TabIndex = 1
+        Me.Label2.Text = "Monto Neto"
+        '
+        'Label9
+        '
+        Me.Label9.AutoSize = True
+        Me.Label9.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label9.Location = New System.Drawing.Point(16, 271)
+        Me.Label9.Name = "Label9"
+        Me.Label9.Size = New System.Drawing.Size(150, 18)
+        Me.Label9.TabIndex = 8
+        Me.Label9.Text = "Retorno Anualizado Neto"
+        '
+        'Label8
+        '
+        Me.Label8.AutoSize = True
+        Me.Label8.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label8.Location = New System.Drawing.Point(15, 293)
+        Me.Label8.Name = "Label8"
+        Me.Label8.Size = New System.Drawing.Size(105, 18)
+        Me.Label8.TabIndex = 7
+        Me.Label8.Text = "Dias de tenencia"
+        '
+        'Label11
+        '
+        Me.Label11.AutoSize = True
+        Me.Label11.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label11.Location = New System.Drawing.Point(17, 111)
+        Me.Label11.Name = "Label11"
+        Me.Label11.Size = New System.Drawing.Size(61, 18)
+        Me.Label11.TabIndex = 10
+        Me.Label11.Text = "Unidades"
+        '
+        'Label6
+        '
+        Me.Label6.AutoSize = True
+        Me.Label6.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label6.Location = New System.Drawing.Point(15, 247)
+        Me.Label6.Name = "Label6"
+        Me.Label6.Size = New System.Drawing.Size(154, 18)
+        Me.Label6.TabIndex = 5
+        Me.Label6.Text = "Retorno Anualizado Bruto"
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label5.Location = New System.Drawing.Point(15, 224)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(109, 18)
+        Me.Label5.TabIndex = 77
+        Me.Label5.Text = "Comisiones Bolsa"
+        '
+        'Label12
+        '
+        Me.Label12.AutoSize = True
+        Me.Label12.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label12.Location = New System.Drawing.Point(17, 87)
+        Me.Label12.Name = "Label12"
+        Me.Label12.Size = New System.Drawing.Size(117, 18)
+        Me.Label12.TabIndex = 11
+        Me.Label12.Text = "Fecha Vencimiento"
+        '
+        'Label3
+        '
+        Me.Label3.AutoSize = True
+        Me.Label3.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label3.Location = New System.Drawing.Point(15, 202)
+        Me.Label3.Name = "Label3"
+        Me.Label3.Size = New System.Drawing.Size(107, 18)
+        Me.Label3.TabIndex = 74
+        Me.Label3.Text = "Comisiones Casa"
+        '
+        'Label13
+        '
+        Me.Label13.AutoSize = True
+        Me.Label13.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label13.Location = New System.Drawing.Point(14, 316)
+        Me.Label13.Name = "Label13"
+        Me.Label13.Size = New System.Drawing.Size(154, 18)
+        Me.Label13.TabIndex = 12
+        Me.Label13.Text = "Ganancia de capital total"
+        '
+        'Label16
+        '
+        Me.Label16.AutoSize = True
+        Me.Label16.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label16.Location = New System.Drawing.Point(17, 67)
+        Me.Label16.Name = "Label16"
+        Me.Label16.Size = New System.Drawing.Size(105, 18)
+        Me.Label16.TabIndex = 15
+        Me.Label16.Text = "Fecha Operación"
+        '
+        'Label1
+        '
+        Me.Label1.AutoSize = True
+        Me.Label1.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label1.Location = New System.Drawing.Point(17, 44)
+        Me.Label1.Name = "Label1"
+        Me.Label1.Size = New System.Drawing.Size(87, 18)
+        Me.Label1.TabIndex = 0
+        Me.Label1.Text = "Precio Limpio"
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label4.Location = New System.Drawing.Point(72, 135)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(116, 18)
+        Me.Label4.TabIndex = 72
+        Me.Label4.Text = "Imp. y Comisiones"
+        Me.Label4.Visible = False
+        '
+        'Label14
+        '
+        Me.Label14.AutoSize = True
+        Me.Label14.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label14.Location = New System.Drawing.Point(15, 340)
+        Me.Label14.Name = "Label14"
+        Me.Label14.Size = New System.Drawing.Size(173, 18)
+        Me.Label14.TabIndex = 13
+        Me.Label14.Text = "Ganancia de capital unitario"
+        '
+        'Label17
+        '
+        Me.Label17.AutoSize = True
+        Me.Label17.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label17.Location = New System.Drawing.Point(17, 181)
+        Me.Label17.Name = "Label17"
+        Me.Label17.Size = New System.Drawing.Size(78, 18)
+        Me.Label17.TabIndex = 16
+        Me.Label17.Text = "Precio Sucio"
+        '
+        'Label15
+        '
+        Me.Label15.AutoSize = True
+        Me.Label15.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label15.Location = New System.Drawing.Point(17, 136)
+        Me.Label15.Name = "Label15"
+        Me.Label15.Size = New System.Drawing.Size(93, 18)
+        Me.Label15.TabIndex = 14
+        Me.Label15.Text = "Valor Transado"
+        '
+        'GrpBotonos
+        '
+        Me.GrpBotonos.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpBotonos.Controls.Add(Me.btnAceptar)
+        Me.GrpBotonos.Controls.Add(Me.btnCancelar)
+        Me.GrpBotonos.Location = New System.Drawing.Point(777, 239)
+        Me.GrpBotonos.Name = "GrpBotonos"
+        Me.GrpBotonos.Size = New System.Drawing.Size(312, 118)
+        Me.GrpBotonos.TabIndex = 97
+        Me.GrpBotonos.TabStop = False
+        '
+        'GrpCompra
+        '
+        Me.GrpCompra.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpCompra.Controls.Add(Me.txtRetornoAnualNetoCompra)
+        Me.GrpCompra.Controls.Add(Me.dtpFechaVencimientoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionPorcentajeBolsaCompra)
+        Me.GrpCompra.Controls.Add(Me.dtpFechaOperacionCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionPorcentajeCasaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtUnidadesCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionBolsaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtValorTransadoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionCasaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtPrecioSucioCompra)
+        Me.GrpCompra.Controls.Add(Me.txtPrecioLimpioCompra)
+        Me.GrpCompra.Controls.Add(Me.txtRetornoAnualBrutoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtMontoNetoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtImpuestosYComisionesCompra)
+        Me.GrpCompra.Controls.Add(Me.Label18)
+        Me.GrpCompra.Controls.Add(Me.txtGananciaCapitalTotalCompra)
+        Me.GrpCompra.Controls.Add(Me.txtDiasDeTenenciaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtGananciaCapitalUnitarioCompra)
+        Me.GrpCompra.Location = New System.Drawing.Point(305, 54)
+        Me.GrpCompra.Name = "GrpCompra"
+        Me.GrpCompra.Size = New System.Drawing.Size(170, 397)
+        Me.GrpCompra.TabIndex = 96
+        Me.GrpCompra.TabStop = False
+        '
+        'txtRetornoAnualNetoCompra
+        '
+        Me.txtRetornoAnualNetoCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtRetornoAnualNetoCompra.Location = New System.Drawing.Point(16, 271)
+        Me.txtRetornoAnualNetoCompra.Name = "txtRetornoAnualNetoCompra"
+        Me.txtRetornoAnualNetoCompra.ReadOnly = True
+        Me.txtRetornoAnualNetoCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtRetornoAnualNetoCompra.TabIndex = 0
+        Me.txtRetornoAnualNetoCompra.Visible = False
+        '
+        'dtpFechaVencimientoCompra
+        '
+        Me.dtpFechaVencimientoCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.dtpFechaVencimientoCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoCompra.Location = New System.Drawing.Point(16, 91)
+        Me.dtpFechaVencimientoCompra.Name = "dtpFechaVencimientoCompra"
+        Me.dtpFechaVencimientoCompra.Size = New System.Drawing.Size(140, 20)
+        Me.dtpFechaVencimientoCompra.TabIndex = 3
+        '
+        'txtComisionPorcentajeBolsaCompra
+        '
+        Me.txtComisionPorcentajeBolsaCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionPorcentajeBolsaCompra.Location = New System.Drawing.Point(16, 226)
+        Me.txtComisionPorcentajeBolsaCompra.Name = "txtComisionPorcentajeBolsaCompra"
+        Me.txtComisionPorcentajeBolsaCompra.Size = New System.Drawing.Size(37, 20)
+        Me.txtComisionPorcentajeBolsaCompra.TabIndex = 80
+        '
+        'dtpFechaOperacionCompra
+        '
+        Me.dtpFechaOperacionCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.dtpFechaOperacionCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaOperacionCompra.Location = New System.Drawing.Point(16, 69)
+        Me.dtpFechaOperacionCompra.Name = "dtpFechaOperacionCompra"
+        Me.dtpFechaOperacionCompra.Size = New System.Drawing.Size(140, 20)
+        Me.dtpFechaOperacionCompra.TabIndex = 2
+        '
+        'txtComisionPorcentajeCasaCompra
+        '
+        Me.txtComisionPorcentajeCasaCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionPorcentajeCasaCompra.Location = New System.Drawing.Point(16, 203)
+        Me.txtComisionPorcentajeCasaCompra.Name = "txtComisionPorcentajeCasaCompra"
+        Me.txtComisionPorcentajeCasaCompra.Size = New System.Drawing.Size(37, 20)
+        Me.txtComisionPorcentajeCasaCompra.TabIndex = 79
+        '
+        'txtUnidadesCompra
+        '
+        Me.txtUnidadesCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtUnidadesCompra.Location = New System.Drawing.Point(16, 115)
+        Me.txtUnidadesCompra.Name = "txtUnidadesCompra"
+        Me.txtUnidadesCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtUnidadesCompra.TabIndex = 5
+        '
+        'txtComisionBolsaCompra
+        '
+        Me.txtComisionBolsaCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionBolsaCompra.Location = New System.Drawing.Point(56, 227)
+        Me.txtComisionBolsaCompra.Name = "txtComisionBolsaCompra"
+        Me.txtComisionBolsaCompra.ReadOnly = True
+        Me.txtComisionBolsaCompra.Size = New System.Drawing.Size(99, 20)
+        Me.txtComisionBolsaCompra.TabIndex = 76
+        '
+        'txtValorTransadoCompra
+        '
+        Me.txtValorTransadoCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtValorTransadoCompra.Location = New System.Drawing.Point(16, 137)
+        Me.txtValorTransadoCompra.Name = "txtValorTransadoCompra"
+        Me.txtValorTransadoCompra.ReadOnly = True
+        Me.txtValorTransadoCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtValorTransadoCompra.TabIndex = 0
+        '
+        'txtComisionCasaCompra
+        '
+        Me.txtComisionCasaCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionCasaCompra.Location = New System.Drawing.Point(56, 204)
+        Me.txtComisionCasaCompra.Name = "txtComisionCasaCompra"
+        Me.txtComisionCasaCompra.ReadOnly = True
+        Me.txtComisionCasaCompra.Size = New System.Drawing.Size(100, 20)
+        Me.txtComisionCasaCompra.TabIndex = 73
+        '
+        'txtPrecioSucioCompra
+        '
+        Me.txtPrecioSucioCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtPrecioSucioCompra.Location = New System.Drawing.Point(16, 181)
+        Me.txtPrecioSucioCompra.Name = "txtPrecioSucioCompra"
+        Me.txtPrecioSucioCompra.ReadOnly = True
+        Me.txtPrecioSucioCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtPrecioSucioCompra.TabIndex = 0
+        '
+        'txtPrecioLimpioCompra
+        '
+        Me.txtPrecioLimpioCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtPrecioLimpioCompra.Location = New System.Drawing.Point(16, 47)
+        Me.txtPrecioLimpioCompra.Name = "txtPrecioLimpioCompra"
+        Me.txtPrecioLimpioCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtPrecioLimpioCompra.TabIndex = 1
+        '
+        'txtRetornoAnualBrutoCompra
+        '
+        Me.txtRetornoAnualBrutoCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtRetornoAnualBrutoCompra.Location = New System.Drawing.Point(16, 248)
+        Me.txtRetornoAnualBrutoCompra.Name = "txtRetornoAnualBrutoCompra"
+        Me.txtRetornoAnualBrutoCompra.ReadOnly = True
+        Me.txtRetornoAnualBrutoCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtRetornoAnualBrutoCompra.TabIndex = 0
+        Me.txtRetornoAnualBrutoCompra.Visible = False
+        '
+        'txtMontoNetoCompra
+        '
+        Me.txtMontoNetoCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtMontoNetoCompra.Location = New System.Drawing.Point(16, 159)
+        Me.txtMontoNetoCompra.Name = "txtMontoNetoCompra"
+        Me.txtMontoNetoCompra.ReadOnly = True
+        Me.txtMontoNetoCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtMontoNetoCompra.TabIndex = 0
+        '
+        'txtImpuestosYComisionesCompra
+        '
+        Me.txtImpuestosYComisionesCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtImpuestosYComisionesCompra.Location = New System.Drawing.Point(16, 159)
+        Me.txtImpuestosYComisionesCompra.Name = "txtImpuestosYComisionesCompra"
+        Me.txtImpuestosYComisionesCompra.ReadOnly = True
+        Me.txtImpuestosYComisionesCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtImpuestosYComisionesCompra.TabIndex = 70
+        Me.txtImpuestosYComisionesCompra.Visible = False
+        '
+        'Label18
+        '
+        Me.Label18.AutoSize = True
+        Me.Label18.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label18.Location = New System.Drawing.Point(56, 18)
+        Me.Label18.Name = "Label18"
+        Me.Label18.Size = New System.Drawing.Size(55, 18)
+        Me.Label18.TabIndex = 54
+        Me.Label18.Text = "Compra"
+        '
+        'txtGananciaCapitalTotalCompra
+        '
+        Me.txtGananciaCapitalTotalCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtGananciaCapitalTotalCompra.Location = New System.Drawing.Point(16, 316)
+        Me.txtGananciaCapitalTotalCompra.Name = "txtGananciaCapitalTotalCompra"
+        Me.txtGananciaCapitalTotalCompra.ReadOnly = True
+        Me.txtGananciaCapitalTotalCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtGananciaCapitalTotalCompra.TabIndex = 0
+        Me.txtGananciaCapitalTotalCompra.Visible = False
+        '
+        'txtDiasDeTenenciaCompra
+        '
+        Me.txtDiasDeTenenciaCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtDiasDeTenenciaCompra.Location = New System.Drawing.Point(16, 294)
+        Me.txtDiasDeTenenciaCompra.Name = "txtDiasDeTenenciaCompra"
+        Me.txtDiasDeTenenciaCompra.ReadOnly = True
+        Me.txtDiasDeTenenciaCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtDiasDeTenenciaCompra.TabIndex = 4
+        Me.txtDiasDeTenenciaCompra.Visible = False
+        '
+        'txtGananciaCapitalUnitarioCompra
+        '
+        Me.txtGananciaCapitalUnitarioCompra.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtGananciaCapitalUnitarioCompra.Location = New System.Drawing.Point(16, 339)
+        Me.txtGananciaCapitalUnitarioCompra.Name = "txtGananciaCapitalUnitarioCompra"
+        Me.txtGananciaCapitalUnitarioCompra.ReadOnly = True
+        Me.txtGananciaCapitalUnitarioCompra.Size = New System.Drawing.Size(140, 20)
+        Me.txtGananciaCapitalUnitarioCompra.TabIndex = 0
+        Me.txtGananciaCapitalUnitarioCompra.Visible = False
+        '
+        'GrpVenta
+        '
+        Me.GrpVenta.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpVenta.Controls.Add(Me.txtValorTransadoVenta)
+        Me.GrpVenta.Controls.Add(Me.dtpFechaOperacionVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionPorcentajeBolsaVenta)
+        Me.GrpVenta.Controls.Add(Me.dtpFechaVencimientoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionPorcentajeCasaVenta)
+        Me.GrpVenta.Controls.Add(Me.txtPrecioLimpioVenta)
+        Me.GrpVenta.Controls.Add(Me.txtDiasDeTenenciaVenta)
+        Me.GrpVenta.Controls.Add(Me.txtPrecioSucioVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionBolsaVenta)
+        Me.GrpVenta.Controls.Add(Me.txtMontoNetoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtGananciaCapitalTotalVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionCasaVenta)
+        Me.GrpVenta.Controls.Add(Me.txtGananciaCapitalUnitarioVenta)
+        Me.GrpVenta.Controls.Add(Me.txtRetornoAnualBrutoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtUnidadesVenta)
+        Me.GrpVenta.Controls.Add(Me.Label19)
+        Me.GrpVenta.Controls.Add(Me.txtRetornoAnualNetoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtImpuestosYComisionesVenta)
+        Me.GrpVenta.Location = New System.Drawing.Point(535, 54)
+        Me.GrpVenta.Name = "GrpVenta"
+        Me.GrpVenta.Size = New System.Drawing.Size(179, 397)
+        Me.GrpVenta.TabIndex = 95
+        Me.GrpVenta.TabStop = False
+        '
+        'txtValorTransadoVenta
+        '
+        Me.txtValorTransadoVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtValorTransadoVenta.Location = New System.Drawing.Point(19, 138)
+        Me.txtValorTransadoVenta.Name = "txtValorTransadoVenta"
+        Me.txtValorTransadoVenta.ReadOnly = True
+        Me.txtValorTransadoVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtValorTransadoVenta.TabIndex = 0
+        '
+        'dtpFechaOperacionVenta
+        '
+        Me.dtpFechaOperacionVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.dtpFechaOperacionVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaOperacionVenta.Location = New System.Drawing.Point(19, 72)
+        Me.dtpFechaOperacionVenta.Name = "dtpFechaOperacionVenta"
+        Me.dtpFechaOperacionVenta.Size = New System.Drawing.Size(140, 20)
+        Me.dtpFechaOperacionVenta.TabIndex = 10
+        '
+        'txtComisionPorcentajeBolsaVenta
+        '
+        Me.txtComisionPorcentajeBolsaVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionPorcentajeBolsaVenta.Location = New System.Drawing.Point(20, 225)
+        Me.txtComisionPorcentajeBolsaVenta.Name = "txtComisionPorcentajeBolsaVenta"
+        Me.txtComisionPorcentajeBolsaVenta.Size = New System.Drawing.Size(37, 20)
+        Me.txtComisionPorcentajeBolsaVenta.TabIndex = 82
+        '
+        'dtpFechaVencimientoVenta
+        '
+        Me.dtpFechaVencimientoVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.dtpFechaVencimientoVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoVenta.Location = New System.Drawing.Point(19, 94)
+        Me.dtpFechaVencimientoVenta.Name = "dtpFechaVencimientoVenta"
+        Me.dtpFechaVencimientoVenta.Size = New System.Drawing.Size(140, 20)
+        Me.dtpFechaVencimientoVenta.TabIndex = 11
+        '
+        'txtComisionPorcentajeCasaVenta
+        '
+        Me.txtComisionPorcentajeCasaVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionPorcentajeCasaVenta.Location = New System.Drawing.Point(20, 204)
+        Me.txtComisionPorcentajeCasaVenta.Name = "txtComisionPorcentajeCasaVenta"
+        Me.txtComisionPorcentajeCasaVenta.Size = New System.Drawing.Size(37, 20)
+        Me.txtComisionPorcentajeCasaVenta.TabIndex = 81
+        '
+        'txtPrecioLimpioVenta
+        '
+        Me.txtPrecioLimpioVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtPrecioLimpioVenta.Location = New System.Drawing.Point(19, 50)
+        Me.txtPrecioLimpioVenta.Name = "txtPrecioLimpioVenta"
+        Me.txtPrecioLimpioVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtPrecioLimpioVenta.TabIndex = 9
+        '
+        'txtDiasDeTenenciaVenta
+        '
+        Me.txtDiasDeTenenciaVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtDiasDeTenenciaVenta.Location = New System.Drawing.Point(20, 291)
+        Me.txtDiasDeTenenciaVenta.Name = "txtDiasDeTenenciaVenta"
+        Me.txtDiasDeTenenciaVenta.ReadOnly = True
+        Me.txtDiasDeTenenciaVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtDiasDeTenenciaVenta.TabIndex = 12
+        '
+        'txtPrecioSucioVenta
+        '
+        Me.txtPrecioSucioVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtPrecioSucioVenta.Location = New System.Drawing.Point(19, 182)
+        Me.txtPrecioSucioVenta.Name = "txtPrecioSucioVenta"
+        Me.txtPrecioSucioVenta.ReadOnly = True
+        Me.txtPrecioSucioVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtPrecioSucioVenta.TabIndex = 0
+        '
+        'txtComisionBolsaVenta
+        '
+        Me.txtComisionBolsaVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionBolsaVenta.Location = New System.Drawing.Point(61, 226)
+        Me.txtComisionBolsaVenta.Name = "txtComisionBolsaVenta"
+        Me.txtComisionBolsaVenta.ReadOnly = True
+        Me.txtComisionBolsaVenta.Size = New System.Drawing.Size(98, 20)
+        Me.txtComisionBolsaVenta.TabIndex = 78
+        '
+        'txtMontoNetoVenta
+        '
+        Me.txtMontoNetoVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtMontoNetoVenta.Location = New System.Drawing.Point(19, 160)
+        Me.txtMontoNetoVenta.Name = "txtMontoNetoVenta"
+        Me.txtMontoNetoVenta.ReadOnly = True
+        Me.txtMontoNetoVenta.Size = New System.Drawing.Size(139, 20)
+        Me.txtMontoNetoVenta.TabIndex = 0
+        '
+        'txtGananciaCapitalTotalVenta
+        '
+        Me.txtGananciaCapitalTotalVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtGananciaCapitalTotalVenta.Location = New System.Drawing.Point(20, 314)
+        Me.txtGananciaCapitalTotalVenta.Name = "txtGananciaCapitalTotalVenta"
+        Me.txtGananciaCapitalTotalVenta.ReadOnly = True
+        Me.txtGananciaCapitalTotalVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtGananciaCapitalTotalVenta.TabIndex = 0
+        '
+        'txtComisionCasaVenta
+        '
+        Me.txtComisionCasaVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtComisionCasaVenta.Location = New System.Drawing.Point(60, 204)
+        Me.txtComisionCasaVenta.Name = "txtComisionCasaVenta"
+        Me.txtComisionCasaVenta.ReadOnly = True
+        Me.txtComisionCasaVenta.Size = New System.Drawing.Size(99, 20)
+        Me.txtComisionCasaVenta.TabIndex = 75
+        '
+        'txtGananciaCapitalUnitarioVenta
+        '
+        Me.txtGananciaCapitalUnitarioVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtGananciaCapitalUnitarioVenta.Location = New System.Drawing.Point(21, 337)
+        Me.txtGananciaCapitalUnitarioVenta.Name = "txtGananciaCapitalUnitarioVenta"
+        Me.txtGananciaCapitalUnitarioVenta.ReadOnly = True
+        Me.txtGananciaCapitalUnitarioVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtGananciaCapitalUnitarioVenta.TabIndex = 0
+        '
+        'txtRetornoAnualBrutoVenta
+        '
+        Me.txtRetornoAnualBrutoVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtRetornoAnualBrutoVenta.Location = New System.Drawing.Point(20, 247)
+        Me.txtRetornoAnualBrutoVenta.Name = "txtRetornoAnualBrutoVenta"
+        Me.txtRetornoAnualBrutoVenta.ReadOnly = True
+        Me.txtRetornoAnualBrutoVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtRetornoAnualBrutoVenta.TabIndex = 0
+        '
+        'txtUnidadesVenta
+        '
+        Me.txtUnidadesVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtUnidadesVenta.Location = New System.Drawing.Point(19, 116)
+        Me.txtUnidadesVenta.Name = "txtUnidadesVenta"
+        Me.txtUnidadesVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtUnidadesVenta.TabIndex = 13
+        '
+        'Label19
+        '
+        Me.Label19.AutoSize = True
+        Me.Label19.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label19.Location = New System.Drawing.Point(69, 20)
+        Me.Label19.Name = "Label19"
+        Me.Label19.Size = New System.Drawing.Size(42, 18)
+        Me.Label19.TabIndex = 55
+        Me.Label19.Text = "Venta"
+        '
+        'txtRetornoAnualNetoVenta
+        '
+        Me.txtRetornoAnualNetoVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtRetornoAnualNetoVenta.Location = New System.Drawing.Point(20, 269)
+        Me.txtRetornoAnualNetoVenta.Name = "txtRetornoAnualNetoVenta"
+        Me.txtRetornoAnualNetoVenta.ReadOnly = True
+        Me.txtRetornoAnualNetoVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtRetornoAnualNetoVenta.TabIndex = 0
+        '
+        'txtImpuestosYComisionesVenta
+        '
+        Me.txtImpuestosYComisionesVenta.Font = New System.Drawing.Font("Trebuchet MS", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.txtImpuestosYComisionesVenta.Location = New System.Drawing.Point(19, 160)
+        Me.txtImpuestosYComisionesVenta.Name = "txtImpuestosYComisionesVenta"
+        Me.txtImpuestosYComisionesVenta.ReadOnly = True
+        Me.txtImpuestosYComisionesVenta.Size = New System.Drawing.Size(140, 20)
+        Me.txtImpuestosYComisionesVenta.TabIndex = 71
+        Me.txtImpuestosYComisionesVenta.Visible = False
+        '
+        'GrpImpuesto
+        '
+        Me.GrpImpuesto.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpImpuesto.Controls.Add(Me.ChkIOF)
+        Me.GrpImpuesto.Controls.Add(Me.lblCompra2)
+        Me.GrpImpuesto.Controls.Add(Me.Label7)
+        Me.GrpImpuesto.Controls.Add(Me.lblVenta1)
+        Me.GrpImpuesto.Controls.Add(Me.ChkRenta)
+        Me.GrpImpuesto.Controls.Add(Me.lblVenta2)
+        Me.GrpImpuesto.Controls.Add(Me.txtIOFCompra)
+        Me.GrpImpuesto.Controls.Add(Me.lblCompra1)
+        Me.GrpImpuesto.Controls.Add(Me.txtRentaVenta)
+        Me.GrpImpuesto.Controls.Add(Me.txtIOFVenta)
+        Me.GrpImpuesto.Controls.Add(Me.txtRentaCompra)
+        Me.GrpImpuesto.Location = New System.Drawing.Point(778, 57)
+        Me.GrpImpuesto.Name = "GrpImpuesto"
+        Me.GrpImpuesto.Size = New System.Drawing.Size(312, 148)
+        Me.GrpImpuesto.TabIndex = 94
+        Me.GrpImpuesto.TabStop = False
+        '
+        'ChkIOF
+        '
+        Me.ChkIOF.AutoSize = True
+        Me.ChkIOF.Location = New System.Drawing.Point(20, 44)
+        Me.ChkIOF.Name = "ChkIOF"
+        Me.ChkIOF.Size = New System.Drawing.Size(43, 17)
+        Me.ChkIOF.TabIndex = 84
+        Me.ChkIOF.Text = "IOF"
+        Me.ChkIOF.UseVisualStyleBackColor = True
+        '
+        'lblCompra2
+        '
+        Me.lblCompra2.AutoSize = True
+        Me.lblCompra2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblCompra2.Location = New System.Drawing.Point(226, 39)
+        Me.lblCompra2.Name = "lblCompra2"
+        Me.lblCompra2.Size = New System.Drawing.Size(53, 18)
+        Me.lblCompra2.TabIndex = 93
+        Me.lblCompra2.Text = "Compra"
+        Me.lblCompra2.Visible = False
+        '
+        'Label7
+        '
+        Me.Label7.AutoSize = True
+        Me.Label7.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label7.Location = New System.Drawing.Point(30, 17)
+        Me.Label7.Name = "Label7"
+        Me.Label7.Size = New System.Drawing.Size(68, 18)
+        Me.Label7.TabIndex = 83
+        Me.Label7.Text = "Impuestos"
+        '
+        'lblVenta1
+        '
+        Me.lblVenta1.AutoSize = True
+        Me.lblVenta1.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblVenta1.Location = New System.Drawing.Point(71, 81)
+        Me.lblVenta1.Name = "lblVenta1"
+        Me.lblVenta1.Size = New System.Drawing.Size(40, 18)
+        Me.lblVenta1.TabIndex = 92
+        Me.lblVenta1.Text = "Venta"
+        Me.lblVenta1.Visible = False
+        '
+        'ChkRenta
+        '
+        Me.ChkRenta.AutoSize = True
+        Me.ChkRenta.Location = New System.Drawing.Point(157, 44)
+        Me.ChkRenta.Name = "ChkRenta"
+        Me.ChkRenta.Size = New System.Drawing.Size(63, 17)
+        Me.ChkRenta.TabIndex = 85
+        Me.ChkRenta.Text = "RENTA"
+        Me.ChkRenta.UseVisualStyleBackColor = True
+        '
+        'lblVenta2
+        '
+        Me.lblVenta2.AutoSize = True
+        Me.lblVenta2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblVenta2.Location = New System.Drawing.Point(226, 80)
+        Me.lblVenta2.Name = "lblVenta2"
+        Me.lblVenta2.Size = New System.Drawing.Size(40, 18)
+        Me.lblVenta2.TabIndex = 91
+        Me.lblVenta2.Text = "Venta"
+        Me.lblVenta2.Visible = False
+        '
+        'txtIOFCompra
+        '
+        Me.txtIOFCompra.Location = New System.Drawing.Point(69, 62)
+        Me.txtIOFCompra.Name = "txtIOFCompra"
+        Me.txtIOFCompra.ReadOnly = True
+        Me.txtIOFCompra.Size = New System.Drawing.Size(44, 20)
+        Me.txtIOFCompra.TabIndex = 86
+        '
+        'lblCompra1
+        '
+        Me.lblCompra1.AutoSize = True
+        Me.lblCompra1.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblCompra1.Location = New System.Drawing.Point(64, 42)
+        Me.lblCompra1.Name = "lblCompra1"
+        Me.lblCompra1.Size = New System.Drawing.Size(53, 18)
+        Me.lblCompra1.TabIndex = 90
+        Me.lblCompra1.Text = "Compra"
+        Me.lblCompra1.Visible = False
+        '
+        'txtRentaVenta
+        '
+        Me.txtRentaVenta.Location = New System.Drawing.Point(226, 101)
+        Me.txtRentaVenta.Name = "txtRentaVenta"
+        Me.txtRentaVenta.ReadOnly = True
+        Me.txtRentaVenta.Size = New System.Drawing.Size(44, 20)
+        Me.txtRentaVenta.TabIndex = 87
+        '
+        'txtIOFVenta
+        '
+        Me.txtIOFVenta.Location = New System.Drawing.Point(70, 102)
+        Me.txtIOFVenta.Name = "txtIOFVenta"
+        Me.txtIOFVenta.ReadOnly = True
+        Me.txtIOFVenta.Size = New System.Drawing.Size(44, 20)
+        Me.txtIOFVenta.TabIndex = 89
+        '
+        'txtRentaCompra
+        '
+        Me.txtRentaCompra.Location = New System.Drawing.Point(226, 60)
+        Me.txtRentaCompra.Name = "txtRentaCompra"
+        Me.txtRentaCompra.ReadOnly = True
+        Me.txtRentaCompra.Size = New System.Drawing.Size(44, 20)
+        Me.txtRentaCompra.TabIndex = 88
+        '
+        'TabAcciones
+        '
+        Me.TabAcciones.Controls.Add(Me.TbOperacion)
+        Me.TabAcciones.Controls.Add(Me.TbDividendos)
+        Me.TabAcciones.Cursor = System.Windows.Forms.Cursors.Default
+        Me.TabAcciones.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.TabAcciones.Location = New System.Drawing.Point(0, 0)
+        Me.TabAcciones.Name = "TabAcciones"
+        Me.TabAcciones.SelectedIndex = 0
+        Me.TabAcciones.Size = New System.Drawing.Size(1157, 545)
+        Me.TabAcciones.TabIndex = 0
+        '
+        'Panel1
+        '
+        Me.Panel1.Controls.Add(Me.TabAcciones)
+        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.Panel1.Location = New System.Drawing.Point(0, 25)
+        Me.Panel1.Name = "Panel1"
+        Me.Panel1.Size = New System.Drawing.Size(1157, 545)
+        Me.Panel1.TabIndex = 159
+        '
+        'btnAsociarAccion
+        '
+        Me.btnAsociarAccion.Location = New System.Drawing.Point(128, 23)
+        Me.btnAsociarAccion.Name = "btnAsociarAccion"
+        Me.btnAsociarAccion.Size = New System.Drawing.Size(96, 23)
+        Me.btnAsociarAccion.TabIndex = 81
+        Me.btnAsociarAccion.Text = "Asociar Acción"
+        Me.btnAsociarAccion.UseVisualStyleBackColor = True
+        '
+        'OpenFileDialog1
+        '
+        Me.OpenFileDialog1.FileName = "OpenFileDialog1"
+        '
+        'frmAcciones
+        '
+        Me.AcceptButton = Me.btnAceptar
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.AutoScroll = True
+        Me.CancelButton = Me.btnCancelar
+        Me.ClientSize = New System.Drawing.Size(1157, 570)
+        Me.Controls.Add(Me.btnAsociarAccion)
+        Me.Controls.Add(Me.Panel1)
+        Me.Controls.Add(Me.BindingNavigator1)
+        Me.Name = "frmAcciones"
+        Me.Text = "Acciones"
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.BindingNavigator1.ResumeLayout(False)
+        Me.BindingNavigator1.PerformLayout()
+        Me.TbDividendos.ResumeLayout(False)
+        Me.GroupBox1.ResumeLayout(False)
+        Me.GroupBox1.PerformLayout()
+        CType(Me.dgvDividendos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.TbOperacion.ResumeLayout(False)
+        Me.TbOperacion.PerformLayout()
+        Me.GrpDatos.ResumeLayout(False)
+        Me.GrpDatos.PerformLayout()
+        Me.GrpBotonos.ResumeLayout(False)
+        Me.GrpCompra.ResumeLayout(False)
+        Me.GrpCompra.PerformLayout()
+        Me.GrpVenta.ResumeLayout(False)
+        Me.GrpVenta.PerformLayout()
+        Me.GrpImpuesto.ResumeLayout(False)
+        Me.GrpImpuesto.PerformLayout()
+        Me.TabAcciones.ResumeLayout(False)
+        Me.Panel1.ResumeLayout(False)
+        Me.ResumeLayout(False)
+        Me.PerformLayout()
+
+    End Sub
+    Friend WithEvents btnAceptar As Button
+    Friend WithEvents btnCancelar As Button
+    Friend WithEvents lblTitulo As Label
+    Friend WithEvents BindingNavigator1 As BindingNavigator
+    Friend WithEvents BindingNavigatorSeparator As ToolStripSeparator
+    Friend WithEvents navModificar As ToolStripButton
+    Friend WithEvents navNuevo As ToolStripButton
+    Friend WithEvents navEliminar As ToolStripButton
+    Friend WithEvents TbDividendos As TabPage
+    Friend WithEvents dgvDividendos As DataGridView
+    Friend WithEvents TbOperacion As TabPage
+    Friend WithEvents txtPrecioLimpioCompra As TextBox
+    Friend WithEvents txtImpuestosYComisionesCompra As TextBox
+    Friend WithEvents txtValorTransadoVenta As TextBox
+    Friend WithEvents txtImpuestosYComisionesVenta As TextBox
+    Friend WithEvents txtUnidadesVenta As TextBox
+    Friend WithEvents txtRetornoAnualNetoVenta As TextBox
+    Friend WithEvents txtDiasDeTenenciaCompra As TextBox
+    Friend WithEvents txtRetornoAnualBrutoVenta As TextBox
+    Friend WithEvents txtGananciaCapitalTotalCompra As TextBox
+    Friend WithEvents txtMontoNetoCompra As TextBox
+    Friend WithEvents txtGananciaCapitalUnitarioVenta As TextBox
+    Friend WithEvents txtPrecioSucioCompra As TextBox
+    Friend WithEvents txtGananciaCapitalUnitarioCompra As TextBox
+    Friend WithEvents txtGananciaCapitalTotalVenta As TextBox
+    Friend WithEvents txtValorTransadoCompra As TextBox
+    Friend WithEvents txtMontoNetoVenta As TextBox
+    Friend WithEvents txtRetornoAnualBrutoCompra As TextBox
+    Friend WithEvents txtDiasDeTenenciaVenta As TextBox
+    Friend WithEvents txtPrecioSucioVenta As TextBox
+    Friend WithEvents txtUnidadesCompra As TextBox
+    Friend WithEvents txtRetornoAnualNetoCompra As TextBox
+    Friend WithEvents txtPrecioLimpioVenta As TextBox
+    Friend WithEvents Label16 As Label
+    Friend WithEvents Label4 As Label
+    Friend WithEvents Label17 As Label
+    Friend WithEvents Label15 As Label
+    Friend WithEvents Label14 As Label
+    Friend WithEvents Label1 As Label
+    Friend WithEvents Label13 As Label
+    Friend WithEvents Label2 As Label
+    Friend WithEvents Label18 As Label
+    Friend WithEvents Label12 As Label
+    Friend WithEvents Label19 As Label
+    Friend WithEvents Label6 As Label
+    Friend WithEvents Label11 As Label
+    Friend WithEvents dtpFechaOperacionCompra As DateTimePicker
+    Friend WithEvents dtpFechaVencimientoVenta As DateTimePicker
+    Friend WithEvents dtpFechaVencimientoCompra As DateTimePicker
+    Friend WithEvents Label8 As Label
+    Friend WithEvents dtpFechaOperacionVenta As DateTimePicker
+    Friend WithEvents Label9 As Label
+    Friend WithEvents TabAcciones As TabControl
+    Friend WithEvents txtComisionPorcentajeBolsaVenta As TextBox
+    Friend WithEvents txtComisionPorcentajeCasaVenta As TextBox
+    Friend WithEvents txtComisionPorcentajeBolsaCompra As TextBox
+    Friend WithEvents txtComisionPorcentajeCasaCompra As TextBox
+    Friend WithEvents txtComisionBolsaVenta As TextBox
+    Friend WithEvents txtComisionBolsaCompra As TextBox
+    Friend WithEvents Label5 As Label
+    Friend WithEvents txtComisionCasaVenta As TextBox
+    Friend WithEvents txtComisionCasaCompra As TextBox
+    Friend WithEvents Label3 As Label
+    Friend WithEvents ChkRenta As CheckBox
+    Friend WithEvents ChkIOF As CheckBox
+    Friend WithEvents Label7 As Label
+    Friend WithEvents txtRentaVenta As TextBox
+    Friend WithEvents txtIOFCompra As TextBox
+    Friend WithEvents lblVenta2 As Label
+    Friend WithEvents lblCompra1 As Label
+    Friend WithEvents txtIOFVenta As TextBox
+    Friend WithEvents txtRentaCompra As TextBox
+    Friend WithEvents lblCompra2 As Label
+    Friend WithEvents lblVenta1 As Label
+    Friend WithEvents GroupBox1 As GroupBox
+    Friend WithEvents rdbEfectivo As RadioButton
+    Friend WithEvents rdbPorcentaje As RadioButton
+    Friend WithEvents GrpCompra As GroupBox
+    Friend WithEvents GrpVenta As GroupBox
+    Friend WithEvents GrpImpuesto As GroupBox
+    Friend WithEvents Panel1 As Panel
+    Friend WithEvents btnActualizar As Button
+    Friend WithEvents btnAsociarAccion As Button
+    Friend WithEvents OpenFileDialog1 As OpenFileDialog
+    Friend WithEvents btnQuitar As Button
+    Friend WithEvents GrpBotonos As GroupBox
+    Friend WithEvents GrpDatos As GroupBox
+    Friend WithEvents btnVenderTitulo As Button
+End Class

+ 172 - 0
FRM/frmAcciones.resx

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="BindingNavigator1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>159, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="navModificar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPjVNNaxNRFM0fcKNbBbG4qC7FpRTcdCf9AwqC
+        Ci6UKrQWW1toQYJZKRgqLgRjDG0yH2kwWAWb0tZFA91EUDemaabtfKTNNJmMScz0+O6bSdKxFT3M4c59
+        754z9715L5BMpcqCLCMhioj7KPAoSBJEWdYDfwMV/AuapiEhCG89iR/0ZcKP/DpjAfn1Ao+UEyLRKI+q
+        qiIhSTFP1gW1SdgoFlFUFCibCo+UE97EYtANg7/zTuakWU/qgtZKUDa3sbWtdkg5YTWb5SbtTmbnRHhS
+        F3HBNVCZu6brHVJesap87iDiKRFfHi8g9+STa9Q20I0SjNKOjzSmMerGDkq7Jq8bGhtFXi7gcziLtUes
+        m7bBbrl8NE0TZrUGqwHcH5nAxpaGyVAQ6YcfsHp7umtg7lUOs2Jhr9ZE1QGWB0+i/F3ARPAZ3i8s4u7Y
+        A1rChY5B1bL8rNmoNVqw2dzi4BlgpY/t4Gl8ladwb2TcFR/cA9u2u/xZR725D9Y1Mlx8mYnPAy+P49Wt
+        3q6Y0Dao15uMDR4bvwD2IHPnFLB0CZjpBaZP4Pn1c0h+XPnjN3oHyXEcOK0Wi/s8N6IXgWIQyI0D4WN4
+        evUsHxdTab8BXaSj8GJ0AO+iTJwLIXytxxtlBnLSb/A6EsnQheI3kC2HnXck0/MYvnEFUzf78S3UD3F+
+        iX+ZxFTvSTvoYaRN+V9SvYdA4DcZDa931m0XwAAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHcSURBVDhPnZFLTBpRFIanLtptxY1bt2Xn2lXbdOVj4YoO
+        +ADMyGjc0HVnp2laY5p0VTfWiLbYNB3SxHZr4oNgHB8jEsDy0IAzOsBQmEcwHOfeABXiNKR/8uXkzJz7
+        3Zl7CZQ8t/A4zS9aUtwHa+pk3crz/of4RTuJRt8/KhzNdeYjb3sSoaFKKcyM0J6ZIDVBiW4nJbpacBpQ
+        Y1MZu825iQXp7XmLHH7Tr+0+Bz00CDr3ElRFAlX7Y0qpLAOSYMFFcLarEHqhvGOeVvXDqV5t5xlo+yTE
+        clVTkIQkKbEm+NRV5Jkn+t4waFt9oAYHQBAEnYtnYMX3Gb6zgQbrX7/BYeKqWYAOTOD93RPj7hvNkLAb
+        7DkaSEgViIsKxAziotogkas0C+oZcbgUMS8DG/iBByLnEnxcXILlZV+D1TU/RDOyuUAqlvGnooHkVQn4
+        31k4Omsmea20JwhnSsDFs7BvgGqd00sTgaNFcJKWwLf6pXGACNSfXhRMBPZmQey6AhFB+Yuxc+RSxc/b
+        Ehzcc42oP062XGM9dnI8d1eQlquYVK3e5V6BzTZZzhuCjZ+/8MC/UNQijI5O87WlBAEAD4xfYL3e1+CZ
+        9ALteYWrGTRN6w7SHWAYpqOm+N8QxC3b0mvwrfREqAAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGxSURBVDhPlZM7S8NQGIZT0/4AF3HwCg4iOLV0k2q9bP4A
+        xUUUcXJwUHRxE1QcagidOrnoYAelWKEQdREEFwc3LwVJ6c1ek/T+er7Q1KqtrR88JBzO++T7ziFctXoY
+        Voa9BQOMDsavsqqqmpQkqVwqldCIXC4HQRBcbG9DiZ3C2WwWiqLUSKVSSCQSCIfDuiQUCkEUxV8SE8NO
+        GzRNQz6f159EJpNBMplEJBLRBaxL0Efcbrch0asmoLABCSiQTqcRjUa/jUNQppr9EhSLxdoGeqe5jVFi
+        sZjeiSzLzQU/qZdQJ3Qe8Xi8fQFhSGgcOhMS0XrbAqJQKOjnQhKC1v4loC7ezo5wtziCwKQFN/P9EOwm
+        8U8BhQyCXgGPG2PQfIeoPPmhnKxDcoyWr8bNay0F1P7twhBUFsbRLLDZCewOIro/Dt8E/9JUUC+htisP
+        XtRXYqcbO05zpSZwuVyVRhLieq4PWc8SwEK5DQ4fjOAqD/80/04CKhu7HqXZz/R6eoD7lWHIm4OIbFnw
+        vGxCwGEuX051bFfzXC/DxqCraYhnpks8d/IytX3h4MPHY/wex3HcJ/E1g0s+Et1bAAAAAElFTkSuQmCC
+</value>
+  </data>
+  <metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>25</value>
+  </metadata>
+</root>

+ 3486 - 0
FRM/frmAcciones.vb

@@ -0,0 +1,3486 @@
+
+Imports System.Data.OleDb
+Imports System.IO
+
+Public Class frmAcciones
+    Private TipoOperacion As String
+
+    Public Sub New()
+
+        ' Esta llamada es exigida por el diseñador.
+        InitializeComponent()
+
+        ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+    End Sub
+    Public Sub New(ByVal ConsTOperacion As String)
+
+        ' Esta llamada es exigida por el diseñador.
+        InitializeComponent()
+        TOperacion(ConsTOperacion)
+        TipoOperacion = ConsTOperacion
+        ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+    End Sub
+
+    Dim PorcentajeComisionBolsa_Compra As Double = 0.070625
+    Dim PorcentajeComisionBolsa_Venta As Double = 0.0353125
+    Dim Cargar As Boolean = True
+    Dim PorcentajeComisionCasa_Compra As Double = 0.45
+    Dim PorcentajeComisionCasa_Venta As Double = 0.4
+    Dim Agregar As Boolean = False
+    Dim PorcentajeLIOF As Double = 0.25
+    Dim oAccionesCE As AccionesCE = New AccionesCE
+    Dim oAccionesDAO As New AccionesDAO
+    Dim oDAOGeneral As New DAOGeneral
+    Dim Estado As String = ""
+    Dim MostrarMensaje As Boolean = False
+    Dim EditarDividendos As Boolean = False
+    Dim EditarISR As Boolean = False
+    Dim CambioCalculo = False
+    Dim HabilitarBoton As Boolean = False
+    Dim DobleClick As Boolean = False
+    Dim Operaciones As New Operaciones
+    Dim InstrumentoFinanciero As String = oDAOGeneral.ObtenerInstrumento(Variables.Codigo)
+    'Dim oAccionesNEG As New AccionesNEG
+    Dim Cargado As Boolean = False
+    Dim Cierre As Boolean = False
+    Dim DatosCargados As Boolean = False
+    'Dim dtImpuestosYComisiones As DataTable
+    'Dim dtDividendos As DataTable
+
+    Private _Modo As String
+    Private _IdDocumento As Integer
+    Private _TipoDocumento As String
+    Private _CodigoInversion As String
+    Private _TipoTransaccion As String
+
+
+    Public Property TipoTransaccion As String
+        Get
+            Return _TipoTransaccion
+        End Get
+        Set(value As String)
+            _TipoTransaccion = value
+        End Set
+    End Property
+
+
+    Private Property IdDocumento As Integer
+        Get
+            Return _IdDocumento
+        End Get
+        Set(value As Integer)
+            _IdDocumento = value
+        End Set
+    End Property
+    Private Property TipoDocumento As String
+        Get
+            Return _TipoDocumento
+        End Get
+        Set(value As String)
+            _TipoDocumento = value
+        End Set
+    End Property
+    Private Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+
+    Sub Instrumento()
+        If (InstrumentoFinanciero = "ACCNC") Then
+            lblTitulo.Text = "Acciones Nacionales Comunes"
+            Me.Text = "Acciones Nacionales Comunes"
+        ElseIf (InstrumentoFinanciero = "ACCNP") Then
+            lblTitulo.Text = "Acciones Preferentes Nacionales"
+            ModificacionesPreferentes()
+            Me.Text = "Acciones Preferentes Nacionales"
+        ElseIf (InstrumentoFinanciero = "ACCI") Then
+            lblTitulo.Text = "Acciones Internacionales"
+            Me.Text = "Acciones Internacionales"
+        End If
+    End Sub
+
+
+
+
+    Function ColeccionDatos()
+        Dim coleccion As New Collection
+        Dim PrecioLimpioC, FOperC, FLiqC, DiasTC, GCapTotC, GCapUnC, RetAnBrC, RetAnNetC, UnC, ValTransC, MontoNetoC, PrecSucioC
+        Dim PrecioLimpioV, FOperV, FLiqV, DiasTV, GCapTotV, GCapUnV, RetAnBrV, RetAnNetV, UnV, ValTransV, MontoNetoV, PrecSucioV
+        Dim ComisionCompraCasa, ComisionCompraBolsa, ComisionVentaCasa, ComisionVentaBolsa As Double
+        Dim IOF, Renta, Tipo, RetornoBruto, RetornoNeto
+        Dim ComisionCompraCasaValor, ComisionCompraBolsaValor, ComisionVentaCasaValor, ComisionVentaBolsaValor As Double
+
+        PrecioLimpioC = txtPrecioLimpioCompra.Text.Trim("%")
+        FOperC = dtpFechaOperacionCompra.Value
+        FLiqC = dtpFechaVencimientoCompra.Value
+        DiasTC = txtDiasDeTenenciaCompra.Text.Trim("%")
+        GCapTotC = txtGananciaCapitalTotalCompra.Text.Trim("%")
+        GCapUnC = txtGananciaCapitalUnitarioCompra.Text.Trim("%")
+
+        RetAnNetC = txtRetornoAnualNetoCompra.Text.Trim("%")
+        UnC = txtUnidadesCompra.Text.Trim("%")
+        ValTransC = txtValorTransadoCompra.Text.Trim("%")
+        MontoNetoC = txtMontoNetoCompra.Text.Trim("%")
+        PrecSucioC = txtPrecioSucioCompra.Text.Trim("%")
+
+
+
+        PrecioLimpioV = txtPrecioLimpioVenta.Text.Trim("%")
+        FOperV = dtpFechaOperacionVenta.Value
+        FLiqV = dtpFechaVencimientoVenta.Value
+        DiasTV = txtDiasDeTenenciaVenta.Text.Trim("%")
+        GCapTotV = txtGananciaCapitalTotalVenta.Text.Trim("%")
+        GCapUnV = txtGananciaCapitalUnitarioVenta.Text.Trim("%")
+        RetAnBrV = txtRetornoAnualBrutoVenta.Text.Trim("%")
+        RetAnNetV = txtRetornoAnualNetoVenta.Text.Trim("%")
+        UnV = txtUnidadesVenta.Text.Trim("%")
+        ValTransV = txtValorTransadoVenta.Text.Trim("%")
+        MontoNetoV = txtMontoNetoVenta.Text.Trim("%")
+        PrecSucioV = txtPrecioSucioVenta.Text.Trim("%")
+
+
+
+        ComisionCompraCasa = txtComisionPorcentajeCasaCompra.Text.Trim("%") / 100
+        ComisionCompraBolsa = txtComisionPorcentajeBolsaCompra.Text.Trim("%") / 100
+        ComisionVentaCasa = txtComisionPorcentajeCasaVenta.Text.Trim("%") / 100
+        ComisionVentaBolsa = txtComisionPorcentajeBolsaVenta.Text.Trim("%") / 100
+
+
+
+        ComisionCompraCasaValor = txtComisionCasaCompra.Text
+        ComisionCompraBolsaValor = txtComisionBolsaCompra.Text
+        ComisionVentaCasaValor = txtComisionCasaVenta.Text
+        ComisionVentaBolsaValor = txtComisionBolsaVenta.Text
+
+
+        If (Not String.IsNullOrEmpty(txtRetornoAnualBrutoCompra.Text.ToString.ToString.Trim("%"))) Then
+            RetornoBruto = txtRetornoAnualBrutoCompra.Text.Trim("%") / 100
+        Else
+            RetornoBruto = 0
+        End If
+
+
+
+        If (ChkIOF.Checked) Then
+            IOF = 1
+        Else
+            IOF = 0
+        End If
+
+        If (ChkRenta.Checked) Then
+            Renta = 1
+        Else
+            Renta = 0
+        End If
+
+
+        If rdbPorcentaje.Checked Then
+            Tipo = "Porcentaje"
+
+        Else
+            Tipo = "Efectivo"
+        End If
+
+
+
+
+        coleccion.Add(PrecioLimpioC)
+        coleccion.Add(FOperC)
+        coleccion.Add(FLiqC)
+        coleccion.Add(DiasTC)
+        coleccion.Add(GCapTotC)
+        coleccion.Add(GCapUnC)
+        coleccion.Add(RetornoBruto)
+        coleccion.Add(RetAnNetC)
+        coleccion.Add(UnC)
+        coleccion.Add(ValTransC)
+        coleccion.Add(MontoNetoC)
+        coleccion.Add(PrecSucioC)
+        coleccion.Add(PrecioLimpioV)
+        coleccion.Add(FOperV)
+        coleccion.Add(FLiqV)
+        coleccion.Add(DiasTV)
+        coleccion.Add(GCapTotV)
+        coleccion.Add(GCapUnV)
+        coleccion.Add(RetAnBrV)
+        coleccion.Add(RetAnNetV)
+        coleccion.Add(UnV)
+        coleccion.Add(ValTransV)
+        coleccion.Add(MontoNetoV)
+        coleccion.Add(PrecSucioV)
+
+        coleccion.Add(ComisionCompraCasa)
+        coleccion.Add(ComisionCompraBolsa)
+        coleccion.Add(ComisionVentaCasa)
+        coleccion.Add(ComisionVentaBolsa)
+
+        coleccion.Add(IOF)
+        coleccion.Add(Renta)
+        coleccion.Add(Tipo)
+
+        coleccion.Add(ComisionCompraCasaValor)
+        coleccion.Add(ComisionCompraBolsaValor)
+        coleccion.Add(ComisionVentaCasaValor)
+        coleccion.Add(ComisionVentaBolsaValor)
+        Return coleccion
+    End Function
+
+
+    Function Correlativo()
+        Dim Index As Integer = 0
+        Dim IndexCantidad As Integer = dgvDividendos.Rows.Count - 2
+        Dim NumeroMayor As Integer = 0
+        While Index <= IndexCantidad
+            Dim Numero As Integer = dgvDividendos.Rows(Index).Cells("NumDiv").Value
+            If Numero > NumeroMayor Then
+                NumeroMayor = Numero
+            End If
+            Index += 1
+        End While
+        Return NumeroMayor + 1
+    End Function
+
+
+
+
+    Sub CorrelativoSinBD()
+        Dim Index As Integer = 0
+        Dim IndexCantidad As Integer = dgvDividendos.Rows.Count - 2
+        Dim NumeroMayor As Integer = 0
+        While Index <= IndexCantidad
+
+            dgvDividendos.Rows(Index).Cells("Correlativo").Value = Index + 1
+            Index += 1
+
+        End While
+
+    End Sub
+
+
+
+
+
+
+
+
+
+
+
+    Function ColeccionesElementos(ByVal Index As Integer)
+        Dim coleccion As New Collection
+        Dim Fecha, Estado, Dividendo, CantidadBase, IngresoBruto, PorcISR, ISR, IngresoNeto, Correlativo, Tipo, FechaInicio, FechaCorte
+
+
+
+
+        If rdbPorcentaje.Checked Then
+            Tipo = "Porcentaje"
+
+        Else
+            Tipo = "Efectivo"
+        End If
+
+
+        Fecha = CDate(dgvDividendos.Rows(Index).Cells("Fecha").Value)
+        Dividendo = dgvDividendos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
+        If (Tipo = "Porcentaje") Then
+            Dividendo /= 100
+
+        End If
+        CantidadBase = dgvDividendos.Rows(Index).Cells("CantidadBase").Value.ToString.TrimEnd("%")
+        IngresoBruto = dgvDividendos.Rows(Index).Cells("IngresoBruto").Value.ToString.TrimEnd("%")
+        PorcISR = dgvDividendos.Rows(Index).Cells("PorcISR").Value.ToString.TrimEnd("%")
+        ISR = dgvDividendos.Rows(Index).Cells("ISR").Value.ToString.TrimEnd("%")
+        IngresoNeto = dgvDividendos.Rows(Index).Cells("IngresoNeto").Value.ToString.TrimEnd("%")
+        Estado = "A"
+        Correlativo = dgvDividendos.Rows(Index).Cells("NumDiv").Value.ToString.TrimEnd("%")
+        FechaInicio = dgvDividendos.Rows(Index).Cells("FechaInicio").Value
+        FechaCorte = dgvDividendos.Rows(Index).Cells("FechaCorte").Value
+
+        If (Tipo = "Porcentaje") Then
+
+            If FechaInicio Is DBNull.Value Or FechaCorte Is DBNull.Value Then
+                MsgBox("Verifique las fechas")
+                Exit Function
+            Else
+
+
+                If (String.IsNullOrEmpty(FechaInicio) Or String.IsNullOrEmpty(FechaCorte)) Then
+                    MsgBox("Verifique las fechas")
+                    Exit Function
+                End If
+            End If
+        End If
+        coleccion.Add(Fecha)
+        coleccion.Add(CDec(Dividendo))
+        coleccion.Add(CDec(CantidadBase))
+        coleccion.Add(CDec(IngresoBruto))
+        coleccion.Add(CDec(PorcISR))
+        coleccion.Add(CDec(ISR))
+        coleccion.Add(CDec(IngresoNeto))
+        coleccion.Add(Estado)
+        coleccion.Add(CInt(Correlativo))
+
+
+
+        coleccion.Add(FechaInicio)
+        coleccion.Add(FechaCorte)
+
+        Return coleccion
+
+
+    End Function
+
+
+
+
+    Sub NuevoElementoAccion(ByVal AgregarModificar As Boolean, ByVal Cantidad As Integer)
+        Dim Codigo As String = Variables.Codigo
+        Dim i As Integer = 0
+
+        Dim Index = dgvDividendos.Rows.Count - 2
+
+        i = Cantidad
+        While i <= Index
+
+
+
+
+            Dim coleccion = ColeccionesElementos(i)
+            If (oAccionesDAO.NuevoElementoAccion(Codigo, coleccion) Is Nothing) Then
+
+                Exit Sub
+            End If
+            i += 1
+        End While
+        MsgBox("Registro de ingresos actualizados")
+    End Sub
+
+
+
+
+    Function CanRegistros()
+        Dim Tabla As String = String.Empty
+
+
+        Tabla = "ACC1"
+
+
+
+        Dim Codigo = Variables.Codigo
+        Dim Cantidad As Integer = oDAOGeneral.CantidadRegistros(Codigo, Tabla)
+
+        Return Cantidad
+    End Function
+
+    Sub ModificarElementoAccion()
+        Dim i As Integer = 0
+
+        Dim CantidadRegistrosDB = CanRegistros()
+
+        While i < CantidadRegistrosDB
+
+
+            Dim coleccion = ColeccionesElementos(i)
+            If oAccionesDAO.ModificarElementoAccion(Codigo, coleccion) Is Nothing Then
+
+                Exit Sub
+            End If
+            i += 1
+
+        End While
+
+
+
+        NuevoElementoAccion(True, CantidadRegistrosDB)
+
+    End Sub
+
+
+    Function ColeccionNuevo(ByVal codigo As String)
+
+
+        Dim i As Integer = 0
+        Dim diccionario As New Dictionary(Of String, Collection)
+        Dim Index = dgvDividendos.Rows.Count - 2
+
+
+        While i <= Index
+            Dim coleccion = ColeccionesElementos(i)
+
+            diccionario.Add(i, coleccion)
+
+            i += 1
+        End While
+        Return diccionario
+    End Function
+
+    Public Function NuevaAccion()
+        Dim Coleccion = ColeccionDatos()
+        'Dim Codigo = Variables.Codigo
+        'oAccionesDAO.NuevaAccion(Codigo, Coleccion)
+        Return Coleccion
+    End Function
+    Public Function NuevaAccionConsulta()
+        Dim Coleccion = ColeccionDatos()
+        Dim Codigo = Variables.Codigo
+        oAccionesDAO.NuevaAccion(Codigo, Coleccion)
+        Return Coleccion
+    End Function
+
+    Sub ModificarAccion()
+        Dim Coleccion = ColeccionDatos()
+        Dim Codigo = Variables.Codigo
+        oAccionesDAO.ModificarAccion(Codigo, Coleccion)
+    End Sub
+
+    Sub Eliminar()
+
+        Dim Codigo = Variables.Codigo
+        oAccionesDAO.Eliminar(Codigo)
+    End Sub
+
+    'Sub EliminrElementoAccion()
+
+    '    Dim Codigo = Variables.Codigo
+    '    'oAccionesDAO.EliminarElemeno(Codigo)
+    'End Sub
+
+    Sub ModificacionesPreferentes()
+        GrpVenta.Visible = False
+        txtRetornoAnualBrutoCompra.Visible = True
+        txtRetornoAnualBrutoCompra.ReadOnly = False
+        txtRetornoAnualBrutoCompra.Text = "0.0"
+
+        Label19.Visible = False
+    End Sub
+
+
+    Sub Redimencionar()
+        dgvDividendos.Width = Me.Width - 10
+        dgvDividendos.Height = Me.Height - 50
+
+
+    End Sub
+
+    Private Sub frmAcciones_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+
+
+        Dim VExisteInversion As Boolean = False
+
+        VExisteInversion = ExisteInversion()
+        If VExisteInversion Then
+            TipoOperacion = "C"
+            TipoTransaccion = "C"
+        Else
+            TipoOperacion = String.Empty
+            TipoTransaccion = String.Empty
+        End If
+        If Variables.TipoOperacionCMVTA = "C" Then
+            GrpVenta.Enabled = False
+            GrpCompra.Enabled = True
+        Else
+            GrpVenta.Enabled = True
+            GrpCompra.Enabled = False
+
+        End If
+        Call Instrumento()
+
+        HabilitarBotones()
+
+        PrepararTablaDividendos()
+
+
+        If VExisteInversion Then
+            TipoOperacion = "C"
+            TipoTransaccion = "C"
+        Else
+            TipoOperacion = String.Empty
+            TipoTransaccion = String.Empty
+        End If
+
+        If TipoTransaccion = "C" Then
+
+            Call CargarRegistroBD()
+            Formato()
+            ValidarRentaIOF()
+            CargarDividendos()
+        End If
+        ModificarDividendo()
+
+
+
+        CalcularDividendos()
+        Cargado = True
+
+        ValidarExistencia()
+
+        Formato()
+
+
+        DatosCargados = True
+
+        CargarTransladoNuevo()
+        ConfiguracionCMVTA(VExisteInversion)
+    End Sub
+
+    Sub ConfiguracionCMVTA(ByRef VExisteInversion As Boolean)
+
+        Dim Codigo As String = Variables.Codigo
+        Dim ExisteCMVTA As Boolean = oDAOGeneral.ExisteCMVTA(Codigo)
+        If Not ExisteCMVTA And Variables.InvocadorProInv = "frmINV" Then
+            btnVenderTitulo.Visible = True
+        End If
+        If CantFormAbierto = False And Not VExisteInversion Then
+            If Not Variables.TrasladarCMVTA Is Nothing Then
+                dtpFechaOperacionCompra.Value = Variables.TrasladarCMVTA.FechaOperacionACC
+                dtpFechaVencimientoCompra.Value = Variables.TrasladarCMVTA.FechaVencimientoACC
+                txtPrecioLimpioCompra.Text = Variables.TrasladarCMVTA.PrecioLimpioACC
+                txtUnidadesCompra.Text = Variables.TrasladarCMVTA.UnidadesACC
+                txtComisionPorcentajeCasaCompra.Text = Variables.TrasladarCMVTA.PorcentajeCasaACC
+                txtComisionPorcentajeBolsaCompra.Text = Variables.TrasladarCMVTA.PorcentajeBolsaACC
+            End If
+        End If
+    End Sub
+
+
+    Function ExisteInversion()
+        Dim Codigo As String = Variables.Codigo
+        Dim TablaINV As String = "INV0"
+        Dim TablaPINV As String = "PIN0"
+        Dim General As New DAOGeneral
+        Dim InvPro = Variables.InvPro
+
+
+
+        If InvPro = "I" Then
+
+            Dim INV0 As Boolean = General.ExisteTitulo(Codigo, TablaINV)
+            If INV0 Then
+                navNuevo.Visible = True
+
+                Return True
+            Else
+                navNuevo.Visible = False
+
+                Return False
+            End If
+        End If
+
+
+
+        If InvPro = "P" Then
+            Dim PINV0 As Boolean = General.ExisteTitulo(Codigo, TablaPINV)
+            If PINV0 Then
+                navNuevo.Visible = True
+                Return True
+            Else
+                navNuevo.Visible = False
+                Return False
+            End If
+        End If
+        Return False
+    End Function
+
+
+
+
+
+
+    Function ExisteVenta()
+        Dim Ventas As Boolean = False
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Ventas = General.ExisteVenta(Codigo)
+
+        Return Ventas
+    End Function
+
+
+    Sub ModificarDividendo()
+        Dim Cantidad As Integer = dgvDividendos.Rows.Count - 2
+
+        For i As Integer = 0 To Cantidad
+            If rdbPorcentaje.Checked Then
+                dgvDividendos.Rows(i).Cells("Dividendo").Value *= 100
+
+
+            End If
+
+        Next
+
+    End Sub
+
+    'LOAD
+    'Sub ActualizarDividendos()
+
+    'Dim vFactorDeDividendo = oAccionesCE.FactorDeDividendo
+    'Dim vFechaInicial = oAccionesCE.FechaLiquidacionCompra
+    'Dim vFechaLiquidacionVenta = oAccionesCE.FechaLiquidacionVenta
+    'Dim vUnidadesVenta = oAccionesCE.CantidadVenta
+    'Dim vAccionPreferente = oAccionesCE.AccionPreferente
+    'Dim vValorTransadoCompra = oAccionesCE.ValorTransadoCompra
+
+    'Dim Periodos As Integer
+    'Dim Periodicidad As String = "A"
+    'Dim Filas As DataRow
+    'Dim FactorDidivendo As Double = vFactorDeDividendo
+    'Dim FechaInicial As Date = vFechaInicial
+    'Dim PorcentajeRenta As Double = 0.05
+    'Dim IngresoBruto As Double
+    'Dim Renta As Double
+    'Dim IngresoNeto As Double
+    'Dim SumaImgresoBruto As Double
+    'Dim SumaImgresoNeto As Double
+    'Dim Suma As Object
+
+    'If Periodicidad = "A" Then
+    '       Periodos = DateDiff(DateInterval.Year, vFechaInicial, vFechaLiquidacionVenta)
+
+    'End If
+
+    'For i As Integer = 1 To Periodos
+
+    'If Periodicidad = "A" Then
+    '           FechaInicial = FechaInicial.AddYears(1)
+    'End If
+
+    '       IngresoBruto = FactorDidivendo * vUnidadesVenta
+    'If vAccionPreferente = "S" Then
+    '           IngresoBruto = vValorTransadoCompra * FactorDidivendo
+    'End If
+
+
+    '       Renta = IngresoBruto * PorcentajeRenta
+    '      IngresoNeto = IngresoBruto - Renta
+
+    '     Filas = dtDividendos.NewRow()
+    '    Filas("Fecha") = FechaInicial
+    '   Filas("Dividendo") = FactorDidivendo
+    '  Filas("IngresoBruto") = IngresoBruto
+    ' Filas("Renta") = Renta
+    'Filas("IngresoNeto") = IngresoNeto
+
+    'dtDividendos.Rows.Add(Filas)
+    'Next
+
+    '   SumaImgresoBruto = Dividendos.Compute("SUM(IngresoBruto)", "").ToString
+    '  Suma = dtDividendos.Compute("SUM(IngresoBruto)", "")
+    'If Suma IsNot DBNull.Value Then
+    '       SumaImgresoBruto = Convert.ToDouble(Suma)
+    'End If
+
+    '   SumaImgresoNeto = Dividendos.Compute("SUM(IngresoNeto)", "").ToString
+    '  Suma = dtDividendos.Compute("SUM(IngresoNeto)", "")
+    'If Suma IsNot DBNull.Value Then
+    '       SumaImgresoNeto = Convert.ToDouble(Suma)
+    'End If
+
+
+    'Me.txtIngresoBrutoDividendos_Venta.Text = SumaImgresoBruto.ToString
+    'Me.txtIngresoNetoDividendos_Venta.Text = SumaImgresoNeto.ToString
+
+    'Me.dgvDividendos.DataSource = dtDividendos
+
+    '   RefrescarRetornoAnualBruto_Venta()
+    '  RefrescarRetornoAnualNeto_Venta()
+    'End Sub
+    Private Sub chkAccionPreferente_CheckedChanged(sender As Object, e As EventArgs)
+        ControlChkAccionPreferente()
+
+
+    End Sub
+    Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
+        Dim codigo As String = Variables.Codigo
+        Dim Accion As Collection = NuevaAccion()
+        Dim ElementosAccion As Dictionary(Of String, Collection) = ColeccionNuevo(codigo)
+
+        ''RefrescarClaseEntidad()
+
+        'ModificarElementoAccion()
+
+
+        If (Estado = "N") Then
+
+
+            oAccionesDAO.ProcesoDatos(Accion, codigo, ElementosAccion, "Nuevo")
+
+
+        ElseIf Not ExisteValidacion() Then
+
+            Variables.ColeccionACC = NuevaAccion()
+
+            Me.Close()
+
+
+
+
+        End If
+        If Estado = "M" Then
+            oAccionesDAO.ProcesoDatos(Accion, codigo, ElementosAccion, "Modificar")
+
+            'ActualizarRegistro()
+            'ModificarAccion()
+            'ModificarElementoAccion()
+
+        End If
+        If Estado = "B" Then
+            'ActualizarRegistro()
+            'EliminarAccion()
+            Eliminar()
+
+        End If
+        ValidarExistencia()
+
+
+
+
+    End Sub
+
+
+    Sub ValidarExistencia()
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Dim Tabla As String = String.Empty
+
+        Tabla = "ACC0"
+
+        Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+        If (Existe) Then
+            navNuevo.Enabled = False
+            TbDividendos.Enabled = True
+            navModificar.Enabled = True
+            navEliminar.Enabled = True
+        Else
+            navNuevo.Enabled = True
+            TbDividendos.Enabled = False
+            navModificar.Enabled = False
+            navEliminar.Enabled = False
+            DatosCargados = True
+        End If
+        TipoTransaccion = String.Empty
+        btnAceptar.Text = "Aceptar"
+    End Sub
+
+
+    Function ExisteValidacion()
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Dim Tabla As String = String.Empty
+
+        Tabla = "ACC0"
+
+        Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+        Return Existe
+    End Function
+    Public Function RetornarObjeto()
+        Return oAccionesCE
+    End Function
+
+    Private Sub CargarRegistroBD()
+        oAccionesCE = Nothing
+        CodigoInversion = Variables.Codigo
+
+        oAccionesCE = oAccionesDAO.CargarRegistro(Me.CodigoInversion)
+
+        TipoTransaccion = "C"
+        RefrescarValorControlesInicial()
+    End Sub
+    Public Sub CargarRegistro(vId As Integer, vTipo As String)
+        TipoTransaccion = "C"
+        IdDocumento = vId
+        TipoDocumento = vTipo
+    End Sub
+    Public Sub CargarRegistro(ByRef vCodigoInversion As String)
+        TipoTransaccion = "C"
+        Me.CodigoInversion = vCodigoInversion
+    End Sub
+
+    Private Sub txtDiasDeTenencia_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtDiasDeTenenciaCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtGananciaCapitalTotal_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtGananciaCapitalTotalCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtGananciaCapitalUnitario_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtGananciaCapitalUnitarioCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtRetornoAnualBruto_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtRetornoAnualBrutoCompra.TextChanged
+        If (txtRetornoAnualBrutoCompra.ToString.IndexOf("%") = -1) Then
+            txtRetornoAnualBrutoCompra.Text += "%"
+        End If
+        If (String.IsNullOrEmpty(txtRetornoAnualBrutoCompra.Text.ToString.Trim("%"))) Then
+            txtRetornoAnualBrutoCompra.Text = "0.0%"
+
+        End If
+
+    End Sub
+
+    Private Sub txtRetornoAnualNeto_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtRetornoAnualNetoCompra.TextChanged
+
+    End Sub
+
+    Private Sub cboCasa_C_SelectedIndexChanged(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub txtPrecioSucio_Compra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioSucioCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtGananciaCapitalUnitario_Venta_TextChanged(sender As Object, e As EventArgs) Handles txtGananciaCapitalUnitarioVenta.TextChanged
+
+    End Sub
+
+    Private Sub txtRetornoAnualBruto_Venta_TextChanged(sender As Object, e As EventArgs) Handles txtRetornoAnualBrutoVenta.TextChanged
+
+    End Sub
+
+    Private Sub txtRetornoAnualNeto_Venta_TextChanged(sender As Object, e As EventArgs) Handles txtRetornoAnualNetoVenta.TextChanged
+
+    End Sub
+
+    Private Sub cboCasa_V_SelectedIndexChanged(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub RefrescarValores()
+
+    End Sub
+
+    '********** CONTROL DE VALORES **********
+    'COMPRA
+    Private Sub ControlPrecioLimpioCompra()
+        If DatosCargados Then
+
+
+            Dim valor As Double = 0
+
+            If Not Double.TryParse(Me.txtPrecioLimpioCompra.Text, valor) Then
+
+                oAccionesCE.PrecioLimpioVenta = "0.0"
+            Else
+
+                oAccionesCE.PrecioLimpioCompra = valor
+
+                Me.txtPrecioLimpioCompra.BackColor = Color.White
+
+                If (Me.TipoTransaccion = "N") Then
+                    oAccionesCE.PrecioLimpioVenta = oAccionesCE.PrecioLimpioCompra
+                End If
+
+                RefrescarValorControles()
+            End If
+        End If
+    End Sub
+    Private Sub ControlFechaOperacionCompra()
+        oAccionesCE.FechaOperacionCompra = Me.dtpFechaOperacionCompra.Value.Date
+        RefrescarValorControles()
+    End Sub
+    Private Sub ControlFechaLiquidacionCompra()
+        oAccionesCE.FechaVencimientoCompra = Me.dtpFechaVencimientoCompra.Value.Date
+        RefrescarValorControles()
+    End Sub
+    Private Sub ControlCantidadCompra()
+
+        Dim valor As Integer = 0
+
+        If Not Integer.TryParse(Me.txtUnidadesCompra.Text, valor) Then
+
+
+            oAccionesCE.CantidadCompra = "0"
+        Else
+
+            Me.txtUnidadesCompra.BackColor = Color.White
+
+            oAccionesCE.CantidadCompra = valor
+            If (Me.TipoTransaccion = "N" Or TipoTransaccion = "A") Then
+                oAccionesCE.CantidadVenta = oAccionesCE.CantidadCompra
+            End If
+            RefrescarValorControles()
+        End If
+
+    End Sub
+
+    'VENTA
+    Private Sub ControlPrecioLimpioVenta()
+        If DatosCargados Then
+            Dim valor As Double
+            If Not Double.TryParse(Me.txtPrecioLimpioVenta.Text, valor) Then
+
+                oAccionesCE.PrecioLimpioVenta = "0.0"
+            Else
+                Me.txtPrecioLimpioVenta.BackColor = Color.White
+                oAccionesCE.PrecioLimpioVenta = valor
+            End If
+            RefrescarValorControles()
+
+        End If
+    End Sub
+    Private Sub ControlFechaOperacionVenta()
+        oAccionesCE.FechaOperacionVenta = dtpFechaOperacionVenta.Value.Date
+        RefrescarValorControles()
+
+    End Sub
+    Private Sub ControlFechaLiquidacionVenta()
+        oAccionesCE.FechaVencimientoVenta = dtpFechaVencimientoVenta.Value.Date
+        RefrescarValorControles()
+
+    End Sub
+    Private Sub ControlCantidadVenta()
+        Dim valor As Integer
+        If Not Integer.TryParse(Me.txtUnidadesVenta.Text, valor) Then
+            Me.txtUnidadesVenta.Text = "0"
+            oAccionesCE.CantidadVenta = "0"
+        Else
+            Me.txtUnidadesVenta.BackColor = Color.White
+            oAccionesCE.CantidadVenta = valor
+        End If
+        RefrescarValorControles()
+
+    End Sub
+    Private Sub ControlChkBolsa()
+        'ActivarEdicion()
+
+    End Sub
+    Private Sub ControlChkAccionPreferente()
+        'ActivarEdicion()
+
+
+    End Sub
+
+    '********** FIN CONTROL DE VALORES **********
+
+
+
+    '********** EVENTOS DE CONTROLES ********** 
+
+    'COMPRA
+    Private Sub txtPrecioLimpioCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioLimpioCompra.TextChanged
+        'ControlPrecioLimpioCompra()
+        'ActivarEdicion()
+        ControlPrecioLimpioCompra()
+    End Sub
+
+    Private Sub txtPrecioLimpioCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioLimpioCompra.LostFocus
+        ControlPrecioLimpioCompra()
+    End Sub
+    Private Sub dtpFechaOperacionCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacionCompra.ValueChanged
+        'ActivarEdicion()
+        If DatosCargados Then
+            ControlFechaOperacionCompra()
+            RefrescarValorControles()
+            Formato()
+        End If
+    End Sub
+
+    Private Sub dtpFechaLiquidacionCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoCompra.ValueChanged
+        'ActivarEdicion()
+        If DatosCargados Then
+            ControlFechaLiquidacionCompra()
+            RefrescarValorControles()
+            Formato()
+        End If
+    End Sub
+
+    Private Sub txtUnidadesCompra_TextChanged(sender As Object, e As EventArgs) Handles txtUnidadesCompra.TextChanged
+        'ActivarEdicion()
+        'ControlCantidadCompra()
+        If DatosCargados Then
+
+
+            ControlCantidadCompra()
+            CopiarDatos()
+        End If
+    End Sub
+    Sub CopiarDatos()
+        txtUnidadesVenta.Text = txtUnidadesCompra.Text
+    End Sub
+
+
+
+    Private Sub txtUnidadesCompra_LostFocus(sender As Object, e As EventArgs) Handles txtUnidadesCompra.LostFocus
+        ControlCantidadCompra()
+    End Sub
+
+
+    'VENTA
+    Private Sub txtPrecioLimpioVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioLimpioVenta.TextChanged
+        'ActivarEdicion()
+        'ControlPrecioLimpioVenta()
+        ControlPrecioLimpioVenta()
+    End Sub
+
+    Private Sub txtPrecioLimpioVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioLimpioVenta.LostFocus
+        ControlPrecioLimpioVenta()
+    End Sub
+
+    Private Sub dtpFechaOperacionVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacionVenta.ValueChanged
+        'ActivarEdicion()
+        If DatosCargados Then
+            ControlFechaOperacionVenta()
+            RefrescarValorControles()
+        End If
+    End Sub
+
+    Private Sub dtpFechaLiquidacionVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoVenta.ValueChanged
+        'ActivarEdicion()
+        If DatosCargados Then
+            ControlFechaLiquidacionVenta()
+            RefrescarValorControles()
+        End If
+    End Sub
+
+    Private Sub txtUnidadesVenta_TextChanged(sender As Object, e As EventArgs) Handles txtUnidadesVenta.TextChanged
+        'ActivarEdicion()
+        'ControlCantidadVenta()
+        If DatosCargados Then
+            ControlCantidadVenta()
+
+            MensajeAlerta()
+            MostrarMensaje = True
+        End If
+    End Sub
+
+    Sub MensajeAlerta()
+        If (MostrarMensaje) Then
+            Dim UnidadesVenta As Integer = 0
+            Dim UnidadesCompra As Integer = 0
+
+            If Not String.IsNullOrEmpty(txtUnidadesVenta.Text) Then
+                UnidadesVenta = txtUnidadesVenta.Text
+            End If
+
+            If Not String.IsNullOrEmpty(txtUnidadesCompra.Text) Then
+                UnidadesCompra = txtUnidadesCompra.Text
+            End If
+
+            If (CDec(UnidadesVenta) > CDec(UnidadesCompra)) Then
+                MsgBox("Esta Tratando de Ingresar más acciones de las compradas, verifique los datos si ha cometido algún error.")
+            End If
+        End If
+    End Sub
+
+    Private Sub txtUnidadesVenta_LostFocus(sender As Object, e As EventArgs) Handles txtUnidadesVenta.LostFocus
+        ControlCantidadVenta()
+    End Sub
+    Private Sub chkBolsa_CheckedChanged(sender As Object, e As EventArgs)
+        ControlChkBolsa()
+    End Sub
+
+    '********** FIN EVENTOS DE CONTROLES ********** 
+
+
+
+    '********** FUNCIONES **********
+    Private Sub RefrescarClaseEntidad()
+        ControlChkBolsa()
+
+        ControlPrecioLimpioCompra()
+        ControlFechaOperacionCompra()
+        ControlFechaLiquidacionCompra()
+        ControlCantidadCompra()
+
+        ControlPrecioLimpioVenta()
+        ControlFechaOperacionVenta()
+        ControlFechaLiquidacionVenta()
+        ControlCantidadVenta()
+
+        'RefrescarValorControles()
+
+    End Sub
+
+    Private Sub Formato()
+        If DatosCargados Then
+
+
+            If (String.IsNullOrEmpty(Me.txtRetornoAnualBrutoCompra.Text.ToString.Trim("%"))) Then
+
+
+                Me.txtRetornoAnualBrutoCompra.Text = "0.0"
+            End If
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeCasaCompra.Text.Trim("%"))) Then
+                Me.txtComisionPorcentajeCasaCompra.Text = "0.0%"
+
+            End If
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaCompra.Text.Trim("%"))) Then
+
+                Me.txtComisionPorcentajeBolsaCompra.Text = "0.0%"
+
+            End If
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeCasaVenta.Text.Trim("%"))) Then
+
+                Me.txtComisionPorcentajeCasaVenta.Text = "0.0%"
+
+            End If
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaVenta.Text.Trim("%"))) Then
+
+                Me.txtComisionPorcentajeBolsaVenta.Text = "0.0%"
+
+            End If
+
+
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaCompra.Text.Trim("%"))) Then
+                Me.txtComisionPorcentajeBolsaCompra.Text = "0.0%"
+            End If
+
+
+
+            If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaVenta.Text.Trim("%"))) Then
+                Me.txtComisionPorcentajeBolsaVenta.Text = "0.0%"
+            End If
+
+
+            If String.IsNullOrEmpty(txtRetornoAnualBrutoVenta.Text.ToString) Then
+                txtRetornoAnualBrutoVenta.Text = 0
+
+            End If
+
+            If String.IsNullOrEmpty(txtPrecioLimpioCompra.Text.ToString) Then
+                txtPrecioLimpioCompra.Text = 0
+
+            End If
+
+            If String.IsNullOrEmpty(txtPrecioLimpioVenta.Text.ToString) Then
+                txtPrecioLimpioVenta.Text = 0
+
+            End If
+
+            If String.IsNullOrEmpty(txtUnidadesCompra.Text.ToString) Then
+                txtUnidadesCompra.Text = 0
+
+            End If
+
+            If String.IsNullOrEmpty(txtUnidadesVenta.Text.ToString) Then
+                txtUnidadesVenta.Text = 0
+
+            End If
+
+
+            If (txtComisionPorcentajeCasaVenta.ToString.IndexOf("%") = -1) Then
+                txtComisionPorcentajeCasaVenta.Text += "%"
+            End If
+
+            If (txtComisionPorcentajeBolsaVenta.ToString.IndexOf("%") = -1) Then
+                txtComisionPorcentajeBolsaVenta.Text += "%"
+            End If
+            If String.IsNullOrEmpty(txtGananciaCapitalUnitarioVenta.Text) Then
+                txtGananciaCapitalUnitarioVenta.Text = 0
+            End If
+
+            If String.IsNullOrEmpty(txtRetornoAnualNetoVenta.Text) Then
+                txtRetornoAnualNetoVenta.Text = 0
+            End If
+        End If
+    End Sub
+
+    Sub RefrescarValorControlesInicial()
+
+
+
+
+
+
+
+        Me.txtRetornoAnualBrutoCompra.Text = oAccionesCE.RetornoBruto * 100
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        Dim IOF = oAccionesCE.IOF
+        Dim Renta = oAccionesCE.Renta
+
+        If (IOF) Then
+            ChkIOF.Checked = True
+        Else
+            ChkIOF.Checked = False
+        End If
+
+        If (Renta) Then
+            ChkRenta.Checked = True
+        Else
+            ChkRenta.Checked = False
+        End If
+
+
+
+
+        Me.txtComisionPorcentajeCasaCompra.Text = CStr(oAccionesCE.ComisionPorcentajeCompraCasa * 100) + "%"
+        Me.txtComisionPorcentajeBolsaCompra.Text = CStr(oAccionesCE.ComisionPorcentajeCompraBolsa * 100) + "%"
+        Me.txtComisionPorcentajeCasaVenta.Text = CStr(oAccionesCE.ComisionPorcentajeVentaCasa * 100) + "%"
+        Me.txtComisionPorcentajeBolsaVenta.Text = CStr(oAccionesCE.ComisionPorcentajeVentaBolsa * 100) + "%"
+
+
+
+
+
+        Me.txtComisionCasaCompra.Text = oAccionesCE.ComisionCompraCasa
+        Me.txtComisionBolsaCompra.Text = oAccionesCE.ComisionCompraBolsa
+        Me.txtComisionCasaVenta.Text = oAccionesCE.ComisionVentaCasa
+        Me.txtComisionBolsaVenta.Text = oAccionesCE.ComisionVentaBolsa
+
+
+
+        If (oAccionesCE.Tipo = "Porcentaje") Then
+            rdbPorcentaje.Checked = True
+        ElseIf (oAccionesCE.Tipo = "Efectivo") Then
+            rdbEfectivo.Checked = True
+        End If
+
+
+
+
+
+
+
+
+
+
+
+        'COMPRA
+
+        Me.txtPrecioLimpioCompra.Text = oAccionesCE.PrecioLimpioCompra.ToString()
+
+        dtpFechaOperacionCompra.Value = CDate(oAccionesCE.FechaOperacionCompra)
+        dtpFechaVencimientoCompra.Value = CDate(oAccionesCE.FechaVencimientoCompra)
+
+        Me.txtDiasDeTenenciaCompra.Text = oAccionesCE.DiasDeTenenciaCompra.ToString
+        Me.txtGananciaCapitalTotalCompra.Text = oAccionesCE.GananciaDeCapitalTotalCompra.ToString
+        Me.txtGananciaCapitalUnitarioCompra.Text = oAccionesCE.GananciaDeCapitalUnitarioCompra.ToString
+        Me.txtRetornoAnualNetoCompra.Text = oAccionesCE.RetornoAnualizadoNetoCompra.ToString()
+
+        Me.txtUnidadesCompra.Text = oAccionesCE.CantidadCompra.ToString
+        Me.txtValorTransadoCompra.Text = oAccionesCE.ValorTransadoCompra.ToString()
+
+
+
+
+
+        '   ImpuestosCalculoCompra = CalcularComisionImpuestos(CDec(CalcularImpuesto()), CDec(txtValorTransadoCompra.Text))
+
+
+        Dim ValorIOFCompra = 0.0, ValorRentaCompra = 0.0
+
+
+        Me.txtMontoNetoCompra.Text = oAccionesCE.MontoNetoComprasus
+        Me.txtPrecioSucioCompra.Text = oAccionesCE.PrecioSucioCompra.ToString()
+
+
+
+
+        'VENTA
+
+        Me.txtPrecioLimpioVenta.Text = oAccionesCE.PrecioLimpioVenta.ToString()
+        Me.dtpFechaOperacionVenta.Value = oAccionesCE.FechaOperacionVenta
+        Me.dtpFechaVencimientoVenta.Value = oAccionesCE.FechaVencimientoVenta
+        Me.txtDiasDeTenenciaVenta.Text = oAccionesCE.DiasDeTenenciaVenta.ToString
+        Me.txtGananciaCapitalTotalVenta.Text = oAccionesCE.GananciaDeCapitalTotalVentasus.ToString()
+        Me.txtGananciaCapitalUnitarioVenta.Text = oAccionesCE.GananciaDeCapitalUnitarioVenta.ToString
+
+        txtRetornoAnualBrutoVenta.Text = oAccionesCE.RetornoAnualizadoBrutoVentasus.ToString
+
+
+
+        Me.txtRetornoAnualNetoVenta.Text = oAccionesCE.RetornoAnualizadoNetoVenta.ToString()
+
+
+        Me.txtUnidadesVenta.Text = oAccionesCE.CantidadVenta.ToString
+        Me.txtValorTransadoVenta.Text = oAccionesCE.ValorTransadoVenta.ToString()
+        Me.txtImpuestosYComisionesVenta.Text = oAccionesCE.SumaImpuestosYComisionesVenta.ToString()
+
+
+        Dim ComisionCasaVenta As Double = 0
+        Dim ComisionBolsaVenta As Double = 0
+        Dim ValorTransadoVenta As Double = 0
+
+
+
+
+        '  ImpuestosCalculoVenta = CalcularComisionImpuestos(CDec(CalcularImpuesto()), CDec(txtValorTransadoVenta.Text))
+
+        Dim ValorIOFVenta = 0.0, ValorRentaVenta = 0.0
+
+
+
+        Me.txtMontoNetoVenta.Text = oAccionesCE.MontoNetoVentasus.ToString
+        Me.txtPrecioSucioVenta.Text = oAccionesCE.PrecioSucioVentasus.ToString()
+    End Sub
+    Sub RefrescarValorControles()
+        If DatosCargados Then
+
+
+            If (Cargar) Then
+
+                If (String.IsNullOrEmpty(oAccionesCE.RetornoBruto.ToString())) Then
+
+
+
+                Else
+
+
+                    Me.txtRetornoAnualBrutoCompra.Text = oAccionesCE.RetornoBruto * 100
+
+
+
+                End If
+
+
+                If String.IsNullOrEmpty(txtGananciaCapitalUnitarioVenta.Text) Then
+                    txtGananciaCapitalUnitarioVenta.Text = 0
+                End If
+
+                If String.IsNullOrEmpty(txtRetornoAnualNetoVenta.Text) Then
+                    txtRetornoAnualNetoVenta.Text = 0
+                End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                Dim IOF = oAccionesCE.IOF
+                Dim Renta = oAccionesCE.Renta
+
+
+
+
+
+
+
+                If (IOF) Then
+                    ChkIOF.Checked = True
+                Else
+                    ChkIOF.Checked = False
+                End If
+
+                If (Renta) Then
+                    ChkRenta.Checked = True
+                Else
+                    ChkRenta.Checked = False
+                End If
+
+                If (String.IsNullOrEmpty(Me.txtComisionPorcentajeCasaCompra.Text.TrimEnd("%"))) Then
+                    If (String.IsNullOrEmpty(oAccionesCE.ComisionCompraCasa)) Then
+
+                    Else
+                        If Not oAccionesCE.ComisionCompraCasa = "0" Then
+                            Me.txtComisionPorcentajeCasaCompra.Text = CStr(oAccionesCE.ComisionCompraCasa * 100) + "%"
+                        End If
+
+                    End If
+
+                End If
+
+                If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaCompra.Text.TrimEnd("%"))) Then
+                    If (String.IsNullOrEmpty(oAccionesCE.ComisionCompraBolsa)) Then
+
+                    Else
+                        If Not oAccionesCE.ComisionCompraBolsa = "0" Then
+                            Me.txtComisionPorcentajeBolsaCompra.Text = CStr(oAccionesCE.ComisionCompraBolsa * 100) + "%"
+                        End If
+
+                    End If
+                End If
+
+                If (String.IsNullOrEmpty(Me.txtComisionPorcentajeCasaVenta.Text.TrimEnd("%"))) Then
+                    If (String.IsNullOrEmpty(oAccionesCE.ComisionVentaCasa)) Then
+
+                    End If
+                    If Not oAccionesCE.ComisionVentaCasa = "0" Then
+                        Me.txtComisionPorcentajeCasaVenta.Text = CStr(oAccionesCE.ComisionVentaCasa * 100) + "%"
+                    End If
+
+                End If
+
+                If (String.IsNullOrEmpty(Me.txtComisionPorcentajeBolsaVenta.Text.TrimEnd("%"))) Then
+                    If (String.IsNullOrEmpty(oAccionesCE.ComisionVentaBolsa)) Then
+
+                    Else
+                        If Not oAccionesCE.ComisionVentaBolsa = "0" Then
+                            Me.txtComisionPorcentajeBolsaVenta.Text = CStr(oAccionesCE.ComisionVentaBolsa * 100) + "%"
+                        End If
+
+                    End If
+
+                End If
+            Else
+                If (oAccionesCE.Tipo = "Porcentaje") Then
+
+                    rdbPorcentaje.Checked = True
+                ElseIf (oAccionesCE.Tipo = "Efectivo") Then
+                    rdbEfectivo.Checked = True
+                End If
+            End If
+
+
+
+
+
+
+
+
+
+
+            'COMPRA
+            If (String.IsNullOrEmpty(oAccionesCE.PrecioLimpioCompra.ToString())) Then
+
+            Else
+                If Not oAccionesCE.PrecioLimpioCompra.ToString() = "0" Then
+                    Me.txtPrecioLimpioCompra.Text = oAccionesCE.PrecioLimpioCompra.ToString()
+                End If
+
+
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.FechaOperacionCompra)) Then
+                Me.dtpFechaOperacionCompra.Value = Date.Now.Date
+            Else
+                Me.dtpFechaOperacionCompra.Value = oAccionesCE.FechaOperacionCompra
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.FechaVencimientoCompra)) Then
+                Me.dtpFechaVencimientoCompra.Value = Date.Now.Date
+            Else
+                Me.dtpFechaVencimientoCompra.Value = oAccionesCE.FechaVencimientoCompra
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.DiasDeTenenciaCompra.ToString)) Then
+
+            Else
+                Me.txtDiasDeTenenciaCompra.Text = oAccionesCE.DiasDeTenenciaCompra.ToString
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.GananciaDeCapitalTotalCompra.ToString)) Then
+
+            Else
+                Me.txtGananciaCapitalTotalCompra.Text = oAccionesCE.GananciaDeCapitalTotalCompra.ToString
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.GananciaDeCapitalUnitarioCompra.ToString)) Then
+
+
+            Else
+
+                Me.txtGananciaCapitalUnitarioCompra.Text = oAccionesCE.GananciaDeCapitalUnitarioCompra.ToString
+            End If
+
+
+
+
+            If (String.IsNullOrEmpty(oAccionesCE.RetornoAnualizadoNetoCompra.ToString(Configuraciones.CodigoTXTPorcentaje))) Then
+
+
+            Else
+                Me.txtRetornoAnualNetoCompra.Text = oAccionesCE.RetornoAnualizadoNetoCompra.ToString()
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.CantidadCompra.ToString)) Then
+
+
+            Else
+                If Not oAccionesCE.CantidadCompra.ToString = "0" Then
+                    Me.txtUnidadesCompra.Text = oAccionesCE.CantidadCompra.ToString
+                End If
+
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.ValorTransadoCompra.ToString(Configuraciones.CodigoTXTMontos))) Then
+
+
+            Else
+
+                Me.txtValorTransadoCompra.Text = oAccionesCE.ValorTransadoCompra.ToString()
+            End If
+
+            Dim ComisionCasaCompra As Double = 0
+            Dim ComisionBolsaCompra As Double = 0
+            Dim ValorTransadoCompra As Double = 0
+
+
+            If String.IsNullOrEmpty(txtComisionPorcentajeCasaCompra.Text.TrimEnd("%")) Then
+                ComisionCasaCompra = 0
+            Else
+                ComisionCasaCompra = txtComisionPorcentajeCasaCompra.Text.TrimEnd("%") / 100
+            End If
+
+            If String.IsNullOrEmpty(txtComisionPorcentajeBolsaCompra.Text.TrimEnd("%")) Then
+                ComisionBolsaCompra = 0
+            Else
+                ComisionBolsaCompra = txtComisionPorcentajeBolsaCompra.Text.TrimEnd("%") / 100
+            End If
+            If Not String.IsNullOrEmpty(txtValorTransadoCompra.Text) Then
+                ValorTransadoCompra = txtValorTransadoCompra.Text
+            End If
+
+
+            Me.txtComisionCasaCompra.Text = CalcularComisionImpuestos(ComisionCasaCompra, txtValorTransadoCompra.Text)
+            Me.txtComisionBolsaCompra.Text = CalcularComisionImpuestos(ComisionBolsaCompra, txtValorTransadoCompra.Text)
+
+
+            '   ImpuestosCalculoCompra = CalcularComisionImpuestos(CDec(CalcularImpuesto()), CDec(txtValorTransadoCompra.Text))
+            If (String.IsNullOrEmpty(oAccionesCE.SumaImpuestosYComisionesCompra.ToString(Configuraciones.CodigoTXTMontos))) Then
+
+
+            Else
+                Me.txtImpuestosYComisionesCompra.Text = oAccionesCE.SumaImpuestosYComisionesCompra.ToString()
+
+            End If
+
+            Dim ValorIOFCompra = 0.0, ValorRentaCompra = 0.0
+
+
+            If (Not String.IsNullOrEmpty(txtIOFCompra.Text.ToString)) Then
+
+                ValorIOFCompra = txtIOFCompra.Text
+            End If
+            If (Not String.IsNullOrEmpty(txtRentaCompra.Text.ToString)) Then
+                ValorRentaCompra = txtRentaCompra.Text
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.PrecioSucioCompra.ToString(Configuraciones.CodigoTXTMontos))) Then
+
+
+            Else
+                Me.txtPrecioSucioCompra.Text = oAccionesCE.PrecioSucioCompra.ToString()
+
+            End If
+
+
+            'VENTA
+            If (String.IsNullOrEmpty(oAccionesCE.PrecioLimpioVenta.ToString())) Then
+
+
+            Else
+                If Not oAccionesCE.PrecioLimpioVenta = 0 Then
+                    Me.txtPrecioLimpioVenta.Text = oAccionesCE.PrecioLimpioVenta.ToString()
+                End If
+
+
+
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.FechaOperacionVenta)) Then
+
+                Me.dtpFechaOperacionVenta.Value = Date.Now.Date
+            Else
+                Me.dtpFechaOperacionVenta.Value = oAccionesCE.FechaOperacionVenta
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.FechaVencimientoVenta)) Then
+
+                Me.dtpFechaVencimientoVenta.Value = Date.Now.Date
+            Else
+                Me.dtpFechaVencimientoVenta.Value = oAccionesCE.FechaVencimientoVenta
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.DiasDeTenenciaVenta.ToString)) Then
+
+
+            Else
+
+                Me.txtDiasDeTenenciaVenta.Text = oAccionesCE.DiasDeTenenciaVenta.ToString
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.GananciaDeCapitalTotalVenta.ToString(Configuraciones.CodigoTXTMontos))) Then
+
+
+            Else
+
+                Me.txtGananciaCapitalTotalVenta.Text = oAccionesCE.GananciaDeCapitalTotalVenta.ToString()
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.GananciaDeCapitalUnitarioVenta.ToString)) Then
+
+
+            Else
+                If Double.IsNaN(oAccionesCE.GananciaDeCapitalUnitarioVenta.ToString) Then
+
+                Else
+                    Me.txtGananciaCapitalUnitarioVenta.Text = oAccionesCE.GananciaDeCapitalUnitarioVenta.ToString
+
+
+                End If
+
+            End If
+            If String.IsNullOrEmpty(txtRetornoAnualBrutoVenta.Text.ToString) Then
+                txtRetornoAnualBrutoVenta.Text = 0
+
+            End If
+
+
+            Variables.IngresoBruto = CalcularIngresoBruto()
+            Variables.IngresoNeto = CalcularIngresoNeto()
+            If (rdbEfectivo.Checked) Then
+
+
+                If (String.IsNullOrEmpty(oAccionesCE.RetornoAnualizadoBrutoVenta.ToString(Configuraciones.CodigoTXTPorcentaje))) Then
+
+
+                Else
+                    Me.txtRetornoAnualBrutoVenta.Text = oAccionesCE.RetornoAnualizadoBrutoVenta.ToString()
+
+                End If
+
+            Else
+
+
+                Dim Existe = dgvDividendos.Rows.Count
+                If (Existe >= 1) Then
+                    If (Not dgvDividendos.Rows(0).Cells("Dividendo").Value Is Nothing) Then
+
+
+                        Dim Valor = dgvDividendos.Rows(0).Cells("Dividendo").Value.ToString.Trim("%")
+
+                        If (String.IsNullOrEmpty(Valor)) Then
+
+
+                        Else
+
+                            Me.txtRetornoAnualBrutoVenta.Text = CStr((CDec(Valor.ToString.Trim("%")) * 100)) + "%"
+
+                        End If
+                    End If
+                End If
+            End If
+
+
+
+
+            If (rdbEfectivo.Checked) Then
+
+
+                If (String.IsNullOrEmpty(oAccionesCE.RetornoAnualizadoNetoVenta.ToString(Configuraciones.CodigoTXTPorcentaje))) Then
+
+
+                Else
+                    Me.txtRetornoAnualNetoVenta.Text = oAccionesCE.RetornoAnualizadoNetoVenta.ToString()
+
+                End If
+
+            Else
+
+
+
+                Dim Existe = dgvDividendos.Rows.Count
+                If (Existe >= 1) Then
+
+                    Dim Valor = dgvDividendos.Rows(0).Cells("PorcISR").Value
+
+                    If (String.IsNullOrEmpty(Valor)) Then
+
+
+                    Else
+
+                        Me.txtRetornoAnualNetoVenta.Text = CStr(CDec(txtRetornoAnualBrutoVenta.Text.Trim("%")) * (1 - Valor)) + "%"
+                    End If
+
+                End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+            End If
+            If (String.IsNullOrEmpty(oAccionesCE.CantidadVenta.ToString)) Then
+
+
+            Else
+                If Not oAccionesCE.CantidadVenta = 0 Then
+                    Me.txtUnidadesVenta.Text = oAccionesCE.CantidadVenta.ToString
+
+                End If
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.ValorTransadoVenta.ToString())) Then
+
+
+            Else
+
+                Me.txtValorTransadoVenta.Text = oAccionesCE.ValorTransadoVenta.ToString()
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.SumaImpuestosYComisionesVenta.ToString())) Then
+
+
+            Else
+                Me.txtImpuestosYComisionesVenta.Text = oAccionesCE.SumaImpuestosYComisionesVenta.ToString()
+
+            End If
+            Dim ComisionCasaVenta As Double = 0
+            Dim ComisionBolsaVenta As Double = 0
+            Dim ValorTransadoVenta As Double = 0
+
+
+            If Not String.IsNullOrEmpty(txtComisionPorcentajeCasaVenta.Text.TrimEnd("%")) Then
+                ComisionCasaVenta = txtComisionPorcentajeCasaVenta.Text.TrimEnd("%") / 100
+            End If
+
+            If Not String.IsNullOrEmpty(txtComisionPorcentajeBolsaVenta.Text.TrimEnd("%")) Then
+                ComisionBolsaVenta = txtComisionPorcentajeBolsaVenta.Text.TrimEnd("%") / 100
+            End If
+
+            If Not String.IsNullOrEmpty(txtValorTransadoVenta.Text) Then
+                ValorTransadoVenta = txtValorTransadoVenta.Text
+            End If
+            Me.txtComisionCasaVenta.Text = CalcularComisionImpuestos(ComisionCasaVenta, ValorTransadoVenta)
+
+            Me.txtComisionBolsaVenta.Text = CalcularComisionImpuestos(ComisionBolsaVenta, ValorTransadoVenta)
+
+            '  ImpuestosCalculoVenta = CalcularComisionImpuestos(CDec(CalcularImpuesto()), CDec(txtValorTransadoVenta.Text))
+            txtGananciaCapitalTotalVenta.Text += SumaComisiones()
+            Dim ValorIOFVenta = 0.0, ValorRentaVenta = 0.0
+
+            If (Not String.IsNullOrEmpty(txtIOFVenta.Text.ToString)) Then
+                ValorIOFVenta = txtIOFVenta.Text
+            End If
+            If (Not String.IsNullOrEmpty(txtRentaVenta.Text.ToString)) Then
+                ValorRentaVenta = txtRentaVenta.Text
+            End If
+
+
+            If (String.IsNullOrEmpty(oAccionesCE.MontoNetoVenta.ToString())) Then
+
+
+            Else
+                Me.txtMontoNetoVenta.Text = CDec(oAccionesCE.MontoNetoVenta.ToString()) - CDec(txtComisionBolsaVenta.Text) - CDec(txtComisionCasaVenta.Text) - ValorIOFVenta - ValorRentaVenta
+
+            End If
+            If (String.IsNullOrEmpty(CDec(oAccionesCE.MontoNetoCompra.ToString(Configuraciones.CodigoTXTMontos)))) Or String.IsNullOrEmpty((CDec(txtComisionBolsaCompra.Text)) Or String.IsNullOrEmpty(CDec(txtComisionCasaCompra.Text)) Or String.IsNullOrEmpty(ValorIOFCompra) Or String.IsNullOrEmpty(ValorRentaCompra)) Then
+
+
+            Else
+
+                Me.txtMontoNetoCompra.Text = (CDec(oAccionesCE.MontoNetoCompra.ToString())) + (CDec(txtComisionBolsaCompra.Text) + CDec(txtComisionCasaCompra.Text) + ValorIOFCompra + ValorRentaCompra)
+
+            End If
+
+            If (String.IsNullOrEmpty(oAccionesCE.PrecioSucioVenta.ToString())) Then
+
+                Me.txtPrecioSucioVenta.Text = "0.0"
+            Else
+                If Double.IsNaN(oAccionesCE.PrecioSucioVenta.ToString()) Then
+                    Me.txtPrecioSucioVenta.Text = "0.0"
+                Else
+
+
+                    Me.txtPrecioSucioVenta.Text = oAccionesCE.PrecioSucioVenta.ToString()
+
+
+                End If
+
+            End If
+        End If
+    End Sub
+
+
+    Function CalcularIngresoBruto()
+        Dim Cantidad = dgvDividendos.Rows.Count - 1
+        Dim FechaActual = Date.Now.Date
+        Dim ContadorIngreso As Double = 0.0
+
+        For i As Integer = 0 To Cantidad
+            Try
+
+
+                If (Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("Fecha").Value.ToString)) Then
+
+
+                    Dim FechaPrograma As Date = CDate(dgvDividendos.Rows(i).Cells("Fecha").Value.ToString)
+                    If (FechaActual >= FechaPrograma) Then
+                        If (Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("IngresoBruto").Value.ToString)) Then
+
+                            ContadorIngreso += CDec(dgvDividendos.Rows(i).Cells("IngresoBruto").Value.ToString)
+                        End If
+                    End If
+                End If
+
+            Catch ex As Exception
+
+            End Try
+        Next
+
+        Return ContadorIngreso
+    End Function
+
+
+    Function CalcularIngresoNeto()
+        Dim Cantidad = dgvDividendos.Rows.Count - 1
+        Dim FechaActual = Date.Now.Date
+        Dim ContadorIngreso As Double = 0.0
+
+        For i As Integer = 0 To Cantidad
+            Try
+
+
+                If (Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("Fecha").Value.ToString)) Then
+
+
+                    Dim FechaPrograma As Date = CDate(dgvDividendos.Rows(i).Cells("Fecha").Value.ToString)
+                    If (FechaActual >= FechaPrograma) Then
+                        If (Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("IngresoNeto").Value.ToString)) Then
+                            ContadorIngreso += CDec(dgvDividendos.Rows(i).Cells("IngresoNeto").Value.ToString)
+                        End If
+                    End If
+                End If
+            Catch ex As Exception
+
+            End Try
+        Next
+        Return ContadorIngreso
+    End Function
+
+
+    Function SumaComisiones()
+        Dim ComisionCasaVenta As Double = txtComisionCasaVenta.Text
+        Dim ComisionBolsaVenta As Double = txtComisionBolsaVenta.Text
+        Dim Total As Double = 0.0
+        Total = ComisionCasaVenta + ComisionBolsaVenta
+        Return Total
+    End Function
+
+
+
+    Function CalcularComisionImpuestos(ByVal Comision As Double, ByVal ValorTransado As Double)
+
+        Return Comision * ValorTransado
+    End Function
+
+    Private Sub PrepararTablaImpuestosYComisiones()
+        Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+        Dim oDataGridViewComboBoxColumn As DataGridViewComboBoxColumn
+
+        oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+        oDataGridViewComboBoxColumn.Name = "CodImp"
+        oDataGridViewComboBoxColumn.HeaderText = "Tipo Impuesto"
+        oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTiposImpuesto
+        oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+        oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+        oDataGridViewComboBoxColumn.DataPropertyName = "CodImp"
+        oDataGridViewComboBoxColumn.DisplayIndex = 0
+        '  Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+        oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+        oDataGridViewComboBoxColumn.Name = "TipoOper"
+        oDataGridViewComboBoxColumn.HeaderText = "Tipo Operación"
+        oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTipoOperacion
+        oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+        oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+        oDataGridViewComboBoxColumn.DataPropertyName = "TipoOper"
+        oDataGridViewComboBoxColumn.DisplayIndex = 1
+        '  Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "PorcImp"
+        oDataGridViewTextBoxColumn.HeaderText = "Porcentaje"
+        oDataGridViewTextBoxColumn.DataPropertyName = "PorcImp"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTPorcentaje
+        oDataGridViewTextBoxColumn.DisplayIndex = 2
+        '  Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "MontoSujeto"
+        oDataGridViewTextBoxColumn.HeaderText = "Monto Sujeto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "MontoSujeto"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        oDataGridViewTextBoxColumn.ReadOnly = True
+        oDataGridViewTextBoxColumn.DisplayIndex = 3
+        '  Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "MontoImp"
+        oDataGridViewTextBoxColumn.HeaderText = "Monto Impuesto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "MontoImp"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        oDataGridViewTextBoxColumn.DisplayIndex = 4
+        oDataGridViewTextBoxColumn.ReadOnly = True
+        '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "CodInv"
+        oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.Visible = False
+        '   Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+        '   Me.dgvImpuestosYComisiones.DataSource = oAccionesCE.ImpuestosYComisiones
+    End Sub
+    Private Sub PrepararTablaDividendos()
+        Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "CodInv"
+        oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+        oDataGridViewTextBoxColumn.HeaderText = "Código Inversión"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Correlativo"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Correlativo"
+        oDataGridViewTextBoxColumn.HeaderText = "Correlativo"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = True
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+
+
+
+
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Fecha"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Fecha"
+        oDataGridViewTextBoxColumn.HeaderText = "Fecha"
+        oDataGridViewTextBoxColumn.Name = "Fecha"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Date)
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Name = "Dividendo"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Dividendo"
+        oDataGridViewTextBoxColumn.HeaderText = "Dividendo"
+
+
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "CantidadBase"
+        oDataGridViewTextBoxColumn.DataPropertyName = "CantidadBase"
+        oDataGridViewTextBoxColumn.HeaderText = "Cantidad Base"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "IngresoBruto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "IngresoBruto"
+        oDataGridViewTextBoxColumn.HeaderText = "Ingreso Bruto"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        oDataGridViewTextBoxColumn.ReadOnly = True
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "PorcISR"
+        oDataGridViewTextBoxColumn.DataPropertyName = "PorcISR"
+        oDataGridViewTextBoxColumn.HeaderText = "% ISR"
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTPorcentaje
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "ISR"
+        oDataGridViewTextBoxColumn.DataPropertyName = "ISR"
+        oDataGridViewTextBoxColumn.HeaderText = "ISR"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        oDataGridViewTextBoxColumn.ReadOnly = True
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "IngresoNeto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "IngresoNeto"
+        oDataGridViewTextBoxColumn.HeaderText = "Ingreso Neto"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        oDataGridViewTextBoxColumn.ReadOnly = True
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Estado"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Estado"
+        oDataGridViewTextBoxColumn.HeaderText = "Estado"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "FechaInicio"
+        oDataGridViewTextBoxColumn.DataPropertyName = "FechaInicio"
+        oDataGridViewTextBoxColumn.HeaderText = "FechaInicio"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "FechaCorte"
+        oDataGridViewTextBoxColumn.DataPropertyName = "FechaCorte"
+        oDataGridViewTextBoxColumn.HeaderText = "FechaCorte"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "NumDiv"
+        oDataGridViewTextBoxColumn.DataPropertyName = "NumDiv"
+        oDataGridViewTextBoxColumn.HeaderText = "NuvDiv"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvDividendos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+    End Sub
+
+    Private Sub GuardarRegistro()
+
+    End Sub
+    Private Sub ActualizarRegistro()
+        Dim res As Integer
+        RefrescarClaseEntidad()
+        res = oAccionesDAO.Actualizar(oAccionesCE)
+
+        If res > 0 Then
+            MsgBox("Registro Guardado")
+        Else
+            MsgBox("Algo no salio bien.")
+        End If
+
+    End Sub
+    'Private Sub ActivarEdicion()
+    '    If TipoTransaccion = "C" Then
+    '        Me.TipoTransaccion = "A"
+    '        Me.btnAceptar.Text = "Guardar"
+    '    End If
+
+    'End Sub
+    Private Function FechaDividendo()
+        Dim Index = dgvDividendos.CurrentRow.Index
+        Dim IndexAnterior = Index - 1
+        Dim FechaInicial = dtpFechaOperacionCompra.Value
+
+        Dim FechaActual = dgvDividendos.Rows(Index).Cells("Fecha").Value
+        Dim FechaCalcul As Date = Date.Now.Date
+        If (String.IsNullOrEmpty(FechaActual)) Then
+            If (Index = 0) Then
+                FechaCalcul = Operaciones.Meses(12, FechaInicial, FechaInicial)
+            Else
+                Dim Fecha = dgvDividendos.Rows(IndexAnterior).Cells("Fecha").Value
+                FechaCalcul = Operaciones.Meses(12, Fecha, FechaInicial)
+            End If
+        Else
+            FechaCalcul = FechaActual
+        End If
+        Return FechaCalcul
+    End Function
+    Private Sub PrepararCalculoDividendos(ByVal IdFila As Integer)
+        Dim vFila As DataGridViewRow = dgvDividendos.Rows(IdFila)
+        If (rdbEfectivo.Checked) Then
+
+
+
+
+
+            If vFila.IsNewRow Then
+
+
+                vFila.Cells("Fecha").Value = FechaDividendo()
+
+
+
+
+
+                vFila.Cells("Dividendo").Value = oAccionesCE.FactorDeDividendo
+            End If
+
+            If rdbEfectivo.Checked Then
+
+                If (String.IsNullOrEmpty(txtUnidadesCompra.Text)) Then
+                    vFila.Cells("CantidadBase").Value = 0.0
+                Else
+                    vFila.Cells("CantidadBase").Value = CDec(txtUnidadesCompra.Text)
+                End If
+            Else
+
+                If (String.IsNullOrEmpty(txtValorTransadoCompra.Text)) Then
+                    vFila.Cells("CantidadBase").Value = 0.0
+                Else
+                    vFila.Cells("CantidadBase").Value = CDec(txtValorTransadoCompra.Text)
+                End If
+
+            End If
+
+
+
+            vFila.Cells("IngresoBruto").Value = 0.00
+            vFila.Cells("PorcISR").Value = 0.05
+            vFila.Cells("ISR").Value = 0.00
+            vFila.Cells("IngresoNeto").Value = 0.00
+            If dgvDividendos.Rows(IdFila).Cells("NumDiv").Value Is DBNull.Value Then
+                dgvDividendos.Rows(IdFila).Cells("NumDiv").Value = Correlativo()
+            Else
+
+                If String.IsNullOrEmpty(dgvDividendos.Rows(IdFila).Cells("NumDiv").Value) Then
+
+
+                    dgvDividendos.Rows(IdFila).Cells("NumDiv").Value = Correlativo()
+                End If
+            End If
+
+        Else
+
+            If vFila.IsNewRow Then
+                vFila.Cells("Fecha").Value = FechaDividendo()
+
+                vFila.Cells("Dividendo").Value = oAccionesCE.FactorDeDividendo.ToString + "%"
+
+                If (vFila.Cells("Dividendo").Value.ToString.IndexOf("%") = -1) Then
+                    vFila.Cells("Dividendo").Value += "%"
+                End If
+
+                If rdbEfectivo.Checked Then
+
+                    If (String.IsNullOrEmpty(txtUnidadesCompra.Text)) Then
+                        vFila.Cells("CantidadBase").Value = 0.0
+                    Else
+                        vFila.Cells("CantidadBase").Value = CDec(txtUnidadesCompra.Text)
+                    End If
+                Else
+
+                    If (String.IsNullOrEmpty(txtValorTransadoCompra.Text)) Then
+                        vFila.Cells("CantidadBase").Value = 0.0
+                    Else
+                        vFila.Cells("CantidadBase").Value = CDec(txtValorTransadoCompra.Text)
+                    End If
+
+                End If
+
+                vFila.Cells("IngresoBruto").Value = 0.00
+                vFila.Cells("PorcISR").Value = 0.05
+                vFila.Cells("ISR").Value = 0.00
+                vFila.Cells("IngresoNeto").Value = 0.00
+
+
+                If dgvDividendos.Rows(IdFila).Cells("NumDiv").Value Is DBNull.Value Then
+                    dgvDividendos.Rows(IdFila).Cells("NumDiv").Value = Correlativo()
+                Else
+
+                    If String.IsNullOrEmpty(dgvDividendos.Rows(IdFila).Cells("NumDiv").Value) Then
+
+
+                        dgvDividendos.Rows(IdFila).Cells("NumDiv").Value = Correlativo()
+                    End If
+                End If
+
+            End If
+        End If
+        If (vFila.Cells("Fecha").Value Is DBNull.Value) Then
+            vFila.Cells("Fecha").Value = FechaDividendo()
+        Else
+            If String.IsNullOrEmpty(vFila.Cells("Fecha").Value) Then
+                vFila.Cells("Fecha").Value = FechaDividendo()
+            End If
+        End If
+
+        RefrescarValorControles()
+    End Sub
+
+
+
+    Sub AgregarFechaCO()
+        dgvDividendos.CurrentRow.Cells("FechaInicio").Value = Variables.FechaInicialCorte
+        dgvDividendos.CurrentRow.Cells("FechaCorte").Value = Variables.FechaCorteCorte
+
+    End Sub
+
+
+
+    Function CalculoIngresoBrutoEfectivo(ByVal CantidadUnidades As Double, ByVal Dividendo As Double)
+        Dim Total = CantidadUnidades * (Dividendo)
+        Return Total
+
+    End Function
+
+    Function CalculoIngresoBrutoPorcentaje(ByVal ValorTransado As Double, ByVal Dividendo As Double, ByVal Dias As Integer, ByVal Fecha As Date)
+        Dim Total As Double = 0
+        If (Operaciones.AñoBisiesto(Fecha) = 364) Then
+
+            Total = (ValorTransado * (Dividendo / 100) * Dias) / 365
+
+        End If
+
+        If (Operaciones.AñoBisiesto(Fecha) = 365) Then
+
+            Total = (ValorTransado * (Dividendo / 100) * Dias) / 366
+        End If
+
+
+
+
+
+
+        Return Total
+
+    End Function
+
+    Function RangoDias(ByVal Fecha As Date, ByVal FechaVen As Date)
+        Dim Dias As Integer = DateDiff(DateInterval.Day, Fecha, FechaVen)
+        Return Dias
+    End Function
+
+
+
+    Function CantidadDiasUtimo(ByVal Fecha As Date)
+        Dim Año As Integer = Fecha.Year
+        Dim FechaCorte As Date = CDate("31/12/" + Año.ToString)
+
+        Dim Dias As Integer = DateDiff(DateInterval.Day, Fecha, FechaCorte)
+
+        Return Dias
+    End Function
+
+
+
+    Private Sub PrepararImpuestosYComisiones(ByVal IdFila As Integer)
+        '   Dim vFila As DataGridViewRow = dgvImpuestosYComisiones.Rows(IdFila)
+        '   If vFila.IsNewRow Then
+        '  vFila.Cells("TipoOper").Value = "V"
+        ' vFila.Cells("PorcImp").Value = 0
+        '  vFila.Cells("MontoSujeto").Value = oAccionesCE.ValorTransadoVenta
+        '     vFila.Cells("MontoImp").Value = 0.00
+        'End If
+
+    End Sub
+    '  Private Sub CalcularImpuestosYComisiones(ByVal IdFila As Integer, ByVal IdCol As Integer)
+    ' Dim vFila As DataGridViewRow = dgvImpuestosYComisiones.Rows(IdFila)
+    'Dim vTipoOperacion As String
+    'Dim vCodigoImpuesto As String
+    'Dim vPorcentajeImpuesto As Double
+    'Dim vMontoSujeto As Double
+    'Dim vMontoImpuesto As Double
+    '
+    'If Not vFila.IsNewRow Then
+    '       vCodigoImpuesto = vFila.Cells("CodImp").Value.ToString
+    '      vTipoOperacion = vFila.Cells("TipoOper").Value.ToString
+    'Double.TryParse(vFila.Cells("PorcImp").Value.ToString, vPorcentajeImpuesto)
+    'If IdCol = 3 Then
+    '           vPorcentajeImpuesto = vPorcentajeImpuesto / 100
+    '          vFila.Cells("PorcImp").Value = vPorcentajeImpuesto
+    'End If
+
+    'If vTipoOperacion = "C" Then
+    '           vMontoSujeto = oAccionesCE.ValorTransadoCompra
+    '          vFila.Cells("MontoSujeto").Value = oAccionesCE.ValorTransadoCompra
+    'ElseIf vTipoOperacion = "V" Then
+    '           vMontoSujeto = oAccionesCE.ValorTransadoVenta
+    '          vFila.Cells("MontoSujeto").Value = oAccionesCE.ValorTransadoVenta
+    'Else
+    '           vMontoSujeto = 0
+    'End If
+
+    '       vMontoImpuesto = vMontoSujeto * vPorcentajeImpuesto
+    '      vFila.Cells("MontoImp").Value = vMontoImpuesto
+
+    'End If
+
+    '   RefrescarClaseEntidad()
+    '  RefrescarValorControles()
+    'End Sub
+
+
+    Private Sub dgvDividendos_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs) Handles dgvDividendos.CellBeginEdit
+        'ActivarEdicion()
+        PrepararCalculoDividendos(e.RowIndex)
+    End Sub
+    Private Sub dgvDividendos_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvDividendos.CellEndEdit
+        '    If (Not dgvDividendos.Rows(0).IsNewRow) Then
+
+
+        '        If (DobleClick) Then
+        '            DobleClick = False
+        '            rdbEfectivo.Enabled = True
+        '            rdbPorcentaje.Enabled = True
+
+
+        '            TabControl1.TabPages.Insert(0, TabPage1)
+        '        End If
+        '    End If
+
+        CalcularDividendos()
+
+
+        RefrescarValorControles()
+
+
+    End Sub
+
+    Private Sub dgvDividendos_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs) Handles dgvDividendos.UserDeletedRow
+        'ActivarEdicion()
+        '   oAccionesCE.Dividendos.AcceptChanges()
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs)
+        'ActivarEdicion()
+        PrepararImpuestosYComisiones(e.RowIndex)
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs)
+        ' CalcularImpuestosYComisiones(e.RowIndex, e.ColumnIndex)
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs)
+        'ActivarEdicion()
+        oAccionesCE.ImpuestosYComisiones.AcceptChanges()
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    Private Sub dgvDividendos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvDividendos.CellContentClick
+
+    End Sub
+
+    Private Sub TabPage2_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub txtImpuestosYComisionesCompra_TextChanged(sender As Object, e As EventArgs) Handles txtImpuestosYComisionesCompra.TextChanged
+
+
+
+    End Sub
+
+
+    Private Sub TOperacion(ByVal TOperacion As String)
+        If (TOperacion = "N") Then
+            HabilitarBotones()
+        ElseIf (TOperacion = "B") Then
+            DeshabilitarBotones()
+        End If
+    End Sub
+
+    Sub HabilitarBotones()
+
+
+        txtUnidadesCompra.Enabled = True
+        txtUnidadesVenta.Enabled = True
+
+
+
+
+
+    End Sub
+
+
+
+    Sub DeshabilitarBotones()
+        txtDiasDeTenenciaCompra.Enabled = False
+        txtDiasDeTenenciaVenta.Enabled = False
+        txtGananciaCapitalTotalCompra.Enabled = False
+        txtGananciaCapitalTotalVenta.Enabled = False
+        txtGananciaCapitalUnitarioCompra.Enabled = False
+        txtGananciaCapitalUnitarioVenta.Enabled = False
+        txtRetornoAnualBrutoCompra.Enabled = False
+        txtRetornoAnualBrutoVenta.Enabled = False
+        txtRetornoAnualNetoCompra.Enabled = False
+        txtRetornoAnualNetoVenta.Enabled = False
+        txtUnidadesCompra.Enabled = False
+        txtUnidadesVenta.Enabled = False
+        txtValorTransadoCompra.Enabled = False
+        txtValorTransadoVenta.Enabled = False
+        txtImpuestosYComisionesCompra.Enabled = False
+        txtImpuestosYComisionesVenta.Enabled = False
+        txtMontoNetoCompra.Enabled = False
+        txtMontoNetoVenta.Enabled = False
+        txtPrecioSucioCompra.Enabled = False
+        txtPrecioSucioVenta.Enabled = False
+
+
+
+    End Sub
+
+    Private Sub dtgcomisiones_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    Private Sub TabPage4_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub dtgcomisiones_CellContentClick_1(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
+        Estado = "N"
+        btnAceptar.Text = "Nuevo"
+
+    End Sub
+
+    Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
+        Estado = "M"
+        btnAceptar.Text = "Modificar"
+
+    End Sub
+
+    Private Sub Button1_Click(sender As Object, e As EventArgs)
+        If (Estado = "N") Then
+            'RefrescarClaseEntidad()
+            NuevaAccion()
+        End If
+        If Estado = "M" Then
+            'ActualizarRegistro()
+
+        End If
+    End Sub
+
+    Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
+        Estado = "B"
+        btnAceptar.Text = "Eliminar"
+
+    End Sub
+
+    Private Sub btnAgregar_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub dgvDividendos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvDividendos.CellClick
+        ModificarFechaCorte()
+        PrepararCalculoDividendos(e.RowIndex)
+
+    End Sub
+
+    Sub ModificarFechaCorte()
+        If rdbPorcentaje.Checked Then
+
+
+            Dim Index As Integer = dgvDividendos.CurrentRow.Index
+            If dgvDividendos.Rows(Index).Cells("Fecha").ColumnIndex = dgvDividendos.CurrentCell.ColumnIndex Then
+
+                Dim FechaReferencia = dgvDividendos.Rows(Index).Cells("Fecha").Value
+
+                If (Not String.IsNullOrEmpty(FechaReferencia)) Then
+
+
+                    Dim año = FechaReferencia.Year
+                    Dim PrimeraFecha, SegundaFecha
+
+
+
+
+
+                    If (dgvDividendos.Rows(Index).Cells("FechaInicio").Value Is Nothing) Then
+                        PrimeraFecha = CDate("1/1/" + año.ToString)
+
+                    ElseIf (dgvDividendos.Rows(Index).Cells("FechaInicio").Value Is DBNull.Value) Then
+                        PrimeraFecha = CDate("1/1/" + año.ToString)
+
+                    Else
+                        PrimeraFecha = dgvDividendos.Rows(Index).Cells("FechaInicio").Value
+
+                    End If
+
+                    If (dgvDividendos.Rows(Index).Cells("FechaCorte").Value Is Nothing) Then
+                        SegundaFecha = CDate("31/12/" + año.ToString)
+
+                    ElseIf (dgvDividendos.Rows(Index).Cells("FechaCorte").Value Is DBNull.Value) Then
+                        SegundaFecha = CDate("31/12/" + año.ToString)
+                    Else
+                        SegundaFecha = dgvDividendos.Rows(Index).Cells("FechaCorte").Value
+                    End If
+
+
+
+                    Variables.FechaInicial = PrimeraFecha
+                    Variables.FechaCorte = SegundaFecha
+                    Variables.CorrelativoACC = dgvDividendos.Rows(Index).Cells("NumDiv").Value
+
+
+                    frmFechasAcciones.Show()
+
+
+
+                End If
+                Cierre = True
+            End If
+        End If
+    End Sub
+
+
+    Private Sub txtComisionPorcentajeCasaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorcentajeCasaCompra.TextChanged
+        RefrescarValorControles()
+
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorcentajeBolsaCompra.TextChanged
+        RefrescarValorControles()
+
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaVenta_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorcentajeCasaVenta.TextChanged
+        RefrescarValorControles()
+
+
+
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaVenta_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorcentajeBolsaVenta.TextChanged
+        RefrescarValorControles()
+
+
+    End Sub
+
+    Private Sub txtMontoNetoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtMontoNetoCompra.TextChanged
+
+    End Sub
+
+    Private Sub btnAgregarImpuesto_Click(sender As Object, e As EventArgs)
+        '    GuardarImpuesto()
+    End Sub
+
+    'Private Sub PrepararTablaImpuestos()
+    '   Dim cboColumna As DataGridViewComboBoxColumn
+    '    cboColumna = New DataGridViewComboBoxColumn
+    '     cboColumna.Name = "Valor"
+    '      cboColumna.HeaderText = "CodImp"
+    '       cboColumna.DataSource = oDAOGeneral.ListaImpuesto
+    'cboColumna.ValueMember = "CodImp"
+    'cboColumna.DisplayMember = "Descripcion"
+    ' cboColumna.DataPropertyName = "CodImp"
+    '  cboColumna.DisplayIndex = 1
+    '   Me.dgvImpuestos.Columns.Add(cboColumna)
+
+    'End Sub
+    'Sub GuardarImpuesto()
+    'Dim Impuesto = dgvImpuestos.CurrentRow.Cells(0).Value
+    'Dim CodigoInv = Variables.Codigo
+    '  Dim ValorImpuesto = ReportoConsula.TraerImpuesto(Impuesto)
+    ' Dim Valor = oDAOGeneral.AgregarImpuesto(CodigoInv, "ACC0", Impuesto, 0)
+    '  ActualizarImpuestos(Valor)
+    '   RefrescarValorControles()
+    'End Sub
+
+    ' Sub ModificarImpu(ByVal Impuesto As String)
+
+    ' Dim CodigoInv = Variables.Codigo
+    '  Dim ValorImpuesto = ReportoConsula.TraerImpuesto(Impuesto)
+    '  Dim Valor = oDAOGeneral.AgregarImpuesto(CodigoInv, "ACC0", Impuesto, 1)
+    '   ActualizarImpuestos(Valor)
+    '    RefrescarValorControles()
+    ' End Sub
+
+    ' Sub ActualizarImpuestos(ByVal Valor As Integer)
+    'If (Valor = 1) Then
+    '       dgvImpuestoAgregado.Rows.Clear()
+    '      CargarImpuestos()
+    'End If
+
+    'End Sub
+
+    Private Sub dgvImpuestoAgregado_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    'Sub CargarImpuestos()
+
+    'Try
+
+
+    'Dim codigo As String = Variables.Codigo
+    'Dim ListaImpuestos As String()
+    'Dim ClaveImpuesto
+
+    'Dim dr = oDAOGeneral.CargarImpuesto(codigo, "ACC0")
+    'While dr.Read
+    'If (Not String.IsNullOrEmpty(dr("Impuestos").ToString)) Then
+    '               ClaveImpuesto = dr("Impuestos")
+    '              ListaImpuestos = ClaveImpuesto.split("-")
+    'Else
+    '               ClaveImpuesto = String.Empty
+    'End If
+
+    'End While
+    'For Each i As String In ListaImpuestos
+    '           dgvImpuestoAgregado.Rows.Add(i)
+
+    'Next
+    'Catch ex As Exception
+
+    'End Try
+    'End Sub
+
+
+    ' Sub ModificarImpuestos()
+    'Dim Index As Integer = dgvImpuestoAgregado.CurrentRow.Index
+    'Dim Cantidad As Integer = dgvImpuestoAgregado.Rows.Count - 1
+    'Dim Cadena As String = String.Empty
+    'Dim IsNothing As Boolean = False
+
+
+    '   Cadena = dgvImpuestoAgregado.CurrentRow.Cells(0).Value
+    'If (String.IsNullOrEmpty(Cadena)) Then
+    '       MsgBox("No se puede quitar una cadena vacía")
+    'Else
+    '       ModificarImpu(Cadena)
+    'End If
+
+
+
+
+
+
+
+
+    'End Sub
+
+    Function ObtenerCodigosImpuestos()
+
+
+        Dim codigo As String = Variables.Codigo
+        Dim ListaImpuestos As String()
+        Dim ClaveImpuesto
+        Dim coleccion As New Collection
+        Dim dr = oDAOGeneral.CargarImpuesto(codigo, "ACC0")
+        While dr.Read
+            If (Not String.IsNullOrEmpty(dr("Impuestos").ToString)) Then
+                ClaveImpuesto = dr("Impuestos")
+                ListaImpuestos = ClaveImpuesto.split("-")
+            Else
+                ClaveImpuesto = String.Empty
+            End If
+
+        End While
+        For Each i As String In ListaImpuestos
+            coleccion.Add(i)
+        Next
+
+
+
+        Return coleccion
+    End Function
+    ' Sub AgregarCamposImpuestos()
+    '    Dim CodImp, code As New DataGridViewTextBoxColumn
+    '    CodImp.Name = "CodImp"
+    'dgvImpuestoAgregado.Columns.Add(CodImp)
+
+    '  End Sub
+
+    '********** FIN FUNCIONES **********
+
+    ' Function CalcularImpuesto()
+    'Dim Cargar As New Collection
+    'Dim CantidadFilas = dgvImpuestoAgregado.Rows.Count - 1
+    'Dim Val As String
+    'For i As Integer = 0 To CantidadFilas
+    '       Val = dgvImpuestoAgregado.Rows(i).Cells(0).Value
+    '      Cargar.Add(Val)
+    'Next
+    'Dim Cantidad As Double = 0
+    'Dim Impuestos As Dictionary(Of String, String) = oDAOGeneral.ObtenerImpuesto()
+    'For Each i In Cargar
+
+
+    'For Each valor In Impuestos
+    'If (valor.Key.ToString = i) Then
+    '               Cantidad = Cantidad + valor.Value
+
+    'End If
+    'Next
+
+    'Next
+    'Return Cantidad
+    'End Function
+
+    Private Sub btnQuitar_Click(sender As Object, e As EventArgs)
+        '   ModificarImpuestos()
+    End Sub
+
+    Private Sub dgvImpuestoAgregado_CellClick(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub BindingNavigator1_RefreshItems(sender As Object, e As EventArgs) Handles BindingNavigator1.RefreshItems
+
+    End Sub
+
+
+    Sub ValidarRentaIOF()
+        If (ChkIOF.Checked) Then
+            CalculosIOF()
+
+        Else
+
+            BloquearIOF()
+        End If
+
+        RefrescarValorControles()
+        If (ChkRenta.Checked) Then
+            CalculosRenta()
+        Else
+            BloquearRenta()
+        End If
+        RefrescarValorControles()
+
+    End Sub
+
+    Private Sub ChkIOF_CheckedChanged(sender As Object, e As EventArgs) Handles ChkIOF.CheckedChanged
+
+
+
+
+
+        If (ChkIOF.Checked) Then
+            oAccionesCE.IOF = 1
+            CalculosIOF()
+
+        Else
+            oAccionesCE.IOF = 0
+            BloquearIOF()
+        End If
+        RefrescarValorControles()
+    End Sub
+
+    Sub BloquearIOF()
+        lblCompra1.Visible = False
+        lblVenta1.Visible = False
+        txtIOFCompra.Text = String.Empty
+        txtIOFCompra.Visible = False
+        txtIOFVenta.Text = String.Empty
+        txtIOFVenta.Visible = False
+    End Sub
+
+    Sub CalculosIOF()
+        If (Not String.IsNullOrEmpty(txtValorTransadoCompra.Text) And Not String.IsNullOrEmpty(txtValorTransadoVenta.Text)) Then
+            lblCompra1.Visible = True
+            lblVenta1.Visible = True
+            txtIOFCompra.Visible = True
+            txtIOFVenta.Visible = True
+            Dim ValorTransadoCompra = txtValorTransadoCompra.Text
+            Dim ValorTransadoVenta = txtValorTransadoVenta.Text
+            txtIOFCompra.Text = CalculoImpuestos(ValorTransadoCompra, 0.0025)
+            txtIOFVenta.Text = CalculoImpuestos(ValorTransadoVenta, 0.0025)
+        End If
+    End Sub
+
+    Private Sub ChkRenta_CheckedChanged(sender As Object, e As EventArgs) Handles ChkRenta.CheckedChanged
+        If (ChkRenta.Checked) Then
+            oAccionesCE.Renta = 1
+            CalculosRenta()
+        Else
+            oAccionesCE.Renta = 0
+            BloquearRenta()
+        End If
+        RefrescarValorControles()
+    End Sub
+
+    Sub CalculosRenta()
+        If (Not String.IsNullOrEmpty(txtValorTransadoCompra.Text) And Not String.IsNullOrEmpty(txtValorTransadoVenta.Text)) Then
+
+            lblCompra2.Visible = True
+            lblVenta2.Visible = True
+            txtRentaVenta.Visible = True
+            txtRentaCompra.Visible = True
+            Dim ValorTransadoCompra = txtValorTransadoCompra.Text
+            Dim ValorTransadoVenta = txtValorTransadoVenta.Text
+            txtRentaCompra.Text = CalculoImpuestos(ValorTransadoCompra, 0.1)
+            txtRentaVenta.Text = CalculoImpuestos(ValorTransadoVenta, 0.1)
+
+        End If
+    End Sub
+    Sub BloquearRenta()
+        lblCompra2.Visible = False
+        lblVenta2.Visible = False
+        txtRentaCompra.Text = String.Empty
+        txtRentaCompra.Visible = False
+        txtRentaVenta.Text = String.Empty
+        txtRentaVenta.Visible = False
+    End Sub
+
+    Function CalculoImpuestos(ByVal ValorTransado As Double, ByVal Impuesto As Double)
+        Dim Valor = ValorTransado * Impuesto
+        Return Valor
+    End Function
+
+    Private Sub rdbEfectivo_CheckedChanged(sender As Object, e As EventArgs) Handles rdbEfectivo.CheckedChanged
+
+        If (rdbEfectivo.Checked) Then
+            LimpiarDividendosCambios(1)
+        Else
+            LimpiarDividendosCambios(2)
+        End If
+
+
+
+        CambiarBase()
+
+        CambioCalculo = True
+
+        CambioCalculo = False
+        If (Cargado) Then
+
+
+            RefrescarValorControles()
+
+        End If
+    End Sub
+
+
+
+    Private Sub rdbPorcentaje_CheckedChanged(sender As Object, e As EventArgs) Handles rdbPorcentaje.CheckedChanged
+
+        If (rdbEfectivo.Checked) Then
+            LimpiarDividendosCambios(1)
+        Else
+            LimpiarDividendosCambios(2)
+        End If
+        CambiarBase()
+        CambioCalculo = True
+
+        CambioCalculo = False
+        If (Cargado) Then
+            RefrescarValorControles()
+        End If
+
+    End Sub
+
+
+
+    Sub CambiarBase()
+        Dim Cantidad As Integer = dgvDividendos.Rows.Count - 1
+
+
+
+        For i As Integer = 0 To Cantidad
+
+
+
+            If (dgvDividendos.Rows(i).Cells("NumDiv").Value Is DBNull.Value) Then
+                Exit For
+            Else
+                If String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("NumDiv").Value) Then
+                    Exit For
+                End If
+            End If
+
+            If rdbEfectivo.Checked Then
+
+                If (String.IsNullOrEmpty(txtUnidadesCompra.Text)) Then
+                    dgvDividendos.Rows(i).Cells("CantidadBase").Value = 0.0
+                Else
+                    dgvDividendos.Rows(i).Cells("CantidadBase").Value = CDec(txtUnidadesCompra.Text)
+                End If
+            Else
+
+                If (String.IsNullOrEmpty(txtValorTransadoCompra.Text)) Then
+                    dgvDividendos.Rows(i).Cells("CantidadBase").Value = 0.0
+                Else
+                    dgvDividendos.Rows(i).Cells("CantidadBase").Value = CDec(txtValorTransadoCompra.Text)
+                End If
+
+            End If
+
+
+        Next
+
+        CalcularDividendos()
+    End Sub
+
+    Private Sub dgvDividendos_Click(sender As Object, e As EventArgs) Handles dgvDividendos.Click
+
+    End Sub
+
+
+
+    Sub ClonarDatos()
+
+        If (String.IsNullOrEmpty(txtUnidadesVenta.Text.ToString)) Then
+            txtUnidadesVenta.Text = txtUnidadesCompra.Text
+
+        End If
+    End Sub
+
+    Private Sub txtUnidadesCompra_Leave(sender As Object, e As EventArgs) Handles txtUnidadesCompra.Leave
+        ClonarDatos()
+        Formato()
+    End Sub
+
+    Private Sub rdbEfectivo_Click(sender As Object, e As EventArgs) Handles rdbEfectivo.Click
+
+    End Sub
+
+    Private Sub dgvDividendos_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvDividendos.CellDoubleClick
+        'If (dgvDividendos.Rows.Count = 1) Then
+
+
+
+        '    If (dgvDividendos.Rows(0).IsNewRow) Then
+        '        DobleClick = True
+        '        rdbEfectivo.Enabled = False
+        '        rdbPorcentaje.Enabled = False
+        '        TabPage1.Parent = Nothing
+        '    End If
+        'End If
+
+
+
+    End Sub
+
+    Private Sub txtPrecioLimpioCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioLimpioCompra.KeyPress
+        If String.IsNullOrEmpty(txtPrecioLimpioCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioLimpioCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioLimpioCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioLimpioVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioLimpioVenta.KeyPress
+        If String.IsNullOrEmpty(txtPrecioLimpioVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioLimpioVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioLimpioVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtUnidadesCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtUnidadesCompra.KeyPress
+        If String.IsNullOrEmpty(txtUnidadesCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtUnidadesCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtUnidadesCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtUnidadesVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtUnidadesVenta.KeyPress
+        If String.IsNullOrEmpty(txtUnidadesVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtUnidadesVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtUnidadesVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorcentajeCasaCompra.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorcentajeCasaCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorcentajeCasaCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorcentajeCasaCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorcentajeBolsaCompra.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorcentajeBolsaCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorcentajeBolsaCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorcentajeBolsaCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorcentajeCasaVenta.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorcentajeCasaVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorcentajeCasaVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorcentajeCasaVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorcentajeBolsaVenta.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorcentajeBolsaVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorcentajeBolsaVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorcentajeBolsaVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
+
+    End Sub
+
+    Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
+
+    End Sub
+
+    Private Sub TabPage1_Click(sender As Object, e As EventArgs) Handles TbOperacion.Click
+
+    End Sub
+
+    Private Sub txtGananciaCapitalTotalVenta_TextChanged(sender As Object, e As EventArgs) Handles txtGananciaCapitalTotalVenta.TextChanged
+
+    End Sub
+
+    Private Sub txtDiasDeTenenciaVenta_TextChanged(sender As Object, e As EventArgs) Handles txtDiasDeTenenciaVenta.TextChanged
+
+    End Sub
+
+    Private Sub Label9_Click(sender As Object, e As EventArgs) Handles Label9.Click
+
+    End Sub
+
+    Private Sub Label6_Click(sender As Object, e As EventArgs) Handles Label6.Click
+
+    End Sub
+
+    Private Sub txtIOFCompra_TextChanged(sender As Object, e As EventArgs) Handles txtIOFCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtRentaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtRentaCompra.TextChanged
+
+    End Sub
+
+    Private Sub CalcularDividendos()
+        Dim Cantidad As Integer = dgvDividendos.Rows.Count - 2
+
+        For i As Integer = 0 To Cantidad
+            If (String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("Dividendo").Value)) Then
+                dgvDividendos.Rows(i).Cells("Dividendo").Value = 0
+            End If
+            If rdbEfectivo.Checked Then
+
+                If (String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("Dividendo").Value)) Then
+                    dgvDividendos.Rows(i).Cells("Dividendo").Value = 0
+                End If
+
+
+
+
+
+            End If
+            Dim Dividendos As Double = dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString.Trim("%")
+            Dim Porcentaje As Double = dgvDividendos.Rows(i).Cells("PorcISR").Value
+            Dim Valor = dgvDividendos.Rows(i).Cells("CantidadBase").Value
+
+
+            If rdbEfectivo.Checked Then
+                Dim CalculoIB = CalculoIngresoBrutoEfectivo(Valor, Dividendos)
+
+
+                Dim CalculoRenta = CalculoIB * Porcentaje
+                Dim CalculoIN = CalculoIB - CalculoRenta
+                dgvDividendos.Rows(i).Cells("IngresoBruto").Value = CalculoIB
+                dgvDividendos.Rows(i).Cells("ISR").Value = CalculoRenta
+                dgvDividendos.Rows(i).Cells("IngresoNeto").Value = CalculoIN
+
+            Else
+                If (dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString.IndexOf("%") = -1) Then
+                    dgvDividendos.Rows(i).Cells("Dividendo").Value = dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString + "%"
+                End If
+                Dim Dias As Integer = 0
+                Dim FechaInicialCorte As Date = Date.Now.Date
+                Dim FechaCorteCorte As Date = Date.Now.Date
+
+                If (dgvDividendos.Rows(i).Cells("FechaInicio").Value IsNot DBNull.Value And dgvDividendos.Rows(i).Cells("FechaCorte").Value IsNot DBNull.Value) Then
+                    If (Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("FechaInicio").Value) And Not String.IsNullOrEmpty(dgvDividendos.Rows(i).Cells("FechaCorte").Value)) Then
+
+                        FechaInicialCorte = dgvDividendos.Rows(i).Cells("FechaInicio").Value
+                        FechaCorteCorte = dgvDividendos.Rows(i).Cells("FechaCorte").Value
+
+                        Dias = DateDiff(DateInterval.Day, FechaInicialCorte, FechaCorteCorte)
+                        Dias += 1
+
+                        Dim CalculoIBP = CalculoIngresoBrutoPorcentaje(Valor, Dividendos, Dias, FechaInicialCorte)
+
+
+
+                        Dim CalculoRenta = CalculoIBP * Porcentaje
+                        Dim CalculoIN = CalculoIBP - CalculoRenta
+
+
+
+                        dgvDividendos.Rows(i).Cells("IngresoBruto").Value = CalculoIBP
+                        dgvDividendos.Rows(i).Cells("ISR").Value = CalculoRenta
+                        dgvDividendos.Rows(i).Cells("IngresoNeto").Value = CalculoIN
+
+                    End If
+
+                End If
+            End If
+        Next
+        CorrelativoSinBD()
+    End Sub
+
+    Public Sub btnActualizar_Click(sender As Object, e As EventArgs) Handles btnActualizar.Click
+
+        AgregarFechaCO()
+        CalcularDividendos()
+    End Sub
+
+    Private Sub TabPage3_Click(sender As Object, e As EventArgs) Handles TbDividendos.Click
+
+    End Sub
+
+    Sub LimpiarDividendosCambios(ByVal Calculo As Integer)
+        Dim Cantidad As Integer = dgvDividendos.Rows.Count - 2
+        For i As Integer = 0 To Cantidad
+
+            If (Calculo = 1) Then
+                If (Not dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString.IndexOf("%") = -1) Then
+                    dgvDividendos.Rows(i).Cells("Dividendo").Value = dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString.ToString.Trim("%")
+                End If
+            Else
+                If (dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString.IndexOf("%") = -1) Then
+                    dgvDividendos.Rows(i).Cells("Dividendo").Value = dgvDividendos.Rows(i).Cells("Dividendo").Value.ToString + "%"
+
+                End If
+            End If
+
+
+
+            dgvDividendos.Rows(i).Cells("IngresoBruto").Value = 0
+            dgvDividendos.Rows(i).Cells("ISR").Value = 0
+            dgvDividendos.Rows(i).Cells("IngresoNeto").Value = 0
+        Next
+    End Sub
+
+
+
+    Sub CargarDividendos()
+        Dim Codigo As String = Variables.Codigo
+        Dim dr = oAccionesDAO.CargarDividendo(Codigo)
+
+        While dr.Read
+
+            dgvDividendos.Rows.Add("", "", dr("Fecha"), dr("Dividendo"), dr("CantidadBase"), dr("IngresoBruto"), dr("PorcISR"), dr("ISR"), dr("IngresoNeto"), "", dr("FechaInicio"), dr("FechaCorte"), dr("NumDiv"))
+
+
+
+
+        End While
+    End Sub
+
+    Private Sub btnGenerarAccion_Click(sender As Object, e As EventArgs) Handles btnAsociarAccion.Click
+        GenerarAccion()
+    End Sub
+
+    Sub GenerarAccion()
+        Dim result As Integer = MsgBox("¿Está seguro de Asociar acciones?", MsgBoxStyle.OkCancel)
+        ' Test result.
+        If result = MsgBoxResult.Ok Then
+            ' Get the file name.
+            Dim frmAsociaciones As New frmAsociarAcciones
+
+            frmAsociaciones.Show()
+
+        End If
+    End Sub
+
+    Private Sub dgvDividendos_CellMouseMove(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgvDividendos.CellMouseMove
+        If Cierre Then
+
+            AgregarFechaCO()
+            CalcularDividendos()
+            Cierre = False
+        End If
+    End Sub
+
+    Private Sub dgvDividendos_MouseMove(sender As Object, e As MouseEventArgs) Handles dgvDividendos.MouseMove
+        If Cierre Then
+
+            AgregarFechaCO()
+            CalcularDividendos()
+            Cierre = False
+        End If
+    End Sub
+
+    Private Sub btnQuitar_Click_1(sender As Object, e As EventArgs) Handles btnQuitar.Click
+        QuitarFila()
+        CorrelativoSinBD()
+    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
+        Dim Numero As Integer = dgvDividendos.CurrentRow.Cells("NumDiv").Value
+        If result = MsgBoxResult.Ok Then
+            Try
+                dgvDividendos.Rows.Remove(dgvDividendos.CurrentRow)
+                oAccionesDAO.EliminarElemenoInd(codigo, Numero)
+            Catch ex As Exception
+                MsgBox("No ha seleccionado una fila")
+            End Try
+
+
+
+        End If
+
+
+
+
+
+    End Sub
+
+    Private Sub txtPrecioSucioVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioSucioVenta.TextChanged
+
+    End Sub
+
+    Private Sub txtPrecioLimpioCompra_Leave(sender As Object, e As EventArgs) Handles txtPrecioLimpioCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaCompra_Leave(sender As Object, e As EventArgs) Handles txtComisionPorcentajeCasaCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaCompra_Leave(sender As Object, e As EventArgs) Handles txtComisionPorcentajeBolsaCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPrecioLimpioVenta_Leave(sender As Object, e As EventArgs) Handles txtPrecioLimpioVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtUnidadesVenta_Leave(sender As Object, e As EventArgs) Handles txtUnidadesVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaVenta_Leave(sender As Object, e As EventArgs) Handles txtComisionPorcentajeCasaVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaVenta_Leave(sender As Object, e As EventArgs) Handles txtComisionPorcentajeBolsaVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub frmAcciones_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize
+        Redimencionar()
+    End Sub
+
+    Private Sub txtPrecioLimpioCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioLimpioCompra.KeyUp
+        If txtPrecioLimpioCompra.Text = "." Then
+            txtPrecioLimpioCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtUnidadesCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtUnidadesCompra.KeyUp
+        If txtUnidadesCompra.Text = "." Then
+            txtUnidadesCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorcentajeCasaCompra.KeyUp
+        If txtComisionPorcentajeCasaCompra.Text = "." Then
+            txtComisionPorcentajeCasaCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorcentajeBolsaCompra.KeyUp
+        If txtComisionPorcentajeBolsaCompra.Text = "." Then
+            txtComisionPorcentajeBolsaCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPrecioLimpioVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioLimpioVenta.KeyUp
+        If txtPrecioLimpioVenta.Text = "." Then
+            txtPrecioLimpioVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtUnidadesVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtUnidadesVenta.KeyUp
+        If txtUnidadesVenta.Text = "." Then
+            txtUnidadesVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeCasaVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorcentajeCasaVenta.KeyUp
+        If txtComisionPorcentajeCasaVenta.Text = "." Then
+            txtComisionPorcentajeCasaVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorcentajeBolsaVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorcentajeBolsaVenta.KeyUp
+        If txtComisionPorcentajeBolsaVenta.Text = "." Then
+            txtComisionPorcentajeBolsaVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub btnVenta_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+
+    Private Sub txtValorTransadoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtValorTransadoCompra.TextChanged
+
+    End Sub
+
+
+    Sub CargarTransladoNuevo()
+        Dim Existe As Boolean = ExisteInversion()
+        If CantFormAbierto = False Then
+            If Not RetCodigoInversionExiste And Not Existe Then
+                Dim TipoTransaccionCompraVenta As String = Variables.TipoTransaccionCompraVenta
+                If TipoTransaccionCompraVenta = "C" Then
+                    txtPrecioLimpioCompra.Text = Variables.RetPrecio
+                    txtUnidadesCompra.Text = Variables.RetUnidadesAcciones
+                ElseIf TipoTransaccionCompraVenta = "V" Then
+                    txtPrecioLimpioVenta.Text = Variables.RetPrecio
+                    txtUnidadesVenta.Text = Variables.RetUnidadesAcciones
+                End If
+            End If
+        End If
+    End Sub
+
+    Private Sub btnVenderTitulo_Click(sender As Object, e As EventArgs) Handles btnVenderTitulo.Click
+        If Variables.InvocadorProInv = "frmINV" Then
+            Dim TrasladarDatos As New TrasladarDatosCMVTA
+            Dim General As New DAOGeneral
+            Dim Codigo = Variables.Codigo
+            Dim Tabla As String = "INV0"
+            Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+            TrasladarDatos = RellenarDatosCMVTA()
+            If Existe Then
+                Dim CodigoInversion As String = Variables.Codigo
+                Dim frmPINVCMVTA As New frmPIN("V", CodigoInversion, TrasladarDatos)
+                frmINV.Close()
+                Me.Close()
+                frmPINVCMVTA.ShowDialog()
+            End If
+        End If
+    End Sub
+
+
+    Function RellenarDatosCMVTA()
+        Dim TrasladarDatos As New TrasladarDatosCMVTA
+        TrasladarDatos.FechaOperacionACC = Operaciones.ConvertirFecha(dtpFechaOperacionCompra.Value.ToString)
+        TrasladarDatos.FechaVencimientoACC = Operaciones.ConvertirFecha(dtpFechaVencimientoCompra.Value.ToString)
+        TrasladarDatos.PrecioLimpioACC = Operaciones.ConvertirDecimal(txtPrecioLimpioCompra.Text.ToString)
+        TrasladarDatos.UnidadesACC = Operaciones.ConvertirEntero(txtUnidadesCompra.Text.ToString)
+        TrasladarDatos.PorcentajeBolsaACC = Operaciones.ConvertirDecimal(txtComisionPorcentajeBolsaCompra.Text.ToString)
+        TrasladarDatos.PorcentajeCasaACC = Operaciones.ConvertirDecimal(txtComisionPorcentajeCasaCompra.Text.ToString)
+        TrasladarDatos.NombreInstrumento = "ACC"
+        TrasladarDatos.AgregarCMVTA = True
+        Return TrasladarDatos
+    End Function
+End Class

+ 52 - 0
FRM/frmActualizar.Designer.vb

@@ -0,0 +1,52 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class frmActualizar
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.dgvActualizar = New System.Windows.Forms.DataGridView()
+        CType(Me.dgvActualizar, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.SuspendLayout()
+        '
+        'dgvActualizar
+        '
+        Me.dgvActualizar.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvActualizar.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.dgvActualizar.Location = New System.Drawing.Point(0, 0)
+        Me.dgvActualizar.Name = "dgvActualizar"
+        Me.dgvActualizar.Size = New System.Drawing.Size(772, 334)
+        Me.dgvActualizar.TabIndex = 0
+        '
+        'frmActualizar
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.ClientSize = New System.Drawing.Size(772, 334)
+        Me.Controls.Add(Me.dgvActualizar)
+        Me.Name = "frmActualizar"
+        Me.Text = "frmActualizar"
+        CType(Me.dgvActualizar, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.ResumeLayout(False)
+
+    End Sub
+
+    Friend WithEvents dgvActualizar As DataGridView
+End Class

+ 120 - 0
FRM/frmActualizar.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 13 - 0
FRM/frmActualizar.vb

@@ -0,0 +1,13 @@
+Public Class frmActualizar
+    Private Sub frmActualizar_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        CargarRegistroBD()
+    End Sub
+    Private Sub CargarRegistroBD()
+        Dim oAccionesCE As AccionesCE = New AccionesCE
+
+        Dim CodigoInversion As String = Variables.Codigo
+        Dim oAccionesDAO As New AccionesDAO
+        Dim dt As DataTable = oAccionesDAO.CargarRegistroActualizar()
+        dgvActualizar.DataSource = dt
+    End Sub
+End Class

+ 160 - 0
FRM/frmAsociarAcciones.Designer.vb

@@ -0,0 +1,160 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class frmAsociarAcciones
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.components = New System.ComponentModel.Container()
+        Me.lblTitulo = New System.Windows.Forms.Label()
+        Me.cboCodigo = New System.Windows.Forms.ComboBox()
+        Me.InversionesDEVDataSet1 = New Inversiones.InversionesDEVDataSet1()
+        Me.InversionesDEVDataSet = New Inversiones.InversionesDEVDataSet()
+        Me.INV0BindingSource = New System.Windows.Forms.BindingSource(Me.components)
+        Me.INV0TableAdapter = New Inversiones.InversionesDEVDataSetTableAdapters.INV0TableAdapter()
+        Me.INV0BindingSource1 = New System.Windows.Forms.BindingSource(Me.components)
+        Me.INV0TableAdapter1 = New Inversiones.InversionesDEVDataSet1TableAdapters.INV0TableAdapter()
+        Me.txtCodigo = New System.Windows.Forms.TextBox()
+        Me.btnAceptar = New System.Windows.Forms.Button()
+        Me.btnEliminar = New System.Windows.Forms.Button()
+        Me.RichTextBox1 = New System.Windows.Forms.RichTextBox()
+        CType(Me.InversionesDEVDataSet1, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.InversionesDEVDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.INV0BindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.INV0BindingSource1, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.SuspendLayout()
+        '
+        'lblTitulo
+        '
+        Me.lblTitulo.AutoSize = True
+        Me.lblTitulo.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblTitulo.Location = New System.Drawing.Point(79, 9)
+        Me.lblTitulo.Name = "lblTitulo"
+        Me.lblTitulo.Size = New System.Drawing.Size(159, 24)
+        Me.lblTitulo.TabIndex = 81
+        Me.lblTitulo.Text = "Asociar Acciones"
+        '
+        'cboCodigo
+        '
+        Me.cboCodigo.DataSource = Me.InversionesDEVDataSet1
+        Me.cboCodigo.DisplayMember = "INV0.CodInv"
+        Me.cboCodigo.FormattingEnabled = True
+        Me.cboCodigo.Location = New System.Drawing.Point(88, 50)
+        Me.cboCodigo.Name = "cboCodigo"
+        Me.cboCodigo.Size = New System.Drawing.Size(130, 21)
+        Me.cboCodigo.TabIndex = 82
+        Me.cboCodigo.ValueMember = "INV0.CodInv"
+        '
+        'InversionesDEVDataSet1
+        '
+        Me.InversionesDEVDataSet1.DataSetName = "InversionesDEVDataSet1"
+        Me.InversionesDEVDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
+        '
+        'InversionesDEVDataSet
+        '
+        Me.InversionesDEVDataSet.DataSetName = "InversionesDEVDataSet"
+        Me.InversionesDEVDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
+        '
+        'INV0BindingSource
+        '
+        Me.INV0BindingSource.DataMember = "INV0"
+        Me.INV0BindingSource.DataSource = Me.InversionesDEVDataSet
+        '
+        'INV0TableAdapter
+        '
+        Me.INV0TableAdapter.ClearBeforeFill = True
+        '
+        'INV0BindingSource1
+        '
+        Me.INV0BindingSource1.DataMember = "INV0"
+        Me.INV0BindingSource1.DataSource = Me.InversionesDEVDataSet1
+        '
+        'INV0TableAdapter1
+        '
+        Me.INV0TableAdapter1.ClearBeforeFill = True
+        '
+        'txtCodigo
+        '
+        Me.txtCodigo.Location = New System.Drawing.Point(86, 89)
+        Me.txtCodigo.Name = "txtCodigo"
+        Me.txtCodigo.Size = New System.Drawing.Size(130, 20)
+        Me.txtCodigo.TabIndex = 83
+        '
+        'btnAceptar
+        '
+        Me.btnAceptar.Location = New System.Drawing.Point(33, 236)
+        Me.btnAceptar.Name = "btnAceptar"
+        Me.btnAceptar.Size = New System.Drawing.Size(82, 37)
+        Me.btnAceptar.TabIndex = 84
+        Me.btnAceptar.Text = "Aceptar"
+        Me.btnAceptar.UseVisualStyleBackColor = True
+        '
+        'btnEliminar
+        '
+        Me.btnEliminar.Location = New System.Drawing.Point(189, 236)
+        Me.btnEliminar.Name = "btnEliminar"
+        Me.btnEliminar.Size = New System.Drawing.Size(77, 37)
+        Me.btnEliminar.TabIndex = 85
+        Me.btnEliminar.Text = "Eliminar"
+        Me.btnEliminar.UseVisualStyleBackColor = True
+        '
+        'RichTextBox1
+        '
+        Me.RichTextBox1.Location = New System.Drawing.Point(12, 115)
+        Me.RichTextBox1.Name = "RichTextBox1"
+        Me.RichTextBox1.Size = New System.Drawing.Size(314, 96)
+        Me.RichTextBox1.TabIndex = 86
+        Me.RichTextBox1.Text = ""
+        '
+        'frmAsociarAcciones
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.ClientSize = New System.Drawing.Size(338, 305)
+        Me.Controls.Add(Me.RichTextBox1)
+        Me.Controls.Add(Me.btnEliminar)
+        Me.Controls.Add(Me.btnAceptar)
+        Me.Controls.Add(Me.txtCodigo)
+        Me.Controls.Add(Me.cboCodigo)
+        Me.Controls.Add(Me.lblTitulo)
+        Me.Name = "frmAsociarAcciones"
+        Me.Text = "frmAsociarAcciones"
+        CType(Me.InversionesDEVDataSet1, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.InversionesDEVDataSet, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.INV0BindingSource, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.INV0BindingSource1, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.ResumeLayout(False)
+        Me.PerformLayout()
+
+    End Sub
+
+    Friend WithEvents lblTitulo As Label
+    Friend WithEvents cboCodigo As ComboBox
+    Friend WithEvents InversionesDEVDataSet As InversionesDEVDataSet
+    Friend WithEvents INV0BindingSource As BindingSource
+    Friend WithEvents INV0TableAdapter As InversionesDEVDataSetTableAdapters.INV0TableAdapter
+    Friend WithEvents InversionesDEVDataSet1 As InversionesDEVDataSet1
+    Friend WithEvents INV0BindingSource1 As BindingSource
+    Friend WithEvents INV0TableAdapter1 As InversionesDEVDataSet1TableAdapters.INV0TableAdapter
+    Friend WithEvents txtCodigo As TextBox
+    Friend WithEvents btnAceptar As Button
+    Friend WithEvents btnEliminar As Button
+    Friend WithEvents RichTextBox1 As RichTextBox
+End Class

+ 138 - 0
FRM/frmAsociarAcciones.resx

@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="InversionesDEVDataSet1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>504, 17</value>
+  </metadata>
+  <metadata name="InversionesDEVDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="INV0BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>195, 17</value>
+  </metadata>
+  <metadata name="INV0TableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>352, 17</value>
+  </metadata>
+  <metadata name="INV0BindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 56</value>
+  </metadata>
+  <metadata name="INV0TableAdapter1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>181, 56</value>
+  </metadata>
+</root>

+ 17 - 0
FRM/frmAsociarAcciones.vb

@@ -0,0 +1,17 @@
+Public Class frmAsociarAcciones
+    Private Sub frmAsociarAcciones_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet1.INV0' Puede moverla o quitarla según sea necesario.
+        Me.INV0TableAdapter1.Fill(Me.InversionesDEVDataSet1.INV0)
+        'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet.INV0' Puede moverla o quitarla según sea necesario.
+        Me.INV0TableAdapter.Fill(Me.InversionesDEVDataSet.INV0)
+
+    End Sub
+
+    Private Sub txtCodigo_TextChanged(sender As Object, e As EventArgs) Handles txtCodigo.TextChanged
+
+    End Sub
+
+    Private Sub cboCodigo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCodigo.SelectedIndexChanged
+        txtCodigo.Text = cboCodigo.SelectedValue
+    End Sub
+End Class

+ 1380 - 0
FRM/frmBonos.Designer.vb

@@ -0,0 +1,1380 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
+Partial Class frmBonos
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()>
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()>
+    Private Sub InitializeComponent()
+        Me.components = New System.ComponentModel.Container()
+        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmBonos))
+        Me.Label1 = New System.Windows.Forms.Label()
+        Me.Label2 = New System.Windows.Forms.Label()
+        Me.Label3 = New System.Windows.Forms.Label()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.Label6 = New System.Windows.Forms.Label()
+        Me.Label7 = New System.Windows.Forms.Label()
+        Me.Label8 = New System.Windows.Forms.Label()
+        Me.Label9 = New System.Windows.Forms.Label()
+        Me.Label10 = New System.Windows.Forms.Label()
+        Me.Label11 = New System.Windows.Forms.Label()
+        Me.Label12 = New System.Windows.Forms.Label()
+        Me.Label13 = New System.Windows.Forms.Label()
+        Me.Label16 = New System.Windows.Forms.Label()
+        Me.Label18 = New System.Windows.Forms.Label()
+        Me.Label19 = New System.Windows.Forms.Label()
+        Me.Label20 = New System.Windows.Forms.Label()
+        Me.Label21 = New System.Windows.Forms.Label()
+        Me.dtpUltimaFechaCuponCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpSiguienteFechaCuponCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaLiquidacionCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaVencimientoCompra = New System.Windows.Forms.DateTimePicker()
+        Me.txtValorNominalCompra = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeCuponCompra = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoComisionCompra = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioCompra = New System.Windows.Forms.TextBox()
+        Me.txtDiasAcumuladosCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioCompra = New System.Windows.Forms.TextBox()
+        Me.txtInteresAcumuladoCompra = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeInteresAcumuladoCompra = New System.Windows.Forms.TextBox()
+        Me.txtValorTransadoCompra = New System.Windows.Forms.TextBox()
+        Me.txtMontoAPagar = New System.Windows.Forms.TextBox()
+        Me.txtCostoTransferenciaCompra = New System.Windows.Forms.TextBox()
+        Me.txtDiasAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.Label17 = New System.Windows.Forms.Label()
+        Me.lblBono = New System.Windows.Forms.Label()
+        Me.txtDiasAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtCostoTransferenciaVenta = New System.Windows.Forms.TextBox()
+        Me.txtMontoARecibir = New System.Windows.Forms.TextBox()
+        Me.txtValorTransadoVenta = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeInteresAcumuladoVenta = New System.Windows.Forms.TextBox()
+        Me.txtInteresAcumuladoVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioVenta = New System.Windows.Forms.TextBox()
+        Me.txtDiasAcumuladosVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoComisionVenta = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeCuponVenta = New System.Windows.Forms.TextBox()
+        Me.txtValorNominalVenta = New System.Windows.Forms.TextBox()
+        Me.dtpFechaVencimientoVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaLiquidacionVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpSiguienteFechaCuponVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpUltimaFechaCuponVenta = New System.Windows.Forms.DateTimePicker()
+        Me.Label22 = New System.Windows.Forms.Label()
+        Me.Label23 = New System.Windows.Forms.Label()
+        Me.Label24 = New System.Windows.Forms.Label()
+        Me.Label25 = New System.Windows.Forms.Label()
+        Me.Label26 = New System.Windows.Forms.Label()
+        Me.label27 = New System.Windows.Forms.Label()
+        Me.lblIngresosPorIntereses_Op = New System.Windows.Forms.Label()
+        Me.lblCostosTotales_Op = New System.Windows.Forms.Label()
+        Me.lblGananciaPerdidaTotal_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoGananciaPerdida_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoIntereses_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoAntesISR_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoDespuesISR_Op = New System.Windows.Forms.Label()
+        Me.Label35 = New System.Windows.Forms.Label()
+        Me.txtValorNominal_Op = New System.Windows.Forms.TextBox()
+        Me.txtPlazo_Op = New System.Windows.Forms.TextBox()
+        Me.txtPrecioCompra_Op = New System.Windows.Forms.TextBox()
+        Me.txtPrecioVenta_Op = New System.Windows.Forms.TextBox()
+        Me.txtGananciaPerdidaCapital_Op = New System.Windows.Forms.TextBox()
+        Me.txtIngresosPorIntereses_Op = New System.Windows.Forms.TextBox()
+        Me.txtCostosTotales_Op = New System.Windows.Forms.TextBox()
+        Me.txtGananciaPerdidaTotal_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoGananciaPerdida_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoIntereses_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoAntesISR_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoDespuesISR_Op = New System.Windows.Forms.TextBox()
+        Me.btnAceptar = New System.Windows.Forms.Button()
+        Me.btnCancelar = New System.Windows.Forms.Button()
+        Me.cboAnioBaseC = New System.Windows.Forms.ComboBox()
+        Me.cboAnioBaseV = New System.Windows.Forms.ComboBox()
+        Me.cboPeriodosC = New System.Windows.Forms.ComboBox()
+        Me.cboPeriodosV = New System.Windows.Forms.ComboBox()
+        Me.Label29 = New System.Windows.Forms.Label()
+        Me.Label30 = New System.Windows.Forms.Label()
+        Me.TabControl1 = New System.Windows.Forms.TabControl()
+        Me.TabPage1 = New System.Windows.Forms.TabPage()
+        Me.btnBolsaVenta = New System.Windows.Forms.TextBox()
+        Me.btnCasaVenta = New System.Windows.Forms.TextBox()
+        Me.btnBolsaCompra = New System.Windows.Forms.TextBox()
+        Me.btnCasaCompra = New System.Windows.Forms.TextBox()
+        Me.btnPorcentajeBolsaVenta = New System.Windows.Forms.TextBox()
+        Me.btnPorcentajeCasaVenta = New System.Windows.Forms.TextBox()
+        Me.btnPorcentajeBolsaCompra = New System.Windows.Forms.TextBox()
+        Me.btnPorcentajeCasaCompra = New System.Windows.Forms.TextBox()
+        Me.Label15 = New System.Windows.Forms.Label()
+        Me.Label14 = New System.Windows.Forms.Label()
+        Me.TabPage2 = New System.Windows.Forms.TabPage()
+        Me.btnAccionIngreso = New System.Windows.Forms.Button()
+        Me.dgvIngresos = New System.Windows.Forms.DataGridView()
+        Me.TabPage4 = New System.Windows.Forms.TabPage()
+        Me.pnlPie = New System.Windows.Forms.Panel()
+        Me.BindingNavigator1 = New System.Windows.Forms.BindingNavigator(Me.components)
+        Me.BindingNavigatorSeparator = New System.Windows.Forms.ToolStripSeparator()
+        Me.navModificar = New System.Windows.Forms.ToolStripButton()
+        Me.navNuevo = New System.Windows.Forms.ToolStripButton()
+        Me.navEliminar = New System.Windows.Forms.ToolStripButton()
+        Me.TabControl1.SuspendLayout()
+        Me.TabPage1.SuspendLayout()
+        Me.TabPage2.SuspendLayout()
+        CType(Me.dgvIngresos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.TabPage4.SuspendLayout()
+        Me.pnlPie.SuspendLayout()
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.BindingNavigator1.SuspendLayout()
+        Me.SuspendLayout()
+        '
+        'Label1
+        '
+        Me.Label1.AutoSize = True
+        Me.Label1.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label1.Location = New System.Drawing.Point(20, 73)
+        Me.Label1.Name = "Label1"
+        Me.Label1.Size = New System.Drawing.Size(88, 18)
+        Me.Label1.TabIndex = 0
+        Me.Label1.Text = "Valor Nominal"
+        '
+        'Label2
+        '
+        Me.Label2.AutoSize = True
+        Me.Label2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label2.Location = New System.Drawing.Point(20, 95)
+        Me.Label2.Name = "Label2"
+        Me.Label2.Size = New System.Drawing.Size(142, 18)
+        Me.Label2.TabIndex = 1
+        Me.Label2.Text = "Ultima Fecha de Cupon"
+        '
+        'Label3
+        '
+        Me.Label3.AutoSize = True
+        Me.Label3.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label3.Location = New System.Drawing.Point(20, 117)
+        Me.Label3.Name = "Label3"
+        Me.Label3.Size = New System.Drawing.Size(159, 18)
+        Me.Label3.TabIndex = 2
+        Me.Label3.Text = "Siguiente Fecha de Cupon"
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label4.Location = New System.Drawing.Point(20, 139)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(131, 18)
+        Me.Label4.TabIndex = 3
+        Me.Label4.Text = "Fecha de Liquidacion"
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label5.Location = New System.Drawing.Point(20, 161)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(136, 18)
+        Me.Label5.TabIndex = 4
+        Me.Label5.Text = "Fecha de Vencimiento"
+        '
+        'Label6
+        '
+        Me.Label6.AutoSize = True
+        Me.Label6.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label6.Location = New System.Drawing.Point(20, 250)
+        Me.Label6.Name = "Label6"
+        Me.Label6.Size = New System.Drawing.Size(56, 18)
+        Me.Label6.TabIndex = 5
+        Me.Label6.Text = "Cupon %"
+        '
+        'Label7
+        '
+        Me.Label7.AutoSize = True
+        Me.Label7.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label7.Location = New System.Drawing.Point(20, 294)
+        Me.Label7.Name = "Label7"
+        Me.Label7.Size = New System.Drawing.Size(182, 18)
+        Me.Label7.TabIndex = 6
+        Me.Label7.Text = "YTM Al Vencimiento Comision"
+        '
+        'Label8
+        '
+        Me.Label8.AutoSize = True
+        Me.Label8.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
+        Me.Label8.Location = New System.Drawing.Point(20, 272)
+        Me.Label8.Name = "Label8"
+        Me.Label8.Size = New System.Drawing.Size(124, 18)
+        Me.Label8.TabIndex = 7
+        Me.Label8.Text = "YTM Al vencimiento"
+        '
+        'Label9
+        '
+        Me.Label9.AutoSize = True
+        Me.Label9.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label9.Location = New System.Drawing.Point(20, 382)
+        Me.Label9.Name = "Label9"
+        Me.Label9.Size = New System.Drawing.Size(134, 18)
+        Me.Label9.TabIndex = 8
+        Me.Label9.Text = "Precio al Vencimiento"
+        '
+        'Label10
+        '
+        Me.Label10.AutoSize = True
+        Me.Label10.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label10.ForeColor = System.Drawing.SystemColors.ControlText
+        Me.Label10.Location = New System.Drawing.Point(20, 404)
+        Me.Label10.Name = "Label10"
+        Me.Label10.Size = New System.Drawing.Size(133, 18)
+        Me.Label10.TabIndex = 9
+        Me.Label10.Text = "Precio Compra/Venta"
+        '
+        'Label11
+        '
+        Me.Label11.AutoSize = True
+        Me.Label11.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label11.Location = New System.Drawing.Point(20, 183)
+        Me.Label11.Name = "Label11"
+        Me.Label11.Size = New System.Drawing.Size(74, 18)
+        Me.Label11.TabIndex = 10
+        Me.Label11.Text = "Base (Dias)"
+        '
+        'Label12
+        '
+        Me.Label12.AutoSize = True
+        Me.Label12.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label12.Location = New System.Drawing.Point(20, 228)
+        Me.Label12.Name = "Label12"
+        Me.Label12.Size = New System.Drawing.Size(106, 18)
+        Me.Label12.TabIndex = 11
+        Me.Label12.Text = "Dias Acumulados"
+        '
+        'Label13
+        '
+        Me.Label13.AutoSize = True
+        Me.Label13.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label13.Location = New System.Drawing.Point(20, 206)
+        Me.Label13.Name = "Label13"
+        Me.Label13.Size = New System.Drawing.Size(123, 18)
+        Me.Label13.TabIndex = 12
+        Me.Label13.Text = "Dias al Vencimiento"
+        '
+        'Label16
+        '
+        Me.Label16.AutoSize = True
+        Me.Label16.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label16.Location = New System.Drawing.Point(20, 426)
+        Me.Label16.Name = "Label16"
+        Me.Label16.Size = New System.Drawing.Size(116, 18)
+        Me.Label16.TabIndex = 15
+        Me.Label16.Text = "Interes Acumulado"
+        '
+        'Label18
+        '
+        Me.Label18.AutoSize = True
+        Me.Label18.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label18.Location = New System.Drawing.Point(20, 448)
+        Me.Label18.Name = "Label18"
+        Me.Label18.Size = New System.Drawing.Size(91, 18)
+        Me.Label18.TabIndex = 17
+        Me.Label18.Text = "Precio Sucio %"
+        '
+        'Label19
+        '
+        Me.Label19.AutoSize = True
+        Me.Label19.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label19.Location = New System.Drawing.Point(20, 470)
+        Me.Label19.Name = "Label19"
+        Me.Label19.Size = New System.Drawing.Size(95, 18)
+        Me.Label19.TabIndex = 18
+        Me.Label19.Text = "Valor Transado"
+        '
+        'Label20
+        '
+        Me.Label20.AutoSize = True
+        Me.Label20.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label20.Location = New System.Drawing.Point(20, 492)
+        Me.Label20.Name = "Label20"
+        Me.Label20.Size = New System.Drawing.Size(140, 18)
+        Me.Label20.TabIndex = 19
+        Me.Label20.Text = "Monto a Pagar/Recibir"
+        '
+        'Label21
+        '
+        Me.Label21.AutoSize = True
+        Me.Label21.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label21.Location = New System.Drawing.Point(20, 514)
+        Me.Label21.Name = "Label21"
+        Me.Label21.Size = New System.Drawing.Size(126, 18)
+        Me.Label21.TabIndex = 20
+        Me.Label21.Text = "Costo Transferencia"
+        '
+        'dtpUltimaFechaCuponCompra
+        '
+        Me.dtpUltimaFechaCuponCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpUltimaFechaCuponCompra.Location = New System.Drawing.Point(203, 94)
+        Me.dtpUltimaFechaCuponCompra.Name = "dtpUltimaFechaCuponCompra"
+        Me.dtpUltimaFechaCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpUltimaFechaCuponCompra.TabIndex = 3
+        '
+        'dtpSiguienteFechaCuponCompra
+        '
+        Me.dtpSiguienteFechaCuponCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpSiguienteFechaCuponCompra.Location = New System.Drawing.Point(203, 116)
+        Me.dtpSiguienteFechaCuponCompra.Name = "dtpSiguienteFechaCuponCompra"
+        Me.dtpSiguienteFechaCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpSiguienteFechaCuponCompra.TabIndex = 4
+        '
+        'dtpFechaLiquidacionCompra
+        '
+        Me.dtpFechaLiquidacionCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaLiquidacionCompra.Location = New System.Drawing.Point(203, 138)
+        Me.dtpFechaLiquidacionCompra.Name = "dtpFechaLiquidacionCompra"
+        Me.dtpFechaLiquidacionCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaLiquidacionCompra.TabIndex = 5
+        '
+        'dtpFechaVencimientoCompra
+        '
+        Me.dtpFechaVencimientoCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoCompra.Location = New System.Drawing.Point(203, 160)
+        Me.dtpFechaVencimientoCompra.Name = "dtpFechaVencimientoCompra"
+        Me.dtpFechaVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaVencimientoCompra.TabIndex = 6
+        '
+        'txtValorNominalCompra
+        '
+        Me.txtValorNominalCompra.Location = New System.Drawing.Point(203, 72)
+        Me.txtValorNominalCompra.Name = "txtValorNominalCompra"
+        Me.txtValorNominalCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominalCompra.TabIndex = 2
+        '
+        'txtPorcentajeCuponCompra
+        '
+        Me.txtPorcentajeCuponCompra.Location = New System.Drawing.Point(203, 249)
+        Me.txtPorcentajeCuponCompra.Name = "txtPorcentajeCuponCompra"
+        Me.txtPorcentajeCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPorcentajeCuponCompra.TabIndex = 8
+        '
+        'txtYTMAlVencimientoComisionCompra
+        '
+        Me.txtYTMAlVencimientoComisionCompra.Location = New System.Drawing.Point(203, 293)
+        Me.txtYTMAlVencimientoComisionCompra.Name = "txtYTMAlVencimientoComisionCompra"
+        Me.txtYTMAlVencimientoComisionCompra.ReadOnly = True
+        Me.txtYTMAlVencimientoComisionCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoComisionCompra.TabIndex = 10
+        '
+        'txtYTMAlVencimientoCompra
+        '
+        Me.txtYTMAlVencimientoCompra.Location = New System.Drawing.Point(203, 271)
+        Me.txtYTMAlVencimientoCompra.Name = "txtYTMAlVencimientoCompra"
+        Me.txtYTMAlVencimientoCompra.ReadOnly = True
+        Me.txtYTMAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoCompra.TabIndex = 9
+        '
+        'txtPrecioAlVencimientoCompra
+        '
+        Me.txtPrecioAlVencimientoCompra.Location = New System.Drawing.Point(203, 381)
+        Me.txtPrecioAlVencimientoCompra.Name = "txtPrecioAlVencimientoCompra"
+        Me.txtPrecioAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioAlVencimientoCompra.TabIndex = 11
+        '
+        'txtPrecioCompra
+        '
+        Me.txtPrecioCompra.Location = New System.Drawing.Point(203, 403)
+        Me.txtPrecioCompra.Name = "txtPrecioCompra"
+        Me.txtPrecioCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioCompra.TabIndex = 12
+        '
+        'txtDiasAcumuladosCompra
+        '
+        Me.txtDiasAcumuladosCompra.Location = New System.Drawing.Point(203, 227)
+        Me.txtDiasAcumuladosCompra.Name = "txtDiasAcumuladosCompra"
+        Me.txtDiasAcumuladosCompra.ReadOnly = True
+        Me.txtDiasAcumuladosCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAcumuladosCompra.TabIndex = 0
+        '
+        'txtPrecioSucioCompra
+        '
+        Me.txtPrecioSucioCompra.Location = New System.Drawing.Point(203, 447)
+        Me.txtPrecioSucioCompra.Name = "txtPrecioSucioCompra"
+        Me.txtPrecioSucioCompra.ReadOnly = True
+        Me.txtPrecioSucioCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioSucioCompra.TabIndex = 0
+        '
+        'txtInteresAcumuladoCompra
+        '
+        Me.txtInteresAcumuladoCompra.Location = New System.Drawing.Point(203, 425)
+        Me.txtInteresAcumuladoCompra.Name = "txtInteresAcumuladoCompra"
+        Me.txtInteresAcumuladoCompra.ReadOnly = True
+        Me.txtInteresAcumuladoCompra.Size = New System.Drawing.Size(108, 20)
+        Me.txtInteresAcumuladoCompra.TabIndex = 0
+        '
+        'txtPorcentajeInteresAcumuladoCompra
+        '
+        Me.txtPorcentajeInteresAcumuladoCompra.Location = New System.Drawing.Point(313, 425)
+        Me.txtPorcentajeInteresAcumuladoCompra.Name = "txtPorcentajeInteresAcumuladoCompra"
+        Me.txtPorcentajeInteresAcumuladoCompra.ReadOnly = True
+        Me.txtPorcentajeInteresAcumuladoCompra.Size = New System.Drawing.Size(40, 20)
+        Me.txtPorcentajeInteresAcumuladoCompra.TabIndex = 0
+        '
+        'txtValorTransadoCompra
+        '
+        Me.txtValorTransadoCompra.Location = New System.Drawing.Point(203, 469)
+        Me.txtValorTransadoCompra.Name = "txtValorTransadoCompra"
+        Me.txtValorTransadoCompra.ReadOnly = True
+        Me.txtValorTransadoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorTransadoCompra.TabIndex = 0
+        '
+        'txtMontoAPagar
+        '
+        Me.txtMontoAPagar.Location = New System.Drawing.Point(203, 491)
+        Me.txtMontoAPagar.Name = "txtMontoAPagar"
+        Me.txtMontoAPagar.ReadOnly = True
+        Me.txtMontoAPagar.Size = New System.Drawing.Size(150, 20)
+        Me.txtMontoAPagar.TabIndex = 0
+        '
+        'txtCostoTransferenciaCompra
+        '
+        Me.txtCostoTransferenciaCompra.Location = New System.Drawing.Point(203, 513)
+        Me.txtCostoTransferenciaCompra.Name = "txtCostoTransferenciaCompra"
+        Me.txtCostoTransferenciaCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtCostoTransferenciaCompra.TabIndex = 16
+        '
+        'txtDiasAlVencimientoCompra
+        '
+        Me.txtDiasAlVencimientoCompra.Location = New System.Drawing.Point(203, 205)
+        Me.txtDiasAlVencimientoCompra.Name = "txtDiasAlVencimientoCompra"
+        Me.txtDiasAlVencimientoCompra.ReadOnly = True
+        Me.txtDiasAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAlVencimientoCompra.TabIndex = 0
+        '
+        'Label17
+        '
+        Me.Label17.AutoSize = True
+        Me.Label17.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label17.Location = New System.Drawing.Point(256, 15)
+        Me.Label17.Name = "Label17"
+        Me.Label17.Size = New System.Drawing.Size(55, 18)
+        Me.Label17.TabIndex = 55
+        Me.Label17.Text = "Compra"
+        '
+        'lblBono
+        '
+        Me.lblBono.AutoSize = True
+        Me.lblBono.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblBono.Location = New System.Drawing.Point(13, 33)
+        Me.lblBono.Name = "lblBono"
+        Me.lblBono.Size = New System.Drawing.Size(167, 24)
+        Me.lblBono.TabIndex = 56
+        Me.lblBono.Text = "Bono Corporativo"
+        '
+        'txtDiasAlVencimientoVenta
+        '
+        Me.txtDiasAlVencimientoVenta.Location = New System.Drawing.Point(359, 205)
+        Me.txtDiasAlVencimientoVenta.Name = "txtDiasAlVencimientoVenta"
+        Me.txtDiasAlVencimientoVenta.ReadOnly = True
+        Me.txtDiasAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAlVencimientoVenta.TabIndex = 77
+        '
+        'txtCostoTransferenciaVenta
+        '
+        Me.txtCostoTransferenciaVenta.Location = New System.Drawing.Point(359, 513)
+        Me.txtCostoTransferenciaVenta.Name = "txtCostoTransferenciaVenta"
+        Me.txtCostoTransferenciaVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtCostoTransferenciaVenta.TabIndex = 32
+        '
+        'txtMontoARecibir
+        '
+        Me.txtMontoARecibir.Location = New System.Drawing.Point(359, 491)
+        Me.txtMontoARecibir.Name = "txtMontoARecibir"
+        Me.txtMontoARecibir.ReadOnly = True
+        Me.txtMontoARecibir.Size = New System.Drawing.Size(150, 20)
+        Me.txtMontoARecibir.TabIndex = 0
+        '
+        'txtValorTransadoVenta
+        '
+        Me.txtValorTransadoVenta.Location = New System.Drawing.Point(359, 469)
+        Me.txtValorTransadoVenta.Name = "txtValorTransadoVenta"
+        Me.txtValorTransadoVenta.ReadOnly = True
+        Me.txtValorTransadoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorTransadoVenta.TabIndex = 0
+        '
+        'txtPorcentajeInteresAcumuladoVenta
+        '
+        Me.txtPorcentajeInteresAcumuladoVenta.Location = New System.Drawing.Point(469, 425)
+        Me.txtPorcentajeInteresAcumuladoVenta.Name = "txtPorcentajeInteresAcumuladoVenta"
+        Me.txtPorcentajeInteresAcumuladoVenta.ReadOnly = True
+        Me.txtPorcentajeInteresAcumuladoVenta.Size = New System.Drawing.Size(40, 20)
+        Me.txtPorcentajeInteresAcumuladoVenta.TabIndex = 0
+        '
+        'txtInteresAcumuladoVenta
+        '
+        Me.txtInteresAcumuladoVenta.Location = New System.Drawing.Point(359, 425)
+        Me.txtInteresAcumuladoVenta.Name = "txtInteresAcumuladoVenta"
+        Me.txtInteresAcumuladoVenta.ReadOnly = True
+        Me.txtInteresAcumuladoVenta.Size = New System.Drawing.Size(108, 20)
+        Me.txtInteresAcumuladoVenta.TabIndex = 0
+        '
+        'txtPrecioSucioVenta
+        '
+        Me.txtPrecioSucioVenta.Location = New System.Drawing.Point(359, 447)
+        Me.txtPrecioSucioVenta.Name = "txtPrecioSucioVenta"
+        Me.txtPrecioSucioVenta.ReadOnly = True
+        Me.txtPrecioSucioVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioSucioVenta.TabIndex = 0
+        '
+        'txtDiasAcumuladosVenta
+        '
+        Me.txtDiasAcumuladosVenta.Location = New System.Drawing.Point(359, 227)
+        Me.txtDiasAcumuladosVenta.Name = "txtDiasAcumuladosVenta"
+        Me.txtDiasAcumuladosVenta.ReadOnly = True
+        Me.txtDiasAcumuladosVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAcumuladosVenta.TabIndex = 68
+        '
+        'txtPrecioVenta
+        '
+        Me.txtPrecioVenta.Location = New System.Drawing.Point(359, 403)
+        Me.txtPrecioVenta.Name = "txtPrecioVenta"
+        Me.txtPrecioVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioVenta.TabIndex = 28
+        '
+        'txtPrecioAlVencimientoVenta
+        '
+        Me.txtPrecioAlVencimientoVenta.Location = New System.Drawing.Point(359, 381)
+        Me.txtPrecioAlVencimientoVenta.Name = "txtPrecioAlVencimientoVenta"
+        Me.txtPrecioAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioAlVencimientoVenta.TabIndex = 27
+        '
+        'txtYTMAlVencimientoVenta
+        '
+        Me.txtYTMAlVencimientoVenta.Location = New System.Drawing.Point(359, 271)
+        Me.txtYTMAlVencimientoVenta.Name = "txtYTMAlVencimientoVenta"
+        Me.txtYTMAlVencimientoVenta.ReadOnly = True
+        Me.txtYTMAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoVenta.TabIndex = 25
+        '
+        'txtYTMAlVencimientoComisionVenta
+        '
+        Me.txtYTMAlVencimientoComisionVenta.Location = New System.Drawing.Point(359, 293)
+        Me.txtYTMAlVencimientoComisionVenta.Name = "txtYTMAlVencimientoComisionVenta"
+        Me.txtYTMAlVencimientoComisionVenta.ReadOnly = True
+        Me.txtYTMAlVencimientoComisionVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoComisionVenta.TabIndex = 26
+        '
+        'txtPorcentajeCuponVenta
+        '
+        Me.txtPorcentajeCuponVenta.Location = New System.Drawing.Point(359, 249)
+        Me.txtPorcentajeCuponVenta.Name = "txtPorcentajeCuponVenta"
+        Me.txtPorcentajeCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPorcentajeCuponVenta.TabIndex = 24
+        '
+        'txtValorNominalVenta
+        '
+        Me.txtValorNominalVenta.Location = New System.Drawing.Point(359, 72)
+        Me.txtValorNominalVenta.Name = "txtValorNominalVenta"
+        Me.txtValorNominalVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominalVenta.TabIndex = 18
+        '
+        'dtpFechaVencimientoVenta
+        '
+        Me.dtpFechaVencimientoVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoVenta.Location = New System.Drawing.Point(359, 160)
+        Me.dtpFechaVencimientoVenta.Name = "dtpFechaVencimientoVenta"
+        Me.dtpFechaVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaVencimientoVenta.TabIndex = 22
+        '
+        'dtpFechaLiquidacionVenta
+        '
+        Me.dtpFechaLiquidacionVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaLiquidacionVenta.Location = New System.Drawing.Point(359, 138)
+        Me.dtpFechaLiquidacionVenta.Name = "dtpFechaLiquidacionVenta"
+        Me.dtpFechaLiquidacionVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaLiquidacionVenta.TabIndex = 21
+        '
+        'dtpSiguienteFechaCuponVenta
+        '
+        Me.dtpSiguienteFechaCuponVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpSiguienteFechaCuponVenta.Location = New System.Drawing.Point(359, 116)
+        Me.dtpSiguienteFechaCuponVenta.Name = "dtpSiguienteFechaCuponVenta"
+        Me.dtpSiguienteFechaCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpSiguienteFechaCuponVenta.TabIndex = 20
+        '
+        'dtpUltimaFechaCuponVenta
+        '
+        Me.dtpUltimaFechaCuponVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpUltimaFechaCuponVenta.Location = New System.Drawing.Point(359, 94)
+        Me.dtpUltimaFechaCuponVenta.Name = "dtpUltimaFechaCuponVenta"
+        Me.dtpUltimaFechaCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpUltimaFechaCuponVenta.TabIndex = 19
+        '
+        'Label22
+        '
+        Me.Label22.AutoSize = True
+        Me.Label22.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label22.Location = New System.Drawing.Point(366, 15)
+        Me.Label22.Name = "Label22"
+        Me.Label22.Size = New System.Drawing.Size(43, 18)
+        Me.Label22.TabIndex = 80
+        Me.Label22.Text = "Venta"
+        '
+        'Label23
+        '
+        Me.Label23.AutoSize = True
+        Me.Label23.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label23.Location = New System.Drawing.Point(20, 55)
+        Me.Label23.Name = "Label23"
+        Me.Label23.Size = New System.Drawing.Size(88, 18)
+        Me.Label23.TabIndex = 81
+        Me.Label23.Text = "Valor Nominal"
+        '
+        'Label24
+        '
+        Me.Label24.AutoSize = True
+        Me.Label24.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label24.Location = New System.Drawing.Point(20, 77)
+        Me.Label24.Name = "Label24"
+        Me.Label24.Size = New System.Drawing.Size(38, 18)
+        Me.Label24.TabIndex = 82
+        Me.Label24.Text = "Plazo"
+        '
+        'Label25
+        '
+        Me.Label25.AutoSize = True
+        Me.Label25.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label25.Location = New System.Drawing.Point(20, 99)
+        Me.Label25.Name = "Label25"
+        Me.Label25.Size = New System.Drawing.Size(93, 18)
+        Me.Label25.TabIndex = 83
+        Me.Label25.Text = "Precio Compra"
+        '
+        'Label26
+        '
+        Me.Label26.AutoSize = True
+        Me.Label26.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label26.Location = New System.Drawing.Point(20, 121)
+        Me.Label26.Name = "Label26"
+        Me.Label26.Size = New System.Drawing.Size(81, 18)
+        Me.Label26.TabIndex = 84
+        Me.Label26.Text = "Precio Venta"
+        '
+        'label27
+        '
+        Me.label27.AutoSize = True
+        Me.label27.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.label27.Location = New System.Drawing.Point(20, 143)
+        Me.label27.Name = "label27"
+        Me.label27.Size = New System.Drawing.Size(176, 18)
+        Me.label27.TabIndex = 85
+        Me.label27.Text = "Ganancia/Perdida de Capital"
+        '
+        'lblIngresosPorIntereses_Op
+        '
+        Me.lblIngresosPorIntereses_Op.AutoSize = True
+        Me.lblIngresosPorIntereses_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblIngresosPorIntereses_Op.Location = New System.Drawing.Point(20, 165)
+        Me.lblIngresosPorIntereses_Op.Name = "lblIngresosPorIntereses_Op"
+        Me.lblIngresosPorIntereses_Op.Size = New System.Drawing.Size(132, 18)
+        Me.lblIngresosPorIntereses_Op.TabIndex = 86
+        Me.lblIngresosPorIntereses_Op.Text = "Ingreso por Intereses"
+        '
+        'lblCostosTotales_Op
+        '
+        Me.lblCostosTotales_Op.AutoSize = True
+        Me.lblCostosTotales_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblCostosTotales_Op.Location = New System.Drawing.Point(20, 187)
+        Me.lblCostosTotales_Op.Name = "lblCostosTotales_Op"
+        Me.lblCostosTotales_Op.Size = New System.Drawing.Size(94, 18)
+        Me.lblCostosTotales_Op.TabIndex = 87
+        Me.lblCostosTotales_Op.Text = "Costos Totales"
+        '
+        'lblGananciaPerdidaTotal_Op
+        '
+        Me.lblGananciaPerdidaTotal_Op.AutoSize = True
+        Me.lblGananciaPerdidaTotal_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblGananciaPerdidaTotal_Op.Location = New System.Drawing.Point(20, 209)
+        Me.lblGananciaPerdidaTotal_Op.Name = "lblGananciaPerdidaTotal_Op"
+        Me.lblGananciaPerdidaTotal_Op.Size = New System.Drawing.Size(147, 18)
+        Me.lblGananciaPerdidaTotal_Op.TabIndex = 88
+        Me.lblGananciaPerdidaTotal_Op.Text = "Ganancia/Perdida Total"
+        '
+        'lblRendimientoGananciaPerdida_Op
+        '
+        Me.lblRendimientoGananciaPerdida_Op.AutoSize = True
+        Me.lblRendimientoGananciaPerdida_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoGananciaPerdida_Op.Location = New System.Drawing.Point(20, 231)
+        Me.lblRendimientoGananciaPerdida_Op.Name = "lblRendimientoGananciaPerdida_Op"
+        Me.lblRendimientoGananciaPerdida_Op.Size = New System.Drawing.Size(191, 18)
+        Me.lblRendimientoGananciaPerdida_Op.TabIndex = 89
+        Me.lblRendimientoGananciaPerdida_Op.Text = "Rendimiento Ganancia/Perdida"
+        '
+        'lblRendimientoIntereses_Op
+        '
+        Me.lblRendimientoIntereses_Op.AutoSize = True
+        Me.lblRendimientoIntereses_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoIntereses_Op.Location = New System.Drawing.Point(20, 253)
+        Me.lblRendimientoIntereses_Op.Name = "lblRendimientoIntereses_Op"
+        Me.lblRendimientoIntereses_Op.Size = New System.Drawing.Size(140, 18)
+        Me.lblRendimientoIntereses_Op.TabIndex = 90
+        Me.lblRendimientoIntereses_Op.Text = "Rendimiento Intereses"
+        '
+        'lblRendimientoAntesISR_Op
+        '
+        Me.lblRendimientoAntesISR_Op.AutoSize = True
+        Me.lblRendimientoAntesISR_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoAntesISR_Op.Location = New System.Drawing.Point(20, 275)
+        Me.lblRendimientoAntesISR_Op.Name = "lblRendimientoAntesISR_Op"
+        Me.lblRendimientoAntesISR_Op.Size = New System.Drawing.Size(141, 18)
+        Me.lblRendimientoAntesISR_Op.TabIndex = 91
+        Me.lblRendimientoAntesISR_Op.Text = "Rendimiento antes ISR"
+        '
+        'lblRendimientoDespuesISR_Op
+        '
+        Me.lblRendimientoDespuesISR_Op.AutoSize = True
+        Me.lblRendimientoDespuesISR_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoDespuesISR_Op.Location = New System.Drawing.Point(20, 297)
+        Me.lblRendimientoDespuesISR_Op.Name = "lblRendimientoDespuesISR_Op"
+        Me.lblRendimientoDespuesISR_Op.Size = New System.Drawing.Size(156, 18)
+        Me.lblRendimientoDespuesISR_Op.TabIndex = 92
+        Me.lblRendimientoDespuesISR_Op.Text = "Rendimiento despues ISR"
+        '
+        'Label35
+        '
+        Me.Label35.AutoSize = True
+        Me.Label35.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label35.Location = New System.Drawing.Point(122, 20)
+        Me.Label35.Name = "Label35"
+        Me.Label35.Size = New System.Drawing.Size(169, 18)
+        Me.Label35.TabIndex = 93
+        Me.Label35.Text = "Resultado de la Operacion"
+        '
+        'txtValorNominal_Op
+        '
+        Me.txtValorNominal_Op.Location = New System.Drawing.Point(219, 54)
+        Me.txtValorNominal_Op.Name = "txtValorNominal_Op"
+        Me.txtValorNominal_Op.ReadOnly = True
+        Me.txtValorNominal_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominal_Op.TabIndex = 0
+        '
+        'txtPlazo_Op
+        '
+        Me.txtPlazo_Op.Location = New System.Drawing.Point(219, 76)
+        Me.txtPlazo_Op.Name = "txtPlazo_Op"
+        Me.txtPlazo_Op.ReadOnly = True
+        Me.txtPlazo_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPlazo_Op.TabIndex = 0
+        '
+        'txtPrecioCompra_Op
+        '
+        Me.txtPrecioCompra_Op.Location = New System.Drawing.Point(219, 98)
+        Me.txtPrecioCompra_Op.Name = "txtPrecioCompra_Op"
+        Me.txtPrecioCompra_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioCompra_Op.TabIndex = 0
+        '
+        'txtPrecioVenta_Op
+        '
+        Me.txtPrecioVenta_Op.Location = New System.Drawing.Point(219, 120)
+        Me.txtPrecioVenta_Op.Name = "txtPrecioVenta_Op"
+        Me.txtPrecioVenta_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioVenta_Op.TabIndex = 0
+        '
+        'txtGananciaPerdidaCapital_Op
+        '
+        Me.txtGananciaPerdidaCapital_Op.Location = New System.Drawing.Point(219, 142)
+        Me.txtGananciaPerdidaCapital_Op.Name = "txtGananciaPerdidaCapital_Op"
+        Me.txtGananciaPerdidaCapital_Op.ReadOnly = True
+        Me.txtGananciaPerdidaCapital_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtGananciaPerdidaCapital_Op.TabIndex = 0
+        '
+        'txtIngresosPorIntereses_Op
+        '
+        Me.txtIngresosPorIntereses_Op.Location = New System.Drawing.Point(219, 164)
+        Me.txtIngresosPorIntereses_Op.Name = "txtIngresosPorIntereses_Op"
+        Me.txtIngresosPorIntereses_Op.ReadOnly = True
+        Me.txtIngresosPorIntereses_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtIngresosPorIntereses_Op.TabIndex = 0
+        '
+        'txtCostosTotales_Op
+        '
+        Me.txtCostosTotales_Op.Location = New System.Drawing.Point(219, 186)
+        Me.txtCostosTotales_Op.Name = "txtCostosTotales_Op"
+        Me.txtCostosTotales_Op.ReadOnly = True
+        Me.txtCostosTotales_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtCostosTotales_Op.TabIndex = 0
+        '
+        'txtGananciaPerdidaTotal_Op
+        '
+        Me.txtGananciaPerdidaTotal_Op.Location = New System.Drawing.Point(219, 208)
+        Me.txtGananciaPerdidaTotal_Op.Name = "txtGananciaPerdidaTotal_Op"
+        Me.txtGananciaPerdidaTotal_Op.ReadOnly = True
+        Me.txtGananciaPerdidaTotal_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtGananciaPerdidaTotal_Op.TabIndex = 0
+        '
+        'txtRendimientoGananciaPerdida_Op
+        '
+        Me.txtRendimientoGananciaPerdida_Op.Location = New System.Drawing.Point(219, 230)
+        Me.txtRendimientoGananciaPerdida_Op.Name = "txtRendimientoGananciaPerdida_Op"
+        Me.txtRendimientoGananciaPerdida_Op.ReadOnly = True
+        Me.txtRendimientoGananciaPerdida_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoGananciaPerdida_Op.TabIndex = 0
+        '
+        'txtRendimientoIntereses_Op
+        '
+        Me.txtRendimientoIntereses_Op.Location = New System.Drawing.Point(219, 252)
+        Me.txtRendimientoIntereses_Op.Name = "txtRendimientoIntereses_Op"
+        Me.txtRendimientoIntereses_Op.ReadOnly = True
+        Me.txtRendimientoIntereses_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoIntereses_Op.TabIndex = 0
+        '
+        'txtRendimientoAntesISR_Op
+        '
+        Me.txtRendimientoAntesISR_Op.Location = New System.Drawing.Point(219, 274)
+        Me.txtRendimientoAntesISR_Op.Name = "txtRendimientoAntesISR_Op"
+        Me.txtRendimientoAntesISR_Op.ReadOnly = True
+        Me.txtRendimientoAntesISR_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoAntesISR_Op.TabIndex = 0
+        '
+        'txtRendimientoDespuesISR_Op
+        '
+        Me.txtRendimientoDespuesISR_Op.Location = New System.Drawing.Point(219, 296)
+        Me.txtRendimientoDespuesISR_Op.Name = "txtRendimientoDespuesISR_Op"
+        Me.txtRendimientoDespuesISR_Op.ReadOnly = True
+        Me.txtRendimientoDespuesISR_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoDespuesISR_Op.TabIndex = 0
+        '
+        'btnAceptar
+        '
+        Me.btnAceptar.DialogResult = System.Windows.Forms.DialogResult.OK
+        Me.btnAceptar.Location = New System.Drawing.Point(10, 3)
+        Me.btnAceptar.Name = "btnAceptar"
+        Me.btnAceptar.Size = New System.Drawing.Size(75, 23)
+        Me.btnAceptar.TabIndex = 106
+        Me.btnAceptar.Text = "Aceptar"
+        Me.btnAceptar.UseVisualStyleBackColor = True
+        '
+        'btnCancelar
+        '
+        Me.btnCancelar.DialogResult = System.Windows.Forms.DialogResult.Cancel
+        Me.btnCancelar.Location = New System.Drawing.Point(91, 3)
+        Me.btnCancelar.Name = "btnCancelar"
+        Me.btnCancelar.Size = New System.Drawing.Size(75, 23)
+        Me.btnCancelar.TabIndex = 107
+        Me.btnCancelar.Text = "Cancelar"
+        Me.btnCancelar.UseVisualStyleBackColor = True
+        '
+        'cboAnioBaseC
+        '
+        Me.cboAnioBaseC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboAnioBaseC.FormattingEnabled = True
+        Me.cboAnioBaseC.Items.AddRange(New Object() {"360", "365"})
+        Me.cboAnioBaseC.Location = New System.Drawing.Point(203, 182)
+        Me.cboAnioBaseC.Name = "cboAnioBaseC"
+        Me.cboAnioBaseC.Size = New System.Drawing.Size(150, 21)
+        Me.cboAnioBaseC.TabIndex = 7
+        '
+        'cboAnioBaseV
+        '
+        Me.cboAnioBaseV.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboAnioBaseV.FormattingEnabled = True
+        Me.cboAnioBaseV.Items.AddRange(New Object() {"360", "365"})
+        Me.cboAnioBaseV.Location = New System.Drawing.Point(359, 182)
+        Me.cboAnioBaseV.Name = "cboAnioBaseV"
+        Me.cboAnioBaseV.Size = New System.Drawing.Size(150, 21)
+        Me.cboAnioBaseV.TabIndex = 23
+        '
+        'cboPeriodosC
+        '
+        Me.cboPeriodosC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboPeriodosC.FormattingEnabled = True
+        Me.cboPeriodosC.Location = New System.Drawing.Point(203, 49)
+        Me.cboPeriodosC.Name = "cboPeriodosC"
+        Me.cboPeriodosC.Size = New System.Drawing.Size(150, 21)
+        Me.cboPeriodosC.TabIndex = 1
+        '
+        'cboPeriodosV
+        '
+        Me.cboPeriodosV.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboPeriodosV.FormattingEnabled = True
+        Me.cboPeriodosV.Location = New System.Drawing.Point(359, 49)
+        Me.cboPeriodosV.Name = "cboPeriodosV"
+        Me.cboPeriodosV.Size = New System.Drawing.Size(150, 21)
+        Me.cboPeriodosV.TabIndex = 17
+        '
+        'Label29
+        '
+        Me.Label29.AutoSize = True
+        Me.Label29.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label29.Location = New System.Drawing.Point(20, 50)
+        Me.Label29.Name = "Label29"
+        Me.Label29.Size = New System.Drawing.Size(80, 18)
+        Me.Label29.TabIndex = 115
+        Me.Label29.Text = "Periodicidad"
+        '
+        'Label30
+        '
+        Me.Label30.AutoSize = True
+        Me.Label30.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label30.Location = New System.Drawing.Point(536, 373)
+        Me.Label30.Name = "Label30"
+        Me.Label30.Size = New System.Drawing.Size(59, 18)
+        Me.Label30.TabIndex = 118
+        Me.Label30.Text = "Ingresos"
+        '
+        'TabControl1
+        '
+        Me.TabControl1.Controls.Add(Me.TabPage1)
+        Me.TabControl1.Controls.Add(Me.TabPage2)
+        Me.TabControl1.Controls.Add(Me.TabPage4)
+        Me.TabControl1.Location = New System.Drawing.Point(17, 72)
+        Me.TabControl1.Name = "TabControl1"
+        Me.TabControl1.SelectedIndex = 0
+        Me.TabControl1.Size = New System.Drawing.Size(696, 589)
+        Me.TabControl1.TabIndex = 121
+        '
+        'TabPage1
+        '
+        Me.TabPage1.Controls.Add(Me.btnBolsaVenta)
+        Me.TabPage1.Controls.Add(Me.btnCasaVenta)
+        Me.TabPage1.Controls.Add(Me.btnBolsaCompra)
+        Me.TabPage1.Controls.Add(Me.btnCasaCompra)
+        Me.TabPage1.Controls.Add(Me.btnPorcentajeBolsaVenta)
+        Me.TabPage1.Controls.Add(Me.btnPorcentajeCasaVenta)
+        Me.TabPage1.Controls.Add(Me.btnPorcentajeBolsaCompra)
+        Me.TabPage1.Controls.Add(Me.btnPorcentajeCasaCompra)
+        Me.TabPage1.Controls.Add(Me.Label15)
+        Me.TabPage1.Controls.Add(Me.Label14)
+        Me.TabPage1.Controls.Add(Me.Label17)
+        Me.TabPage1.Controls.Add(Me.Label1)
+        Me.TabPage1.Controls.Add(Me.Label2)
+        Me.TabPage1.Controls.Add(Me.Label3)
+        Me.TabPage1.Controls.Add(Me.Label4)
+        Me.TabPage1.Controls.Add(Me.Label5)
+        Me.TabPage1.Controls.Add(Me.Label29)
+        Me.TabPage1.Controls.Add(Me.Label6)
+        Me.TabPage1.Controls.Add(Me.cboPeriodosV)
+        Me.TabPage1.Controls.Add(Me.Label7)
+        Me.TabPage1.Controls.Add(Me.cboPeriodosC)
+        Me.TabPage1.Controls.Add(Me.Label8)
+        Me.TabPage1.Controls.Add(Me.cboAnioBaseV)
+        Me.TabPage1.Controls.Add(Me.Label9)
+        Me.TabPage1.Controls.Add(Me.cboAnioBaseC)
+        Me.TabPage1.Controls.Add(Me.Label10)
+        Me.TabPage1.Controls.Add(Me.Label11)
+        Me.TabPage1.Controls.Add(Me.Label12)
+        Me.TabPage1.Controls.Add(Me.Label13)
+        Me.TabPage1.Controls.Add(Me.Label16)
+        Me.TabPage1.Controls.Add(Me.Label18)
+        Me.TabPage1.Controls.Add(Me.Label19)
+        Me.TabPage1.Controls.Add(Me.Label20)
+        Me.TabPage1.Controls.Add(Me.Label21)
+        Me.TabPage1.Controls.Add(Me.dtpUltimaFechaCuponCompra)
+        Me.TabPage1.Controls.Add(Me.dtpSiguienteFechaCuponCompra)
+        Me.TabPage1.Controls.Add(Me.dtpFechaLiquidacionCompra)
+        Me.TabPage1.Controls.Add(Me.dtpFechaVencimientoCompra)
+        Me.TabPage1.Controls.Add(Me.txtValorNominalCompra)
+        Me.TabPage1.Controls.Add(Me.txtPorcentajeCuponCompra)
+        Me.TabPage1.Controls.Add(Me.txtYTMAlVencimientoComisionCompra)
+        Me.TabPage1.Controls.Add(Me.txtYTMAlVencimientoCompra)
+        Me.TabPage1.Controls.Add(Me.txtPrecioAlVencimientoCompra)
+        Me.TabPage1.Controls.Add(Me.txtPrecioCompra)
+        Me.TabPage1.Controls.Add(Me.txtDiasAcumuladosCompra)
+        Me.TabPage1.Controls.Add(Me.txtPrecioSucioCompra)
+        Me.TabPage1.Controls.Add(Me.txtInteresAcumuladoCompra)
+        Me.TabPage1.Controls.Add(Me.txtPorcentajeInteresAcumuladoCompra)
+        Me.TabPage1.Controls.Add(Me.txtValorTransadoCompra)
+        Me.TabPage1.Controls.Add(Me.txtMontoAPagar)
+        Me.TabPage1.Controls.Add(Me.txtCostoTransferenciaCompra)
+        Me.TabPage1.Controls.Add(Me.txtDiasAlVencimientoCompra)
+        Me.TabPage1.Controls.Add(Me.Label22)
+        Me.TabPage1.Controls.Add(Me.dtpUltimaFechaCuponVenta)
+        Me.TabPage1.Controls.Add(Me.txtDiasAlVencimientoVenta)
+        Me.TabPage1.Controls.Add(Me.dtpSiguienteFechaCuponVenta)
+        Me.TabPage1.Controls.Add(Me.txtCostoTransferenciaVenta)
+        Me.TabPage1.Controls.Add(Me.dtpFechaLiquidacionVenta)
+        Me.TabPage1.Controls.Add(Me.txtMontoARecibir)
+        Me.TabPage1.Controls.Add(Me.dtpFechaVencimientoVenta)
+        Me.TabPage1.Controls.Add(Me.txtValorTransadoVenta)
+        Me.TabPage1.Controls.Add(Me.txtValorNominalVenta)
+        Me.TabPage1.Controls.Add(Me.txtPorcentajeInteresAcumuladoVenta)
+        Me.TabPage1.Controls.Add(Me.txtPorcentajeCuponVenta)
+        Me.TabPage1.Controls.Add(Me.txtInteresAcumuladoVenta)
+        Me.TabPage1.Controls.Add(Me.txtYTMAlVencimientoComisionVenta)
+        Me.TabPage1.Controls.Add(Me.txtPrecioSucioVenta)
+        Me.TabPage1.Controls.Add(Me.txtYTMAlVencimientoVenta)
+        Me.TabPage1.Controls.Add(Me.txtPrecioAlVencimientoVenta)
+        Me.TabPage1.Controls.Add(Me.txtPrecioVenta)
+        Me.TabPage1.Controls.Add(Me.txtDiasAcumuladosVenta)
+        Me.TabPage1.Location = New System.Drawing.Point(4, 22)
+        Me.TabPage1.Name = "TabPage1"
+        Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
+        Me.TabPage1.Size = New System.Drawing.Size(688, 563)
+        Me.TabPage1.TabIndex = 0
+        Me.TabPage1.Text = "Operación"
+        Me.TabPage1.UseVisualStyleBackColor = True
+        '
+        'btnBolsaVenta
+        '
+        Me.btnBolsaVenta.Location = New System.Drawing.Point(402, 355)
+        Me.btnBolsaVenta.Name = "btnBolsaVenta"
+        Me.btnBolsaVenta.ReadOnly = True
+        Me.btnBolsaVenta.Size = New System.Drawing.Size(104, 20)
+        Me.btnBolsaVenta.TabIndex = 125
+        '
+        'btnCasaVenta
+        '
+        Me.btnCasaVenta.Location = New System.Drawing.Point(402, 322)
+        Me.btnCasaVenta.Name = "btnCasaVenta"
+        Me.btnCasaVenta.ReadOnly = True
+        Me.btnCasaVenta.Size = New System.Drawing.Size(104, 20)
+        Me.btnCasaVenta.TabIndex = 124
+        '
+        'btnBolsaCompra
+        '
+        Me.btnBolsaCompra.Location = New System.Drawing.Point(247, 355)
+        Me.btnBolsaCompra.Name = "btnBolsaCompra"
+        Me.btnBolsaCompra.ReadOnly = True
+        Me.btnBolsaCompra.Size = New System.Drawing.Size(104, 20)
+        Me.btnBolsaCompra.TabIndex = 123
+        '
+        'btnCasaCompra
+        '
+        Me.btnCasaCompra.Location = New System.Drawing.Point(247, 322)
+        Me.btnCasaCompra.Name = "btnCasaCompra"
+        Me.btnCasaCompra.ReadOnly = True
+        Me.btnCasaCompra.Size = New System.Drawing.Size(104, 20)
+        Me.btnCasaCompra.TabIndex = 122
+        '
+        'btnPorcentajeBolsaVenta
+        '
+        Me.btnPorcentajeBolsaVenta.Location = New System.Drawing.Point(359, 355)
+        Me.btnPorcentajeBolsaVenta.Name = "btnPorcentajeBolsaVenta"
+        Me.btnPorcentajeBolsaVenta.ReadOnly = True
+        Me.btnPorcentajeBolsaVenta.Size = New System.Drawing.Size(37, 20)
+        Me.btnPorcentajeBolsaVenta.TabIndex = 121
+        '
+        'btnPorcentajeCasaVenta
+        '
+        Me.btnPorcentajeCasaVenta.Location = New System.Drawing.Point(359, 322)
+        Me.btnPorcentajeCasaVenta.Name = "btnPorcentajeCasaVenta"
+        Me.btnPorcentajeCasaVenta.ReadOnly = True
+        Me.btnPorcentajeCasaVenta.Size = New System.Drawing.Size(37, 20)
+        Me.btnPorcentajeCasaVenta.TabIndex = 120
+        '
+        'btnPorcentajeBolsaCompra
+        '
+        Me.btnPorcentajeBolsaCompra.Location = New System.Drawing.Point(203, 355)
+        Me.btnPorcentajeBolsaCompra.Name = "btnPorcentajeBolsaCompra"
+        Me.btnPorcentajeBolsaCompra.ReadOnly = True
+        Me.btnPorcentajeBolsaCompra.Size = New System.Drawing.Size(38, 20)
+        Me.btnPorcentajeBolsaCompra.TabIndex = 119
+        '
+        'btnPorcentajeCasaCompra
+        '
+        Me.btnPorcentajeCasaCompra.Location = New System.Drawing.Point(203, 322)
+        Me.btnPorcentajeCasaCompra.Name = "btnPorcentajeCasaCompra"
+        Me.btnPorcentajeCasaCompra.ReadOnly = True
+        Me.btnPorcentajeCasaCompra.Size = New System.Drawing.Size(38, 20)
+        Me.btnPorcentajeCasaCompra.TabIndex = 118
+        '
+        'Label15
+        '
+        Me.Label15.AutoSize = True
+        Me.Label15.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label15.Location = New System.Drawing.Point(20, 352)
+        Me.Label15.Name = "Label15"
+        Me.Label15.Size = New System.Drawing.Size(96, 18)
+        Me.Label15.TabIndex = 117
+        Me.Label15.Text = "Comisión Bolsa"
+        '
+        'Label14
+        '
+        Me.Label14.AutoSize = True
+        Me.Label14.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label14.Location = New System.Drawing.Point(20, 322)
+        Me.Label14.Name = "Label14"
+        Me.Label14.Size = New System.Drawing.Size(94, 18)
+        Me.Label14.TabIndex = 116
+        Me.Label14.Text = "Comisión Casa"
+        '
+        'TabPage2
+        '
+        Me.TabPage2.Controls.Add(Me.btnAccionIngreso)
+        Me.TabPage2.Controls.Add(Me.dgvIngresos)
+        Me.TabPage2.Location = New System.Drawing.Point(4, 22)
+        Me.TabPage2.Name = "TabPage2"
+        Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
+        Me.TabPage2.Size = New System.Drawing.Size(688, 563)
+        Me.TabPage2.TabIndex = 1
+        Me.TabPage2.Text = "Ingresos"
+        Me.TabPage2.UseVisualStyleBackColor = True
+        '
+        'btnAccionIngreso
+        '
+        Me.btnAccionIngreso.Location = New System.Drawing.Point(20, 212)
+        Me.btnAccionIngreso.Name = "btnAccionIngreso"
+        Me.btnAccionIngreso.Size = New System.Drawing.Size(75, 23)
+        Me.btnAccionIngreso.TabIndex = 117
+        Me.btnAccionIngreso.Text = "Aceptar"
+        Me.btnAccionIngreso.UseVisualStyleBackColor = True
+        '
+        'dgvIngresos
+        '
+        Me.dgvIngresos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvIngresos.Location = New System.Drawing.Point(20, 20)
+        Me.dgvIngresos.Name = "dgvIngresos"
+        Me.dgvIngresos.Size = New System.Drawing.Size(646, 174)
+        Me.dgvIngresos.TabIndex = 116
+        '
+        'TabPage4
+        '
+        Me.TabPage4.Controls.Add(Me.Label35)
+        Me.TabPage4.Controls.Add(Me.Label23)
+        Me.TabPage4.Controls.Add(Me.Label24)
+        Me.TabPage4.Controls.Add(Me.Label25)
+        Me.TabPage4.Controls.Add(Me.Label26)
+        Me.TabPage4.Controls.Add(Me.label27)
+        Me.TabPage4.Controls.Add(Me.lblIngresosPorIntereses_Op)
+        Me.TabPage4.Controls.Add(Me.lblCostosTotales_Op)
+        Me.TabPage4.Controls.Add(Me.txtRendimientoDespuesISR_Op)
+        Me.TabPage4.Controls.Add(Me.lblGananciaPerdidaTotal_Op)
+        Me.TabPage4.Controls.Add(Me.txtRendimientoAntesISR_Op)
+        Me.TabPage4.Controls.Add(Me.lblRendimientoGananciaPerdida_Op)
+        Me.TabPage4.Controls.Add(Me.txtRendimientoIntereses_Op)
+        Me.TabPage4.Controls.Add(Me.lblRendimientoIntereses_Op)
+        Me.TabPage4.Controls.Add(Me.txtRendimientoGananciaPerdida_Op)
+        Me.TabPage4.Controls.Add(Me.lblRendimientoAntesISR_Op)
+        Me.TabPage4.Controls.Add(Me.txtGananciaPerdidaTotal_Op)
+        Me.TabPage4.Controls.Add(Me.lblRendimientoDespuesISR_Op)
+        Me.TabPage4.Controls.Add(Me.txtCostosTotales_Op)
+        Me.TabPage4.Controls.Add(Me.txtValorNominal_Op)
+        Me.TabPage4.Controls.Add(Me.txtIngresosPorIntereses_Op)
+        Me.TabPage4.Controls.Add(Me.txtPlazo_Op)
+        Me.TabPage4.Controls.Add(Me.txtGananciaPerdidaCapital_Op)
+        Me.TabPage4.Controls.Add(Me.txtPrecioCompra_Op)
+        Me.TabPage4.Controls.Add(Me.txtPrecioVenta_Op)
+        Me.TabPage4.Location = New System.Drawing.Point(4, 22)
+        Me.TabPage4.Name = "TabPage4"
+        Me.TabPage4.Size = New System.Drawing.Size(688, 563)
+        Me.TabPage4.TabIndex = 3
+        Me.TabPage4.Text = "Resultado de la Op."
+        Me.TabPage4.UseVisualStyleBackColor = True
+        '
+        'pnlPie
+        '
+        Me.pnlPie.Controls.Add(Me.btnAceptar)
+        Me.pnlPie.Controls.Add(Me.btnCancelar)
+        Me.pnlPie.Dock = System.Windows.Forms.DockStyle.Bottom
+        Me.pnlPie.Location = New System.Drawing.Point(0, 667)
+        Me.pnlPie.Name = "pnlPie"
+        Me.pnlPie.Size = New System.Drawing.Size(747, 46)
+        Me.pnlPie.TabIndex = 122
+        '
+        'BindingNavigator1
+        '
+        Me.BindingNavigator1.AddNewItem = Nothing
+        Me.BindingNavigator1.CountItem = Nothing
+        Me.BindingNavigator1.DeleteItem = Nothing
+        Me.BindingNavigator1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorSeparator, Me.navModificar, Me.navNuevo, Me.navEliminar})
+        Me.BindingNavigator1.Location = New System.Drawing.Point(0, 0)
+        Me.BindingNavigator1.MoveFirstItem = Nothing
+        Me.BindingNavigator1.MoveLastItem = Nothing
+        Me.BindingNavigator1.MoveNextItem = Nothing
+        Me.BindingNavigator1.MovePreviousItem = Nothing
+        Me.BindingNavigator1.Name = "BindingNavigator1"
+        Me.BindingNavigator1.PositionItem = Nothing
+        Me.BindingNavigator1.Size = New System.Drawing.Size(747, 25)
+        Me.BindingNavigator1.TabIndex = 128
+        Me.BindingNavigator1.Text = "BindingNavigator1"
+        '
+        'BindingNavigatorSeparator
+        '
+        Me.BindingNavigatorSeparator.Name = "BindingNavigatorSeparator"
+        Me.BindingNavigatorSeparator.Size = New System.Drawing.Size(6, 25)
+        '
+        'navModificar
+        '
+        Me.navModificar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navModificar.Image = CType(resources.GetObject("navModificar.Image"), System.Drawing.Image)
+        Me.navModificar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navModificar.Name = "navModificar"
+        Me.navModificar.Size = New System.Drawing.Size(23, 22)
+        Me.navModificar.Text = "Modificar"
+        '
+        'navNuevo
+        '
+        Me.navNuevo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navNuevo.Image = CType(resources.GetObject("navNuevo.Image"), System.Drawing.Image)
+        Me.navNuevo.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navNuevo.Name = "navNuevo"
+        Me.navNuevo.Size = New System.Drawing.Size(23, 22)
+        Me.navNuevo.Text = "Nuevo"
+        '
+        'navEliminar
+        '
+        Me.navEliminar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navEliminar.Image = CType(resources.GetObject("navEliminar.Image"), System.Drawing.Image)
+        Me.navEliminar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navEliminar.Name = "navEliminar"
+        Me.navEliminar.Size = New System.Drawing.Size(23, 22)
+        Me.navEliminar.Text = "Eliminar"
+        '
+        'frmBonos
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.AutoScroll = True
+        Me.ClientSize = New System.Drawing.Size(747, 713)
+        Me.Controls.Add(Me.BindingNavigator1)
+        Me.Controls.Add(Me.pnlPie)
+        Me.Controls.Add(Me.TabControl1)
+        Me.Controls.Add(Me.Label30)
+        Me.Controls.Add(Me.lblBono)
+        Me.Name = "frmBonos"
+        Me.Text = "Bonos Corporativos"
+        Me.TabControl1.ResumeLayout(False)
+        Me.TabPage1.ResumeLayout(False)
+        Me.TabPage1.PerformLayout()
+        Me.TabPage2.ResumeLayout(False)
+        CType(Me.dgvIngresos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.TabPage4.ResumeLayout(False)
+        Me.TabPage4.PerformLayout()
+        Me.pnlPie.ResumeLayout(False)
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.BindingNavigator1.ResumeLayout(False)
+        Me.BindingNavigator1.PerformLayout()
+        Me.ResumeLayout(False)
+        Me.PerformLayout()
+
+    End Sub
+
+    Friend WithEvents Label1 As Label
+    Friend WithEvents Label2 As Label
+    Friend WithEvents Label3 As Label
+    Friend WithEvents Label4 As Label
+    Friend WithEvents Label5 As Label
+    Friend WithEvents Label6 As Label
+    Friend WithEvents Label7 As Label
+    Friend WithEvents Label8 As Label
+    Friend WithEvents Label9 As Label
+    Friend WithEvents Label10 As Label
+    Friend WithEvents Label11 As Label
+    Friend WithEvents Label12 As Label
+    Friend WithEvents Label13 As Label
+    Friend WithEvents Label16 As Label
+    Friend WithEvents Label18 As Label
+    Friend WithEvents Label19 As Label
+    Friend WithEvents Label20 As Label
+    Friend WithEvents Label21 As Label
+    Friend WithEvents dtpUltimaFechaCuponCompra As DateTimePicker
+    Friend WithEvents dtpSiguienteFechaCuponCompra As DateTimePicker
+    Friend WithEvents dtpFechaLiquidacionCompra As DateTimePicker
+    Friend WithEvents dtpFechaVencimientoCompra As DateTimePicker
+    Friend WithEvents txtValorNominalCompra As TextBox
+    Friend WithEvents txtPorcentajeCuponCompra As TextBox
+    Friend WithEvents txtYTMAlVencimientoComisionCompra As TextBox
+    Friend WithEvents txtYTMAlVencimientoCompra As TextBox
+    Friend WithEvents txtPrecioAlVencimientoCompra As TextBox
+    Friend WithEvents txtPrecioCompra As TextBox
+    Friend WithEvents txtDiasAcumuladosCompra As TextBox
+    Friend WithEvents txtPrecioSucioCompra As TextBox
+    Friend WithEvents txtInteresAcumuladoCompra As TextBox
+    Friend WithEvents txtPorcentajeInteresAcumuladoCompra As TextBox
+    Friend WithEvents txtValorTransadoCompra As TextBox
+    Friend WithEvents txtMontoAPagar As TextBox
+    Friend WithEvents txtCostoTransferenciaCompra As TextBox
+    Friend WithEvents txtDiasAlVencimientoCompra As TextBox
+    Friend WithEvents Label17 As Label
+    Friend WithEvents lblBono As Label
+    Friend WithEvents txtDiasAlVencimientoVenta As TextBox
+    Friend WithEvents txtCostoTransferenciaVenta As TextBox
+    Friend WithEvents txtMontoARecibir As TextBox
+    Friend WithEvents txtValorTransadoVenta As TextBox
+    Friend WithEvents txtPorcentajeInteresAcumuladoVenta As TextBox
+    Friend WithEvents txtInteresAcumuladoVenta As TextBox
+    Friend WithEvents txtPrecioSucioVenta As TextBox
+    Friend WithEvents txtDiasAcumuladosVenta As TextBox
+    Friend WithEvents txtPrecioVenta As TextBox
+    Friend WithEvents txtPrecioAlVencimientoVenta As TextBox
+    Friend WithEvents txtYTMAlVencimientoVenta As TextBox
+    Friend WithEvents txtYTMAlVencimientoComisionVenta As TextBox
+    Friend WithEvents txtPorcentajeCuponVenta As TextBox
+    Friend WithEvents txtValorNominalVenta As TextBox
+    Friend WithEvents dtpFechaVencimientoVenta As DateTimePicker
+    Friend WithEvents dtpFechaLiquidacionVenta As DateTimePicker
+    Friend WithEvents dtpSiguienteFechaCuponVenta As DateTimePicker
+    Friend WithEvents dtpUltimaFechaCuponVenta As DateTimePicker
+    Friend WithEvents Label22 As Label
+    Friend WithEvents Label23 As Label
+    Friend WithEvents Label24 As Label
+    Friend WithEvents Label25 As Label
+    Friend WithEvents Label26 As Label
+    Friend WithEvents label27 As Label
+    Friend WithEvents lblIngresosPorIntereses_Op As Label
+    Friend WithEvents lblCostosTotales_Op As Label
+    Friend WithEvents lblGananciaPerdidaTotal_Op As Label
+    Friend WithEvents lblRendimientoGananciaPerdida_Op As Label
+    Friend WithEvents lblRendimientoIntereses_Op As Label
+    Friend WithEvents lblRendimientoAntesISR_Op As Label
+    Friend WithEvents lblRendimientoDespuesISR_Op As Label
+    Friend WithEvents Label35 As Label
+    Friend WithEvents txtValorNominal_Op As TextBox
+    Friend WithEvents txtPlazo_Op As TextBox
+    Friend WithEvents txtPrecioCompra_Op As TextBox
+    Friend WithEvents txtPrecioVenta_Op As TextBox
+    Friend WithEvents txtGananciaPerdidaCapital_Op As TextBox
+    Friend WithEvents txtIngresosPorIntereses_Op As TextBox
+    Friend WithEvents txtCostosTotales_Op As TextBox
+    Friend WithEvents txtGananciaPerdidaTotal_Op As TextBox
+    Friend WithEvents txtRendimientoGananciaPerdida_Op As TextBox
+    Friend WithEvents txtRendimientoIntereses_Op As TextBox
+    Friend WithEvents txtRendimientoAntesISR_Op As TextBox
+    Friend WithEvents txtRendimientoDespuesISR_Op As TextBox
+    Friend WithEvents btnAceptar As Button
+    Friend WithEvents btnCancelar As Button
+    Friend WithEvents cboAnioBaseC As ComboBox
+    Friend WithEvents cboAnioBaseV As ComboBox
+    Friend WithEvents cboPeriodosC As ComboBox
+    Friend WithEvents cboPeriodosV As ComboBox
+    Friend WithEvents Label29 As Label
+    Friend WithEvents Label30 As Label
+    Friend WithEvents TabControl1 As TabControl
+    Friend WithEvents TabPage1 As TabPage
+    Friend WithEvents TabPage4 As TabPage
+    Friend WithEvents pnlPie As Panel
+    Friend WithEvents BindingNavigator1 As BindingNavigator
+    Friend WithEvents BindingNavigatorSeparator As ToolStripSeparator
+    Friend WithEvents navModificar As ToolStripButton
+    Friend WithEvents navNuevo As ToolStripButton
+    Friend WithEvents navEliminar As ToolStripButton
+    Friend WithEvents TabPage2 As TabPage
+    Friend WithEvents dgvIngresos As DataGridView
+    Friend WithEvents btnAccionIngreso As Button
+    Friend WithEvents btnBolsaVenta As TextBox
+    Friend WithEvents btnCasaVenta As TextBox
+    Friend WithEvents btnBolsaCompra As TextBox
+    Friend WithEvents btnCasaCompra As TextBox
+    Friend WithEvents btnPorcentajeBolsaVenta As TextBox
+    Friend WithEvents btnPorcentajeCasaVenta As TextBox
+    Friend WithEvents btnPorcentajeBolsaCompra As TextBox
+    Friend WithEvents btnPorcentajeCasaCompra As TextBox
+    Friend WithEvents Label15 As Label
+    Friend WithEvents Label14 As Label
+End Class

+ 167 - 0
FRM/frmBonos.resx

@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="BindingNavigator1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="navModificar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPjVNNaxNRFM0fcKNbBbG4qC7FpRTcdCf9AwqC
+        Ci6UKrQWW1toQYJZKRgqLgRjDG0yH2kwWAWb0tZFA91EUDemaabtfKTNNJmMScz0+O6bSdKxFT3M4c59
+        754z9715L5BMpcqCLCMhioj7KPAoSBJEWdYDfwMV/AuapiEhCG89iR/0ZcKP/DpjAfn1Ao+UEyLRKI+q
+        qiIhSTFP1gW1SdgoFlFUFCibCo+UE97EYtANg7/zTuakWU/qgtZKUDa3sbWtdkg5YTWb5SbtTmbnRHhS
+        F3HBNVCZu6brHVJesap87iDiKRFfHi8g9+STa9Q20I0SjNKOjzSmMerGDkq7Jq8bGhtFXi7gcziLtUes
+        m7bBbrl8NE0TZrUGqwHcH5nAxpaGyVAQ6YcfsHp7umtg7lUOs2Jhr9ZE1QGWB0+i/F3ARPAZ3i8s4u7Y
+        A1rChY5B1bL8rNmoNVqw2dzi4BlgpY/t4Gl8ladwb2TcFR/cA9u2u/xZR725D9Y1Mlx8mYnPAy+P49Wt
+        3q6Y0Dao15uMDR4bvwD2IHPnFLB0CZjpBaZP4Pn1c0h+XPnjN3oHyXEcOK0Wi/s8N6IXgWIQyI0D4WN4
+        evUsHxdTab8BXaSj8GJ0AO+iTJwLIXytxxtlBnLSb/A6EsnQheI3kC2HnXck0/MYvnEFUzf78S3UD3F+
+        iX+ZxFTvSTvoYaRN+V9SvYdA4DcZDa931m0XwAAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZFPTNpQHMc7D+469bKr13nz7GkznuY87MQK
+        OhFTqGYXPNvblmVZFpKd5sUZwQ3NYokJejVRRzB2uooE2PijQVotUAb9Ewy/9b0ACrGG+E0++eXX/t7n
+        te8RKAXu06MMv9Cb5j4PpI9XB3je341fdJJYzPOwePSupxD90J8Mj1XLEWacdr0JUdOU6LBT4lQbdgPq
+        9UzWarFvY0Fm92OvHHn/XPs5DHr4BejcK1AVCVTtnynligxIggVnobd9xfCIsu15WtMPZwa1vWegHZAQ
+        z9dMQRKSpMS64GtfiWee6PsvQdsZAjU0CoIg6FwiC8veb7DOBpqsrv2Aw+RFqwAdmMD7H09POq40Q8IG
+        2VM0kJSqkBAViBskRLVJMl9tFTQybptSxIIMbGADD0RPJfiysAhLS94mvhU/xLKyuUAqVfCnooHURRn4
+        v+dw9KeV1KXSmSCSLQOXOIcDA1QbnORMBLY2wXFGAq/ve/MAEag/OSuaCKytgvhlFaKCco2xczSn4ucd
+        CX7dco2o/51qu8ZGrORk/qYgI9cw6Xq9ya0Ci8VZKRiC4OYWHrgLRS3BxMQsX19KEADwwPgF1u2eB5fT
+        DbRrDlczaJrWbaQjwDBMV11x3xDEf8bvbDj6Irl1AAAAAElFTkSuQmCC
+</value>
+  </data>
+  <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGzSURBVDhPlZO5SgNRFIYnTvIANmLhFrAQwSohncS98wEU
+        G1HEysIiQRs7RcVChyFVKhstTKEEIwRcigQEGws7l4BMyGbWyZ783jNkYjSjiQc+Zrjc/5tz7mW4WvUw
+        TAxLCwYYHYymMmWz2YTP56uUy2Vokc/nIQjCIdurKbFQOJPJQJblOslkEvF4HKFQSJEEg0GIotgk0TEs
+        tCGXy6FQKChPIp1OI5FIIBwOKwLWJegjDodDlShVF1BYhQQUSKVSiEQi38YhKFPLfglKpVJ9A73T3Ooo
+        0WhU6USSpN8FP2mUUCd0HrFYrH0BoUpoHDoTEtF62wKiWCwq50ISgtb+JaAu3s6O4F8chnfSgNv5fggW
+        nfingEIqAZeAR9socu4DVJ88kE/WcW0dqVyN6ddaCqj9u4VBZFkYR7OAvRPYNiKyNwb3OP/yq6BRQm1X
+        H1xorPhWN3Ym9NW6wO/3V7UkxM1cHzLOJYCF8jYOH4zAKg/PNP9OAiozux6ZSTR/ptfTfdyvDEGyGxHe
+        MOB5WQevVV+5nOrYrOW5XoaZQVejiXOmSzyf4CVq+8LKh45H+V2O47hPEKaEPxpcorEAAAAASUVORK5C
+        YII=
+</value>
+  </data>
+</root>

+ 1088 - 0
FRM/frmBonos.vb

@@ -0,0 +1,1088 @@
+Public Class frmBonos
+    Dim oBonosCE As New BonosCE
+    Dim oBonosDAO As New BonosDAO
+    Dim oDAOGeneral As New DAOGeneral
+    Dim TotalValorCupones As Double
+    Dim codigo As String = Variables.Codigo
+    Dim BonosConsulta As New BonosDAO
+    Dim Estado As String = String.Empty
+    Dim Operaciones As New Operaciones
+    Dim InstrumentoFinanciero As String = oDAOGeneral.ObtenerInstrumento(Variables.Codigo)
+    'Private _Modo As String
+    Private _IdDocumento As Integer
+    Private _TipoDocumento As String
+    Private _CodigoInversion As String
+    Private _TipoTransaccion As String 'N=Nuevo, A=Actualizar, C=Consulta
+
+
+    Public Property TipoTransaccion As String
+        Get
+            Return _TipoTransaccion
+        End Get
+        Set(value As String)
+            _TipoTransaccion = value
+        End Set
+    End Property
+    Private Property IdDocumento As Integer
+        Get
+            Return _IdDocumento
+        End Get
+        Set(value As Integer)
+            _IdDocumento = value
+        End Set
+    End Property
+    Private Property TipoDocumento As String
+        Get
+            Return _TipoDocumento
+        End Get
+        Set(value As String)
+            _TipoDocumento = value
+        End Set
+    End Property
+    Private Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+    Private Sub frmBonos_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        Call CargarPeriodos()
+        'PrepararTablaImpuestosYComisiones()
+        PrepararTablaIngresos()
+
+        If Me.TipoTransaccion Is Nothing Then
+            Me.TipoTransaccion = "N"
+
+        End If
+
+        If Me.TipoTransaccion = "C" Then
+            Call CargarRegistroBD()
+        End If
+        CargarIngresos()
+        'CargarComisiones()
+    End Sub
+    Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
+        If (TipoTransaccion = "N" Or TipoTransaccion = "A") Then
+            RefrescarClaseEntidad()
+            If TipoTransaccion = "N" Then
+                GuardarNuevoRegistro()
+            End If
+            If TipoTransaccion = "A" Then
+                ActualizarRegistro()
+            End If
+        Else
+            Me.Close()
+        End If
+    End Sub
+    Function RetornarObjeto()
+        Return oBonosCE
+    End Function
+
+    Public Sub CargarRegistro(vId As Integer, vTipo As String)
+        TipoTransaccion = "C"
+        IdDocumento = vId
+        TipoDocumento = vTipo
+    End Sub
+    Public Sub CargarRegistro(ByVal CodInversion As String)
+        TipoTransaccion = "C"
+        CodigoInversion = CodInversion
+    End Sub
+    Private Sub CargarRegistroBD()
+        oBonosCE = Nothing
+        oBonosCE = oBonosDAO.CargarRegistro(Me.CodigoInversion)
+
+        TipoTransaccion = "C"
+        RefrescarValorControles()
+
+    End Sub
+    Private Sub dtpUltimaFechaCuponCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpUltimaFechaCuponCompra.ValueChanged
+        'ActivarEdicion()
+        ControlUltimaFechaCuponCompra()
+    End Sub
+    Private Sub dtpSiguienteFechaCuponCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpSiguienteFechaCuponCompra.ValueChanged
+        'ActivarEdicion()
+        ControlSiguienteFechaCuponCompra()
+    End Sub
+    Private Sub dtpFechaLiquidacionCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaLiquidacionCompra.ValueChanged
+        'ActivarEdicion()
+        ControlFechaLiquidacionCompra()
+    End Sub
+    Private Sub dtpFechaVencimientoCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoCompra.ValueChanged
+        'ActivarEdicion()
+        ControlFechaVencimientoCompra()
+    End Sub
+    Private Sub txtPorcentajeCuponCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeCuponCompra.TextChanged
+        'ActivarEdicion()
+    End Sub
+
+    Private Sub txtPrecioCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioCompra.TextChanged
+        'ActivarEdicion()
+    End Sub
+    Private Sub txtPrecioAlVencimientoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoCompra.TextChanged
+        'ActivarEdicion()
+    End Sub
+    Private Sub txtCostoTransferenciaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtCostoTransferenciaCompra.TextChanged
+        'RefrescarMontoAPagarCompra()
+        'ActivarEdicion()
+    End Sub
+
+    Private Sub dtpFechaVencimientoVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoVenta.ValueChanged
+
+        'ActivarEdicion()
+        ControlFechaVencimientoVenta()
+
+    End Sub
+    Private Sub ControlFechaVencimientoVenta()
+        Dim valor As Date
+        valor = dtpFechaVencimientoVenta.Value.Date
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            oBonosCE.FechaVencimientoVenta = valor
+            RefrescarValorControles()
+
+        End If
+
+    End Sub
+    Private Sub cboAnioBaseC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBaseC.SelectedIndexChanged
+        'ActivarEdicion()
+        ControlAnioBaseCompra()
+    End Sub
+
+    Private Sub cboAnioBaseV_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBaseV.SelectedIndexChanged
+        'RefrescarInteresAcumuladoVenta()
+        'RefrescarDiasAlVencimientoVenta()
+        'RefrescarDiasAcumuladosVenta()
+        ControlAnioBaseVenta()
+        'ActivarEdicion()
+    End Sub
+    Private Sub ControlAnioBaseVenta()
+        Dim valor As Integer
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            If cboAnioBaseV.SelectedIndex > -1 Then
+                oBonosCE.DiasBaseVenta = cboAnioBaseV.SelectedItem
+            Else
+                oBonosCE.DiasBaseVenta = 365
+            End If
+        End If
+    End Sub
+    Sub CargarPeriodos()
+        Dim vTipoTransaccion As String = Me.TipoTransaccion
+        TipoTransaccion = "X"
+        Me.cboPeriodosC.DataSource = oDAOGeneral.ListaPeriodicidad
+        Me.cboPeriodosC.ValueMember = "Codigo"
+        Me.cboPeriodosC.DisplayMember = "Descripcion"
+        Me.cboPeriodosC.SelectedIndex = -1
+
+        Me.cboPeriodosV.DataSource = oDAOGeneral.ListaPeriodicidad
+        Me.cboPeriodosV.ValueMember = "Codigo"
+        Me.cboPeriodosV.DisplayMember = "Descripcion"
+        Me.cboPeriodosV.SelectedIndex = -1
+        TipoTransaccion = vTipoTransaccion
+
+    End Sub
+    Private Sub cboPeriodosC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodosC.SelectedIndexChanged
+
+        ControlPeriodosCompra()
+    End Sub
+
+    Private Sub cboPeriodosV_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodosV.SelectedIndexChanged
+        'ActivarEdicion()
+    End Sub
+
+    Function CalcularCupones() As DataTable
+        Dim dtCupones As New DataTable
+        Dim vFechaLiquidacionCompra As Date = oBonosCE.FechaLiquidacionCompra
+        Dim vFechaLiquidacionVenta As Date = oBonosCE.FechaLiquidacionVenta
+        Dim vSiguienteFechaCuponCompra As Date = oBonosCE.SiguienteFechaCuponCompra
+        Dim vPeriodicidad As String = oBonosCE.PeriodicidadCompra
+        Dim vValorNominalCompra As Double = oBonosCE.ValorNominalCompra
+        Dim vPorcentajeCuponCompra As Double = oBonosCE.PorcentajeCuponCompra
+        Dim vAnioBaseCompra As Integer = oBonosCE.DiasBaseCompra
+        Dim vColumnas As DataColumn
+        Dim vFilas As DataRow
+
+        Dim vEstaFecha As Date
+        Dim vSiguienteFecha As Date
+        Dim vDias As Integer
+        Dim vValor As Double
+
+        'CREAMOS COLUMNAS
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Date)
+        vColumnas.ColumnName = "FechaCupon"
+        vColumnas.Caption = "Fecha Cupon"
+        vColumnas.AllowDBNull = False
+        dtCupones.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Integer)
+        vColumnas.ColumnName = "Dias"
+        vColumnas.Caption = "Dias"
+        vColumnas.AllowDBNull = False
+        dtCupones.Columns.Add(vColumnas)
+
+        vColumnas = New DataColumn
+        vColumnas.DataType = GetType(Double)
+        vColumnas.ColumnName = "Valor"
+        vColumnas.Caption = "Valor Cupon"
+        vColumnas.AllowDBNull = False
+        dtCupones.Columns.Add(vColumnas)
+
+        vSiguienteFecha = vSiguienteFechaCuponCompra
+        vDias = DateDiff(DateInterval.Day, vFechaLiquidacionCompra, vSiguienteFechaCuponCompra)
+
+        Dim ControlBucle As Integer = 1
+
+        While vSiguienteFecha <= vFechaLiquidacionVenta
+            vEstaFecha = vSiguienteFecha
+            vFilas = dtCupones.NewRow
+            vFilas("FechaCupon") = vSiguienteFecha
+            vFilas("Dias") = vDias
+
+            Try
+                vValor = vValorNominalCompra * vPorcentajeCuponCompra * vDias / vAnioBaseCompra
+            Catch ex As Exception
+                vValor = 0
+            End Try
+
+            vFilas("Valor") = vValor
+            dtCupones.Rows.Add(vFilas)
+
+            If vPeriodicidad = "S" Then
+                vSiguienteFecha = vSiguienteFecha.AddMonths(6)
+            ElseIf vPeriodicidad = "M" Then
+                vSiguienteFecha = vSiguienteFecha.AddMonths(1)
+            Else
+                Exit While
+            End If
+
+            If vAnioBaseCompra = 360 Then
+                vDias = Utilidades.Days360(vEstaFecha, vSiguienteFecha)
+            Else
+                vDias = DateDiff(DateInterval.Day, vEstaFecha, vSiguienteFecha)
+            End If
+
+
+
+        End While
+
+        Try
+            TotalValorCupones = dtCupones.Compute("SUM(Valor)", "")
+        Catch ex As Exception
+            TotalValorCupones = 0
+        End Try
+
+        'Me.txtTotalIngresoCupones.Text = TotalValorCupones.ToString
+
+        Return dtCupones
+        dtCupones.Dispose()
+    End Function
+    Private Sub CalcularIngresos(ByVal IdFila As Integer)
+        Dim vFila As DataGridViewRow = dgvIngresos.Rows(IdFila)
+        Dim IdFilaAnterior As Integer = IdFila - 1
+        Dim vFilaAnterior As DataGridViewRow
+        Dim vNumCupon As Integer
+        Dim vFechaCupon As Date
+        Dim vFechaAnteriorCupon As Date
+        Dim vDias As Integer
+        Dim vIngreso As Double
+        Dim vImpuesto As Double
+        Dim vLiquido As Double
+        Dim vValorNominal As Double = oBonosCE.ValorNominalCompra
+        Dim vPorcentajeCupon As Double = oBonosCE.PorcentajeCuponCompra
+        Dim vDiasBase As Integer = oBonosCE.DiasBaseCompra
+
+        If Not vFila.IsNewRow Then
+            'Date.TryParse(vFila.Cells("FechaCupon").Value.ToString, vFechaCupon)
+
+            If (IdFila) > 0 Then
+                vFilaAnterior = dgvIngresos.Rows(IdFilaAnterior)
+                vNumCupon = vFilaAnterior.Cells("NumCupon").Value
+                vNumCupon += 1
+
+                vFechaCupon = vFila.Cells("FechaCupon").Value
+                vFechaAnteriorCupon = vFilaAnterior.Cells("FechaCupon").Value
+                vDias = DateDiff(DateInterval.Day, vFechaCupon, vFechaAnteriorCupon)
+
+                vIngreso = vValorNominal * vPorcentajeCupon * vDias / vDiasBase
+                vImpuesto = vIngreso * 0.1
+                vLiquido = vIngreso - vImpuesto
+
+                vFila.Cells("NumCupon").Value = vNumCupon
+                vFila.Cells("Dias").Value = vDias
+                vFila.Cells("Ingreso").Value = vIngreso
+                vFila.Cells("MontoImpuesto").Value = vImpuesto
+                vFila.Cells("Liquido").Value = vLiquido
+            Else
+                vFila.Cells("NumCupon").Value = 1
+                vFila.Cells("Dias").Value = 0
+                vFila.Cells("Ingreso").Value = 0
+                vFila.Cells("MontoImpuesto").Value = 0
+                vFila.Cells("Liquido").Value = 0
+            End If
+
+        End If
+
+    End Sub
+    'Sub RefrescarTablaIngresos()
+    '    'Me.dgvIngresos.DataSource = CalcularCupones()
+    'End Sub
+    Private Sub RefrescarValorControles()
+        'Me.cboCasa_C.SelectedValue = oBonosCE.CodigoCasaCompra.ToString
+        Me.cboPeriodosC.SelectedValue = oBonosCE.PeriodicidadCompra.ToString
+        Me.txtValorNominalCompra.Text = oBonosCE.ValorNominalCompra.ToString(Configuraciones.CodigoTXTMontos)
+        Me.dtpUltimaFechaCuponCompra.Value = oBonosCE.UltimaFechaCuponCompra
+        Me.dtpSiguienteFechaCuponCompra.Value = oBonosCE.SiguienteFechaCuponCompra
+        Me.dtpFechaLiquidacionCompra.Value = oBonosCE.FechaLiquidacionCompra
+        Me.dtpFechaVencimientoCompra.Value = oBonosCE.FechaVencimientoCompra
+        Me.txtPorcentajeCuponCompra.Text = oBonosCE.PorcentajeCuponCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtYTMAlVencimientoCompra.Text = oBonosCE.YTMAlVencimientoCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtYTMAlVencimientoComisionCompra.Text = oBonosCE.YTMAlVencimientoComisionCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtPrecioAlVencimientoCompra.Text = oBonosCE.PrecioAlVencimientoCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtPrecioCompra.Text = oBonosCE.PrecioCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.cboAnioBaseC.SelectedItem = oBonosCE.DiasBaseCompra.ToString
+        Me.txtDiasAcumuladosCompra.Text = oBonosCE.DiasAcumuladosCompra.ToString
+        Me.txtDiasAlVencimientoCompra.Text = oBonosCE.DiasAlVencimientoCompra.ToString
+        Me.txtPorcentajeInteresAcumuladoCompra.Text = oBonosCE.PorcentajeInteresAcumuladoCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtInteresAcumuladoCompra.Text = oBonosCE.InteresAcumuladoCompra.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtPrecioSucioCompra.Text = oBonosCE.PrecioSucioCompra.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtValorTransadoCompra.Text = oBonosCE.ValorTransadoCompra.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtMontoAPagar.Text = oBonosCE.MontoAPagarCompra.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtCostoTransferenciaCompra.Text = oBonosCE.CostoDeTransferenciaCompra.ToString(Configuraciones.CodigoTXTMontos)
+
+        'Me.cboCasa_V.SelectedValue = oBonosCE.CodigoCasaVenta.ToString
+        Me.cboPeriodosV.SelectedValue = oBonosCE.PeriodicidadVenta.ToString
+        Me.txtValorNominalVenta.Text = oBonosCE.ValorNominalVenta.ToString(Configuraciones.CodigoTXTMontos)
+        Me.dtpUltimaFechaCuponVenta.Value = oBonosCE.UltimaFechaCuponVenta
+        Me.dtpSiguienteFechaCuponVenta.Value = oBonosCE.SiguienteFechaCuponVenta
+        Me.dtpFechaLiquidacionVenta.Value = oBonosCE.FechaLiquidacionVenta
+        Me.dtpFechaVencimientoVenta.Value = oBonosCE.FechaVencimientoVenta
+        Me.txtPorcentajeCuponVenta.Text = oBonosCE.PorcentajeCuponVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtYTMAlVencimientoComisionVenta.Text = oBonosCE.YTMAlVencimientoComisionVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtYTMAlVencimientoVenta.Text = oBonosCE.YTMAlVencimientoVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtPrecioAlVencimientoVenta.Text = oBonosCE.PrecioAlVencimientoVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtPrecioVenta.Text = oBonosCE.PrecioVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.cboAnioBaseV.SelectedItem = oBonosCE.DiasBaseVenta.ToString
+        Me.txtDiasAcumuladosVenta.Text = oBonosCE.DiasAcumuladosVenta.ToString
+        Me.txtDiasAlVencimientoVenta.Text = oBonosCE.DiasAlVencimientoVenta.ToString
+        Me.txtPorcentajeInteresAcumuladoVenta.Text = oBonosCE.InteresAcumuladoPorcentajeVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtInteresAcumuladoVenta.Text = oBonosCE.InteresAcumuladoVenta.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtPrecioSucioVenta.Text = oBonosCE.PrecioSucioVenta.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtValorTransadoVenta.Text = oBonosCE.ValorTransadoVenta.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtMontoARecibir.Text = oBonosCE.MontoARecibirVenta.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtCostoTransferenciaVenta.Text = oBonosCE.CostoDeTransferenciaVenta.ToString(Configuraciones.CodigoTXTMontos)
+
+        Me.txtValorNominal_Op.Text = oBonosCE.ValorNominalRO.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtPlazo_Op.Text = oBonosCE.DiasPlazoRO.ToString
+        Me.txtPrecioCompra_Op.Text = oBonosCE.PrecioCompraRO.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtPrecioVenta_Op.Text = oBonosCE.PrecioVentaRO.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtGananciaPerdidaCapital_Op.Text = oBonosCE.GananciaPerdidaDeCapital.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtIngresosPorIntereses_Op.Text = oBonosCE.IngresoPorInteres.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtCostosTotales_Op.Text = oBonosCE.CostosTotales.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtGananciaPerdidaTotal_Op.Text = oBonosCE.GananciaPerdidaTotal.ToString(Configuraciones.CodigoTXTMontos)
+        Me.txtRendimientoGananciaPerdida_Op.Text = oBonosCE.RendimientoGananciaPerdida.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtRendimientoIntereses_Op.Text = oBonosCE.RendimientoDeIntereses.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtRendimientoAntesISR_Op.Text = oBonosCE.RendimientoAntesImpuestos.ToString(Configuraciones.CodigoTXTPorcentaje)
+        Me.txtRendimientoDespuesISR_Op.Text = oBonosCE.RendimientoDespuesImpuestos.ToString(Configuraciones.CodigoTXTPorcentaje)
+
+        If Me.TipoTransaccion = "N" Then Me.btnAceptar.Text = "Guardar"
+        If Me.TipoTransaccion = "A" Then Me.btnAceptar.Text = "Guardar"
+        If Me.TipoTransaccion = "C" Then Me.btnAceptar.Text = "Aceptar"
+
+    End Sub
+    Private Sub RefrescarClaseEntidad()
+        ControlValorNominalCompra()
+        ControlUltimaFechaCuponCompra()
+        ControlSiguienteFechaCuponCompra()
+        ControlFechaLiquidacionCompra()
+        ControlFechaVencimientoCompra()
+        ControlPorcentajeCuponCompra()
+        'ControlYTMAlVencimientoCompra()
+        ControlPrecioAlVencimientoCompra()
+        ControlPrecioCompra()
+        ControlAnioBaseCompra()
+        ControlCostosDeTransferencia()
+
+        'ControlValorNominalv
+        ControlUltimaFechaCuponCompra()
+        ControlSiguienteFechaCuponCompra()
+        ControlFechaLiquidacionCompra()
+        ControlFechaVencimientoCompra()
+        ControlPorcentajeCuponCompra()
+        'ControlYTMAlVencimientoCompra()
+        ControlPrecioAlVencimientoCompra()
+        ControlPrecioCompra()
+        ControlAnioBaseCompra()
+        ControlCostosDeTransferencia()
+
+
+    End Sub
+    Private Sub GuardarNuevoRegistro()
+        Dim res As Integer
+        RefrescarClaseEntidad()
+
+        res = oBonosDAO.Nuevo(oBonosCE)
+        If res = 1 Then
+            MsgBox("Registro Guardado")
+        Else
+            MsgBox("Algo no salio bien.")
+        End If
+
+    End Sub
+    Private Sub ActualizarRegistro()
+        Dim res As Integer
+        RefrescarClaseEntidad()
+
+        res = oBonosDAO.Actualizar(oBonosCE)
+
+        If res = 1 Then
+            MsgBox("Registro Guardado")
+        Else
+            MsgBox("Algo no salio bien.")
+        End If
+
+    End Sub
+    'Private Sub ActivarEdicion()
+    '    If TipoTransaccion = "C" Then
+    '        Me.TipoTransaccion = "A"
+    '        Me.btnAceptar.Text = "Guardar"
+    '    End If
+
+    'End Sub
+    Private Sub ControlPeriodosCompra()
+        Dim valor As String
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            If Me.cboPeriodosC.SelectedIndex = -1 Then
+                valor = ""
+            Else
+                valor = Me.cboPeriodosC.SelectedValue
+            End If
+            oBonosCE.PeriodicidadCompra = valor
+            RefrescarValorControles()
+        End If
+    End Sub
+    Private Sub ControlValorNominalCompra()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtValorNominalCompra.Text, valor) Then
+            Me.txtValorNominalCompra.BackColor = Configuraciones.ColorFondoError
+            Me.txtValorNominalCompra.Focus()
+        Else
+            Me.txtValorNominalCompra.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                Me.oBonosCE.ValorNominalCompra = valor
+                RefrescarValorControles()
+            End If
+        End If
+
+    End Sub
+    Private Sub ControlUltimaFechaCuponCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oBonosCE.UltimaFechaCuponCompra = dtpUltimaFechaCuponCompra.Value.Date
+            RefrescarValorControles()
+        End If
+    End Sub
+    Private Sub ControlSiguienteFechaCuponCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oBonosCE.SiguienteFechaCuponCompra = dtpSiguienteFechaCuponCompra.Value.Date
+            RefrescarValorControles()
+        End If
+    End Sub
+    Private Sub ControlFechaLiquidacionCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oBonosCE.FechaLiquidacionCompra = dtpFechaLiquidacionCompra.Value.Date
+            RefrescarValorControles()
+        End If
+    End Sub
+    Private Sub ControlFechaVencimientoCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oBonosCE.FechaVencimientoCompra = dtpFechaVencimientoCompra.Value.Date
+            RefrescarValorControles()
+        End If
+    End Sub
+    Private Sub ControlPorcentajeCuponCompra()
+        Dim valor As Double
+
+        If Not Double.TryParse(txtPorcentajeCuponCompra.Text.Replace("%", ""), valor) Then
+            Me.txtPorcentajeCuponCompra.BackColor = Configuraciones.ColorFondoError
+            Me.txtPorcentajeCuponCompra.Focus()
+        Else
+            Me.txtPorcentajeCuponCompra.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                Me.oBonosCE.PorcentajeCuponCompra = valor / 100
+                RefrescarValorControles()
+            End If
+        End If
+
+    End Sub
+    Private Sub ControlAnioBaseCompra()
+        Dim valor As Integer
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            valor = cboAnioBaseC.SelectedItem
+            Me.oBonosCE.DiasBaseCompra = valor
+            RefrescarValorControles()
+        End If
+
+    End Sub
+
+    Private Sub txtValorNominalCompra_LostFocus(sender As Object, e As EventArgs) Handles txtValorNominalCompra.LostFocus
+        ControlValorNominalCompra()
+    End Sub
+
+
+    Private Sub ControlPrecioAlVencimientoCompra()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtPrecioAlVencimientoCompra.Text.Replace("%", String.Empty), valor) Then
+            Me.txtPrecioAlVencimientoCompra.BackColor = Configuraciones.ColorFondoError
+            Me.txtPrecioAlVencimientoCompra.Focus()
+        Else
+            Me.txtPrecioAlVencimientoCompra.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                Me.oBonosCE.PrecioAlVencimientoCompra = valor / 100
+                RefrescarValorControles()
+            End If
+        End If
+
+    End Sub
+    Private Sub ControlPrecioCompra()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtPrecioCompra.Text.Replace("%", String.Empty), valor) Then
+            Me.txtPrecioCompra.BackColor = Configuraciones.ColorFondoError
+            Me.txtPrecioCompra.Focus()
+        Else
+            Me.txtPrecioCompra.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                Me.oBonosCE.PrecioCompra = valor / 100
+                RefrescarValorControles()
+            End If
+
+        End If
+    End Sub
+    Private Sub ControlCostosDeTransferencia()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtCostoTransferenciaCompra.Text, valor) Then
+            Me.txtCostoTransferenciaCompra.BackColor = Configuraciones.ColorFondoError
+            Me.txtCostoTransferenciaCompra.Focus()
+        Else
+            Me.txtCostoTransferenciaCompra.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                Me.oBonosCE.CostoDeTransferenciaCompra = valor
+                RefrescarValorControles()
+
+            End If
+        End If
+    End Sub
+    Private Sub txtPorcentajeCuponCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeCuponCompra.LostFocus
+        ControlPorcentajeCuponCompra()
+    End Sub
+    Private Sub txtPrecioAlVencimientoCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoCompra.LostFocus
+        ControlPrecioAlVencimientoCompra()
+    End Sub
+
+    Private Sub txtPrecioCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioCompra.LostFocus
+        ControlPrecioCompra()
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_LostFocus(sender As Object, e As EventArgs) Handles txtCostoTransferenciaCompra.LostFocus
+        ControlCostosDeTransferencia()
+    End Sub
+
+    Private Sub dtpSiguienteFechaCuponVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpSiguienteFechaCuponVenta.ValueChanged
+        'ActivarEdicion()
+    End Sub
+
+
+    Private Sub txtCostoTransferenciaVenta_TextChanged(sender As Object, e As EventArgs) Handles txtCostoTransferenciaVenta.TextChanged
+        'ActivarEdicion()
+    End Sub
+
+    'Private Sub PrepararTablaImpuestosYComisiones()
+    '    Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+    '    Dim oDataGridViewComboBoxColumn As DataGridViewComboBoxColumn
+
+    '    oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+    '    oDataGridViewComboBoxColumn.Name = "CodImp"
+    '    oDataGridViewComboBoxColumn.HeaderText = "Tipo Impuesto"
+    '    oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTiposImpuesto
+    '    oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+    '    oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+    '    oDataGridViewComboBoxColumn.DataPropertyName = "CodImp"
+    '    oDataGridViewComboBoxColumn.DisplayIndex = 0
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+    '    oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+    '    oDataGridViewComboBoxColumn.Name = "TipoOper"
+    '    oDataGridViewComboBoxColumn.HeaderText = "Tipo Operación"
+    '    oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTipoOperacion
+    '    oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+    '    oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+    '    oDataGridViewComboBoxColumn.DataPropertyName = "TipoOper"
+    '    oDataGridViewComboBoxColumn.DisplayIndex = 1
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "PorcImp"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Porcentaje"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "PorcImp"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTPorcentaje
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 2
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "MontoSujeto"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Monto Sujeto"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "MontoSujeto"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+    '    oDataGridViewTextBoxColumn.ReadOnly = True
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 3
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "MontoImp"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Monto Impuesto"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "MontoImp"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 4
+    '    oDataGridViewTextBoxColumn.ReadOnly = True
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "CodInv"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.Visible = False
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    Me.dgvImpuestosYComisiones.DataSource = oBonosCE.ImpuestosYComisiones
+    'End Sub
+    'Private Sub PrepararImpuestosYComisiones(ByVal IdFila As Integer)
+    '    Dim vFila As DataGridViewRow = dgvImpuestosYComisiones.Rows(IdFila)
+    '    If vFila.IsNewRow Then
+    '        vFila.Cells("TipoOper").Value = "V"
+    '        vFila.Cells("PorcImp").Value = 0
+    '        vFila.Cells("MontoSujeto").Value = oBonosCE.ValorTransadoVenta
+    '        vFila.Cells("MontoImp").Value = 0.00
+    '    End If
+    'End Sub
+    'Private Sub CalcularImpuestosYComisiones(ByVal IdFila As Integer, ByVal IdCol As Integer)
+    '    Dim vFila As DataGridViewRow = dgvImpuestosYComisiones.Rows(IdFila)
+    '    Dim vTipoOperacion As String
+    '    Dim vCodigoImpuesto As String
+    '    Dim vPorcentajeImpuesto As Double
+    '    Dim vMontoSujeto As Double
+    '    Dim vMontoImpuesto As Double
+
+    '    If Not vFila.IsNewRow Then
+    '        vCodigoImpuesto = vFila.Cells("CodImp").Value.ToString
+    '        vTipoOperacion = vFila.Cells("TipoOper").Value.ToString
+    '        Double.TryParse(vFila.Cells("PorcImp").Value.ToString, vPorcentajeImpuesto)
+    '        If IdCol = 3 Then
+    '            vPorcentajeImpuesto = vPorcentajeImpuesto / 100
+    '            vFila.Cells("PorcImp").Value = vPorcentajeImpuesto
+    '        End If
+
+    '        If vTipoOperacion = "C" Then
+    '            vMontoSujeto = oBonosCE.ValorTransadoCompra
+    '            vFila.Cells("MontoSujeto").Value = oBonosCE.ValorTransadoCompra
+    '        ElseIf vTipoOperacion = "V" Then
+    '            vMontoSujeto = oBonosCE.ValorTransadoVenta
+    '            vFila.Cells("MontoSujeto").Value = oBonosCE.ValorTransadoVenta
+    '        Else
+    '            vMontoSujeto = 0
+    '        End If
+
+    '        vMontoImpuesto = vMontoSujeto * vPorcentajeImpuesto
+    '        vFila.Cells("MontoImp").Value = vMontoImpuesto
+
+    '    End If
+
+    '    RefrescarClaseEntidad()
+    '    RefrescarValorControles()
+    'End Sub
+    'Function CalcularComisiones(ByVal TipoImp As String, ByVal TipoOpe As String)
+    '    Dim Cantidad = dgvImpuestosYComisiones.Rows.Count - 1
+    '    Dim Comision
+    '    For i As Integer = 0 To Cantidad
+
+
+    '        Comision = dgvIngresos.Rows(i).Cells(3)
+    '    Next
+
+
+    'End Function
+    'Private Sub dgvImpuestosYComisiones_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs)
+    '    'ActivarEdicion()
+    '    PrepararImpuestosYComisiones(e.RowIndex)
+    'End Sub
+
+    'Private Sub dgvImpuestosYComisiones_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs)
+    '    CalcularImpuestosYComisiones(e.RowIndex, e.ColumnIndex)
+    'End Sub
+
+    Private Sub dgvImpuestosYComisiones_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs)
+        'ActivarEdicion()
+        oBonosCE.ImpuestosYComisiones.AcceptChanges()
+    End Sub
+
+    Private Sub PrepararTablaIngresos()
+        Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "CodInv"
+        oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+        oDataGridViewTextBoxColumn.HeaderText = "Código Inversión"
+        oDataGridViewTextBoxColumn.ValueType = GetType(String)
+        oDataGridViewTextBoxColumn.Visible = False
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "NumCupon"
+        oDataGridViewTextBoxColumn.DataPropertyName = "NumCupon"
+        oDataGridViewTextBoxColumn.HeaderText = "No. Cupón"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Integer)
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "FechaCupon"
+        oDataGridViewTextBoxColumn.DataPropertyName = "FechaCupon"
+        oDataGridViewTextBoxColumn.HeaderText = "Fecha Cupón"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Date)
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Dias"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Dias"
+        oDataGridViewTextBoxColumn.HeaderText = "Dias "
+        oDataGridViewTextBoxColumn.ValueType = GetType(Integer)
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Ingreso"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Ingreso"
+        oDataGridViewTextBoxColumn.HeaderText = "Ingreso"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "PorcentajeImpuesto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "PorcImpuesto"
+        oDataGridViewTextBoxColumn.HeaderText = "% Impuesto"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "MontoImpuesto"
+        oDataGridViewTextBoxColumn.DataPropertyName = "MontoImpuesto"
+        oDataGridViewTextBoxColumn.HeaderText = "Impuesto"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+        oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+        oDataGridViewTextBoxColumn.Name = "Liquido"
+        oDataGridViewTextBoxColumn.DataPropertyName = "Liquido"
+        oDataGridViewTextBoxColumn.HeaderText = "Liquido"
+        oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+        oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+        Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+    End Sub
+
+    Private Sub txtValorNominalVenta_LostFocus(sender As Object, e As EventArgs) Handles txtValorNominalVenta.LostFocus
+        ControlValorNominalVenta()
+    End Sub
+    Private Sub ControlValorNominalVenta()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtValorNominalVenta.Text, valor) Then
+            Me.txtValorNominalVenta.BackColor = Configuraciones.ColorFondoError
+            Me.txtValorNominalVenta.Focus()
+        Else
+            Me.txtValorNominalVenta.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                oBonosCE.ValorNominalVenta = valor
+                RefrescarValorControles()
+            End If
+        End If
+
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeCuponVenta.LostFocus
+        ControlPorcentajeCuponVenta()
+    End Sub
+    Private Sub ControlPorcentajeCuponVenta()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtPorcentajeCuponVenta.Text, valor) Then
+            Me.txtPorcentajeCuponVenta.BackColor = Configuraciones.ColorFondoError
+            Me.txtPorcentajeCuponVenta.Focus()
+        Else
+            Me.txtPorcentajeCuponVenta.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                oBonosCE.PorcentajeCuponVenta = valor
+                RefrescarValorControles()
+
+            End If
+        End If
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoVenta.LostFocus
+        ControlPrecioAlVencimientoVenta()
+    End Sub
+    Private Sub ControlPrecioAlVencimientoVenta()
+        Dim valor As Double
+        If Not Double.TryParse(Me.txtPrecioAlVencimientoVenta.Text, valor) Then
+            Me.txtPrecioAlVencimientoVenta.BackColor = Configuraciones.ColorFondoError
+            Me.txtPrecioAlVencimientoVenta.Focus()
+        Else
+            Me.txtPrecioAlVencimientoVenta.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                oBonosCE.PrecioAlVencimientoVenta = valor
+                RefrescarValorControles()
+            End If
+        End If
+    End Sub
+
+    Private Sub txtPrecioVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioVenta.LostFocus
+        ControlPrecioVenta()
+    End Sub
+    Private Sub ControlPrecioVenta()
+        Dim valor As Double
+        If Not Double.TryParse(txtPrecioVenta.Text, valor) Then
+            txtPrecioVenta.BackColor = Configuraciones.ColorFondoError
+            txtPrecioVenta.Focus()
+        Else
+            txtPrecioVenta.BackColor = Configuraciones.ColorFondoPredefinido
+            If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+                oBonosCE.PrecioVenta = valor
+                RefrescarValorControles()
+            End If
+        End If
+    End Sub
+
+    Private Sub dgvIngresos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellContentClick
+
+    End Sub
+    Private Sub PrepararCalculoIngresos(ByVal IdFila As Integer)
+        Dim vFila As DataGridViewRow = dgvIngresos.Rows(IdFila)
+        Dim vFilaAnterior As DataGridViewRow
+        Dim vNumCupon As Integer
+        Dim vFechaCupon As Date
+        Dim vFechaCuponAnterior As Date
+        Dim vDias As Integer
+
+        vFechaCupon = Date.Now.Date
+
+        If IdFila > 0 Then
+            vFilaAnterior = dgvIngresos.Rows(IdFila - 1)
+            vNumCupon = vFilaAnterior.Cells("NumCupon").Value
+            vNumCupon += 1
+            vFechaCuponAnterior = vFilaAnterior.Cells("FechaCupon").Value
+            'vFechaCupon = oBonosCE.SiguienteFechaCuponCompra
+        Else
+            vNumCupon = 1
+            vFechaCuponAnterior = oBonosCE.UltimaFechaCuponCompra
+        End If
+
+        vDias = DateDiff(DateInterval.Day, vFechaCuponAnterior, vFechaCupon)
+
+        If vFila.IsNewRow Then
+            vFila.Cells("NumCupon").Value = vNumCupon
+            vFila.Cells("FechaCupon").Value = vFechaCupon
+            vFila.Cells("Dias").Value = vDias
+            vFila.Cells("Ingreso").Value = 0
+            vFila.Cells("PorcentajeImpuesto").Value = 10
+            vFila.Cells("MontoImpuesto").Value = 0
+            vFila.Cells("Liquido").Value = 0.00
+        End If
+    End Sub
+    Private Sub dgvIngresos_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs) Handles dgvIngresos.CellBeginEdit
+        'ActivarEdicion()
+        PrepararCalculoIngresos(e.RowIndex)
+    End Sub
+
+    Private Sub dgvIngresos_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellEndEdit
+        CalcularIngresos(e.RowIndex)
+    End Sub
+
+    Private Sub dgvIngresos_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs) Handles dgvIngresos.UserDeletedRow
+        'ActivarEdicion()
+        oBonosCE.Ingresos.AcceptChanges()
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
+
+    End Sub
+
+    Private Sub btnAccionComision_Click(sender As Object, e As EventArgs)
+        If (Estado = "N") Then
+            'NuevaComision()
+        ElseIf (Estado = "M") Then
+            'ModificarComision()
+        ElseIf (Estado = "B") Then
+            EliminarComision()
+        End If
+    End Sub
+
+    'Function ColecccionComisiones()
+    '    Dim coleccion As New Collection
+    '    Dim TipoImp, TipOp, MontoSuje, PorcImp, MontoImp As String
+    '    TipoImp = dgvImpuestosYComisiones.CurrentRow.Cells(0).Value
+    '    TipOp = dgvImpuestosYComisiones.CurrentRow.Cells(1).Value
+    '    PorcImp = CDec(dgvImpuestosYComisiones.CurrentRow.Cells(2).Value.ToString.TrimEnd("%") / 100)
+    '    MontoSuje = dgvImpuestosYComisiones.CurrentRow.Cells(3).Value
+    '    MontoImp = dgvImpuestosYComisiones.CurrentRow.Cells(4).Value.ToString.TrimEnd("%")
+
+    '    coleccion.Add(TipoImp)
+    '    coleccion.Add(TipOp)
+    '    coleccion.Add(PorcImp)
+    '    coleccion.Add(MontoSuje)
+    '    coleccion.Add(MontoImp)
+    '    Return coleccion
+    'End Function
+
+
+    Function ColeccionIngresos()
+        Dim coleccion As New Collection
+        Dim NoCupon, Fecha, Ingreso, PorcImpuesto, Impuesto, Dias As String
+        NoCupon = dgvIngresos.CurrentRow.Cells(1).Value
+        Fecha = dgvIngresos.CurrentRow.Cells(2).Value
+        Dias = dgvIngresos.CurrentRow.Cells(3).Value
+        Ingreso = dgvIngresos.CurrentRow.Cells(4).Value
+        PorcImpuesto = dgvIngresos.CurrentRow.Cells(5).Value
+        Impuesto = dgvIngresos.CurrentRow.Cells(6).Value
+
+        coleccion.Add(NocUpon)
+        coleccion.Add(Fecha)
+        coleccion.Add(Dias)
+        coleccion.Add(Ingreso)
+        coleccion.Add(PorcImpuesto)
+        coleccion.Add(Impuesto)
+        Return coleccion
+    End Function
+
+    'Sub NuevaComision()
+    '    Dim coleccion = ColecccionComisiones()
+    '    BonosConsulta.NuevoImpuesto(coleccion, codigo)
+    'End Sub
+
+    Sub NuevoIngreso()
+        Dim coleccion = ColeccionIngresos()
+        '   BonosConsulta.NuevoIngreso(coleccion, codigo)
+    End Sub
+    'Sub ModificarComision()
+    '    Dim coleccion = ColecccionComisiones()
+    '    BonosConsulta.ModificarImpuesto(coleccion, codigo)
+    'End Sub
+
+    Sub ModificarIngreso()
+        Dim coleccion = ColeccionIngresos()
+        '    BonosConsulta.ModificarIngreso(coleccion, codigo)
+    End Sub
+
+    Sub EliminarComision()
+        BonosConsulta.EliminarImpuesto(codigo)
+    End Sub
+
+    Sub EliminarIngreso()
+        Dim NoCupon = dgvIngresos.CurrentRow.Cells(0).Value
+        ' BonosConsulta.EliminarIngreso(codigo, NoCupon)
+    End Sub
+
+    Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
+        'btnAccionComision.Text = "Modificar"
+        btnAccionIngreso.Text = "Modificar"
+        Estado = "M"
+    End Sub
+
+    Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
+        'btnAccionComision.Text = "Nuevo"
+        btnAccionIngreso.Text = "Nuevo"
+        Estado = "N"
+    End Sub
+
+    Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
+        'btnAccionComision.Text = "Eliminar"
+        btnAccionIngreso.Text = "Eliminar"
+        Estado = "B"
+    End Sub
+
+    'Sub CargarComisiones()
+
+    '    Dim codigo As String = Variables.Codigo
+    '    Dim dr = BonosConsulta.CargarImpuestos(codigo)
+    '    While dr.Read
+    '        dgvImpuestosYComisiones.Rows.Add(dr("TipoImp"), dr("TipoOp"), ((dr("PorcImp") * 100.0).ToString + "%"), dr("MontoSuje"), dr("MontoImp"))
+    '    End While
+
+
+    'End Sub
+
+    Sub CargarIngresos()
+
+        Dim codigo As String = Variables.Codigo
+        Dim dr = BonosConsulta.CargarIngreso(codigo, InstrumentoFinanciero)
+        While dr.Read
+            dgvIngresos.Rows.Add("", dr("NoCupon"), dr("Fecha"), dr("Dias"), dr("Ingreso"), dr("PorcImpuesto"), dr("Impuesto"))
+        End While
+
+
+    End Sub
+
+    Private Sub btnAccionIngreso_Click(sender As Object, e As EventArgs) Handles btnAccionIngreso.Click
+        If (Estado = "N") Then
+            NuevoIngreso()
+        ElseIf (Estado = "M") Then
+            ModificarIngreso()
+        ElseIf (Estado = "B") Then
+            EliminarIngreso()
+        End If
+    End Sub
+
+    Private Sub TabPage1_Click(sender As Object, e As EventArgs) Handles TabPage1.Click
+
+    End Sub
+
+    Private Sub txtValorNominalCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtValorNominalCompra.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtValorNominalVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtValorNominalVenta.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPorcentajeCuponCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeCuponCompra.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeCuponVenta.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioAlVencimientoCompra.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioAlVencimientoVenta.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPrecioCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioCompra.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtPrecioVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioVenta.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCostoTransferenciaCompra.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+
+    Private Sub txtCostoTransferenciaVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCostoTransferenciaVenta.KeyPress
+        'Operaciones.ValidarEntrada(sender, e)
+    End Sub
+End Class

+ 317 - 0
FRM/frmBuscarReporteVenta.Designer.vb

@@ -0,0 +1,317 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class frmBuscarReporteVenta
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.dtpFechaOperacion = New System.Windows.Forms.DateTimePicker()
+        Me.cboEmpresa = New System.Windows.Forms.ComboBox()
+        Me.cboCasaCorredora = New System.Windows.Forms.ComboBox()
+        Me.lblCasa = New System.Windows.Forms.Label()
+        Me.lblFecha = New System.Windows.Forms.Label()
+        Me.lblEmpresa = New System.Windows.Forms.Label()
+        Me.dgvReportoCompras = New System.Windows.Forms.DataGridView()
+        Me.Panel1 = New System.Windows.Forms.Panel()
+        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
+        Me.rdbDeshabilitarFecha = New System.Windows.Forms.RadioButton()
+        Me.rdbRangoFechas = New System.Windows.Forms.RadioButton()
+        Me.rdbFecha = New System.Windows.Forms.RadioButton()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.dtpFechaOperacion2 = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaOperacion1 = New System.Windows.Forms.DateTimePicker()
+        Me.grpVigencia = New System.Windows.Forms.GroupBox()
+        Me.rdbVigente = New System.Windows.Forms.RadioButton()
+        Me.rdbTodosVigencia = New System.Windows.Forms.RadioButton()
+        Me.Panel2 = New System.Windows.Forms.Panel()
+        Me.Panel3 = New System.Windows.Forms.Panel()
+        CType(Me.dgvReportoCompras, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.Panel1.SuspendLayout()
+        Me.GroupBox1.SuspendLayout()
+        Me.grpVigencia.SuspendLayout()
+        Me.Panel2.SuspendLayout()
+        Me.Panel3.SuspendLayout()
+        Me.SuspendLayout()
+        '
+        'dtpFechaOperacion
+        '
+        Me.dtpFechaOperacion.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.dtpFechaOperacion.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaOperacion.Location = New System.Drawing.Point(21, 67)
+        Me.dtpFechaOperacion.Name = "dtpFechaOperacion"
+        Me.dtpFechaOperacion.Size = New System.Drawing.Size(91, 20)
+        Me.dtpFechaOperacion.TabIndex = 0
+        '
+        'cboEmpresa
+        '
+        Me.cboEmpresa.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.cboEmpresa.FormattingEnabled = True
+        Me.cboEmpresa.Location = New System.Drawing.Point(679, 97)
+        Me.cboEmpresa.Name = "cboEmpresa"
+        Me.cboEmpresa.Size = New System.Drawing.Size(171, 21)
+        Me.cboEmpresa.TabIndex = 1
+        '
+        'cboCasaCorredora
+        '
+        Me.cboCasaCorredora.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.cboCasaCorredora.FormattingEnabled = True
+        Me.cboCasaCorredora.Location = New System.Drawing.Point(679, 42)
+        Me.cboCasaCorredora.Name = "cboCasaCorredora"
+        Me.cboCasaCorredora.Size = New System.Drawing.Size(171, 21)
+        Me.cboCasaCorredora.TabIndex = 2
+        '
+        'lblCasa
+        '
+        Me.lblCasa.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.lblCasa.AutoSize = True
+        Me.lblCasa.Location = New System.Drawing.Point(726, 16)
+        Me.lblCasa.Name = "lblCasa"
+        Me.lblCasa.Size = New System.Drawing.Size(80, 13)
+        Me.lblCasa.TabIndex = 5
+        Me.lblCasa.Text = "Casa Corredora"
+        '
+        'lblFecha
+        '
+        Me.lblFecha.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.lblFecha.AutoSize = True
+        Me.lblFecha.Location = New System.Drawing.Point(44, 39)
+        Me.lblFecha.Name = "lblFecha"
+        Me.lblFecha.Size = New System.Drawing.Size(37, 13)
+        Me.lblFecha.TabIndex = 4
+        Me.lblFecha.Text = "Fecha"
+        '
+        'lblEmpresa
+        '
+        Me.lblEmpresa.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.lblEmpresa.AutoSize = True
+        Me.lblEmpresa.Location = New System.Drawing.Point(726, 81)
+        Me.lblEmpresa.Name = "lblEmpresa"
+        Me.lblEmpresa.Size = New System.Drawing.Size(48, 13)
+        Me.lblEmpresa.TabIndex = 3
+        Me.lblEmpresa.Text = "Empresa"
+        '
+        'dgvReportoCompras
+        '
+        Me.dgvReportoCompras.AllowUserToAddRows = False
+        Me.dgvReportoCompras.AllowUserToDeleteRows = False
+        Me.dgvReportoCompras.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvReportoCompras.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvReportoCompras.BackgroundColor = System.Drawing.Color.White
+        Me.dgvReportoCompras.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvReportoCompras.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.dgvReportoCompras.Location = New System.Drawing.Point(0, 0)
+        Me.dgvReportoCompras.Name = "dgvReportoCompras"
+        Me.dgvReportoCompras.Size = New System.Drawing.Size(907, 282)
+        Me.dgvReportoCompras.TabIndex = 3
+        '
+        'Panel1
+        '
+        Me.Panel1.Controls.Add(Me.Panel3)
+        Me.Panel1.Controls.Add(Me.Panel2)
+        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.Panel1.Location = New System.Drawing.Point(0, 0)
+        Me.Panel1.Name = "Panel1"
+        Me.Panel1.Size = New System.Drawing.Size(907, 424)
+        Me.Panel1.TabIndex = 5
+        '
+        'GroupBox1
+        '
+        Me.GroupBox1.Controls.Add(Me.rdbDeshabilitarFecha)
+        Me.GroupBox1.Controls.Add(Me.lblFecha)
+        Me.GroupBox1.Controls.Add(Me.rdbRangoFechas)
+        Me.GroupBox1.Controls.Add(Me.rdbFecha)
+        Me.GroupBox1.Controls.Add(Me.dtpFechaOperacion)
+        Me.GroupBox1.Controls.Add(Me.Label5)
+        Me.GroupBox1.Controls.Add(Me.Label4)
+        Me.GroupBox1.Controls.Add(Me.dtpFechaOperacion2)
+        Me.GroupBox1.Controls.Add(Me.dtpFechaOperacion1)
+        Me.GroupBox1.Location = New System.Drawing.Point(3, 14)
+        Me.GroupBox1.Name = "GroupBox1"
+        Me.GroupBox1.Size = New System.Drawing.Size(423, 109)
+        Me.GroupBox1.TabIndex = 6
+        Me.GroupBox1.TabStop = False
+        Me.GroupBox1.Text = "Busqueda por Fecha de Operación"
+        '
+        'rdbDeshabilitarFecha
+        '
+        Me.rdbDeshabilitarFecha.AutoSize = True
+        Me.rdbDeshabilitarFecha.Checked = True
+        Me.rdbDeshabilitarFecha.Location = New System.Drawing.Point(355, 19)
+        Me.rdbDeshabilitarFecha.Name = "rdbDeshabilitarFecha"
+        Me.rdbDeshabilitarFecha.Size = New System.Drawing.Size(65, 17)
+        Me.rdbDeshabilitarFecha.TabIndex = 16
+        Me.rdbDeshabilitarFecha.TabStop = True
+        Me.rdbDeshabilitarFecha.Text = "Ninguno"
+        Me.rdbDeshabilitarFecha.UseVisualStyleBackColor = True
+        '
+        'rdbRangoFechas
+        '
+        Me.rdbRangoFechas.AutoSize = True
+        Me.rdbRangoFechas.Location = New System.Drawing.Point(168, 16)
+        Me.rdbRangoFechas.Name = "rdbRangoFechas"
+        Me.rdbRangoFechas.Size = New System.Drawing.Size(127, 17)
+        Me.rdbRangoFechas.TabIndex = 15
+        Me.rdbRangoFechas.Text = "Busqueda Por Rango"
+        Me.rdbRangoFechas.UseVisualStyleBackColor = True
+        '
+        'rdbFecha
+        '
+        Me.rdbFecha.AutoSize = True
+        Me.rdbFecha.Location = New System.Drawing.Point(21, 19)
+        Me.rdbFecha.Name = "rdbFecha"
+        Me.rdbFecha.Size = New System.Drawing.Size(91, 17)
+        Me.rdbFecha.TabIndex = 14
+        Me.rdbFecha.Text = "Buscar Fecha"
+        Me.rdbFecha.UseVisualStyleBackColor = True
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.Location = New System.Drawing.Point(254, 36)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(62, 13)
+        Me.Label5.TabIndex = 10
+        Me.Label5.Text = "Fecha Final"
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Location = New System.Drawing.Point(152, 37)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(67, 13)
+        Me.Label4.TabIndex = 9
+        Me.Label4.Text = "Fecha Inicial"
+        '
+        'dtpFechaOperacion2
+        '
+        Me.dtpFechaOperacion2.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaOperacion2.Location = New System.Drawing.Point(242, 67)
+        Me.dtpFechaOperacion2.Name = "dtpFechaOperacion2"
+        Me.dtpFechaOperacion2.Size = New System.Drawing.Size(100, 20)
+        Me.dtpFechaOperacion2.TabIndex = 8
+        '
+        'dtpFechaOperacion1
+        '
+        Me.dtpFechaOperacion1.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaOperacion1.Location = New System.Drawing.Point(136, 67)
+        Me.dtpFechaOperacion1.Name = "dtpFechaOperacion1"
+        Me.dtpFechaOperacion1.Size = New System.Drawing.Size(100, 20)
+        Me.dtpFechaOperacion1.TabIndex = 7
+        '
+        'grpVigencia
+        '
+        Me.grpVigencia.Controls.Add(Me.rdbTodosVigencia)
+        Me.grpVigencia.Controls.Add(Me.rdbVigente)
+        Me.grpVigencia.Location = New System.Drawing.Point(432, 16)
+        Me.grpVigencia.Name = "grpVigencia"
+        Me.grpVigencia.Size = New System.Drawing.Size(149, 107)
+        Me.grpVigencia.TabIndex = 7
+        Me.grpVigencia.TabStop = False
+        Me.grpVigencia.Text = "Vigencia"
+        '
+        'rdbVigente
+        '
+        Me.rdbVigente.AutoSize = True
+        Me.rdbVigente.Checked = True
+        Me.rdbVigente.Location = New System.Drawing.Point(8, 24)
+        Me.rdbVigente.Name = "rdbVigente"
+        Me.rdbVigente.Size = New System.Drawing.Size(128, 17)
+        Me.rdbVigente.TabIndex = 15
+        Me.rdbVigente.TabStop = True
+        Me.rdbVigente.Text = "Mostrar Solo Vigentes"
+        Me.rdbVigente.UseVisualStyleBackColor = True
+        '
+        'rdbTodosVigencia
+        '
+        Me.rdbTodosVigencia.AutoSize = True
+        Me.rdbTodosVigencia.Location = New System.Drawing.Point(8, 47)
+        Me.rdbTodosVigencia.Name = "rdbTodosVigencia"
+        Me.rdbTodosVigencia.Size = New System.Drawing.Size(93, 17)
+        Me.rdbTodosVigencia.TabIndex = 16
+        Me.rdbTodosVigencia.Text = "Mostrar Todos"
+        Me.rdbTodosVigencia.UseVisualStyleBackColor = True
+        '
+        'Panel2
+        '
+        Me.Panel2.Controls.Add(Me.GroupBox1)
+        Me.Panel2.Controls.Add(Me.grpVigencia)
+        Me.Panel2.Controls.Add(Me.cboCasaCorredora)
+        Me.Panel2.Controls.Add(Me.lblEmpresa)
+        Me.Panel2.Controls.Add(Me.lblCasa)
+        Me.Panel2.Controls.Add(Me.cboEmpresa)
+        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Top
+        Me.Panel2.Location = New System.Drawing.Point(0, 0)
+        Me.Panel2.Name = "Panel2"
+        Me.Panel2.Size = New System.Drawing.Size(907, 142)
+        Me.Panel2.TabIndex = 8
+        '
+        'Panel3
+        '
+        Me.Panel3.Controls.Add(Me.dgvReportoCompras)
+        Me.Panel3.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.Panel3.Location = New System.Drawing.Point(0, 142)
+        Me.Panel3.Name = "Panel3"
+        Me.Panel3.Size = New System.Drawing.Size(907, 282)
+        Me.Panel3.TabIndex = 9
+        '
+        'frmBuscarReporteVenta
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.ClientSize = New System.Drawing.Size(907, 424)
+        Me.Controls.Add(Me.Panel1)
+        Me.Name = "frmBuscarReporteVenta"
+        Me.Text = "frmBuscarReporteVenta"
+        CType(Me.dgvReportoCompras, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.Panel1.ResumeLayout(False)
+        Me.GroupBox1.ResumeLayout(False)
+        Me.GroupBox1.PerformLayout()
+        Me.grpVigencia.ResumeLayout(False)
+        Me.grpVigencia.PerformLayout()
+        Me.Panel2.ResumeLayout(False)
+        Me.Panel2.PerformLayout()
+        Me.Panel3.ResumeLayout(False)
+        Me.ResumeLayout(False)
+
+    End Sub
+
+    Friend WithEvents dtpFechaOperacion As DateTimePicker
+    Friend WithEvents cboEmpresa As ComboBox
+    Friend WithEvents cboCasaCorredora As ComboBox
+    Friend WithEvents lblCasa As Label
+    Friend WithEvents lblFecha As Label
+    Friend WithEvents lblEmpresa As Label
+    Friend WithEvents dgvReportoCompras As DataGridView
+    Friend WithEvents Panel1 As Panel
+    Friend WithEvents grpVigencia As GroupBox
+    Friend WithEvents rdbTodosVigencia As RadioButton
+    Friend WithEvents rdbVigente As RadioButton
+    Friend WithEvents GroupBox1 As GroupBox
+    Friend WithEvents rdbDeshabilitarFecha As RadioButton
+    Friend WithEvents rdbRangoFechas As RadioButton
+    Friend WithEvents rdbFecha As RadioButton
+    Friend WithEvents Label5 As Label
+    Friend WithEvents Label4 As Label
+    Friend WithEvents dtpFechaOperacion2 As DateTimePicker
+    Friend WithEvents dtpFechaOperacion1 As DateTimePicker
+    Friend WithEvents Panel3 As Panel
+    Friend WithEvents Panel2 As Panel
+End Class

+ 120 - 0
FRM/frmBuscarReporteVenta.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 172 - 0
FRM/frmBuscarReporteVenta.vb

@@ -0,0 +1,172 @@
+Public Class frmBuscarReporteVenta
+
+    Private Codigo As String = String.Empty
+
+    Sub New()
+
+        ' Esta llamada es exigida por el diseñador.
+        InitializeComponent()
+
+        ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
+
+    End Sub
+    Sub New(Codigo As String)
+
+        Me.New
+        Me.Codigo = Codigo
+    End Sub
+
+
+
+
+    Private Sub frmBuscarReporteVenta_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        CargarCasasCorredoras()
+        CargarEmpresas()
+        CargarDatosBusqueda()
+    End Sub
+
+    Sub CargarCasasCorredoras()
+        Dim oDAOGeneral As New DAOGeneral
+        If Me.cboCasaCorredora.Items.Count = 0 Or Me.cboCasaCorredora.Items.Count = 1 Then
+            Me.cboCasaCorredora.DataSource = oDAOGeneral.ListaCasasCorredoras.Tables("CasasCorredoras")
+            Me.cboCasaCorredora.DisplayMember = "Descripcion"
+            Me.cboCasaCorredora.ValueMember = "Codigo"
+            Me.cboCasaCorredora.SelectedIndex = 0
+        End If
+    End Sub
+
+    Private Sub CargarEmpresas()
+        Dim oDAOGeneral As New DAOGeneral
+        Me.cboEmpresa.DataSource = oDAOGeneral.ListaEmpresas
+        Me.cboEmpresa.DisplayMember = "Descripcion"
+        Me.cboEmpresa.ValueMember = "Codigo"
+
+        Me.cboEmpresa.SelectedIndex = 0
+
+    End Sub
+
+
+    Sub CargarDatosBusqueda()
+        Dim ReportoVenta As New ReportosDAO
+        Dim ds As New DataSet
+        Dim FechaOperacion1 As Date = Date.Today.Date
+        Dim FechaOperacion2 As Date = Date.Today.Date
+        Dim Empresa As String = ""
+        Dim CasaCorredora As String = ""
+        Dim Estado As String = ""
+        If Not cboEmpresa.SelectedValue Is Nothing Then
+            Empresa = cboEmpresa.SelectedValue.ToString()
+        End If
+        If Not cboCasaCorredora.SelectedValue Is Nothing Then
+            CasaCorredora = cboCasaCorredora.SelectedValue.ToString
+        End If
+        Dim TipoFecha As Integer = 0
+
+
+
+
+        If rdbVigente.Checked Then
+            Estado = "Vigente"
+        End If
+
+
+
+
+        If rdbFecha.Checked Then
+            FechaOperacion1 = Format(dtpFechaOperacion.Value, "dd/MM/yyyy")
+        ElseIf rdbRangoFechas.Checked Then
+            FechaOperacion1 = Format(dtpFechaOperacion1.Value, "dd/MM/yyyy")
+            FechaOperacion2 = Format(dtpFechaOperacion2.Value, "dd/MM/yyyy")
+            TipoFecha = 1
+        Else
+            TipoFecha = 2
+        End If
+        If TipoFecha = 0 Then
+            ds = ReportoVenta.FiltroReportoVenta(FechaOperacion1, "", Estado, Empresa, CasaCorredora)
+        ElseIf TipoFecha = 1 Then
+
+            ds = ReportoVenta.FiltroReportoVenta(FechaOperacion1, FechaOperacion2, Estado, Empresa, CasaCorredora)
+        Else
+            ds = ReportoVenta.FiltroReportoVenta("", "", Estado, Empresa, CasaCorredora)
+        End If
+
+
+
+        dgvReportoCompras.DataSource = ds.Tables(0)
+        Dim Index As Integer = 0
+        Dim Cantidad As Integer = dgvReportoCompras.Rows.Count - 1
+        While (Cantidad >= Index)
+
+
+            If dgvReportoCompras.Rows(Index).Cells("Tipo").Value = "INSTRUMENTO ---> REPORTO" Then
+                dgvReportoCompras.Rows(Index).DefaultCellStyle.BackColor = Drawing.Color.FromArgb(150, 247, 231)
+            Else
+                dgvReportoCompras.Rows(Index).DefaultCellStyle.BackColor = Drawing.Color.FromArgb(247, 230, 150)
+            End If
+
+            If dgvReportoCompras.Rows(Index).Cells("Estado").Value = "Vencido" Then
+
+                dgvReportoCompras.Rows(Index).DefaultCellStyle.ForeColor = Color.Maroon
+            End If
+            Index += 1
+        End While
+    End Sub
+
+    Private Sub dtpFechaVencimiento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacion.ValueChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub cboEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresa.SelectedIndexChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub cboCasaCorredora_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCasaCorredora.SelectedIndexChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Sub CargarRegistro()
+        Dim Codigo As String = dgvReportoCompras.CurrentRow.Cells("CodigoInversion").Value.ToString
+        If Not String.IsNullOrEmpty(Codigo) Then
+            'Dim frmReportoVenta As New frmReporto("venta", Codigo, Me.Codigo)
+
+            If MsgBox("¿Esta Seguro que Desea Seleccionar Este Reporto?", MsgBoxStyle.OkCancel) = DialogResult.OK Then
+                Me.Close()
+                'frmReportoVenta.Show()
+            End If
+        Else
+            MsgBox("Error al Seleccionar el registro")
+        End If
+    End Sub
+
+    Private Sub dgvReportoCompras_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvReportoCompras.CellClick
+        CargarRegistro()
+    End Sub
+
+    Private Sub rdbFecha_CheckedChanged(sender As Object, e As EventArgs) Handles rdbFecha.CheckedChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub rdbRangoFechas_CheckedChanged(sender As Object, e As EventArgs) Handles rdbRangoFechas.CheckedChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub dtpFechaOperacion1_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacion1.ValueChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub dtpFechaOperacion2_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacion2.ValueChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub rdbDeshabilitarFecha_CheckedChanged(sender As Object, e As EventArgs) Handles rdbDeshabilitarFecha.CheckedChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub rdbVigente_CheckedChanged(sender As Object, e As EventArgs) Handles rdbVigente.CheckedChanged
+        CargarDatosBusqueda()
+    End Sub
+
+    Private Sub rdbTodosVigencia_CheckedChanged(sender As Object, e As EventArgs) Handles rdbTodosVigencia.CheckedChanged
+        CargarDatosBusqueda()
+    End Sub
+End Class

+ 1549 - 0
FRM/frmCertificadosDeInversion.Designer.vb

@@ -0,0 +1,1549 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
+Partial Class frmCertificadosDeInversion
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()>
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()>
+    Private Sub InitializeComponent()
+        Me.components = New System.ComponentModel.Container()
+        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmCertificadosDeInversion))
+        Me.Label1 = New System.Windows.Forms.Label()
+        Me.Label2 = New System.Windows.Forms.Label()
+        Me.Label3 = New System.Windows.Forms.Label()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.Label6 = New System.Windows.Forms.Label()
+        Me.Label7 = New System.Windows.Forms.Label()
+        Me.Label8 = New System.Windows.Forms.Label()
+        Me.Label9 = New System.Windows.Forms.Label()
+        Me.Label10 = New System.Windows.Forms.Label()
+        Me.Label11 = New System.Windows.Forms.Label()
+        Me.Label12 = New System.Windows.Forms.Label()
+        Me.Label13 = New System.Windows.Forms.Label()
+        Me.Label16 = New System.Windows.Forms.Label()
+        Me.Label18 = New System.Windows.Forms.Label()
+        Me.Label19 = New System.Windows.Forms.Label()
+        Me.Label20 = New System.Windows.Forms.Label()
+        Me.Label21 = New System.Windows.Forms.Label()
+        Me.dtpUltimaFechaCuponCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpSiguienteFechaCuponCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaLiquidacionCompra = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaVencimientoCompra = New System.Windows.Forms.DateTimePicker()
+        Me.txtValorNominalCompra = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeCuponCompra = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoComisionCompra = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioCompra = New System.Windows.Forms.TextBox()
+        Me.txtDiasAcumuladosCompra = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioCompra = New System.Windows.Forms.TextBox()
+        Me.txtInteresAcumuladoCompra = New System.Windows.Forms.TextBox()
+        Me.txtValorTransadoCompra = New System.Windows.Forms.TextBox()
+        Me.txtMontoAPagar = New System.Windows.Forms.TextBox()
+        Me.txtCostoTransferenciaCompra = New System.Windows.Forms.TextBox()
+        Me.txtDiasAlVencimientoCompra = New System.Windows.Forms.TextBox()
+        Me.Label17 = New System.Windows.Forms.Label()
+        Me.lblBono = New System.Windows.Forms.Label()
+        Me.txtDiasAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtMontoARecibir = New System.Windows.Forms.TextBox()
+        Me.txtValorTransadoVenta = New System.Windows.Forms.TextBox()
+        Me.txtInteresAcumuladoVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioSucioVenta = New System.Windows.Forms.TextBox()
+        Me.txtDiasAcumuladosVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioVenta = New System.Windows.Forms.TextBox()
+        Me.txtPrecioAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoVenta = New System.Windows.Forms.TextBox()
+        Me.txtYTMAlVencimientoComisionVenta = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeCuponVenta = New System.Windows.Forms.TextBox()
+        Me.txtValorNominalVenta = New System.Windows.Forms.TextBox()
+        Me.dtpFechaVencimientoVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpFechaLiquidacionVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpSiguienteFechaCuponVenta = New System.Windows.Forms.DateTimePicker()
+        Me.dtpUltimaFechaCuponVenta = New System.Windows.Forms.DateTimePicker()
+        Me.Label22 = New System.Windows.Forms.Label()
+        Me.Label23 = New System.Windows.Forms.Label()
+        Me.Label24 = New System.Windows.Forms.Label()
+        Me.Label25 = New System.Windows.Forms.Label()
+        Me.Label26 = New System.Windows.Forms.Label()
+        Me.label27 = New System.Windows.Forms.Label()
+        Me.lblIngresosPorIntereses_Op = New System.Windows.Forms.Label()
+        Me.lblCostosTotales_Op = New System.Windows.Forms.Label()
+        Me.lblGananciaPerdidaTotal_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoGananciaPerdida_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoIntereses_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoAntesISR_Op = New System.Windows.Forms.Label()
+        Me.lblRendimientoDespuesISR_Op = New System.Windows.Forms.Label()
+        Me.Label35 = New System.Windows.Forms.Label()
+        Me.txtValorNominal_Op = New System.Windows.Forms.TextBox()
+        Me.txtPlazo_Op = New System.Windows.Forms.TextBox()
+        Me.txtPrecioCompra_Op = New System.Windows.Forms.TextBox()
+        Me.txtPrecioVenta_Op = New System.Windows.Forms.TextBox()
+        Me.txtGananciaPerdidaCapital_Op = New System.Windows.Forms.TextBox()
+        Me.txtIngresosPorIntereses_Op = New System.Windows.Forms.TextBox()
+        Me.txtCostosTotales_Op = New System.Windows.Forms.TextBox()
+        Me.txtGananciaPerdidaTotal_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoGananciaPerdida_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoIntereses_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoAntesISR_Op = New System.Windows.Forms.TextBox()
+        Me.txtRendimientoDespuesISR_Op = New System.Windows.Forms.TextBox()
+        Me.btnAceptar = New System.Windows.Forms.Button()
+        Me.btnCancelar = New System.Windows.Forms.Button()
+        Me.cboAnioBaseC = New System.Windows.Forms.ComboBox()
+        Me.cboAnioBaseV = New System.Windows.Forms.ComboBox()
+        Me.cboPeriodosC = New System.Windows.Forms.ComboBox()
+        Me.cboPeriodosV = New System.Windows.Forms.ComboBox()
+        Me.Label29 = New System.Windows.Forms.Label()
+        Me.dgvIngresos = New System.Windows.Forms.DataGridView()
+        Me.Label30 = New System.Windows.Forms.Label()
+        Me.TabCampos = New System.Windows.Forms.TabControl()
+        Me.TabPage1 = New System.Windows.Forms.TabPage()
+        Me.btnVenderTitulo = New System.Windows.Forms.Button()
+        Me.GrpVenta = New System.Windows.Forms.GroupBox()
+        Me.txtComisionPorBolsaVenta = New System.Windows.Forms.TextBox()
+        Me.txtComisionPorVentaCasa = New System.Windows.Forms.TextBox()
+        Me.txtCuponesRecibidos = New System.Windows.Forms.TextBox()
+        Me.txtComisionVentaBolsa = New System.Windows.Forms.TextBox()
+        Me.txtComisionVentaCasa = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeInteresAcumuladoVenta = New System.Windows.Forms.TextBox()
+        Me.GrpCompra = New System.Windows.Forms.GroupBox()
+        Me.txtComisionPorBolsaCompra = New System.Windows.Forms.TextBox()
+        Me.txtComisionPorCompraCasa = New System.Windows.Forms.TextBox()
+        Me.txtPorcentajeInteresAcumuladoCompra = New System.Windows.Forms.TextBox()
+        Me.txtComisionCompraBolsa = New System.Windows.Forms.TextBox()
+        Me.txtComisionCompraCasa = New System.Windows.Forms.TextBox()
+        Me.GrpInfo = New System.Windows.Forms.GroupBox()
+        Me.Label28 = New System.Windows.Forms.Label()
+        Me.Label15 = New System.Windows.Forms.Label()
+        Me.Label14 = New System.Windows.Forms.Label()
+        Me.TbIngresos = New System.Windows.Forms.TabPage()
+        Me.Panel2 = New System.Windows.Forms.Panel()
+        Me.TabPage4 = New System.Windows.Forms.TabPage()
+        Me.GrpDatos = New System.Windows.Forms.GroupBox()
+        Me.GrpInfoAcc = New System.Windows.Forms.GroupBox()
+        Me.btnQuitar = New System.Windows.Forms.Button()
+        Me.pnlPie = New System.Windows.Forms.Panel()
+        Me.Button1 = New System.Windows.Forms.Button()
+        Me.BindingNavigator1 = New System.Windows.Forms.BindingNavigator(Me.components)
+        Me.BindingNavigatorSeparator = New System.Windows.Forms.ToolStripSeparator()
+        Me.navModificar = New System.Windows.Forms.ToolStripButton()
+        Me.navNuevo = New System.Windows.Forms.ToolStripButton()
+        Me.navEliminar = New System.Windows.Forms.ToolStripButton()
+        Me.btnIngresos = New System.Windows.Forms.ToolStripButton()
+        Me.lblIngresarRenta = New System.Windows.Forms.Label()
+        Me.Panel1 = New System.Windows.Forms.Panel()
+        CType(Me.dgvIngresos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.TabCampos.SuspendLayout()
+        Me.TabPage1.SuspendLayout()
+        Me.GrpVenta.SuspendLayout()
+        Me.GrpCompra.SuspendLayout()
+        Me.GrpInfo.SuspendLayout()
+        Me.TbIngresos.SuspendLayout()
+        Me.Panel2.SuspendLayout()
+        Me.TabPage4.SuspendLayout()
+        Me.GrpDatos.SuspendLayout()
+        Me.GrpInfoAcc.SuspendLayout()
+        Me.pnlPie.SuspendLayout()
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.BindingNavigator1.SuspendLayout()
+        Me.Panel1.SuspendLayout()
+        Me.SuspendLayout()
+        '
+        'Label1
+        '
+        Me.Label1.AutoSize = True
+        Me.Label1.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label1.Location = New System.Drawing.Point(13, 77)
+        Me.Label1.Name = "Label1"
+        Me.Label1.Size = New System.Drawing.Size(87, 18)
+        Me.Label1.TabIndex = 0
+        Me.Label1.Text = "Valor Nominal"
+        '
+        'Label2
+        '
+        Me.Label2.AutoSize = True
+        Me.Label2.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label2.Location = New System.Drawing.Point(13, 98)
+        Me.Label2.Name = "Label2"
+        Me.Label2.Size = New System.Drawing.Size(142, 18)
+        Me.Label2.TabIndex = 1
+        Me.Label2.Text = "Ultima Fecha de Cupon"
+        '
+        'Label3
+        '
+        Me.Label3.AutoSize = True
+        Me.Label3.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label3.Location = New System.Drawing.Point(13, 121)
+        Me.Label3.Name = "Label3"
+        Me.Label3.Size = New System.Drawing.Size(159, 18)
+        Me.Label3.TabIndex = 2
+        Me.Label3.Text = "Siguiente Fecha de Cupon"
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label4.Location = New System.Drawing.Point(13, 143)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(131, 18)
+        Me.Label4.TabIndex = 3
+        Me.Label4.Text = "Fecha de Liquidacion"
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label5.Location = New System.Drawing.Point(13, 166)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(135, 18)
+        Me.Label5.TabIndex = 4
+        Me.Label5.Text = "Fecha de Vencimiento"
+        '
+        'Label6
+        '
+        Me.Label6.AutoSize = True
+        Me.Label6.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label6.Location = New System.Drawing.Point(13, 252)
+        Me.Label6.Name = "Label6"
+        Me.Label6.Size = New System.Drawing.Size(56, 18)
+        Me.Label6.TabIndex = 5
+        Me.Label6.Text = "Cupon %"
+        '
+        'Label7
+        '
+        Me.Label7.AutoSize = True
+        Me.Label7.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label7.Location = New System.Drawing.Point(14, 273)
+        Me.Label7.Name = "Label7"
+        Me.Label7.Size = New System.Drawing.Size(180, 18)
+        Me.Label7.TabIndex = 6
+        Me.Label7.Text = "YTM Al Vencimiento Comision"
+        '
+        'Label8
+        '
+        Me.Label8.AutoSize = True
+        Me.Label8.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
+        Me.Label8.Location = New System.Drawing.Point(14, 294)
+        Me.Label8.Name = "Label8"
+        Me.Label8.Size = New System.Drawing.Size(123, 18)
+        Me.Label8.TabIndex = 7
+        Me.Label8.Text = "YTM Al vencimiento"
+        '
+        'Label9
+        '
+        Me.Label9.AutoSize = True
+        Me.Label9.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label9.Location = New System.Drawing.Point(13, 318)
+        Me.Label9.Name = "Label9"
+        Me.Label9.Size = New System.Drawing.Size(132, 18)
+        Me.Label9.TabIndex = 8
+        Me.Label9.Text = "Precio al Vencimiento"
+        '
+        'Label10
+        '
+        Me.Label10.AutoSize = True
+        Me.Label10.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label10.ForeColor = System.Drawing.SystemColors.ControlText
+        Me.Label10.Location = New System.Drawing.Point(13, 344)
+        Me.Label10.Name = "Label10"
+        Me.Label10.Size = New System.Drawing.Size(131, 18)
+        Me.Label10.TabIndex = 9
+        Me.Label10.Text = "Precio Compra/Venta"
+        '
+        'Label11
+        '
+        Me.Label11.AutoSize = True
+        Me.Label11.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label11.Location = New System.Drawing.Point(13, 187)
+        Me.Label11.Name = "Label11"
+        Me.Label11.Size = New System.Drawing.Size(74, 18)
+        Me.Label11.TabIndex = 10
+        Me.Label11.Text = "Base (Dias)"
+        '
+        'Label12
+        '
+        Me.Label12.AutoSize = True
+        Me.Label12.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label12.Location = New System.Drawing.Point(13, 232)
+        Me.Label12.Name = "Label12"
+        Me.Label12.Size = New System.Drawing.Size(105, 18)
+        Me.Label12.TabIndex = 11
+        Me.Label12.Text = "Dias Acumulados"
+        '
+        'Label13
+        '
+        Me.Label13.AutoSize = True
+        Me.Label13.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label13.Location = New System.Drawing.Point(13, 209)
+        Me.Label13.Name = "Label13"
+        Me.Label13.Size = New System.Drawing.Size(122, 18)
+        Me.Label13.TabIndex = 12
+        Me.Label13.Text = "Dias al Vencimiento"
+        '
+        'Label16
+        '
+        Me.Label16.AutoSize = True
+        Me.Label16.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label16.Location = New System.Drawing.Point(13, 364)
+        Me.Label16.Name = "Label16"
+        Me.Label16.Size = New System.Drawing.Size(115, 18)
+        Me.Label16.TabIndex = 15
+        Me.Label16.Text = "Interes Acumulado"
+        '
+        'Label18
+        '
+        Me.Label18.AutoSize = True
+        Me.Label18.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label18.Location = New System.Drawing.Point(13, 389)
+        Me.Label18.Name = "Label18"
+        Me.Label18.Size = New System.Drawing.Size(90, 18)
+        Me.Label18.TabIndex = 17
+        Me.Label18.Text = "Precio Sucio %"
+        '
+        'Label19
+        '
+        Me.Label19.AutoSize = True
+        Me.Label19.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label19.Location = New System.Drawing.Point(13, 456)
+        Me.Label19.Name = "Label19"
+        Me.Label19.Size = New System.Drawing.Size(93, 18)
+        Me.Label19.TabIndex = 18
+        Me.Label19.Text = "Valor Transado"
+        '
+        'Label20
+        '
+        Me.Label20.AutoSize = True
+        Me.Label20.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label20.Location = New System.Drawing.Point(13, 475)
+        Me.Label20.Name = "Label20"
+        Me.Label20.Size = New System.Drawing.Size(138, 18)
+        Me.Label20.TabIndex = 19
+        Me.Label20.Text = "Monto a Pagar/Recibir"
+        '
+        'Label21
+        '
+        Me.Label21.AutoSize = True
+        Me.Label21.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label21.Location = New System.Drawing.Point(13, 496)
+        Me.Label21.Name = "Label21"
+        Me.Label21.Size = New System.Drawing.Size(125, 18)
+        Me.Label21.TabIndex = 20
+        Me.Label21.Text = "Costo Transferencia"
+        '
+        'dtpUltimaFechaCuponCompra
+        '
+        Me.dtpUltimaFechaCuponCompra.Enabled = False
+        Me.dtpUltimaFechaCuponCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpUltimaFechaCuponCompra.Location = New System.Drawing.Point(27, 101)
+        Me.dtpUltimaFechaCuponCompra.Name = "dtpUltimaFechaCuponCompra"
+        Me.dtpUltimaFechaCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpUltimaFechaCuponCompra.TabIndex = 3
+        '
+        'dtpSiguienteFechaCuponCompra
+        '
+        Me.dtpSiguienteFechaCuponCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpSiguienteFechaCuponCompra.Location = New System.Drawing.Point(27, 122)
+        Me.dtpSiguienteFechaCuponCompra.Name = "dtpSiguienteFechaCuponCompra"
+        Me.dtpSiguienteFechaCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpSiguienteFechaCuponCompra.TabIndex = 4
+        '
+        'dtpFechaLiquidacionCompra
+        '
+        Me.dtpFechaLiquidacionCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaLiquidacionCompra.Location = New System.Drawing.Point(27, 144)
+        Me.dtpFechaLiquidacionCompra.Name = "dtpFechaLiquidacionCompra"
+        Me.dtpFechaLiquidacionCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaLiquidacionCompra.TabIndex = 5
+        '
+        'dtpFechaVencimientoCompra
+        '
+        Me.dtpFechaVencimientoCompra.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoCompra.Location = New System.Drawing.Point(27, 166)
+        Me.dtpFechaVencimientoCompra.Name = "dtpFechaVencimientoCompra"
+        Me.dtpFechaVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaVencimientoCompra.TabIndex = 6
+        '
+        'txtValorNominalCompra
+        '
+        Me.txtValorNominalCompra.Location = New System.Drawing.Point(27, 79)
+        Me.txtValorNominalCompra.Name = "txtValorNominalCompra"
+        Me.txtValorNominalCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominalCompra.TabIndex = 2
+        '
+        'txtPorcentajeCuponCompra
+        '
+        Me.txtPorcentajeCuponCompra.Location = New System.Drawing.Point(27, 254)
+        Me.txtPorcentajeCuponCompra.Name = "txtPorcentajeCuponCompra"
+        Me.txtPorcentajeCuponCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPorcentajeCuponCompra.TabIndex = 8
+        '
+        'txtYTMAlVencimientoComisionCompra
+        '
+        Me.txtYTMAlVencimientoComisionCompra.Location = New System.Drawing.Point(27, 275)
+        Me.txtYTMAlVencimientoComisionCompra.Name = "txtYTMAlVencimientoComisionCompra"
+        Me.txtYTMAlVencimientoComisionCompra.ReadOnly = True
+        Me.txtYTMAlVencimientoComisionCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoComisionCompra.TabIndex = 10
+        '
+        'txtYTMAlVencimientoCompra
+        '
+        Me.txtYTMAlVencimientoCompra.Location = New System.Drawing.Point(27, 297)
+        Me.txtYTMAlVencimientoCompra.Name = "txtYTMAlVencimientoCompra"
+        Me.txtYTMAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoCompra.TabIndex = 9
+        '
+        'txtPrecioAlVencimientoCompra
+        '
+        Me.txtPrecioAlVencimientoCompra.Location = New System.Drawing.Point(27, 319)
+        Me.txtPrecioAlVencimientoCompra.Name = "txtPrecioAlVencimientoCompra"
+        Me.txtPrecioAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioAlVencimientoCompra.TabIndex = 11
+        '
+        'txtPrecioCompra
+        '
+        Me.txtPrecioCompra.Location = New System.Drawing.Point(27, 341)
+        Me.txtPrecioCompra.Name = "txtPrecioCompra"
+        Me.txtPrecioCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioCompra.TabIndex = 12
+        '
+        'txtDiasAcumuladosCompra
+        '
+        Me.txtDiasAcumuladosCompra.Location = New System.Drawing.Point(27, 233)
+        Me.txtDiasAcumuladosCompra.Name = "txtDiasAcumuladosCompra"
+        Me.txtDiasAcumuladosCompra.ReadOnly = True
+        Me.txtDiasAcumuladosCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAcumuladosCompra.TabIndex = 0
+        '
+        'txtPrecioSucioCompra
+        '
+        Me.txtPrecioSucioCompra.Location = New System.Drawing.Point(27, 385)
+        Me.txtPrecioSucioCompra.Name = "txtPrecioSucioCompra"
+        Me.txtPrecioSucioCompra.ReadOnly = True
+        Me.txtPrecioSucioCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioSucioCompra.TabIndex = 0
+        '
+        'txtInteresAcumuladoCompra
+        '
+        Me.txtInteresAcumuladoCompra.Location = New System.Drawing.Point(27, 363)
+        Me.txtInteresAcumuladoCompra.Name = "txtInteresAcumuladoCompra"
+        Me.txtInteresAcumuladoCompra.ReadOnly = True
+        Me.txtInteresAcumuladoCompra.Size = New System.Drawing.Size(108, 20)
+        Me.txtInteresAcumuladoCompra.TabIndex = 0
+        '
+        'txtValorTransadoCompra
+        '
+        Me.txtValorTransadoCompra.Location = New System.Drawing.Point(27, 453)
+        Me.txtValorTransadoCompra.Name = "txtValorTransadoCompra"
+        Me.txtValorTransadoCompra.ReadOnly = True
+        Me.txtValorTransadoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorTransadoCompra.TabIndex = 0
+        '
+        'txtMontoAPagar
+        '
+        Me.txtMontoAPagar.Location = New System.Drawing.Point(27, 474)
+        Me.txtMontoAPagar.Name = "txtMontoAPagar"
+        Me.txtMontoAPagar.ReadOnly = True
+        Me.txtMontoAPagar.Size = New System.Drawing.Size(150, 20)
+        Me.txtMontoAPagar.TabIndex = 0
+        '
+        'txtCostoTransferenciaCompra
+        '
+        Me.txtCostoTransferenciaCompra.Location = New System.Drawing.Point(27, 496)
+        Me.txtCostoTransferenciaCompra.Name = "txtCostoTransferenciaCompra"
+        Me.txtCostoTransferenciaCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtCostoTransferenciaCompra.TabIndex = 16
+        '
+        'txtDiasAlVencimientoCompra
+        '
+        Me.txtDiasAlVencimientoCompra.Location = New System.Drawing.Point(27, 211)
+        Me.txtDiasAlVencimientoCompra.Name = "txtDiasAlVencimientoCompra"
+        Me.txtDiasAlVencimientoCompra.ReadOnly = True
+        Me.txtDiasAlVencimientoCompra.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAlVencimientoCompra.TabIndex = 0
+        '
+        'Label17
+        '
+        Me.Label17.AutoSize = True
+        Me.Label17.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label17.Location = New System.Drawing.Point(68, 15)
+        Me.Label17.Name = "Label17"
+        Me.Label17.Size = New System.Drawing.Size(55, 18)
+        Me.Label17.TabIndex = 55
+        Me.Label17.Text = "Compra"
+        '
+        'lblBono
+        '
+        Me.lblBono.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.lblBono.AutoSize = True
+        Me.lblBono.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblBono.Location = New System.Drawing.Point(29, -38)
+        Me.lblBono.Name = "lblBono"
+        Me.lblBono.Size = New System.Drawing.Size(234, 24)
+        Me.lblBono.TabIndex = 56
+        Me.lblBono.Text = "Certificados de Inversión"
+        '
+        'txtDiasAlVencimientoVenta
+        '
+        Me.txtDiasAlVencimientoVenta.Location = New System.Drawing.Point(29, 212)
+        Me.txtDiasAlVencimientoVenta.Name = "txtDiasAlVencimientoVenta"
+        Me.txtDiasAlVencimientoVenta.ReadOnly = True
+        Me.txtDiasAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAlVencimientoVenta.TabIndex = 77
+        '
+        'txtMontoARecibir
+        '
+        Me.txtMontoARecibir.Location = New System.Drawing.Point(29, 473)
+        Me.txtMontoARecibir.Name = "txtMontoARecibir"
+        Me.txtMontoARecibir.ReadOnly = True
+        Me.txtMontoARecibir.Size = New System.Drawing.Size(150, 20)
+        Me.txtMontoARecibir.TabIndex = 0
+        '
+        'txtValorTransadoVenta
+        '
+        Me.txtValorTransadoVenta.Location = New System.Drawing.Point(29, 451)
+        Me.txtValorTransadoVenta.Name = "txtValorTransadoVenta"
+        Me.txtValorTransadoVenta.ReadOnly = True
+        Me.txtValorTransadoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorTransadoVenta.TabIndex = 0
+        '
+        'txtInteresAcumuladoVenta
+        '
+        Me.txtInteresAcumuladoVenta.Location = New System.Drawing.Point(29, 364)
+        Me.txtInteresAcumuladoVenta.Name = "txtInteresAcumuladoVenta"
+        Me.txtInteresAcumuladoVenta.ReadOnly = True
+        Me.txtInteresAcumuladoVenta.Size = New System.Drawing.Size(108, 20)
+        Me.txtInteresAcumuladoVenta.TabIndex = 0
+        '
+        'txtPrecioSucioVenta
+        '
+        Me.txtPrecioSucioVenta.Location = New System.Drawing.Point(29, 386)
+        Me.txtPrecioSucioVenta.Name = "txtPrecioSucioVenta"
+        Me.txtPrecioSucioVenta.ReadOnly = True
+        Me.txtPrecioSucioVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioSucioVenta.TabIndex = 0
+        '
+        'txtDiasAcumuladosVenta
+        '
+        Me.txtDiasAcumuladosVenta.Location = New System.Drawing.Point(29, 234)
+        Me.txtDiasAcumuladosVenta.Name = "txtDiasAcumuladosVenta"
+        Me.txtDiasAcumuladosVenta.ReadOnly = True
+        Me.txtDiasAcumuladosVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtDiasAcumuladosVenta.TabIndex = 68
+        '
+        'txtPrecioVenta
+        '
+        Me.txtPrecioVenta.Location = New System.Drawing.Point(29, 342)
+        Me.txtPrecioVenta.Name = "txtPrecioVenta"
+        Me.txtPrecioVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioVenta.TabIndex = 28
+        '
+        'txtPrecioAlVencimientoVenta
+        '
+        Me.txtPrecioAlVencimientoVenta.Location = New System.Drawing.Point(29, 320)
+        Me.txtPrecioAlVencimientoVenta.Name = "txtPrecioAlVencimientoVenta"
+        Me.txtPrecioAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioAlVencimientoVenta.TabIndex = 27
+        '
+        'txtYTMAlVencimientoVenta
+        '
+        Me.txtYTMAlVencimientoVenta.Location = New System.Drawing.Point(29, 299)
+        Me.txtYTMAlVencimientoVenta.Name = "txtYTMAlVencimientoVenta"
+        Me.txtYTMAlVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoVenta.TabIndex = 25
+        '
+        'txtYTMAlVencimientoComisionVenta
+        '
+        Me.txtYTMAlVencimientoComisionVenta.Location = New System.Drawing.Point(29, 278)
+        Me.txtYTMAlVencimientoComisionVenta.Name = "txtYTMAlVencimientoComisionVenta"
+        Me.txtYTMAlVencimientoComisionVenta.ReadOnly = True
+        Me.txtYTMAlVencimientoComisionVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtYTMAlVencimientoComisionVenta.TabIndex = 26
+        '
+        'txtPorcentajeCuponVenta
+        '
+        Me.txtPorcentajeCuponVenta.Location = New System.Drawing.Point(29, 256)
+        Me.txtPorcentajeCuponVenta.Name = "txtPorcentajeCuponVenta"
+        Me.txtPorcentajeCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtPorcentajeCuponVenta.TabIndex = 24
+        '
+        'txtValorNominalVenta
+        '
+        Me.txtValorNominalVenta.Location = New System.Drawing.Point(29, 79)
+        Me.txtValorNominalVenta.Name = "txtValorNominalVenta"
+        Me.txtValorNominalVenta.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominalVenta.TabIndex = 18
+        '
+        'dtpFechaVencimientoVenta
+        '
+        Me.dtpFechaVencimientoVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaVencimientoVenta.Location = New System.Drawing.Point(29, 167)
+        Me.dtpFechaVencimientoVenta.Name = "dtpFechaVencimientoVenta"
+        Me.dtpFechaVencimientoVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaVencimientoVenta.TabIndex = 22
+        '
+        'dtpFechaLiquidacionVenta
+        '
+        Me.dtpFechaLiquidacionVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpFechaLiquidacionVenta.Location = New System.Drawing.Point(29, 145)
+        Me.dtpFechaLiquidacionVenta.Name = "dtpFechaLiquidacionVenta"
+        Me.dtpFechaLiquidacionVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpFechaLiquidacionVenta.TabIndex = 21
+        '
+        'dtpSiguienteFechaCuponVenta
+        '
+        Me.dtpSiguienteFechaCuponVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpSiguienteFechaCuponVenta.Location = New System.Drawing.Point(29, 123)
+        Me.dtpSiguienteFechaCuponVenta.Name = "dtpSiguienteFechaCuponVenta"
+        Me.dtpSiguienteFechaCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpSiguienteFechaCuponVenta.TabIndex = 20
+        '
+        'dtpUltimaFechaCuponVenta
+        '
+        Me.dtpUltimaFechaCuponVenta.Enabled = False
+        Me.dtpUltimaFechaCuponVenta.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
+        Me.dtpUltimaFechaCuponVenta.Location = New System.Drawing.Point(29, 101)
+        Me.dtpUltimaFechaCuponVenta.Name = "dtpUltimaFechaCuponVenta"
+        Me.dtpUltimaFechaCuponVenta.Size = New System.Drawing.Size(150, 20)
+        Me.dtpUltimaFechaCuponVenta.TabIndex = 19
+        '
+        'Label22
+        '
+        Me.Label22.AutoSize = True
+        Me.Label22.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label22.Location = New System.Drawing.Point(80, 15)
+        Me.Label22.Name = "Label22"
+        Me.Label22.Size = New System.Drawing.Size(42, 18)
+        Me.Label22.TabIndex = 80
+        Me.Label22.Text = "Venta"
+        '
+        'Label23
+        '
+        Me.Label23.AutoSize = True
+        Me.Label23.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label23.Location = New System.Drawing.Point(17, 22)
+        Me.Label23.Name = "Label23"
+        Me.Label23.Size = New System.Drawing.Size(87, 18)
+        Me.Label23.TabIndex = 81
+        Me.Label23.Text = "Valor Nominal"
+        '
+        'Label24
+        '
+        Me.Label24.AutoSize = True
+        Me.Label24.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label24.Location = New System.Drawing.Point(17, 45)
+        Me.Label24.Name = "Label24"
+        Me.Label24.Size = New System.Drawing.Size(38, 18)
+        Me.Label24.TabIndex = 82
+        Me.Label24.Text = "Plazo"
+        '
+        'Label25
+        '
+        Me.Label25.AutoSize = True
+        Me.Label25.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label25.Location = New System.Drawing.Point(17, 66)
+        Me.Label25.Name = "Label25"
+        Me.Label25.Size = New System.Drawing.Size(92, 18)
+        Me.Label25.TabIndex = 83
+        Me.Label25.Text = "Precio Compra"
+        '
+        'Label26
+        '
+        Me.Label26.AutoSize = True
+        Me.Label26.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label26.Location = New System.Drawing.Point(17, 88)
+        Me.Label26.Name = "Label26"
+        Me.Label26.Size = New System.Drawing.Size(79, 18)
+        Me.Label26.TabIndex = 84
+        Me.Label26.Text = "Precio Venta"
+        '
+        'label27
+        '
+        Me.label27.AutoSize = True
+        Me.label27.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.label27.Location = New System.Drawing.Point(17, 110)
+        Me.label27.Name = "label27"
+        Me.label27.Size = New System.Drawing.Size(175, 18)
+        Me.label27.TabIndex = 85
+        Me.label27.Text = "Ganancia/Perdida de Capital"
+        '
+        'lblIngresosPorIntereses_Op
+        '
+        Me.lblIngresosPorIntereses_Op.AutoSize = True
+        Me.lblIngresosPorIntereses_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblIngresosPorIntereses_Op.Location = New System.Drawing.Point(17, 132)
+        Me.lblIngresosPorIntereses_Op.Name = "lblIngresosPorIntereses_Op"
+        Me.lblIngresosPorIntereses_Op.Size = New System.Drawing.Size(132, 18)
+        Me.lblIngresosPorIntereses_Op.TabIndex = 86
+        Me.lblIngresosPorIntereses_Op.Text = "Ingreso por Intereses"
+        '
+        'lblCostosTotales_Op
+        '
+        Me.lblCostosTotales_Op.AutoSize = True
+        Me.lblCostosTotales_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblCostosTotales_Op.Location = New System.Drawing.Point(17, 154)
+        Me.lblCostosTotales_Op.Name = "lblCostosTotales_Op"
+        Me.lblCostosTotales_Op.Size = New System.Drawing.Size(92, 18)
+        Me.lblCostosTotales_Op.TabIndex = 87
+        Me.lblCostosTotales_Op.Text = "Costos Totales"
+        '
+        'lblGananciaPerdidaTotal_Op
+        '
+        Me.lblGananciaPerdidaTotal_Op.AutoSize = True
+        Me.lblGananciaPerdidaTotal_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblGananciaPerdidaTotal_Op.Location = New System.Drawing.Point(17, 176)
+        Me.lblGananciaPerdidaTotal_Op.Name = "lblGananciaPerdidaTotal_Op"
+        Me.lblGananciaPerdidaTotal_Op.Size = New System.Drawing.Size(144, 18)
+        Me.lblGananciaPerdidaTotal_Op.TabIndex = 88
+        Me.lblGananciaPerdidaTotal_Op.Text = "Ganancia/Perdida Total"
+        '
+        'lblRendimientoGananciaPerdida_Op
+        '
+        Me.lblRendimientoGananciaPerdida_Op.AutoSize = True
+        Me.lblRendimientoGananciaPerdida_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoGananciaPerdida_Op.Location = New System.Drawing.Point(17, 198)
+        Me.lblRendimientoGananciaPerdida_Op.Name = "lblRendimientoGananciaPerdida_Op"
+        Me.lblRendimientoGananciaPerdida_Op.Size = New System.Drawing.Size(189, 18)
+        Me.lblRendimientoGananciaPerdida_Op.TabIndex = 89
+        Me.lblRendimientoGananciaPerdida_Op.Text = "Rendimiento Ganancia/Perdida"
+        '
+        'lblRendimientoIntereses_Op
+        '
+        Me.lblRendimientoIntereses_Op.AutoSize = True
+        Me.lblRendimientoIntereses_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoIntereses_Op.Location = New System.Drawing.Point(17, 220)
+        Me.lblRendimientoIntereses_Op.Name = "lblRendimientoIntereses_Op"
+        Me.lblRendimientoIntereses_Op.Size = New System.Drawing.Size(139, 18)
+        Me.lblRendimientoIntereses_Op.TabIndex = 90
+        Me.lblRendimientoIntereses_Op.Text = "Rendimiento Intereses"
+        '
+        'lblRendimientoAntesISR_Op
+        '
+        Me.lblRendimientoAntesISR_Op.AutoSize = True
+        Me.lblRendimientoAntesISR_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoAntesISR_Op.Location = New System.Drawing.Point(17, 242)
+        Me.lblRendimientoAntesISR_Op.Name = "lblRendimientoAntesISR_Op"
+        Me.lblRendimientoAntesISR_Op.Size = New System.Drawing.Size(140, 18)
+        Me.lblRendimientoAntesISR_Op.TabIndex = 91
+        Me.lblRendimientoAntesISR_Op.Text = "Rendimiento antes ISR"
+        '
+        'lblRendimientoDespuesISR_Op
+        '
+        Me.lblRendimientoDespuesISR_Op.AutoSize = True
+        Me.lblRendimientoDespuesISR_Op.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblRendimientoDespuesISR_Op.Location = New System.Drawing.Point(17, 264)
+        Me.lblRendimientoDespuesISR_Op.Name = "lblRendimientoDespuesISR_Op"
+        Me.lblRendimientoDespuesISR_Op.Size = New System.Drawing.Size(155, 18)
+        Me.lblRendimientoDespuesISR_Op.TabIndex = 92
+        Me.lblRendimientoDespuesISR_Op.Text = "Rendimiento despues ISR"
+        '
+        'Label35
+        '
+        Me.Label35.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.Label35.AutoSize = True
+        Me.Label35.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label35.Location = New System.Drawing.Point(397, 46)
+        Me.Label35.Name = "Label35"
+        Me.Label35.Size = New System.Drawing.Size(169, 18)
+        Me.Label35.TabIndex = 93
+        Me.Label35.Text = "Resultado de la Operacion"
+        '
+        'txtValorNominal_Op
+        '
+        Me.txtValorNominal_Op.Location = New System.Drawing.Point(32, 22)
+        Me.txtValorNominal_Op.Name = "txtValorNominal_Op"
+        Me.txtValorNominal_Op.ReadOnly = True
+        Me.txtValorNominal_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtValorNominal_Op.TabIndex = 0
+        '
+        'txtPlazo_Op
+        '
+        Me.txtPlazo_Op.Location = New System.Drawing.Point(32, 44)
+        Me.txtPlazo_Op.Name = "txtPlazo_Op"
+        Me.txtPlazo_Op.ReadOnly = True
+        Me.txtPlazo_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPlazo_Op.TabIndex = 0
+        '
+        'txtPrecioCompra_Op
+        '
+        Me.txtPrecioCompra_Op.Location = New System.Drawing.Point(32, 66)
+        Me.txtPrecioCompra_Op.Name = "txtPrecioCompra_Op"
+        Me.txtPrecioCompra_Op.ReadOnly = True
+        Me.txtPrecioCompra_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioCompra_Op.TabIndex = 0
+        '
+        'txtPrecioVenta_Op
+        '
+        Me.txtPrecioVenta_Op.Location = New System.Drawing.Point(32, 88)
+        Me.txtPrecioVenta_Op.Name = "txtPrecioVenta_Op"
+        Me.txtPrecioVenta_Op.ReadOnly = True
+        Me.txtPrecioVenta_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtPrecioVenta_Op.TabIndex = 0
+        '
+        'txtGananciaPerdidaCapital_Op
+        '
+        Me.txtGananciaPerdidaCapital_Op.Location = New System.Drawing.Point(32, 110)
+        Me.txtGananciaPerdidaCapital_Op.Name = "txtGananciaPerdidaCapital_Op"
+        Me.txtGananciaPerdidaCapital_Op.ReadOnly = True
+        Me.txtGananciaPerdidaCapital_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtGananciaPerdidaCapital_Op.TabIndex = 0
+        '
+        'txtIngresosPorIntereses_Op
+        '
+        Me.txtIngresosPorIntereses_Op.Location = New System.Drawing.Point(32, 132)
+        Me.txtIngresosPorIntereses_Op.Name = "txtIngresosPorIntereses_Op"
+        Me.txtIngresosPorIntereses_Op.ReadOnly = True
+        Me.txtIngresosPorIntereses_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtIngresosPorIntereses_Op.TabIndex = 0
+        '
+        'txtCostosTotales_Op
+        '
+        Me.txtCostosTotales_Op.Location = New System.Drawing.Point(32, 154)
+        Me.txtCostosTotales_Op.Name = "txtCostosTotales_Op"
+        Me.txtCostosTotales_Op.ReadOnly = True
+        Me.txtCostosTotales_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtCostosTotales_Op.TabIndex = 0
+        '
+        'txtGananciaPerdidaTotal_Op
+        '
+        Me.txtGananciaPerdidaTotal_Op.Location = New System.Drawing.Point(32, 176)
+        Me.txtGananciaPerdidaTotal_Op.Name = "txtGananciaPerdidaTotal_Op"
+        Me.txtGananciaPerdidaTotal_Op.ReadOnly = True
+        Me.txtGananciaPerdidaTotal_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtGananciaPerdidaTotal_Op.TabIndex = 0
+        '
+        'txtRendimientoGananciaPerdida_Op
+        '
+        Me.txtRendimientoGananciaPerdida_Op.Location = New System.Drawing.Point(32, 198)
+        Me.txtRendimientoGananciaPerdida_Op.Name = "txtRendimientoGananciaPerdida_Op"
+        Me.txtRendimientoGananciaPerdida_Op.ReadOnly = True
+        Me.txtRendimientoGananciaPerdida_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoGananciaPerdida_Op.TabIndex = 0
+        '
+        'txtRendimientoIntereses_Op
+        '
+        Me.txtRendimientoIntereses_Op.Location = New System.Drawing.Point(32, 220)
+        Me.txtRendimientoIntereses_Op.Name = "txtRendimientoIntereses_Op"
+        Me.txtRendimientoIntereses_Op.ReadOnly = True
+        Me.txtRendimientoIntereses_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoIntereses_Op.TabIndex = 0
+        '
+        'txtRendimientoAntesISR_Op
+        '
+        Me.txtRendimientoAntesISR_Op.Location = New System.Drawing.Point(32, 242)
+        Me.txtRendimientoAntesISR_Op.Name = "txtRendimientoAntesISR_Op"
+        Me.txtRendimientoAntesISR_Op.ReadOnly = True
+        Me.txtRendimientoAntesISR_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoAntesISR_Op.TabIndex = 0
+        '
+        'txtRendimientoDespuesISR_Op
+        '
+        Me.txtRendimientoDespuesISR_Op.Location = New System.Drawing.Point(32, 264)
+        Me.txtRendimientoDespuesISR_Op.Name = "txtRendimientoDespuesISR_Op"
+        Me.txtRendimientoDespuesISR_Op.ReadOnly = True
+        Me.txtRendimientoDespuesISR_Op.Size = New System.Drawing.Size(150, 20)
+        Me.txtRendimientoDespuesISR_Op.TabIndex = 0
+        '
+        'btnAceptar
+        '
+        Me.btnAceptar.DialogResult = System.Windows.Forms.DialogResult.OK
+        Me.btnAceptar.Location = New System.Drawing.Point(10, 3)
+        Me.btnAceptar.Name = "btnAceptar"
+        Me.btnAceptar.Size = New System.Drawing.Size(75, 23)
+        Me.btnAceptar.TabIndex = 106
+        Me.btnAceptar.Text = "Aceptar"
+        Me.btnAceptar.UseVisualStyleBackColor = True
+        '
+        'btnCancelar
+        '
+        Me.btnCancelar.DialogResult = System.Windows.Forms.DialogResult.Cancel
+        Me.btnCancelar.Location = New System.Drawing.Point(91, 3)
+        Me.btnCancelar.Name = "btnCancelar"
+        Me.btnCancelar.Size = New System.Drawing.Size(75, 23)
+        Me.btnCancelar.TabIndex = 107
+        Me.btnCancelar.Text = "Cancelar"
+        Me.btnCancelar.UseVisualStyleBackColor = True
+        '
+        'cboAnioBaseC
+        '
+        Me.cboAnioBaseC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboAnioBaseC.FormattingEnabled = True
+        Me.cboAnioBaseC.Items.AddRange(New Object() {""})
+        Me.cboAnioBaseC.Location = New System.Drawing.Point(27, 188)
+        Me.cboAnioBaseC.Name = "cboAnioBaseC"
+        Me.cboAnioBaseC.Size = New System.Drawing.Size(150, 21)
+        Me.cboAnioBaseC.TabIndex = 7
+        '
+        'cboAnioBaseV
+        '
+        Me.cboAnioBaseV.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboAnioBaseV.FormattingEnabled = True
+        Me.cboAnioBaseV.Items.AddRange(New Object() {""})
+        Me.cboAnioBaseV.Location = New System.Drawing.Point(29, 189)
+        Me.cboAnioBaseV.Name = "cboAnioBaseV"
+        Me.cboAnioBaseV.Size = New System.Drawing.Size(150, 21)
+        Me.cboAnioBaseV.TabIndex = 23
+        '
+        'cboPeriodosC
+        '
+        Me.cboPeriodosC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboPeriodosC.FormattingEnabled = True
+        Me.cboPeriodosC.Location = New System.Drawing.Point(27, 56)
+        Me.cboPeriodosC.Name = "cboPeriodosC"
+        Me.cboPeriodosC.Size = New System.Drawing.Size(150, 21)
+        Me.cboPeriodosC.TabIndex = 1
+        '
+        'cboPeriodosV
+        '
+        Me.cboPeriodosV.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+        Me.cboPeriodosV.FormattingEnabled = True
+        Me.cboPeriodosV.Location = New System.Drawing.Point(29, 56)
+        Me.cboPeriodosV.Name = "cboPeriodosV"
+        Me.cboPeriodosV.Size = New System.Drawing.Size(150, 21)
+        Me.cboPeriodosV.TabIndex = 17
+        '
+        'Label29
+        '
+        Me.Label29.AutoSize = True
+        Me.Label29.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label29.Location = New System.Drawing.Point(13, 58)
+        Me.Label29.Name = "Label29"
+        Me.Label29.Size = New System.Drawing.Size(79, 18)
+        Me.Label29.TabIndex = 115
+        Me.Label29.Text = "Periodicidad"
+        '
+        'dgvIngresos
+        '
+        Me.dgvIngresos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvIngresos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvIngresos.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.dgvIngresos.Location = New System.Drawing.Point(0, 0)
+        Me.dgvIngresos.Name = "dgvIngresos"
+        Me.dgvIngresos.Size = New System.Drawing.Size(923, 510)
+        Me.dgvIngresos.TabIndex = 116
+        '
+        'Label30
+        '
+        Me.Label30.AutoSize = True
+        Me.Label30.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label30.Location = New System.Drawing.Point(536, 373)
+        Me.Label30.Name = "Label30"
+        Me.Label30.Size = New System.Drawing.Size(59, 18)
+        Me.Label30.TabIndex = 118
+        Me.Label30.Text = "Ingresos"
+        '
+        'TabCampos
+        '
+        Me.TabCampos.Controls.Add(Me.TabPage1)
+        Me.TabCampos.Controls.Add(Me.TbIngresos)
+        Me.TabCampos.Controls.Add(Me.TabPage4)
+        Me.TabCampos.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.TabCampos.Location = New System.Drawing.Point(0, 0)
+        Me.TabCampos.Name = "TabCampos"
+        Me.TabCampos.SelectedIndex = 0
+        Me.TabCampos.Size = New System.Drawing.Size(937, 542)
+        Me.TabCampos.TabIndex = 121
+        '
+        'TabPage1
+        '
+        Me.TabPage1.AutoScroll = True
+        Me.TabPage1.Controls.Add(Me.btnVenderTitulo)
+        Me.TabPage1.Controls.Add(Me.GrpVenta)
+        Me.TabPage1.Controls.Add(Me.GrpCompra)
+        Me.TabPage1.Controls.Add(Me.GrpInfo)
+        Me.TabPage1.Controls.Add(Me.lblBono)
+        Me.TabPage1.Location = New System.Drawing.Point(4, 22)
+        Me.TabPage1.Name = "TabPage1"
+        Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
+        Me.TabPage1.Size = New System.Drawing.Size(929, 516)
+        Me.TabPage1.TabIndex = 0
+        Me.TabPage1.Text = "Operación"
+        Me.TabPage1.UseVisualStyleBackColor = True
+        '
+        'btnVenderTitulo
+        '
+        Me.btnVenderTitulo.Location = New System.Drawing.Point(587, 6)
+        Me.btnVenderTitulo.Name = "btnVenderTitulo"
+        Me.btnVenderTitulo.Size = New System.Drawing.Size(75, 51)
+        Me.btnVenderTitulo.TabIndex = 142
+        Me.btnVenderTitulo.Text = "Vender Titulo"
+        Me.btnVenderTitulo.UseVisualStyleBackColor = True
+        Me.btnVenderTitulo.Visible = False
+        '
+        'GrpVenta
+        '
+        Me.GrpVenta.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpVenta.Controls.Add(Me.txtPorcentajeCuponVenta)
+        Me.GrpVenta.Controls.Add(Me.txtDiasAcumuladosVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionPorBolsaVenta)
+        Me.GrpVenta.Controls.Add(Me.txtPrecioVenta)
+        Me.GrpVenta.Controls.Add(Me.txtPrecioAlVencimientoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionPorVentaCasa)
+        Me.GrpVenta.Controls.Add(Me.txtYTMAlVencimientoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtPrecioSucioVenta)
+        Me.GrpVenta.Controls.Add(Me.txtCuponesRecibidos)
+        Me.GrpVenta.Controls.Add(Me.txtYTMAlVencimientoComisionVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionVentaBolsa)
+        Me.GrpVenta.Controls.Add(Me.txtInteresAcumuladoVenta)
+        Me.GrpVenta.Controls.Add(Me.txtComisionVentaCasa)
+        Me.GrpVenta.Controls.Add(Me.txtPorcentajeInteresAcumuladoVenta)
+        Me.GrpVenta.Controls.Add(Me.cboPeriodosV)
+        Me.GrpVenta.Controls.Add(Me.txtValorNominalVenta)
+        Me.GrpVenta.Controls.Add(Me.cboAnioBaseV)
+        Me.GrpVenta.Controls.Add(Me.txtValorTransadoVenta)
+        Me.GrpVenta.Controls.Add(Me.Label22)
+        Me.GrpVenta.Controls.Add(Me.dtpFechaVencimientoVenta)
+        Me.GrpVenta.Controls.Add(Me.dtpUltimaFechaCuponVenta)
+        Me.GrpVenta.Controls.Add(Me.txtMontoARecibir)
+        Me.GrpVenta.Controls.Add(Me.txtDiasAlVencimientoVenta)
+        Me.GrpVenta.Controls.Add(Me.dtpFechaLiquidacionVenta)
+        Me.GrpVenta.Controls.Add(Me.dtpSiguienteFechaCuponVenta)
+        Me.GrpVenta.Location = New System.Drawing.Point(691, 18)
+        Me.GrpVenta.Name = "GrpVenta"
+        Me.GrpVenta.Size = New System.Drawing.Size(209, 586)
+        Me.GrpVenta.TabIndex = 141
+        Me.GrpVenta.TabStop = False
+        '
+        'txtComisionPorBolsaVenta
+        '
+        Me.txtComisionPorBolsaVenta.Location = New System.Drawing.Point(28, 429)
+        Me.txtComisionPorBolsaVenta.Name = "txtComisionPorBolsaVenta"
+        Me.txtComisionPorBolsaVenta.Size = New System.Drawing.Size(43, 20)
+        Me.txtComisionPorBolsaVenta.TabIndex = 138
+        '
+        'txtComisionPorVentaCasa
+        '
+        Me.txtComisionPorVentaCasa.Location = New System.Drawing.Point(28, 408)
+        Me.txtComisionPorVentaCasa.Name = "txtComisionPorVentaCasa"
+        Me.txtComisionPorVentaCasa.Size = New System.Drawing.Size(43, 20)
+        Me.txtComisionPorVentaCasa.TabIndex = 136
+        '
+        'txtCuponesRecibidos
+        '
+        Me.txtCuponesRecibidos.Location = New System.Drawing.Point(29, 515)
+        Me.txtCuponesRecibidos.Name = "txtCuponesRecibidos"
+        Me.txtCuponesRecibidos.ReadOnly = True
+        Me.txtCuponesRecibidos.Size = New System.Drawing.Size(150, 20)
+        Me.txtCuponesRecibidos.TabIndex = 133
+        '
+        'txtComisionVentaBolsa
+        '
+        Me.txtComisionVentaBolsa.Location = New System.Drawing.Point(77, 430)
+        Me.txtComisionVentaBolsa.Name = "txtComisionVentaBolsa"
+        Me.txtComisionVentaBolsa.ReadOnly = True
+        Me.txtComisionVentaBolsa.Size = New System.Drawing.Size(102, 20)
+        Me.txtComisionVentaBolsa.TabIndex = 121
+        '
+        'txtComisionVentaCasa
+        '
+        Me.txtComisionVentaCasa.Location = New System.Drawing.Point(77, 408)
+        Me.txtComisionVentaCasa.Name = "txtComisionVentaCasa"
+        Me.txtComisionVentaCasa.ReadOnly = True
+        Me.txtComisionVentaCasa.Size = New System.Drawing.Size(102, 20)
+        Me.txtComisionVentaCasa.TabIndex = 119
+        '
+        'txtPorcentajeInteresAcumuladoVenta
+        '
+        Me.txtPorcentajeInteresAcumuladoVenta.Location = New System.Drawing.Point(139, 364)
+        Me.txtPorcentajeInteresAcumuladoVenta.Name = "txtPorcentajeInteresAcumuladoVenta"
+        Me.txtPorcentajeInteresAcumuladoVenta.ReadOnly = True
+        Me.txtPorcentajeInteresAcumuladoVenta.Size = New System.Drawing.Size(40, 20)
+        Me.txtPorcentajeInteresAcumuladoVenta.TabIndex = 0
+        '
+        'GrpCompra
+        '
+        Me.GrpCompra.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpCompra.Controls.Add(Me.txtPorcentajeCuponCompra)
+        Me.GrpCompra.Controls.Add(Me.txtDiasAlVencimientoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtCostoTransferenciaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionPorBolsaCompra)
+        Me.GrpCompra.Controls.Add(Me.txtMontoAPagar)
+        Me.GrpCompra.Controls.Add(Me.txtValorTransadoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionPorCompraCasa)
+        Me.GrpCompra.Controls.Add(Me.txtPorcentajeInteresAcumuladoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtInteresAcumuladoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtPrecioSucioCompra)
+        Me.GrpCompra.Controls.Add(Me.txtDiasAcumuladosCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionCompraBolsa)
+        Me.GrpCompra.Controls.Add(Me.txtPrecioCompra)
+        Me.GrpCompra.Controls.Add(Me.txtPrecioAlVencimientoCompra)
+        Me.GrpCompra.Controls.Add(Me.txtComisionCompraCasa)
+        Me.GrpCompra.Controls.Add(Me.txtYTMAlVencimientoCompra)
+        Me.GrpCompra.Controls.Add(Me.Label17)
+        Me.GrpCompra.Controls.Add(Me.txtYTMAlVencimientoComisionCompra)
+        Me.GrpCompra.Controls.Add(Me.txtValorNominalCompra)
+        Me.GrpCompra.Controls.Add(Me.cboPeriodosC)
+        Me.GrpCompra.Controls.Add(Me.dtpFechaVencimientoCompra)
+        Me.GrpCompra.Controls.Add(Me.dtpFechaLiquidacionCompra)
+        Me.GrpCompra.Controls.Add(Me.cboAnioBaseC)
+        Me.GrpCompra.Controls.Add(Me.dtpSiguienteFechaCuponCompra)
+        Me.GrpCompra.Controls.Add(Me.dtpUltimaFechaCuponCompra)
+        Me.GrpCompra.Location = New System.Drawing.Point(353, 18)
+        Me.GrpCompra.Name = "GrpCompra"
+        Me.GrpCompra.Size = New System.Drawing.Size(202, 547)
+        Me.GrpCompra.TabIndex = 140
+        Me.GrpCompra.TabStop = False
+        '
+        'txtComisionPorBolsaCompra
+        '
+        Me.txtComisionPorBolsaCompra.Location = New System.Drawing.Point(27, 430)
+        Me.txtComisionPorBolsaCompra.Name = "txtComisionPorBolsaCompra"
+        Me.txtComisionPorBolsaCompra.Size = New System.Drawing.Size(44, 20)
+        Me.txtComisionPorBolsaCompra.TabIndex = 137
+        '
+        'txtComisionPorCompraCasa
+        '
+        Me.txtComisionPorCompraCasa.Location = New System.Drawing.Point(27, 408)
+        Me.txtComisionPorCompraCasa.Name = "txtComisionPorCompraCasa"
+        Me.txtComisionPorCompraCasa.Size = New System.Drawing.Size(44, 20)
+        Me.txtComisionPorCompraCasa.TabIndex = 135
+        '
+        'txtPorcentajeInteresAcumuladoCompra
+        '
+        Me.txtPorcentajeInteresAcumuladoCompra.Location = New System.Drawing.Point(137, 363)
+        Me.txtPorcentajeInteresAcumuladoCompra.Name = "txtPorcentajeInteresAcumuladoCompra"
+        Me.txtPorcentajeInteresAcumuladoCompra.ReadOnly = True
+        Me.txtPorcentajeInteresAcumuladoCompra.Size = New System.Drawing.Size(40, 20)
+        Me.txtPorcentajeInteresAcumuladoCompra.TabIndex = 0
+        '
+        'txtComisionCompraBolsa
+        '
+        Me.txtComisionCompraBolsa.Location = New System.Drawing.Point(77, 431)
+        Me.txtComisionCompraBolsa.Name = "txtComisionCompraBolsa"
+        Me.txtComisionCompraBolsa.ReadOnly = True
+        Me.txtComisionCompraBolsa.Size = New System.Drawing.Size(100, 20)
+        Me.txtComisionCompraBolsa.TabIndex = 120
+        '
+        'txtComisionCompraCasa
+        '
+        Me.txtComisionCompraCasa.Location = New System.Drawing.Point(77, 408)
+        Me.txtComisionCompraCasa.Name = "txtComisionCompraCasa"
+        Me.txtComisionCompraCasa.ReadOnly = True
+        Me.txtComisionCompraCasa.Size = New System.Drawing.Size(100, 20)
+        Me.txtComisionCompraCasa.TabIndex = 118
+        '
+        'GrpInfo
+        '
+        Me.GrpInfo.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpInfo.Controls.Add(Me.Label7)
+        Me.GrpInfo.Controls.Add(Me.Label21)
+        Me.GrpInfo.Controls.Add(Me.Label20)
+        Me.GrpInfo.Controls.Add(Me.Label19)
+        Me.GrpInfo.Controls.Add(Me.Label18)
+        Me.GrpInfo.Controls.Add(Me.Label16)
+        Me.GrpInfo.Controls.Add(Me.Label13)
+        Me.GrpInfo.Controls.Add(Me.Label12)
+        Me.GrpInfo.Controls.Add(Me.Label28)
+        Me.GrpInfo.Controls.Add(Me.Label11)
+        Me.GrpInfo.Controls.Add(Me.Label10)
+        Me.GrpInfo.Controls.Add(Me.Label9)
+        Me.GrpInfo.Controls.Add(Me.Label8)
+        Me.GrpInfo.Controls.Add(Me.Label6)
+        Me.GrpInfo.Controls.Add(Me.Label15)
+        Me.GrpInfo.Controls.Add(Me.Label29)
+        Me.GrpInfo.Controls.Add(Me.Label14)
+        Me.GrpInfo.Controls.Add(Me.Label5)
+        Me.GrpInfo.Controls.Add(Me.Label4)
+        Me.GrpInfo.Controls.Add(Me.Label1)
+        Me.GrpInfo.Controls.Add(Me.Label3)
+        Me.GrpInfo.Controls.Add(Me.Label2)
+        Me.GrpInfo.Location = New System.Drawing.Point(33, 18)
+        Me.GrpInfo.Name = "GrpInfo"
+        Me.GrpInfo.Size = New System.Drawing.Size(200, 586)
+        Me.GrpInfo.TabIndex = 139
+        Me.GrpInfo.TabStop = False
+        '
+        'Label28
+        '
+        Me.Label28.AutoSize = True
+        Me.Label28.Font = New System.Drawing.Font("Trebuchet MS", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.Label28.Location = New System.Drawing.Point(14, 520)
+        Me.Label28.Name = "Label28"
+        Me.Label28.Size = New System.Drawing.Size(116, 18)
+        Me.Label28.TabIndex = 132
+        Me.Label28.Text = "Cupones Recibidos"
+        '
+        'Label15
+        '
+        Me.Label15.AutoSize = True
+        Me.Label15.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
+        Me.Label15.Location = New System.Drawing.Point(11, 431)
+        Me.Label15.Name = "Label15"
+        Me.Label15.Size = New System.Drawing.Size(96, 18)
+        Me.Label15.TabIndex = 117
+        Me.Label15.Text = "Comision Bolsa"
+        '
+        'Label14
+        '
+        Me.Label14.AutoSize = True
+        Me.Label14.Font = New System.Drawing.Font("Trebuchet MS", 9.75!)
+        Me.Label14.Location = New System.Drawing.Point(13, 410)
+        Me.Label14.Name = "Label14"
+        Me.Label14.Size = New System.Drawing.Size(94, 18)
+        Me.Label14.TabIndex = 116
+        Me.Label14.Text = "Comision Casa"
+        '
+        'TbIngresos
+        '
+        Me.TbIngresos.Controls.Add(Me.Panel2)
+        Me.TbIngresos.Location = New System.Drawing.Point(4, 22)
+        Me.TbIngresos.Name = "TbIngresos"
+        Me.TbIngresos.Padding = New System.Windows.Forms.Padding(3)
+        Me.TbIngresos.Size = New System.Drawing.Size(929, 516)
+        Me.TbIngresos.TabIndex = 1
+        Me.TbIngresos.Text = "Ingresos"
+        Me.TbIngresos.UseVisualStyleBackColor = True
+        '
+        'Panel2
+        '
+        Me.Panel2.Controls.Add(Me.dgvIngresos)
+        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.Panel2.Location = New System.Drawing.Point(3, 3)
+        Me.Panel2.Name = "Panel2"
+        Me.Panel2.Size = New System.Drawing.Size(923, 510)
+        Me.Panel2.TabIndex = 118
+        '
+        'TabPage4
+        '
+        Me.TabPage4.Controls.Add(Me.GrpDatos)
+        Me.TabPage4.Controls.Add(Me.GrpInfoAcc)
+        Me.TabPage4.Controls.Add(Me.Label35)
+        Me.TabPage4.Location = New System.Drawing.Point(4, 22)
+        Me.TabPage4.Name = "TabPage4"
+        Me.TabPage4.Size = New System.Drawing.Size(929, 516)
+        Me.TabPage4.TabIndex = 3
+        Me.TabPage4.Text = "Resultado de la Op."
+        Me.TabPage4.UseVisualStyleBackColor = True
+        '
+        'GrpDatos
+        '
+        Me.GrpDatos.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpDatos.Controls.Add(Me.txtPlazo_Op)
+        Me.GrpDatos.Controls.Add(Me.txtPrecioVenta_Op)
+        Me.GrpDatos.Controls.Add(Me.txtPrecioCompra_Op)
+        Me.GrpDatos.Controls.Add(Me.txtRendimientoDespuesISR_Op)
+        Me.GrpDatos.Controls.Add(Me.txtGananciaPerdidaCapital_Op)
+        Me.GrpDatos.Controls.Add(Me.txtRendimientoAntesISR_Op)
+        Me.GrpDatos.Controls.Add(Me.txtIngresosPorIntereses_Op)
+        Me.GrpDatos.Controls.Add(Me.txtRendimientoIntereses_Op)
+        Me.GrpDatos.Controls.Add(Me.txtValorNominal_Op)
+        Me.GrpDatos.Controls.Add(Me.txtRendimientoGananciaPerdida_Op)
+        Me.GrpDatos.Controls.Add(Me.txtCostosTotales_Op)
+        Me.GrpDatos.Controls.Add(Me.txtGananciaPerdidaTotal_Op)
+        Me.GrpDatos.Location = New System.Drawing.Point(621, 94)
+        Me.GrpDatos.Name = "GrpDatos"
+        Me.GrpDatos.Size = New System.Drawing.Size(210, 301)
+        Me.GrpDatos.TabIndex = 95
+        Me.GrpDatos.TabStop = False
+        '
+        'GrpInfoAcc
+        '
+        Me.GrpInfoAcc.Anchor = System.Windows.Forms.AnchorStyles.None
+        Me.GrpInfoAcc.Controls.Add(Me.Label24)
+        Me.GrpInfoAcc.Controls.Add(Me.lblRendimientoDespuesISR_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.Label23)
+        Me.GrpInfoAcc.Controls.Add(Me.lblRendimientoAntesISR_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.lblRendimientoIntereses_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.Label25)
+        Me.GrpInfoAcc.Controls.Add(Me.lblRendimientoGananciaPerdida_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.Label26)
+        Me.GrpInfoAcc.Controls.Add(Me.lblGananciaPerdidaTotal_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.label27)
+        Me.GrpInfoAcc.Controls.Add(Me.lblCostosTotales_Op)
+        Me.GrpInfoAcc.Controls.Add(Me.lblIngresosPorIntereses_Op)
+        Me.GrpInfoAcc.Location = New System.Drawing.Point(103, 98)
+        Me.GrpInfoAcc.Name = "GrpInfoAcc"
+        Me.GrpInfoAcc.Size = New System.Drawing.Size(215, 297)
+        Me.GrpInfoAcc.TabIndex = 94
+        Me.GrpInfoAcc.TabStop = False
+        '
+        'btnQuitar
+        '
+        Me.btnQuitar.Location = New System.Drawing.Point(172, 3)
+        Me.btnQuitar.Name = "btnQuitar"
+        Me.btnQuitar.Size = New System.Drawing.Size(78, 23)
+        Me.btnQuitar.TabIndex = 117
+        Me.btnQuitar.Text = "Quitar"
+        Me.btnQuitar.UseVisualStyleBackColor = True
+        '
+        'pnlPie
+        '
+        Me.pnlPie.Controls.Add(Me.Button1)
+        Me.pnlPie.Controls.Add(Me.btnAceptar)
+        Me.pnlPie.Controls.Add(Me.btnQuitar)
+        Me.pnlPie.Controls.Add(Me.btnCancelar)
+        Me.pnlPie.Dock = System.Windows.Forms.DockStyle.Bottom
+        Me.pnlPie.Location = New System.Drawing.Point(0, 567)
+        Me.pnlPie.Name = "pnlPie"
+        Me.pnlPie.Size = New System.Drawing.Size(937, 46)
+        Me.pnlPie.TabIndex = 122
+        '
+        'Button1
+        '
+        Me.Button1.Location = New System.Drawing.Point(256, 3)
+        Me.Button1.Name = "Button1"
+        Me.Button1.Size = New System.Drawing.Size(75, 23)
+        Me.Button1.TabIndex = 118
+        Me.Button1.Text = "Button1"
+        Me.Button1.UseVisualStyleBackColor = True
+        '
+        'BindingNavigator1
+        '
+        Me.BindingNavigator1.AddNewItem = Nothing
+        Me.BindingNavigator1.CountItem = Nothing
+        Me.BindingNavigator1.DeleteItem = Nothing
+        Me.BindingNavigator1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BindingNavigatorSeparator, Me.navModificar, Me.navNuevo, Me.navEliminar, Me.btnIngresos})
+        Me.BindingNavigator1.Location = New System.Drawing.Point(0, 0)
+        Me.BindingNavigator1.MoveFirstItem = Nothing
+        Me.BindingNavigator1.MoveLastItem = Nothing
+        Me.BindingNavigator1.MoveNextItem = Nothing
+        Me.BindingNavigator1.MovePreviousItem = Nothing
+        Me.BindingNavigator1.Name = "BindingNavigator1"
+        Me.BindingNavigator1.PositionItem = Nothing
+        Me.BindingNavigator1.Size = New System.Drawing.Size(937, 25)
+        Me.BindingNavigator1.TabIndex = 124
+        Me.BindingNavigator1.Text = "BindingNavigator1"
+        '
+        'BindingNavigatorSeparator
+        '
+        Me.BindingNavigatorSeparator.Name = "BindingNavigatorSeparator"
+        Me.BindingNavigatorSeparator.Size = New System.Drawing.Size(6, 25)
+        '
+        'navModificar
+        '
+        Me.navModificar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navModificar.Image = CType(resources.GetObject("navModificar.Image"), System.Drawing.Image)
+        Me.navModificar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navModificar.Name = "navModificar"
+        Me.navModificar.Size = New System.Drawing.Size(23, 22)
+        Me.navModificar.Text = "Modificar"
+        '
+        'navNuevo
+        '
+        Me.navNuevo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navNuevo.Image = CType(resources.GetObject("navNuevo.Image"), System.Drawing.Image)
+        Me.navNuevo.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navNuevo.Name = "navNuevo"
+        Me.navNuevo.Size = New System.Drawing.Size(23, 22)
+        Me.navNuevo.Text = "Nuevo"
+        '
+        'navEliminar
+        '
+        Me.navEliminar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.navEliminar.Image = CType(resources.GetObject("navEliminar.Image"), System.Drawing.Image)
+        Me.navEliminar.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.navEliminar.Name = "navEliminar"
+        Me.navEliminar.Size = New System.Drawing.Size(23, 22)
+        Me.navEliminar.Text = "Eliminar"
+        '
+        'btnIngresos
+        '
+        Me.btnIngresos.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
+        Me.btnIngresos.Image = CType(resources.GetObject("btnIngresos.Image"), System.Drawing.Image)
+        Me.btnIngresos.ImageTransparentColor = System.Drawing.Color.Magenta
+        Me.btnIngresos.Name = "btnIngresos"
+        Me.btnIngresos.Size = New System.Drawing.Size(23, 22)
+        Me.btnIngresos.Text = "Ingresos"
+        Me.btnIngresos.Visible = False
+        '
+        'lblIngresarRenta
+        '
+        Me.lblIngresarRenta.AutoSize = True
+        Me.lblIngresarRenta.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblIngresarRenta.ForeColor = System.Drawing.Color.Maroon
+        Me.lblIngresarRenta.Location = New System.Drawing.Point(421, 37)
+        Me.lblIngresarRenta.Name = "lblIngresarRenta"
+        Me.lblIngresarRenta.Size = New System.Drawing.Size(0, 24)
+        Me.lblIngresarRenta.TabIndex = 126
+        '
+        'Panel1
+        '
+        Me.Panel1.Controls.Add(Me.TabCampos)
+        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.Panel1.Location = New System.Drawing.Point(0, 25)
+        Me.Panel1.Name = "Panel1"
+        Me.Panel1.Size = New System.Drawing.Size(937, 542)
+        Me.Panel1.TabIndex = 127
+        '
+        'frmCertificadosDeInversion
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.AutoScroll = True
+        Me.ClientSize = New System.Drawing.Size(937, 613)
+        Me.Controls.Add(Me.Panel1)
+        Me.Controls.Add(Me.lblIngresarRenta)
+        Me.Controls.Add(Me.BindingNavigator1)
+        Me.Controls.Add(Me.pnlPie)
+        Me.Controls.Add(Me.Label30)
+        Me.Name = "frmCertificadosDeInversion"
+        Me.Text = "Certificados de Inversión"
+        CType(Me.dgvIngresos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.TabCampos.ResumeLayout(False)
+        Me.TabPage1.ResumeLayout(False)
+        Me.TabPage1.PerformLayout()
+        Me.GrpVenta.ResumeLayout(False)
+        Me.GrpVenta.PerformLayout()
+        Me.GrpCompra.ResumeLayout(False)
+        Me.GrpCompra.PerformLayout()
+        Me.GrpInfo.ResumeLayout(False)
+        Me.GrpInfo.PerformLayout()
+        Me.TbIngresos.ResumeLayout(False)
+        Me.Panel2.ResumeLayout(False)
+        Me.TabPage4.ResumeLayout(False)
+        Me.TabPage4.PerformLayout()
+        Me.GrpDatos.ResumeLayout(False)
+        Me.GrpDatos.PerformLayout()
+        Me.GrpInfoAcc.ResumeLayout(False)
+        Me.GrpInfoAcc.PerformLayout()
+        Me.pnlPie.ResumeLayout(False)
+        CType(Me.BindingNavigator1, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.BindingNavigator1.ResumeLayout(False)
+        Me.BindingNavigator1.PerformLayout()
+        Me.Panel1.ResumeLayout(False)
+        Me.ResumeLayout(False)
+        Me.PerformLayout()
+
+    End Sub
+
+    Friend WithEvents Label1 As Label
+    Friend WithEvents Label2 As Label
+    Friend WithEvents Label3 As Label
+    Friend WithEvents Label4 As Label
+    Friend WithEvents Label5 As Label
+    Friend WithEvents Label6 As Label
+    Friend WithEvents Label7 As Label
+    Friend WithEvents Label8 As Label
+    Friend WithEvents Label9 As Label
+    Friend WithEvents Label10 As Label
+    Friend WithEvents Label11 As Label
+    Friend WithEvents Label12 As Label
+    Friend WithEvents Label13 As Label
+    Friend WithEvents Label16 As Label
+    Friend WithEvents Label18 As Label
+    Friend WithEvents Label19 As Label
+    Friend WithEvents Label20 As Label
+    Friend WithEvents Label21 As Label
+    Friend WithEvents dtpUltimaFechaCuponCompra As DateTimePicker
+    Friend WithEvents dtpSiguienteFechaCuponCompra As DateTimePicker
+    Friend WithEvents dtpFechaLiquidacionCompra As DateTimePicker
+    Friend WithEvents dtpFechaVencimientoCompra As DateTimePicker
+    Friend WithEvents txtValorNominalCompra As TextBox
+    Friend WithEvents txtPorcentajeCuponCompra As TextBox
+    Friend WithEvents txtYTMAlVencimientoComisionCompra As TextBox
+    Friend WithEvents txtYTMAlVencimientoCompra As TextBox
+    Friend WithEvents txtPrecioAlVencimientoCompra As TextBox
+    Friend WithEvents txtPrecioCompra As TextBox
+    Friend WithEvents txtDiasAcumuladosCompra As TextBox
+    Friend WithEvents txtPrecioSucioCompra As TextBox
+    Friend WithEvents txtInteresAcumuladoCompra As TextBox
+    Friend WithEvents txtValorTransadoCompra As TextBox
+    Friend WithEvents txtMontoAPagar As TextBox
+    Friend WithEvents txtCostoTransferenciaCompra As TextBox
+    Friend WithEvents txtDiasAlVencimientoCompra As TextBox
+    Friend WithEvents Label17 As Label
+    Friend WithEvents lblBono As Label
+    Friend WithEvents txtDiasAlVencimientoVenta As TextBox
+    Friend WithEvents txtMontoARecibir As TextBox
+    Friend WithEvents txtValorTransadoVenta As TextBox
+    Friend WithEvents txtInteresAcumuladoVenta As TextBox
+    Friend WithEvents txtPrecioSucioVenta As TextBox
+    Friend WithEvents txtDiasAcumuladosVenta As TextBox
+    Friend WithEvents txtPrecioVenta As TextBox
+    Friend WithEvents txtPrecioAlVencimientoVenta As TextBox
+    Friend WithEvents txtYTMAlVencimientoVenta As TextBox
+    Friend WithEvents txtYTMAlVencimientoComisionVenta As TextBox
+    Friend WithEvents txtPorcentajeCuponVenta As TextBox
+    Friend WithEvents txtValorNominalVenta As TextBox
+    Friend WithEvents dtpFechaVencimientoVenta As DateTimePicker
+    Friend WithEvents dtpFechaLiquidacionVenta As DateTimePicker
+    Friend WithEvents dtpSiguienteFechaCuponVenta As DateTimePicker
+    Friend WithEvents dtpUltimaFechaCuponVenta As DateTimePicker
+    Friend WithEvents Label22 As Label
+    Friend WithEvents Label23 As Label
+    Friend WithEvents Label24 As Label
+    Friend WithEvents Label25 As Label
+    Friend WithEvents Label26 As Label
+    Friend WithEvents label27 As Label
+    Friend WithEvents lblIngresosPorIntereses_Op As Label
+    Friend WithEvents lblCostosTotales_Op As Label
+    Friend WithEvents lblGananciaPerdidaTotal_Op As Label
+    Friend WithEvents lblRendimientoGananciaPerdida_Op As Label
+    Friend WithEvents lblRendimientoIntereses_Op As Label
+    Friend WithEvents lblRendimientoAntesISR_Op As Label
+    Friend WithEvents lblRendimientoDespuesISR_Op As Label
+    Friend WithEvents Label35 As Label
+    Friend WithEvents txtValorNominal_Op As TextBox
+    Friend WithEvents txtPlazo_Op As TextBox
+    Friend WithEvents txtPrecioCompra_Op As TextBox
+    Friend WithEvents txtPrecioVenta_Op As TextBox
+    Friend WithEvents txtGananciaPerdidaCapital_Op As TextBox
+    Friend WithEvents txtIngresosPorIntereses_Op As TextBox
+    Friend WithEvents txtCostosTotales_Op As TextBox
+    Friend WithEvents txtGananciaPerdidaTotal_Op As TextBox
+    Friend WithEvents txtRendimientoGananciaPerdida_Op As TextBox
+    Friend WithEvents txtRendimientoIntereses_Op As TextBox
+    Friend WithEvents txtRendimientoAntesISR_Op As TextBox
+    Friend WithEvents txtRendimientoDespuesISR_Op As TextBox
+    Friend WithEvents btnAceptar As Button
+    Friend WithEvents btnCancelar As Button
+    Friend WithEvents cboAnioBaseC As ComboBox
+    Friend WithEvents cboAnioBaseV As ComboBox
+    Friend WithEvents cboPeriodosC As ComboBox
+    Friend WithEvents cboPeriodosV As ComboBox
+    Friend WithEvents Label29 As Label
+    Friend WithEvents dgvIngresos As DataGridView
+    Friend WithEvents Label30 As Label
+    Friend WithEvents TabCampos As TabControl
+    Friend WithEvents TabPage1 As TabPage
+    Friend WithEvents TbIngresos As TabPage
+    Friend WithEvents TabPage4 As TabPage
+    Friend WithEvents pnlPie As Panel
+    Friend WithEvents txtComisionVentaCasa As TextBox
+    Friend WithEvents txtComisionVentaBolsa As TextBox
+    Friend WithEvents BindingNavigator1 As BindingNavigator
+    Friend WithEvents BindingNavigatorSeparator As ToolStripSeparator
+    Friend WithEvents navModificar As ToolStripButton
+    Friend WithEvents navNuevo As ToolStripButton
+    Friend WithEvents navEliminar As ToolStripButton
+    Friend WithEvents txtCuponesRecibidos As TextBox
+    Friend WithEvents Label28 As Label
+    Friend WithEvents txtComisionPorBolsaVenta As TextBox
+    Friend WithEvents txtComisionPorBolsaCompra As TextBox
+    Friend WithEvents txtComisionPorVentaCasa As TextBox
+    Friend WithEvents txtComisionPorCompraCasa As TextBox
+    Friend WithEvents txtComisionCompraBolsa As TextBox
+    Friend WithEvents txtComisionCompraCasa As TextBox
+    Friend WithEvents Label15 As Label
+    Friend WithEvents Label14 As Label
+    Friend WithEvents txtPorcentajeInteresAcumuladoCompra As TextBox
+    Friend WithEvents txtPorcentajeInteresAcumuladoVenta As TextBox
+    Friend WithEvents lblIngresarRenta As Label
+    Friend WithEvents btnQuitar As Button
+    Friend WithEvents GrpVenta As GroupBox
+    Friend WithEvents GrpCompra As GroupBox
+    Friend WithEvents GrpInfo As GroupBox
+    Friend WithEvents btnIngresos As ToolStripButton
+    Friend WithEvents Panel1 As Panel
+    Friend WithEvents Panel2 As Panel
+    Friend WithEvents GrpDatos As GroupBox
+    Friend WithEvents GrpInfoAcc As GroupBox
+    Friend WithEvents Button1 As Button
+    Friend WithEvents btnVenderTitulo As Button
+End Class

+ 181 - 0
FRM/frmCertificadosDeInversion.resx

@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="BindingNavigator1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="navModificar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIVSURBVDhPjVNNaxNRFM0fcKNbBbG4qC7FpRTcdCf9AwqC
+        Ci6UKrQWW1toQYJZKRgqLgRjDG0yH2kwWAWb0tZFA91EUDemaabtfKTNNJmMScz0+O6bSdKxFT3M4c59
+        754z9715L5BMpcqCLCMhioj7KPAoSBJEWdYDfwMV/AuapiEhCG89iR/0ZcKP/DpjAfn1Ao+UEyLRKI+q
+        qiIhSTFP1gW1SdgoFlFUFCibCo+UE97EYtANg7/zTuakWU/qgtZKUDa3sbWtdkg5YTWb5SbtTmbnRHhS
+        F3HBNVCZu6brHVJesap87iDiKRFfHi8g9+STa9Q20I0SjNKOjzSmMerGDkq7Jq8bGhtFXi7gcziLtUes
+        m7bBbrl8NE0TZrUGqwHcH5nAxpaGyVAQ6YcfsHp7umtg7lUOs2Jhr9ZE1QGWB0+i/F3ARPAZ3i8s4u7Y
+        A1rChY5B1bL8rNmoNVqw2dzi4BlgpY/t4Gl8ladwb2TcFR/cA9u2u/xZR725D9Y1Mlx8mYnPAy+P49Wt
+        3q6Y0Dao15uMDR4bvwD2IHPnFLB0CZjpBaZP4Pn1c0h+XPnjN3oHyXEcOK0Wi/s8N6IXgWIQyI0D4WN4
+        evUsHxdTab8BXaSj8GJ0AO+iTJwLIXytxxtlBnLSb/A6EsnQheI3kC2HnXck0/MYvnEFUzf78S3UD3F+
+        iX+ZxFTvSTvoYaRN+V9SvYdA4DcZDa931m0XwAAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="navNuevo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHbSURBVDhPnZE7TNtQFIbdDmVtYWFlha1zJ0CdgA5MwQmP
+        EGRiEEuY660IIYQqdSpLixoeAVEcIdGuSDyiIMzDhChJmwcoYIOTOE38UFAOvldJIBGuIn7p09Gxz/2u
+        fS+BkubmXif4+cY496UtfrbaxvOeV/hFPQmFPjdkTqbepIMzLVH/h0IuwPTTzgkfNUKJDjslDtdgN6AG
+        x5JWi30bCxK7s41yYLpL2+8E3d8DOtcHqiKBqv0zJZeXAUmw4NL3qSnjf6/8ZNqL+vHYW22vA7RDEsKp
+        oilIQpKUWBJ8b8ryTKt+0AvazjtQfd0gCILORZLww70MG6y3wuraOhxHb6oF6MAE3tM8MuS40wwJu8Ve
+        oIGoVICIqEDYICKqFaKpQrWgnH7bsCKmZWC9m3ggeCHB1/lvsLDgrrC45IFQUjYXSNk8/lQ0ELvJAf/3
+        Ck7+VBO7VeoTBJI54CJXcGiAapnzaxOBrUZwlpDAvbhSOUAE6s8vMyYCa7UgfFuAoKA8YOwcvFbx87oE
+        R09cI+pPYzXXWI6VHEo9FiTkIiZeqo95UmCxjObThmDr12888D8UNQsDA+N8aSlBAMAL4xdYl+sjOEdd
+        QDsncTWDpmndRjq8DMO8LCmeG4K4B04tbBPumXp1AAAAAElFTkSuQmCC
+</value>
+  </data>
+  <data name="navEliminar.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGxSURBVDhPlZM7S8NQGIbTpv4AF3HwVnAQwUnpJvW++QMU
+        F1HEycFB0cVNUHHQEDo5uehgB21RQYi6CIKLg5s3kJTeTHrJpdfX84WmVm2tfvCQcDjvk+87h3ClamH0
+        Mjx16GA4GT+qV9d1VZKkQj6fRzVM04QgCDtsb1WJh8LpdBqappVJJBJQFAXhcNiShEIhiKL4Q+JgeGiD
+        YRjIZDLWk0ilUlBVFZFIxBKwLkEf8fl8tsSqsoDCNiSgQDKZRDQa/TIOQZlS9lOQy+XKG+id5rZHicVi
+        VieyLNcWfKdSQp3QecTj8b8LCFtC49CZkIjW/ywgstmsdS4kIWjtXwLq4uVoFzfT3bgYbsDVZDsEj0P8
+        VUAhm1e/gPulfhjBbRQfzqAdLELy9hTOB1wLdQXU/vVUJ3QWxu44sNwIrLsR3RxAcJB/qimolFDbxTs/
+        KktZa8bakKtYFgQCgWI1CXE50Yb03gzAQuYSh3fG6zyPs1H+jQRUfex6tFo/0/PhFm7nuiAvuxFZacDj
+        rAMXXlfhdMS5WspzrYw+Bl1NVfbGmsTjIV6mtk+8fHi/n9/gOI77AD0lg7Tvh7efAAAAAElFTkSuQmCC
+</value>
+  </data>
+  <data name="btnIngresos.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+  </data>
+</root>

+ 4376 - 0
FRM/frmCertificadosDeInversion.vb

@@ -0,0 +1,4376 @@
+Public Class frmCertificadosDeInversion
+    Dim oCEPrincipal As New CertificadoDeInversionCE
+    Dim oDAOPrincipal As New CertificadosDeInversionDAO
+    Dim oDAOGeneral As New DAOGeneral
+    Dim Bonos As New BonosCE
+    Dim TotalValorCupones As Double
+    Dim Index
+    Dim BonoCalculo As New FormulasBonoCE
+    Dim Cargar As Boolean = True
+    Dim BonosConsulta As New BonosDAO
+    Dim Operaciones As New Operaciones
+    Dim ModificarRenta As Boolean = True
+    Dim Tipo As Integer = 0
+    Dim IndexBaseC As Integer = 0
+    Dim IndexBaseV As Integer = 0
+    Dim PeriodoC As Integer = 0
+    Dim PeriodoV As Integer = 0
+    'Dim InstrumentoFinanciero As String = oDAOGeneral.ObtenerInstrumento(Variables.Codigo)
+    'Private _Modo As String
+    Private _IdDocumento As Integer
+    Private _TipoDocumento As String
+    Private _CodigoInversion As String
+    Private _TipoTransaccion As String 'N=Nuevo, A=Actualizar, C=Consulta
+    Private TipoPeriodicidad As Integer = 0
+    Public InstanciaAmortizacion As New DataGridView
+    Public InstanciaIngresos As New DataGridView
+    Private TipoOperacion As String
+    Public Sub New()
+        InitializeComponent()
+
+    End Sub
+
+    Public Sub New(TipoOper As String)
+        Me.New
+        TipoOperacion = TipoOper
+
+    End Sub
+
+
+
+
+
+
+
+    Sub CargarBase()
+
+        If cboAnioBaseC.Items.Count = 0 Or cboAnioBaseC.Items.Count = 1 Then
+
+
+            Me.cboAnioBaseC.DataSource = oDAOGeneral.ListaBase
+            Me.cboAnioBaseC.DisplayMember = "Descripcion"
+            Me.cboAnioBaseC.ValueMember = "Codigo"
+            Me.cboAnioBaseC.SelectedIndex = 0
+        End If
+        If cboAnioBaseV.Items.Count = 0 Or cboAnioBaseV.Items.Count = 1 Then
+
+
+            Me.cboAnioBaseV.DataSource = oDAOGeneral.ListaBase
+            Me.cboAnioBaseV.DisplayMember = "Descripcion"
+            Me.cboAnioBaseV.ValueMember = "Codigo"
+            Me.cboAnioBaseV.SelectedIndex = 0
+        End If
+    End Sub
+
+
+
+    Public Property TipoTransaccion As String
+        Get
+            Return _TipoTransaccion
+        End Get
+        Set(value As String)
+            _TipoTransaccion = value
+        End Set
+    End Property
+    Private Property IdDocumento As Integer
+        Get
+            Return _IdDocumento
+        End Get
+        Set(value As Integer)
+            _IdDocumento = value
+        End Set
+    End Property
+    Private Property TipoDocumento As String
+        Get
+            Return _TipoDocumento
+        End Get
+        Set(value As String)
+            _TipoDocumento = value
+        End Set
+    End Property
+    Private Property CodigoInversion As String
+        Get
+            Return _CodigoInversion
+        End Get
+        Set(value As String)
+            _CodigoInversion = value
+        End Set
+    End Property
+
+    Function FechaCupon(ByVal liquidacion As Date, ByVal Vencimiento As Date, ByVal frecuencia As Integer)
+        Dim periodos As Integer = 0
+
+        If frecuencia = 1 Then
+            periodos = -12
+        ElseIf frecuencia = 2 Then
+            periodos = -6
+        ElseIf frecuencia = 4 Then
+            periodos = -3
+
+        ElseIf frecuencia = 12 Then
+            periodos = -1
+
+        End If
+
+
+
+        If (Not periodos = 0) Then
+            While Vencimiento > liquidacion
+
+                Vencimiento = Vencimiento.AddMonths(periodos)
+
+            End While
+        Else
+            Return liquidacion
+        End If
+        Return Vencimiento
+
+
+    End Function
+
+    Sub ValidarExistencia()
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Dim Tabla As String = String.Empty
+        Dim Ins As String = Instrumento()
+
+        If (Ins = "TIT") Then
+            Tabla = "TIT"
+        ElseIf (Ins = "EURB") Then
+            Tabla = "EURB0"
+        ElseIf (Ins = "BONO") Then
+            Tabla = "BON0"
+
+        ElseIf (Ins = "CINV") Then
+            Tabla = "CIN0"
+
+        End If
+        Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+
+
+        If Tabla = "TIT" Then
+            If (Existe) Then
+                navNuevo.Enabled = False
+                'TbIngresos.rea = False
+                navModificar.Enabled = True
+                navEliminar.Enabled = True
+                btnIngresos.Enabled = True
+
+            Else
+                navNuevo.Enabled = True
+                'TbIngresos.Enabled = False
+                navModificar.Enabled = False
+                navEliminar.Enabled = False
+                btnIngresos.Enabled = False
+
+            End If
+
+        Else
+            If (Existe) Then
+                navNuevo.Enabled = False
+                'TbIngresos.Enabled = True
+                navModificar.Enabled = True
+                navEliminar.Enabled = True
+                btnIngresos.Enabled = True
+            Else
+                navNuevo.Enabled = True
+                'TbIngresos.Enabled = False
+                navModificar.Enabled = False
+                navEliminar.Enabled = False
+                btnIngresos.Enabled = False
+            End If
+        End If
+
+        TipoTransaccion = String.Empty
+        btnAceptar.Text = "Aceptar"
+    End Sub
+
+
+    Function ExisteValidacion()
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Dim Tabla As String = String.Empty
+        Dim Ins As String = Instrumento()
+
+        If (Ins = "TIT") Then
+            Tabla = "TIT"
+        ElseIf (Ins = "EURB") Then
+            Tabla = "EURB0"
+        ElseIf (Ins = "BONO") Then
+            Tabla = "BON0"
+
+        ElseIf (Ins = "CINV") Then
+            Tabla = "CIN0"
+
+        End If
+        Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+        Return Existe
+    End Function
+
+
+    Private Sub frmBonos_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        Dim VExisteInversion As Boolean = False
+        If Variables.TipoOperacionCMVTA = "C" Then
+            GrpVenta.Enabled = False
+            GrpCompra.Enabled = True
+        Else
+            GrpVenta.Enabled = True
+            GrpCompra.Enabled = False
+        End If
+        VExisteInversion = ExisteInversion()
+        ValidarExistencia()
+        Dim Ins As String = Instrumento()
+
+        CargarBase()
+        AsignacionPeriodicidad()
+        If (Not Ins = "TIT") Then
+            btnIngresos.Visible = False
+            'TbIngresos.Enabled = False
+        End If
+        If (Ins = "TIT") Then
+            btnIngresos.Visible = True
+            lblBono.Text = "Titularizacion"
+            ConfTitularizacion()
+        ElseIf (Ins = "EURB") Then
+            lblBono.Text = "Euro Bonos"
+
+        ElseIf (Ins = "BONO") Then
+            lblBono.Text = "Bonos"
+        End If
+        Bono()
+        Tipo = 1
+
+        Call CargarPeriodos()
+        'PrepararTablaImpuestosYComisiones()
+
+        PrepararTablaIngresos()
+
+        If Me.TipoTransaccion Is Nothing Then
+            Me.TipoTransaccion = "N"
+
+        End If
+
+        If Me.TipoTransaccion = "C" Then
+            '     Call CargarRegistroBD()
+        End If
+
+        CargarIngresos()
+        ' CargarComisiones()
+
+        RefrescarValorControles()
+
+        Cargar = False
+
+        'Calculos()
+        'Formato()
+        'ValidacionErrores()
+        BotonQuitar()
+
+
+
+        CamposTiempo()
+
+        CargarTransladoNuevo()
+        ConfiguracionCMVTA(VExisteInversion)
+    End Sub
+
+    Sub ConfiguracionCMVTA(ByRef VExisteInversion As Boolean)
+        Dim Codigo As String = Variables.Codigo
+        Dim ExisteCMVTA As Boolean = oDAOGeneral.ExisteCMVTA(Codigo)
+        If Not ExisteCMVTA And Variables.InvocadorProInv = "frmINV" Then
+            btnVenderTitulo.Visible = True
+        End If
+        If CantFormAbierto = False And Not VExisteInversion Then
+            If Not Variables.TrasladarCMVTA Is Nothing Then
+                cboAnioBaseC.SelectedIndex = Variables.TrasladarCMVTA.BaseCINV
+                txtPorcentajeCuponCompra.Text = Variables.TrasladarCMVTA.CuponCINV
+                dtpFechaLiquidacionCompra.Value = Variables.TrasladarCMVTA.FechaLiquidacionCINV
+                dtpFechaVencimientoCompra.Value = Variables.TrasladarCMVTA.FechaVencimientoCINV
+                cboPeriodosC.SelectedValue = Variables.TrasladarCMVTA.PeriodicidadCINV
+                txtComisionPorBolsaCompra.Text = Variables.TrasladarCMVTA.PorcentajeComisionBolsaCINV
+                txtComisionPorCompraCasa.Text = Variables.TrasladarCMVTA.PorcentajeComisionCasaCINV
+                txtPrecioCompra.Text = Variables.TrasladarCMVTA.PrecioCompraCINV
+                txtPrecioAlVencimientoCompra.Text = Variables.TrasladarCMVTA.PrecioVencimientoCINV
+                dtpUltimaFechaCuponCompra.Value = Variables.TrasladarCMVTA.UltimaFechaCuponCINV
+                txtValorNominalCompra.Text = Variables.TrasladarCMVTA.ValorNominalCINV
+                txtYTMAlVencimientoCompra.Text = Variables.TrasladarCMVTA.YTMVencimientoCINV
+
+            End If
+        End If
+    End Sub
+
+    Function ExisteVenta()
+        Dim Ventas As Boolean = False
+        Dim General As New DAOGeneral
+        Dim Codigo As String = Variables.Codigo
+        Ventas = General.ExisteVenta(Codigo)
+
+        Return Ventas
+    End Function
+
+    Sub CamposTiempo()
+        If Not TypeOf cboPeriodosC.SelectedValue Is DataRowView Then
+            Variables.PeriodicidadTIT = cboPeriodosC.SelectedValue
+        End If
+
+        Variables.BaseTIT = cboAnioBaseC.SelectedIndex
+
+
+    End Sub
+
+
+    Sub ConfTitularizacion()
+
+
+
+
+        dgvIngresos.Dispose()
+        TbIngresos.Parent = Nothing
+
+
+
+
+
+
+
+        Dim TbAmortizacion As New TabPage
+        Dim frmTitularizacion As New frmResultadoTitularizacion()
+        TbAmortizacion.Name = "tbAmortizacion"
+        TbAmortizacion.Text = "Amortizacion"
+        If TabCampos.TabCount = 2 Then
+            frmTitularizacion.Dock = DockStyle.Fill
+            frmTitularizacion.TopLevel = False
+            frmTitularizacion.Parent = TbAmortizacion
+            TabCampos.Controls.Add(TbAmortizacion)
+            frmTitularizacion.Show()
+        End If
+    End Sub
+
+
+    Function ExisteInversion()
+        Dim Codigo As String = Variables.Codigo
+        Dim TablaINV As String = "INV0"
+        Dim TablaPINV As String = "PIN0"
+        Dim General As New DAOGeneral
+        Dim InvPro = Variables.InvPro
+
+
+
+        If InvPro = "I" Then
+
+            Dim INV0 As Boolean = General.ExisteTitulo(Codigo, TablaINV)
+            If INV0 Then
+                navNuevo.Visible = True
+
+                Return True
+            Else
+                navNuevo.Visible = False
+
+                Return False
+            End If
+        End If
+
+
+
+        If InvPro = "P" Then
+            Dim PINV0 As Boolean = General.ExisteTitulo(Codigo, TablaPINV)
+            If PINV0 Then
+                navNuevo.Visible = True
+                Return True
+            Else
+                navNuevo.Visible = False
+                Return False
+            End If
+        End If
+        Return False
+    End Function
+
+
+    Sub Bono()
+        dtpSiguienteFechaCuponCompra.Enabled = False
+        dtpSiguienteFechaCuponVenta.Enabled = False
+        dtpUltimaFechaCuponCompra.Enabled = True
+        dtpUltimaFechaCuponVenta.Enabled = True
+    End Sub
+    Private Function Parametros()
+        Dim Coleccion As New Collection
+        Dim PeriodoCompra = cboPeriodosC.SelectedValue
+        Dim ValorNominalCompra = txtValorNominalCompra.Text
+        Dim UltCuponCompra = dtpUltimaFechaCuponCompra.Value
+        Dim SigFechaCuponCompra = dtpSiguienteFechaCuponCompra.Value
+        Dim FechaLiqCompra = dtpFechaLiquidacionCompra.Value
+        Dim FechaVenCompra = dtpFechaVencimientoCompra.Value
+        Dim PorcentajeCuponCompra = txtPorcentajeCuponCompra.Text.TrimEnd("%") / 100
+        Dim PrecioVenciCompra = txtPrecioAlVencimientoCompra.Text
+        Dim PrecioCompra = txtPrecioCompra.Text
+        Dim DiasBase = IndexBaseC
+        Dim CostoTransCompra = txtCostoTransferenciaCompra.Text
+        Dim PorcCupC = txtPorcentajeCuponCompra.Text.TrimEnd("%") / 100
+
+        Dim PeriodoVenta = cboPeriodosV.SelectedValue
+        Dim ValorNominalVenta = txtValorNominalVenta.Text
+        Dim UltCuponVenta = dtpUltimaFechaCuponVenta.Value
+        Dim SigFechaCuponVenta = dtpSiguienteFechaCuponVenta.Value
+        Dim FechaLiqVenta = dtpFechaLiquidacionVenta.Value
+        Dim FechaVenVenta = dtpFechaVencimientoVenta.Value
+        Dim PorcentajeCuponVenta = txtPorcentajeCuponVenta.Text.TrimEnd("%") / 100
+        Dim PrecioVenciVenta = txtPrecioAlVencimientoVenta.Text
+        Dim PrecioVenta = txtPrecioVenta.Text
+        Dim DiasBaseV = IndexBaseV
+        Dim CostoTransVenta = txtCuponesRecibidos.Text
+        Dim PorcCupV = txtPorcentajeCuponVenta.Text.TrimEnd("%") / 100
+
+        Dim ComisionPorCompraCasa = txtComisionPorCompraCasa.Text.TrimEnd("%") / 100
+        Dim ComisionPorCompraBolsa = txtComisionPorBolsaCompra.Text.TrimEnd("%") / 100
+        Dim ComisionPorVentaCasa = txtComisionPorVentaCasa.Text.TrimEnd("%") / 100
+        Dim ComisionPorVentaBolsa = txtComisionPorBolsaVenta.Text.TrimEnd("%") / 100
+        Dim YTMCompra = txtYTMAlVencimientoComisionCompra.Text.TrimEnd("%") / 100
+        Dim YTMVenta = txtYTMAlVencimientoComisionVenta.Text.TrimEnd("%") / 100
+
+
+
+
+        Dim DiasVenC, DiasVenV, DiasAcuC, DiasAcuV, YTMVenC, YTMVenV, IntAcuC, IntAcuV, IntPorAcuC, IntPorAcuV, PrecSucioC, PrecSucioV
+        Dim ComisionCasaC, ComisionCasaV, ComisionBolsaC, ComisionBolsaV, ValTransC, ValTransV, MontoPagar, MontoRecibir, CostTrans, CupRecibidos
+
+        DiasVenC = txtDiasAlVencimientoCompra.Text
+        DiasVenV = txtDiasAlVencimientoVenta.Text
+        DiasAcuC = txtDiasAcumuladosCompra.Text
+        DiasAcuV = txtDiasAcumuladosVenta.Text
+        YTMVenC = txtYTMAlVencimientoCompra.Text.ToString.Trim("%") / 100
+        YTMVenV = txtYTMAlVencimientoVenta.Text.ToString.Trim("%") / 100
+        IntAcuC = txtInteresAcumuladoCompra.Text
+        IntAcuV = txtInteresAcumuladoVenta.Text
+        IntPorAcuC = txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%") / 100
+        IntPorAcuV = txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%") / 100
+        PrecSucioC = txtPrecioSucioCompra.Text.ToString.Trim("%") / 100
+        PrecSucioV = txtPrecioSucioVenta.Text.ToString.Trim("%") / 100
+        ComisionCasaC = txtComisionCompraCasa.Text
+        ComisionCasaV = txtComisionVentaCasa.Text
+
+        ComisionBolsaC = txtComisionCompraBolsa.Text
+        ComisionBolsaV = txtComisionVentaBolsa.Text
+        ValTransC = txtValorTransadoCompra.Text
+        ValTransV = txtValorTransadoVenta.Text
+        MontoPagar = txtMontoAPagar.Text
+        MontoRecibir = txtMontoARecibir.Text
+        CostTrans = txtCostoTransferenciaCompra.Text
+        CupRecibidos = txtCuponesRecibidos.Text
+
+
+        Dim Codigo = Variables.Codigo
+        Coleccion.Add(PeriodoCompra)
+        Coleccion.Add(ValorNominalCompra)
+        Coleccion.Add(UltCuponCompra)
+        Coleccion.Add(SigFechaCuponCompra)
+        Coleccion.Add(FechaLiqCompra)
+        Coleccion.Add(FechaVenCompra)
+        Coleccion.Add(PorcentajeCuponCompra)
+        Coleccion.Add(PrecioVenciCompra)
+        Coleccion.Add(PrecioCompra)
+
+        Coleccion.Add(DiasBase)
+        Coleccion.Add(CostoTransCompra)
+
+
+        Coleccion.Add(PeriodoVenta)
+        Coleccion.Add(ValorNominalVenta)
+        Coleccion.Add(UltCuponVenta)
+        Coleccion.Add(SigFechaCuponVenta)
+        Coleccion.Add(FechaLiqVenta)
+        Coleccion.Add(FechaVenVenta)
+        Coleccion.Add(PorcentajeCuponVenta)
+        Coleccion.Add(PrecioVenciVenta)
+        Coleccion.Add(PrecioVenta)
+        Coleccion.Add(DiasBaseV)
+        Coleccion.Add(CostoTransVenta)
+        Coleccion.Add(Codigo)
+        Coleccion.Add(PorcCupC)
+        Coleccion.Add(PorcCupV)
+
+
+        Coleccion.Add(ComisionPorCompraCasa)
+        Coleccion.Add(ComisionPorCompraBolsa)
+        Coleccion.Add(ComisionPorVentaCasa)
+        Coleccion.Add(ComisionPorVentaBolsa)
+        Coleccion.Add(YTMCompra)
+        Coleccion.Add(YTMVenta)
+
+
+
+        Coleccion.Add(CInt(DiasVenC))
+        Coleccion.Add(CInt(DiasVenV))
+        Coleccion.Add(CInt(DiasAcuC))
+        Coleccion.Add(CInt(DiasAcuV))
+        Coleccion.Add(CDec(YTMVenC))
+        Coleccion.Add(CDec(YTMVenV))
+        Coleccion.Add(CDec(IntAcuC))
+        Coleccion.Add(CDec(IntAcuV))
+
+        Coleccion.Add(CDec(IntPorAcuC))
+        Coleccion.Add(CDec(IntPorAcuV))
+        Coleccion.Add(CDec(PrecSucioC))
+        Coleccion.Add(CDec(PrecSucioV))
+        Coleccion.Add(CDec(ComisionCasaC))
+        Coleccion.Add(CDec(ComisionCasaV))
+        Coleccion.Add(CDec(ComisionBolsaC))
+        Coleccion.Add(CDec(ComisionBolsaV))
+        Coleccion.Add(CDec(ValTransC))
+        Coleccion.Add(CDec(ValTransV))
+        Coleccion.Add(CDec(MontoPagar))
+        Coleccion.Add(CDec(MontoRecibir))
+        Coleccion.Add(CDec(CostTrans))
+        Coleccion.Add(CDec(CupRecibidos))
+
+
+
+        Return Coleccion
+    End Function
+
+    Private Sub LimpiarElementos()
+        Dim Fecha = DateTime.Today
+        dgvIngresos.Rows.Clear()
+
+        cboPeriodosC.SelectedIndex = -1
+        txtValorNominalCompra.Text = String.Empty
+        dtpUltimaFechaCuponCompra.Value = Fecha
+        dtpSiguienteFechaCuponCompra.Value = Fecha
+        dtpFechaLiquidacionCompra.Value = Fecha
+        dtpFechaVencimientoCompra.Value = Fecha
+        txtPorcentajeCuponCompra.Text = String.Empty
+        txtPrecioAlVencimientoCompra.Text = String.Empty
+        txtPrecioCompra.Text = String.Empty
+        cboAnioBaseC.SelectedIndex = 0
+        txtCostoTransferenciaCompra.Text = String.Empty
+        txtYTMAlVencimientoCompra.Text = String.Empty
+        txtYTMAlVencimientoComisionCompra.Text = String.Empty
+
+        txtComisionCompraCasa.Text = String.Empty
+        txtComisionCompraBolsa.Text = String.Empty
+
+
+        cboPeriodosV.SelectedIndex = -1
+        txtValorNominalVenta.Text = String.Empty
+        dtpUltimaFechaCuponVenta.Value = Fecha
+        dtpSiguienteFechaCuponVenta.Value = Fecha
+        dtpFechaLiquidacionVenta.Value = Fecha
+        dtpFechaVencimientoVenta.Value = Fecha
+        txtPorcentajeCuponVenta.Text = String.Empty
+        txtPrecioAlVencimientoVenta.Text = String.Empty
+        txtPrecioVenta.Text = String.Empty
+        cboAnioBaseV.SelectedIndex = 0
+        txtCuponesRecibidos.Text = String.Empty
+        txtYTMAlVencimientoVenta.Text = String.Empty
+        txtYTMAlVencimientoComisionVenta.Text = String.Empty
+
+        txtComisionVentaCasa.Text = String.Empty
+        txtComisionVentaBolsa.Text = String.Empty
+    End Sub
+    Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
+
+        Dim Codigo = Variables.Codigo
+
+
+
+        If TipoTransaccion = "N" Then
+
+            oDAOPrincipal.Nuevo(Parametros, Instrumento)
+        ElseIf Not ExisteValidacion() Then
+            Variables.ColeccionCINV = Parametros()
+
+            Me.Close()
+
+
+        End If
+
+
+
+        If TipoTransaccion = "M" Then
+            Dim Diccionario As New Dictionary(Of Integer, Collection)
+            Diccionario = ModificarIngreso()
+            oDAOPrincipal.ProcesoDatos(Parametros, Diccionario, Instrumento)
+
+
+        End If
+        If TipoTransaccion = "B" Then
+            oDAOPrincipal.
+                Eliminar(Codigo, Instrumento)
+
+            'EliminarIngreso()
+            LimpiarElementos()
+
+        End If
+        ValidarExistencia()
+    End Sub
+    Function RetornarObjeto()
+        Return oCEPrincipal
+    End Function
+
+    Public Sub CargarRegistro(vId As Integer, vTipo As String)
+        TipoTransaccion = "C"
+        IdDocumento = vId
+        TipoDocumento = vTipo
+    End Sub
+    Public Sub CargarRegistro(ByVal CodInversion As String)
+        TipoTransaccion = "C"
+        CodigoInversion = CodInversion
+    End Sub
+    Private Sub CargarRegistroBD()
+        oCEPrincipal = Nothing
+        '  oCEPrincipal = oDAOPrincipal.CargarRegistro(Me.CodigoInversion)
+
+        TipoTransaccion = "C"
+        RefrescarValorControles()
+
+    End Sub
+    Private Sub dtpUltimaFechaCuponCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpUltimaFechaCuponCompra.ValueChanged
+        'ActivarEdicion()
+        ' ControlUltimaFechaCuponCompra()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub dtpSiguienteFechaCuponCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpSiguienteFechaCuponCompra.ValueChanged
+        'ActivarEdicion()
+        ' ControlSiguienteFechaCuponCompra()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub dtpFechaLiquidacionCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaLiquidacionCompra.ValueChanged
+        'ActivarEdicion()
+        '  ControlFechaLiquidacionCompra()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub dtpFechaVencimientoCompra_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoCompra.ValueChanged
+        'ActivarEdicion()
+        '  ControlFechaVencimientoCompra()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub txtPorcentajeCuponCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeCuponCompra.TextChanged
+        'ActivarEdicion()
+
+        Calculos()
+        ValidacionErrores()
+
+    End Sub
+
+    Private Sub txtPrecioCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioCompra.TextChanged
+        'ActivarEdicion()
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub txtPrecioAlVencimientoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoCompra.TextChanged
+        'ActivarEdicion()
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+    Private Sub txtCostoTransferenciaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtCostoTransferenciaCompra.TextChanged
+        'RefrescarMontoAPagarCompra()
+        'ActivarEdicion()
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub dtpFechaVencimientoVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimientoVenta.ValueChanged
+        Formato()
+        Calculos()
+        ValidacionErrores()
+        'ActivarEdicion()
+        '  ControlFechaVencimientoVenta()
+
+    End Sub
+    Private Sub ControlFechaVencimientoVenta()
+        Dim valor As Date
+        valor = dtpFechaVencimientoVenta.Value.Date
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            oCEPrincipal.FechaVencimientoVenta = valor
+
+
+        End If
+
+    End Sub
+    Private Sub cboAnioBaseC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBaseC.SelectedIndexChanged
+        'ActivarEdicion()
+        ' ControlAnioBaseCompra()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+        CamposTiempo()
+    End Sub
+
+    Private Sub cboAnioBaseV_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBaseV.SelectedIndexChanged
+        'RefrescarInteresAcumuladoVenta()
+        'RefrescarDiasAlVencimientoVenta()
+        'RefrescarDiasAcumuladosVenta()
+        '    ControlAnioBaseVenta()
+        'ActivarEdicion()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+        CamposTiempo()
+    End Sub
+    Private Sub ControlAnioBaseVenta()
+        Dim valor As Integer
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            If cboAnioBaseV.SelectedIndex > -1 Then
+                oCEPrincipal.DiasBaseVenta = cboAnioBaseV.SelectedItem
+            Else
+                oCEPrincipal.DiasBaseVenta = 365
+            End If
+        End If
+    End Sub
+    Sub CargarPeriodos()
+        If cboPeriodosC.Items.Count = 0 Or cboPeriodosC.Items.Count = 1 Then
+
+
+            Me.cboPeriodosC.DataSource = oDAOGeneral.ListaPeriodicidad
+            Me.cboPeriodosC.ValueMember = "Codigo"
+            Me.cboPeriodosC.DisplayMember = "Descripcion"
+            Me.cboPeriodosC.SelectedIndex = 0
+        End If
+
+        If cboPeriodosV.Items.Count = 0 Or cboPeriodosV.Items.Count = 1 Then
+
+
+            Me.cboPeriodosV.DataSource = oDAOGeneral.ListaPeriodicidad
+            Me.cboPeriodosV.ValueMember = "Codigo"
+            Me.cboPeriodosV.DisplayMember = "Descripcion"
+            Me.cboPeriodosV.SelectedIndex = 0
+        End If
+    End Sub
+    Private Sub cboPeriodosC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodosC.SelectedIndexChanged
+        Formato()
+        Calculos()
+        ControlPeriodosCompra()
+        ValidacionErrores()
+        CamposTiempo()
+    End Sub
+
+    Private Sub cboPeriodosV_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodosV.SelectedIndexChanged
+        'ActivarEdicion()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+        CamposTiempo()
+    End Sub
+
+
+
+
+    'Sub RefrescarTablaIngresos()
+    '    'Me.dgvIngresos.DataSource = CalcularCupones()
+    'End Sub
+    Private Sub RefrescarValorControles()
+
+
+        Dim codigo = Variables.Codigo
+
+        Dim coleccion = oDAOPrincipal.CargarRegistro(codigo, Instrumento)
+
+        If (Not coleccion.Count = 1) Then
+            Dim Operaciones As New Operaciones
+
+
+
+
+
+            If coleccion(10) = 0 Then
+                IndexBaseC = 0
+            ElseIf coleccion(10) = 1 Then
+                IndexBaseC = 1
+            ElseIf coleccion(10) = 2 Then
+                IndexBaseC = 2
+            Else
+
+                IndexBaseC = 3
+            End If
+
+            If coleccion(21) = 0 Then
+                IndexBaseV = 0
+            ElseIf coleccion(21) = 1 Then
+                IndexBaseV = 1
+            ElseIf coleccion(21) = 2 Then
+                IndexBaseV = 2
+            Else
+
+                IndexBaseV = 3
+            End If
+
+
+
+
+
+
+
+
+
+
+
+            cboPeriodosC.SelectedValue = coleccion(1).ToString
+            If (String.IsNullOrEmpty(coleccion(2).ToString)) Then
+                txtValorNominalCompra.Text = 0
+            Else
+                txtValorNominalCompra.Text = coleccion(2).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(3).ToString)) Then
+                dtpUltimaFechaCuponCompra.Value = Date.Now.Date
+            Else
+                dtpUltimaFechaCuponCompra.Value = coleccion(3).ToString
+            End If
+            If (String.IsNullOrEmpty(coleccion(4).ToString)) Then
+                dtpSiguienteFechaCuponCompra.Value = Date.Now.Date
+            Else
+                dtpSiguienteFechaCuponCompra.Value = coleccion(4).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(5).ToString)) Then
+                dtpFechaLiquidacionCompra.Value = Date.Now.Date
+            Else
+                dtpFechaLiquidacionCompra.Value = coleccion(5).ToString
+            End If
+            If (String.IsNullOrEmpty(coleccion(6).ToString)) Then
+                dtpFechaVencimientoCompra.Value = Date.Now.Date
+            Else
+                dtpFechaVencimientoCompra.Value = coleccion(6).ToString
+            End If
+
+            ' txtPorcentajeCuponCompra.Text = coleccion(7)
+            If (String.IsNullOrEmpty(coleccion(8).ToString)) Then
+                txtPrecioAlVencimientoCompra.Text = 0
+            Else
+                txtPrecioAlVencimientoCompra.Text = coleccion(8).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(9).ToString)) Then
+
+            Else
+                txtPrecioCompra.Text = coleccion(9).ToString
+            End If
+
+
+            cboAnioBaseC.SelectedIndex = IndexBaseC
+            If (String.IsNullOrEmpty(coleccion(11).ToString)) Then
+                txtCostoTransferenciaCompra.Text = 0
+            Else
+                txtCostoTransferenciaCompra.Text = coleccion(11).ToString
+            End If
+
+            txtPorcentajeInteresAcumuladoCompra.Text = String.Empty
+            If (String.IsNullOrEmpty(coleccion(23).ToString)) Then
+                txtPorcentajeCuponCompra.Text = 0
+            Else
+                txtPorcentajeCuponCompra.Text = (CDec(coleccion(23) * 100).ToString)
+            End If
+
+            'txtDiasAlVencimientoCompra.Text = BonoCalculo.DiasVencimiento(dtpFechaLiquidacionCompra.Value, dtpFechaVencimientoCompra.Value, IndexBaseC).ToString
+            'txtDiasAcumuladosCompra.Text = Operaciones.DiasAcumulados(dtpUltimaFechaCuponCompra.Value, dtpFechaLiquidacionCompra.Value, IndexBaseC).ToString
+
+
+            'txtInteresAcumuladoCompra.Text = Operaciones.InteresAcumulado(txtValorNominalCompra.Text, txtPorcentajeCuponCompra.Text.TrimEnd("%") / 100, txtDiasAcumuladosCompra.Text, IndexBaseC).ToString
+            'txtPorcentajeInteresAcumuladoCompra.Text = Operaciones.InteresAcumuladoPor(txtInteresAcumuladoCompra.Text, txtValorNominalCompra.Text) * 100
+            'txtPrecioSucioCompra.Text = Operaciones.PrecioSucio(txtPrecioCompra.Text, txtPorcentajeInteresAcumuladoCompra.Text / 100).ToString
+            'txtValorTransadoCompra.Text = Operaciones.ValorTrasado(txtPrecioCompra.Text, txtValorNominalCompra.Text).ToString
+            If (String.IsNullOrEmpty(txtComisionPorCompraCasa.Text)) Then
+                txtComisionPorCompraCasa.Text = 0
+            End If
+            If (String.IsNullOrEmpty(txtValorTransadoCompra.Text)) Then
+                txtValorTransadoCompra.Text = 0
+            End If
+
+
+            If (String.IsNullOrEmpty(txtComisionPorBolsaCompra.Text)) Then
+                txtComisionPorBolsaCompra.Text = 0
+            End If
+
+            txtComisionCompraCasa.Text = Operaciones.Comisiones(CDec(txtComisionPorCompraCasa.Text.TrimEnd("%") / 100), CDec(txtValorTransadoCompra.Text)).ToString
+
+            txtComisionCompraBolsa.Text = Operaciones.Comisiones(CDec(txtComisionPorBolsaCompra.Text.TrimEnd("%") / 100), CDec(txtValorTransadoCompra.Text)).ToString
+            If (String.IsNullOrEmpty(txtYTMAlVencimientoCompra.Text.ToString)) Then
+                txtYTMAlVencimientoCompra.Text = 0
+            End If
+
+            'txtYTMAlVencimientoComisionCompra.Text = Bonos.CalcularYTMComision(CDec(txtYTMAlVencimientoCompra.Text.TrimEnd("%") / 100), CDec(txtComisionPorCompraCasa.Text.ToString.Trim("%")), CDec(txtDiasAlVencimientoCompra.Text), CDec(txtComisionPorBolsaCompra.Text.ToString.Trim("%")), dtpFechaLiquidacionCompra.Value, dtpFechaVencimientoCompra.Value, IndexBaseC).ToString
+
+
+
+
+            'txtMontoAPagar.Text = Operaciones.MontoPagar(CDec(txtValorTransadoCompra.Text), CDec(txtComisionCompraBolsa.Text), CDec(txtComisionCompraCasa.Text), CDec(txtInteresAcumuladoCompra.Text), CDec(txtCostoTransferenciaCompra.Text)).ToString
+
+
+
+
+            If (String.IsNullOrEmpty(coleccion(12).ToString)) Then
+                cboPeriodosV.SelectedValue = 0
+            Else
+                cboPeriodosV.SelectedValue = coleccion(12).ToString
+            End If
+
+
+            If (String.IsNullOrEmpty(coleccion(13).ToString)) Then
+                txtValorNominalVenta.Text = 0
+            Else
+                txtValorNominalVenta.Text = coleccion(13).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(14).ToString)) Then
+                dtpUltimaFechaCuponVenta.Value = Date.Now.Date
+            Else
+                dtpUltimaFechaCuponVenta.Value = coleccion(14).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(15).ToString)) Then
+                dtpSiguienteFechaCuponVenta.Value = Date.Now.Date
+            Else
+                dtpSiguienteFechaCuponVenta.Value = coleccion(15).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(16).ToString)) Then
+                dtpFechaLiquidacionVenta.Value = Date.Now.Date
+            Else
+                dtpFechaLiquidacionVenta.Value = coleccion(16).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(17).ToString)) Then
+                dtpFechaVencimientoVenta.Value = Date.Now.Date
+            Else
+                dtpFechaVencimientoVenta.Value = coleccion(17).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(24).ToString)) Then
+                txtPorcentajeCuponVenta.Text = 0
+            Else
+                txtPorcentajeCuponVenta.Text = CDec(coleccion(24) * 100).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(19).ToString)) Then
+                txtPrecioAlVencimientoVenta.Text = 0
+            Else
+                txtPrecioAlVencimientoVenta.Text = coleccion(19).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(20).ToString)) Then
+                txtPrecioVenta.Text = 0
+            Else
+                txtPrecioVenta.Text = coleccion(20).ToString
+            End If
+
+            cboAnioBaseV.SelectedIndex = IndexBaseV
+            If (String.IsNullOrEmpty(coleccion(22).ToString)) Then
+                txtCuponesRecibidos.Text = 0
+            Else
+                txtCuponesRecibidos.Text = coleccion(22).ToString
+            End If
+
+            'txtDiasAlVencimientoVenta.Text = BonoCalculo.DiasVencimiento(dtpFechaLiquidacionVenta.Value, dtpFechaVencimientoVenta.Value, IndexBaseV).ToString
+            'txtDiasAcumuladosVenta.Text = Operaciones.DiasAcumulados(dtpUltimaFechaCuponVenta.Value, dtpFechaLiquidacionVenta.Value, IndexBaseV).ToString
+            'txtInteresAcumuladoVenta.Text = Operaciones.InteresAcumulado(txtValorNominalVenta.Text, txtPorcentajeCuponVenta.Text.TrimEnd("%") / 100, txtDiasAcumuladosVenta.Text, IndexBaseV).ToString
+            'txtPorcentajeInteresAcumuladoVenta.Text = Operaciones.InteresAcumuladoPor(txtInteresAcumuladoVenta.Text, txtValorNominalVenta.Text) * 100
+            'txtPrecioSucioVenta.Text = Operaciones.PrecioSucio(txtPrecioVenta.Text, txtPorcentajeInteresAcumuladoVenta.Text / 100).ToString
+            'txtValorTransadoVenta.Text = Operaciones.ValorTrasado(txtPrecioVenta.Text, txtValorNominalCompra.Text).ToString
+
+            If (String.IsNullOrEmpty(txtComisionPorVentaCasa.Text)) Then
+                txtComisionPorVentaCasa.Text = 0
+            End If
+            If (String.IsNullOrEmpty(txtComisionPorBolsaVenta.Text)) Then
+                txtComisionPorBolsaVenta.Text = 0
+            End If
+
+
+            'txtComisionVentaCasa.Text = Operaciones.Comisiones(CDec(txtComisionPorVentaCasa.Text.TrimEnd("%") / 100), CDec(txtValorTransadoVenta.Text)).ToString
+            'txtComisionVentaBolsa.Text = Operaciones.Comisiones(CDec(txtComisionPorBolsaVenta.Text.TrimEnd("%") / 100), CDec(txtValorTransadoVenta.Text)).ToString
+            If String.IsNullOrEmpty(txtYTMAlVencimientoVenta.Text.ToString) Then
+                txtYTMAlVencimientoVenta.Text = 0
+            End If
+            'txtYTMAlVencimientoComisionVenta.Text = Bonos.CalcularYTMComision(CDec(txtYTMAlVencimientoCompra.Text.TrimEnd("%") / 100), CDec(txtComisionPorCompraCasa.Text.ToString.Trim("%")), CDec(txtDiasAlVencimientoCompra.Text), CDec(txtComisionPorBolsaCompra.Text.ToString.Trim("%")), dtpFechaLiquidacionCompra.Value, dtpFechaVencimientoCompra.Value, IndexBaseC).ToString
+            'txtMontoARecibir.Text = Operaciones.MontoRecibir(txtValorTransadoVenta.Text, txtComisionVentaBolsa.Text, txtComisionVentaCasa.Text, txtInteresAcumuladoVenta.Text).ToString
+            'txtCuponesRecibidos.Text = Recibido().ToString
+
+
+
+
+            If (String.IsNullOrEmpty(coleccion(25).ToString)) Then
+                txtComisionPorCompraCasa.Text = 0
+            Else
+                txtComisionPorCompraCasa.Text = (CDec(coleccion(25)) * 100).ToString
+            End If
+
+
+            If (String.IsNullOrEmpty(coleccion(26).ToString)) Then
+                txtComisionPorBolsaCompra.Text = 0
+            Else
+                txtComisionPorBolsaCompra.Text = (CDec(coleccion(26)) * 100).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(27).ToString)) Then
+                txtComisionPorVentaCasa.Text = 0
+            Else
+                txtComisionPorVentaCasa.Text = (CDec(coleccion(27)) * 100).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(28).ToString)) Then
+                txtComisionPorBolsaVenta.Text = 0
+            Else
+                txtComisionPorBolsaVenta.Text = (CDec(coleccion(28)) * 100).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(29).ToString)) Then
+                txtYTMAlVencimientoComisionCompra.Text = 0
+            Else
+                txtYTMAlVencimientoComisionCompra.Text = (CDec(coleccion(29)) * 100).ToString
+            End If
+
+            If (String.IsNullOrEmpty(coleccion(30).ToString)) Then
+
+                txtYTMAlVencimientoComisionVenta.Text = 0
+            Else
+                txtYTMAlVencimientoComisionVenta.Text = (CDec(coleccion(30)) * 100).ToString
+            End If
+
+            'Campos Extras'
+
+            If Not String.IsNullOrEmpty(coleccion(31).ToString) Then
+
+                txtDiasAlVencimientoCompra.Text = coleccion(31).ToString
+
+            End If
+
+
+            If Not String.IsNullOrEmpty(coleccion(32).ToString) Then
+
+                txtDiasAlVencimientoVenta.Text = coleccion(32).ToString
+
+
+            End If
+
+
+            If Not String.IsNullOrEmpty(coleccion(33).ToString) Then
+
+                txtDiasAcumuladosCompra.Text = coleccion(33).ToString
+
+
+            End If
+
+
+            If Not String.IsNullOrEmpty(coleccion(34).ToString) Then
+
+                txtDiasAcumuladosVenta.Text = coleccion(34).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(35).ToString) Then
+
+                txtYTMAlVencimientoCompra.Text = (coleccion(35) * 100).ToString + "%"
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(36).ToString) Then
+
+                txtYTMAlVencimientoVenta.Text = (coleccion(36) * 100).ToString + "%"
+
+
+            End If
+
+
+            If Not String.IsNullOrEmpty(coleccion(37).ToString) Then
+
+                txtPorcentajeInteresAcumuladoCompra.Text = (coleccion(37) * 100).ToString + "%"
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(38).ToString) Then
+
+
+                txtPorcentajeInteresAcumuladoVenta.Text = (coleccion(38) * 100).ToString + "%"
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(39).ToString) Then
+
+                txtInteresAcumuladoCompra.Text = coleccion(39).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(40).ToString) Then
+
+                txtInteresAcumuladoVenta.Text = coleccion(40).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(41).ToString) Then
+
+                txtPrecioSucioCompra.Text = (coleccion(41) * 100).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(42).ToString) Then
+
+                txtPrecioSucioVenta.Text = (coleccion(42) * 100).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(43).ToString) Then
+
+                txtComisionCompraCasa.Text = coleccion(43).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(44).ToString) Then
+
+                txtComisionVentaCasa.Text = coleccion(44).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(45).ToString) Then
+
+                txtComisionCompraBolsa.Text = coleccion(45).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(46).ToString) Then
+
+
+                txtComisionVentaBolsa.Text = coleccion(46).ToString
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(47).ToString) Then
+
+                txtValorTransadoCompra.Text = coleccion(47).ToString
+
+
+            End If
+
+
+
+            If Not String.IsNullOrEmpty(coleccion(48).ToString) Then
+
+                txtValorTransadoVenta.Text = coleccion(48).ToString
+
+
+            End If
+
+            If Not String.IsNullOrEmpty(coleccion(49).ToString) Then
+
+                txtMontoAPagar.Text = coleccion(49).ToString
+
+
+            End If
+
+            If Not String.IsNullOrEmpty(coleccion(50).ToString) Then
+
+
+                txtMontoARecibir.Text = coleccion(50).ToString
+
+            End If
+
+
+            If Not String.IsNullOrEmpty(coleccion(51).ToString) Then
+
+                txtCuponesRecibidos.Text = coleccion(51).ToString
+
+
+            End If
+
+
+
+        End If
+
+
+
+    End Sub
+
+
+    Sub Formato()
+
+        If cboPeriodosC.SelectedIndex = -1 Then
+            If cboPeriodosC.Items.Count > 0 Then
+                cboPeriodosC.SelectedIndex = 0
+            End If
+        End If
+
+        If cboPeriodosV.SelectedIndex = -1 Then
+            If cboPeriodosV.Items.Count > 0 Then
+                cboPeriodosV.SelectedIndex = 0
+            End If
+        End If
+
+        If cboAnioBaseC.SelectedIndex = -1 Then
+            If cboAnioBaseC.Items.Count > 0 Then
+                cboAnioBaseC.SelectedIndex = 0
+            End If
+        End If
+
+        If cboAnioBaseV.SelectedIndex = -1 Then
+            If cboAnioBaseV.Items.Count > 0 Then
+                cboAnioBaseV.SelectedIndex = 0
+            End If
+        End If
+
+
+        If IsNumeric(txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%")) Then
+            If Double.IsNaN(txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoCompra.Text = "0.0%"
+            End If
+        End If
+
+        If IsNumeric(txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%")) Then
+            If Double.IsNaN(txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoVenta.Text = "0.0%"
+            End If
+        End If
+
+
+        If IsNumeric(txtPrecioSucioCompra.Text.ToString.Trim("%")) Then
+            If Double.IsNaN(txtPrecioSucioCompra.Text.ToString.Trim("%")) Then
+                txtPrecioSucioCompra.Text = "0.0%"
+            End If
+        End If
+
+        If IsNumeric(txtPrecioSucioVenta.Text.ToString.Trim("%")) Then
+            If Double.IsNaN(txtPrecioSucioVenta.Text.ToString.Trim("%")) Then
+                txtPrecioSucioVenta.Text = "0.0%"
+            End If
+        End If
+
+
+        If (String.IsNullOrEmpty(txtValorNominalCompra.Text.ToString)) Then
+            txtValorNominalCompra.Text = "0.0"
+
+        End If
+
+        If (String.IsNullOrEmpty(txtDiasAlVencimientoCompra.Text)) Then
+            txtDiasAlVencimientoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtDiasAcumuladosCompra.Text)) Then
+            txtDiasAcumuladosCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPorcentajeCuponCompra.Text)) Then
+            txtPorcentajeCuponCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtYTMAlVencimientoComisionCompra.Text)) Then
+            txtYTMAlVencimientoComisionCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtYTMAlVencimientoCompra.Text)) Then
+            txtYTMAlVencimientoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioAlVencimientoCompra.Text)) Then
+            txtPrecioAlVencimientoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioCompra.Text)) Then
+            txtPrecioCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtInteresAcumuladoCompra.Text)) Then
+            txtInteresAcumuladoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPorcentajeInteresAcumuladoCompra.Text)) Then
+            txtPorcentajeInteresAcumuladoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioSucioCompra.Text)) Then
+            txtPrecioSucioCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionPorCompraCasa.Text)) Then
+            txtComisionPorCompraCasa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionCompraCasa.Text)) Then
+            txtComisionCompraCasa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionPorBolsaCompra.Text)) Then
+            txtComisionPorBolsaCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionCompraBolsa.Text)) Then
+            txtComisionCompraBolsa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtValorTransadoCompra.Text)) Then
+            txtValorTransadoCompra.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtMontoAPagar.Text)) Then
+            txtMontoAPagar.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtCostoTransferenciaCompra.Text)) Then
+            txtCostoTransferenciaCompra.Text = "0.0"
+        End If
+
+
+        If (String.IsNullOrEmpty(txtValorNominalVenta.Text)) Then
+            txtValorNominalVenta.Text = "0.0"
+        End If
+
+
+
+        If (String.IsNullOrEmpty(txtDiasAlVencimientoVenta.Text)) Then
+            txtDiasAlVencimientoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtDiasAcumuladosVenta.Text)) Then
+            txtDiasAcumuladosVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPorcentajeCuponVenta.Text)) Then
+            txtPorcentajeCuponVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtYTMAlVencimientoComisionVenta.Text)) Then
+            txtYTMAlVencimientoComisionVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtYTMAlVencimientoVenta.Text)) Then
+            txtYTMAlVencimientoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioAlVencimientoVenta.Text)) Then
+            txtPrecioAlVencimientoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioVenta.Text)) Then
+            txtPrecioVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtInteresAcumuladoVenta.Text)) Then
+            txtInteresAcumuladoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPorcentajeInteresAcumuladoVenta.Text)) Then
+            txtPorcentajeInteresAcumuladoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtPrecioSucioVenta.Text)) Then
+            txtPrecioSucioVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionPorVentaCasa.Text)) Then
+            txtComisionPorVentaCasa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionVentaCasa.Text)) Then
+            txtComisionVentaCasa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionPorBolsaVenta.Text)) Then
+            txtComisionPorBolsaVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtComisionVentaBolsa.Text)) Then
+            txtComisionVentaBolsa.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtValorTransadoVenta.Text)) Then
+            txtValorTransadoVenta.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtMontoARecibir.Text)) Then
+            txtMontoARecibir.Text = "0.0"
+        End If
+
+        If (String.IsNullOrEmpty(txtCuponesRecibidos.Text)) Then
+            txtCuponesRecibidos.Text = "0.0"
+        End If
+
+
+
+        If (txtPorcentajeCuponCompra.ToString.IndexOf("%") = -1) Then
+            txtPorcentajeCuponCompra.Text += "%"
+        End If
+
+        If (txtYTMAlVencimientoCompra.ToString.IndexOf("%") = -1) Then
+            txtYTMAlVencimientoCompra.Text += "%"
+        End If
+
+        If (txtPorcentajeCuponVenta.ToString.IndexOf("%") = -1) Then
+            txtPorcentajeCuponVenta.Text += "%"
+        End If
+
+        If (txtYTMAlVencimientoVenta.ToString.IndexOf("%") = -1) Then
+            txtYTMAlVencimientoVenta.Text += "%"
+        End If
+
+        If (txtComisionPorCompraCasa.ToString.IndexOf("%") = -1) Then
+            txtComisionPorCompraCasa.Text += "%"
+        End If
+
+        If (txtComisionPorBolsaCompra.ToString.IndexOf("%") = -1) Then
+            txtComisionPorBolsaCompra.Text += "%"
+        End If
+
+
+        If (txtComisionPorVentaCasa.ToString.IndexOf("%") = -1) Then
+            txtComisionPorVentaCasa.Text += "%"
+        End If
+
+
+        If (txtComisionPorBolsaVenta.ToString.IndexOf("%") = -1) Then
+            txtComisionPorBolsaVenta.Text += "%"
+        End If
+
+
+
+
+
+
+    End Sub
+
+
+
+    Sub Calculos()
+
+        If (Not Cargar) Then
+
+            Dim V_dtpSiguienteFechaCuponCompra = Date.Now.Date, V_dtpFechaVencimientoCompra = Date.Now.Date, V_dtpFechaLiquidacionCompra = Date.Now.Date, V_dtpUltimaFechaCuponCompra = Date.Now.Date
+            Dim V_txtValorNominalCompra = 0.0, V_txtPorcentajeCuponCompra = 0.0, V_txtDiasAcumuladosCompra = 0, V_txtInteresAcumuladoCompra = 0.0
+            Dim V_txtPorcentajeInteresAcumuladoCompra = 0.0, V_txtComisionPorCompraCasa = 0.0, V_txtValorTransadoCompra = 0.0
+            Dim V_txtComisionPorBolsaCompra = 0.0, V_txtComisionCompraCasa = 0.0, V_txtComisionCompraBolsa = 0.0
+            Dim V_txtYTMAlVencimientoCompra = 0.0, V_txtYTMAlVencimientoComisionCompra = 0.0, V_txtMontoAPagar = 0.0, V_txtPrecioCompra = 0.0
+            Dim V_txtPrecioAlVencimientoCompra = 0.0, V_txtCostoTransferenciaCompra = 0.0, V_txtPrecioSucioCompra = 0.0
+            Dim V_txtDiasAlVencimientoCompra = 0
+            Dim TipoPeriodoCompra As Integer = 0
+
+
+            Dim V_dtpSiguienteFechaCuponVenta = Date.Now.Date, V_dtpFechaVencimientoVenta = Date.Now.Date, V_dtpFechaLiquidacionVenta = Date.Now.Date, V_dtpUltimaFechaCuponVenta = Date.Now.Date
+            Dim V_txtValorNominalVenta = 0.0, V_txtPorcentajeCuponVenta = 0.0, V_txtDiasAcumuladosVenta = 0, V_txtInteresAcumuladoVenta = 0.0
+            Dim V_txtPorcentajeInteresAcumuladoVenta = 0.0, V_txtComisionPorVentaCasa = 0.0, V_txtValorTransadoVenta = 0.0
+            Dim V_txtComisionPorBolsaVenta = 0.0, V_txtComisionVentaCasa = 0.0, V_txtComisionVentaBolsa = 0.0
+            Dim V_txtYTMAlVencimientoVenta = 0.0, V_txtYTMAlVencimientoComisionVenta = 0.0, V_txtPrecioVenta = 0.0
+            Dim V_txtPrecioAlVencimientoVenta = 0.0, V_txtCostoTransferenciaVenta = 0.0, V_txtPrecioSucioVenta = 0.0
+            Dim V_txtDiasAlVencimientoVenta = 0.0, V_txtMontoARecibir = 0.0, V_txtCuponesRecibidos = 0.0
+            Dim TipoPeriodoVenta As Integer = 0
+
+            V_dtpSiguienteFechaCuponCompra = dtpSiguienteFechaCuponCompra.Value
+            V_dtpSiguienteFechaCuponVenta = dtpSiguienteFechaCuponVenta.Value
+            V_dtpUltimaFechaCuponCompra = dtpUltimaFechaCuponCompra.Value
+            V_dtpUltimaFechaCuponVenta = dtpUltimaFechaCuponVenta.Value
+            V_dtpFechaVencimientoCompra = dtpFechaVencimientoCompra.Value
+            V_dtpFechaVencimientoVenta = dtpFechaVencimientoVenta.Value
+            V_dtpFechaLiquidacionCompra = dtpFechaLiquidacionCompra.Value
+            V_dtpFechaLiquidacionVenta = dtpFechaLiquidacionVenta.Value
+
+
+
+
+            If String.IsNullOrEmpty(txtValorNominalCompra.Text) Then
+                V_txtValorNominalCompra = 0
+            Else
+
+                V_txtValorNominalCompra = txtValorNominalCompra.Text
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtValorNominalVenta.Text) Then
+                V_txtValorNominalVenta = 0
+            Else
+                V_txtValorNominalVenta = txtValorNominalVenta.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtPorcentajeCuponCompra.Text.Trim("%")) Then
+                V_txtPorcentajeCuponCompra = 0
+            Else
+                V_txtPorcentajeCuponCompra = CDec(txtPorcentajeCuponCompra.Text.Trim("%") / 100)
+            End If
+
+            If String.IsNullOrEmpty(txtPorcentajeCuponVenta.Text.Trim("%")) Then
+
+                V_txtPorcentajeCuponVenta = 0
+            Else
+
+                V_txtPorcentajeCuponVenta = CDec(txtPorcentajeCuponVenta.Text.Trim("%") / 100)
+
+            End If
+
+
+            If String.IsNullOrEmpty(txtYTMAlVencimientoCompra.Text.Trim("%")) Then
+
+                V_txtYTMAlVencimientoCompra = 0
+
+            Else
+
+                V_txtYTMAlVencimientoCompra = CDec(txtYTMAlVencimientoCompra.Text.Trim("%") / 100)
+
+            End If
+
+
+            If String.IsNullOrEmpty(txtYTMAlVencimientoVenta.Text.Trim("%")) Then
+
+                V_txtYTMAlVencimientoVenta = 0
+            Else
+
+                V_txtYTMAlVencimientoVenta = CDec(txtYTMAlVencimientoVenta.Text.Trim("%") / 100)
+
+            End If
+
+
+            If String.IsNullOrEmpty(txtPrecioCompra.Text) Then
+                V_txtPrecioCompra = 0
+
+            Else
+
+                V_txtPrecioCompra = txtPrecioCompra.Text
+
+            End If
+
+
+
+
+            If String.IsNullOrEmpty(txtPrecioVenta.Text) Then
+
+                V_txtPrecioVenta = 0
+            Else
+
+                V_txtPrecioVenta = txtPrecioVenta.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtPrecioAlVencimientoCompra.Text) Then
+
+                V_txtPrecioAlVencimientoCompra = 0
+            Else
+
+                V_txtPrecioAlVencimientoCompra = txtPrecioAlVencimientoCompra.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtPrecioAlVencimientoVenta.Text) Then
+
+                V_txtPrecioAlVencimientoVenta = 0
+            Else
+
+                V_txtPrecioAlVencimientoVenta = txtPrecioAlVencimientoVenta.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtComisionPorCompraCasa.Text.Trim("%")) Then
+                V_txtComisionPorCompraCasa = 0
+
+            Else
+
+                V_txtComisionPorCompraCasa = CDec(txtComisionPorCompraCasa.Text.Trim("%")) / 100
+
+            End If
+
+
+
+
+            If String.IsNullOrEmpty(txtComisionPorVentaCasa.Text.Trim("%")) Then
+
+                V_txtComisionPorVentaCasa = 0
+            Else
+
+                V_txtComisionPorVentaCasa = CDec(txtComisionPorVentaCasa.Text.Trim("%")) / 100
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtComisionCompraCasa.Text) Then
+
+                V_txtComisionCompraCasa = 0
+            Else
+
+                V_txtComisionCompraCasa = txtComisionCompraCasa.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtComisionVentaCasa.Text) Then
+
+                V_txtComisionVentaCasa = 0
+            Else
+
+                V_txtComisionVentaCasa = txtComisionVentaCasa.Text
+
+            End If
+
+
+
+
+            If String.IsNullOrEmpty(txtComisionPorBolsaCompra.Text.Trim("%")) Then
+
+                V_txtComisionPorBolsaCompra = 0
+            Else
+
+                V_txtComisionPorBolsaCompra = CDec(txtComisionPorBolsaCompra.Text.Trim("%")) / 100
+
+            End If
+
+
+
+
+            If String.IsNullOrEmpty(txtComisionPorBolsaVenta.Text.Trim("%")) Then
+                V_txtComisionPorBolsaVenta = 0
+
+            Else
+
+                V_txtComisionPorBolsaVenta = CDec(txtComisionPorBolsaVenta.Text.Trim("%")) / 100
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtComisionCompraBolsa.Text) Then
+                V_txtComisionCompraBolsa = 0
+
+            Else
+
+                V_txtComisionCompraBolsa = txtComisionCompraBolsa.Text
+
+            End If
+
+
+
+
+            If String.IsNullOrEmpty(txtComisionVentaBolsa.Text) Then
+                V_txtComisionVentaBolsa = 0
+
+            Else
+
+                V_txtComisionVentaBolsa = txtComisionVentaBolsa.Text
+
+            End If
+
+
+
+            If String.IsNullOrEmpty(txtCostoTransferenciaCompra.Text) Then
+                V_txtCostoTransferenciaCompra = 0
+
+            Else
+
+                V_txtCostoTransferenciaCompra = txtCostoTransferenciaCompra.Text
+
+            End If
+
+
+
+
+
+
+            If (cboPeriodosC.SelectedValue = "M") Then
+                TipoPeriodoCompra = 12
+                PeriodoC = 1
+            ElseIf (cboPeriodosC.SelectedValue = "T") Then
+                TipoPeriodoCompra = 4
+                PeriodoC = 3
+
+            ElseIf (cboPeriodosC.SelectedValue = "S") Then
+                TipoPeriodoCompra = 2
+                PeriodoC = 6
+
+            ElseIf (cboPeriodosC.SelectedValue = "A") Then
+                TipoPeriodoCompra = 1
+                PeriodoC = 12
+            End If
+
+
+            If (cboPeriodosV.SelectedValue = "M") Then
+                TipoPeriodoVenta = 12
+                PeriodoV = 1
+            ElseIf (cboPeriodosV.SelectedValue = "T") Then
+                TipoPeriodoVenta = 4
+                PeriodoV = 3
+            ElseIf (cboPeriodosV.SelectedValue = "S") Then
+                TipoPeriodoVenta = 2
+                PeriodoV = 6
+            ElseIf (cboPeriodosV.SelectedValue = "A") Then
+                TipoPeriodoVenta = 1
+                PeriodoV = 12
+            End If
+
+
+
+
+            If cboAnioBaseC.SelectedIndex = 0 Then
+                IndexBaseC = 0
+            ElseIf cboAnioBaseC.SelectedIndex = 1 Then
+                IndexBaseC = 1
+            ElseIf cboAnioBaseC.SelectedIndex = 2 Then
+                IndexBaseC = 2
+            Else
+
+                IndexBaseC = 3
+            End If
+
+            If cboAnioBaseV.SelectedIndex = 0 Then
+                IndexBaseV = 0
+            ElseIf cboAnioBaseV.SelectedIndex = 1 Then
+                IndexBaseV = 1
+            ElseIf cboAnioBaseV.SelectedIndex = 2 Then
+                IndexBaseV = 2
+            Else
+
+                IndexBaseV = 3
+            End If
+
+
+            If (Tipo = 0) Then
+
+
+                dtpUltimaFechaCuponCompra.Value = FechaCupon(V_dtpFechaLiquidacionCompra, V_dtpFechaVencimientoCompra, TipoPeriodoCompra)
+                dtpUltimaFechaCuponVenta.Value = FechaCupon(V_dtpFechaLiquidacionVenta, V_dtpFechaVencimientoVenta, TipoPeriodoVenta)
+
+
+            Else
+
+                dtpSiguienteFechaCuponCompra.Value = FechaTipo(V_dtpUltimaFechaCuponCompra, TipoPeriodoCompra)
+                dtpSiguienteFechaCuponVenta.Value = FechaTipo(V_dtpUltimaFechaCuponVenta, TipoPeriodoVenta)
+
+            End If
+            V_dtpSiguienteFechaCuponCompra = dtpSiguienteFechaCuponCompra.Value
+            V_dtpSiguienteFechaCuponVenta = dtpSiguienteFechaCuponVenta.Value
+            V_dtpUltimaFechaCuponCompra = dtpUltimaFechaCuponCompra.Value
+            V_dtpUltimaFechaCuponVenta = dtpUltimaFechaCuponVenta.Value
+            V_dtpFechaVencimientoCompra = dtpFechaVencimientoCompra.Value
+            V_dtpFechaVencimientoVenta = dtpFechaVencimientoVenta.Value
+            V_dtpFechaLiquidacionCompra = dtpFechaLiquidacionCompra.Value
+            V_dtpFechaLiquidacionVenta = dtpFechaLiquidacionVenta.Value
+
+            'Valores de Compra
+
+            V_txtDiasAlVencimientoCompra = BonoCalculo.DiasVencimiento(V_dtpFechaLiquidacionCompra, V_dtpFechaVencimientoCompra, IndexBaseC)
+
+
+            V_txtDiasAcumuladosCompra = Operaciones.DiasAcumulados(V_dtpUltimaFechaCuponCompra, V_dtpFechaLiquidacionCompra, IndexBaseC)
+            V_txtInteresAcumuladoCompra = BonoCalculo.InteresAcumulado(V_txtValorNominalCompra, V_txtPorcentajeCuponCompra, V_dtpUltimaFechaCuponCompra, V_dtpFechaLiquidacionCompra, V_txtDiasAcumuladosCompra, IndexBaseC)
+
+
+            V_txtPorcentajeInteresAcumuladoCompra = BonoCalculo.InteresAcumuladoPor(V_txtInteresAcumuladoCompra, V_txtValorNominalCompra, PeriodoC, IndexBaseC) * 100
+            V_txtPrecioSucioCompra = BonoCalculo.PrecioSucio(V_txtPrecioCompra, V_txtPorcentajeInteresAcumuladoCompra / 100)
+            V_txtValorTransadoCompra = BonoCalculo.ValorTrasado(V_txtPrecioCompra, V_txtValorNominalCompra)
+            'V_txtComisionCompraCasa = BonoCalculo.Comisiones(CDec(V_txtComisionPorCompraCasa), CDec(V_txtValorTransadoCompra))
+            ' V_txtComisionCompraBolsa = BonoCalculo.Comisiones(CDec(V_txtComisionPorBolsaCompra), CDec(V_txtValorTransadoCompra))
+            V_txtComisionCompraCasa = CalcularComision(V_txtComisionPorCompraCasa, V_txtValorTransadoCompra)
+            V_txtComisionCompraBolsa = CalcularComision(V_txtComisionPorBolsaCompra, V_txtValorTransadoCompra)
+            V_txtYTMAlVencimientoComisionCompra = Bonos.CalcularYTMComision(CDec(V_txtYTMAlVencimientoCompra), CDec(V_txtComisionPorCompraCasa), V_txtDiasAlVencimientoCompra, CDec(V_txtComisionPorBolsaCompra), V_dtpFechaLiquidacionCompra, V_dtpFechaVencimientoCompra, IndexBaseC)
+            V_txtMontoAPagar = BonoCalculo.MontoPagar(V_txtValorTransadoCompra, V_txtComisionCompraBolsa, V_txtComisionCompraCasa, V_txtInteresAcumuladoCompra, V_txtCostoTransferenciaCompra)
+
+
+            'Valores de Venta
+
+            V_txtDiasAlVencimientoVenta = BonoCalculo.DiasVencimiento(V_dtpFechaLiquidacionVenta, V_dtpFechaVencimientoVenta, IndexBaseV)
+            V_txtDiasAcumuladosVenta = Operaciones.DiasAcumulados(V_dtpUltimaFechaCuponVenta, V_dtpFechaLiquidacionVenta, IndexBaseV)
+            V_txtInteresAcumuladoVenta = BonoCalculo.InteresAcumulado(V_txtValorNominalVenta, V_txtPorcentajeCuponVenta, V_dtpUltimaFechaCuponVenta, V_dtpFechaLiquidacionVenta, V_txtDiasAcumuladosVenta, IndexBaseV)
+            V_txtPorcentajeInteresAcumuladoVenta = BonoCalculo.InteresAcumuladoPor(V_txtInteresAcumuladoVenta, V_txtValorNominalVenta, PeriodoV, IndexBaseV) * 100
+            V_txtPrecioSucioVenta = BonoCalculo.PrecioSucio(V_txtPrecioVenta, V_txtPorcentajeInteresAcumuladoVenta / 100)
+            V_txtValorTransadoVenta = BonoCalculo.ValorTrasado(V_txtPrecioVenta, V_txtValorNominalVenta)
+            'V_txtComisionVentaCasa = BonoCalculo.Comisiones(CDec(V_txtComisionPorVentaCasa), CDec(V_txtValorTransadoVenta))
+            ' V_txtComisionVentaBolsa = BonoCalculo.Comisiones(CDec(V_txtComisionPorBolsaVenta), CDec(V_txtValorTransadoVenta))
+
+            V_txtComisionVentaCasa = CalcularComision(V_txtComisionPorVentaCasa, V_txtValorTransadoVenta)
+            V_txtComisionVentaBolsa = CalcularComision(V_txtComisionPorBolsaVenta, V_txtValorTransadoVenta)
+
+            V_txtYTMAlVencimientoComisionVenta = Bonos.CalcularYTMComision(V_txtYTMAlVencimientoVenta, V_txtComisionPorVentaCasa, V_txtDiasAlVencimientoVenta, V_txtComisionPorBolsaVenta, V_dtpFechaLiquidacionVenta, V_dtpFechaVencimientoVenta, IndexBaseV)
+            V_txtMontoARecibir = BonoCalculo.MontoRecibir(V_txtValorTransadoVenta, V_txtComisionVentaBolsa, V_txtComisionVentaCasa, V_txtInteresAcumuladoVenta)
+            V_txtCuponesRecibidos = Recibido()
+
+            'Valores de Compra
+
+
+            txtDiasAlVencimientoCompra.Text = Format(V_txtDiasAlVencimientoCompra, "0.0000")
+            txtDiasAcumuladosCompra.Text = Format(V_txtDiasAcumuladosCompra, "0.0000")
+            txtInteresAcumuladoCompra.Text = Format(V_txtInteresAcumuladoCompra, "0.0000")
+            txtPorcentajeInteresAcumuladoCompra.Text = CStr(Format(V_txtPorcentajeInteresAcumuladoCompra, "0.000")) + "%"
+            txtPrecioSucioCompra.Text = Format(V_txtPrecioSucioCompra, "0.0000")
+            txtValorTransadoCompra.Text = Format(V_txtValorTransadoCompra, "0.0000")
+            txtComisionCompraCasa.Text = Format(V_txtComisionCompraCasa, "0.0000")
+            txtComisionCompraBolsa.Text = Format(V_txtComisionCompraBolsa, "0.0000")
+            txtYTMAlVencimientoComisionCompra.Text = CStr(Format(V_txtYTMAlVencimientoComisionCompra, "0.0000") * 100) + "%"
+            txtMontoAPagar.Text = Format(V_txtMontoAPagar, "0.0000")
+            txtComisionCompraCasa.Text = Format(V_txtComisionCompraCasa, "0.0000")
+            txtComisionCompraBolsa.Text = Format(V_txtComisionCompraBolsa, "0.0000")
+
+            'Valores de Venta
+
+            FechaCupon(V_dtpFechaLiquidacionVenta, V_dtpFechaVencimientoVenta, TipoPeriodoVenta)
+            txtDiasAlVencimientoVenta.Text = Format(V_txtDiasAlVencimientoVenta, "0.0000")
+            txtDiasAcumuladosVenta.Text = Format(V_txtDiasAcumuladosVenta, "0.0000")
+            txtInteresAcumuladoVenta.Text = Format(V_txtInteresAcumuladoVenta, "0.0000")
+            txtPorcentajeInteresAcumuladoVenta.Text = CStr(Format(V_txtPorcentajeInteresAcumuladoVenta, "0.0000")) + "%"
+            txtPrecioSucioVenta.Text = Format(V_txtPrecioSucioVenta, "0.0000")
+            txtValorTransadoVenta.Text = Format(V_txtValorTransadoVenta, "0.0000")
+            txtComisionVentaCasa.Text = Format(V_txtComisionVentaCasa, "0.0000")
+            txtComisionVentaBolsa.Text = Format(V_txtComisionVentaBolsa, "0.0000")
+            txtYTMAlVencimientoComisionVenta.Text = CStr(Format(V_txtYTMAlVencimientoComisionVenta, "0.0000") * 100) + "%"
+            txtMontoARecibir.Text = Format(V_txtMontoARecibir, "0.0000")
+            txtCuponesRecibidos.Text = Format(V_txtCuponesRecibidos, "0.0000")
+            txtComisionVentaCasa.Text = Format(V_txtComisionVentaCasa, "0.0000")
+            txtComisionVentaBolsa.Text = Format(V_txtComisionVentaBolsa, "0.0000")
+
+        End If
+
+        CorrelativoSinBD()
+    End Sub
+
+
+    Function CalcularComision(ByVal Porcentaje As Double, ByVal VTransado As Double)
+        Return Porcentaje * VTransado
+
+    End Function
+
+
+    Private Sub RefrescarClaseEntidad()
+        ControlValorNominalCompra()
+        ControlUltimaFechaCuponCompra()
+        ControlSiguienteFechaCuponCompra()
+        ControlFechaLiquidacionCompra()
+        ControlFechaVencimientoCompra()
+        ControlPorcentajeCuponCompra()
+        'ControlYTMAlVencimientoCompra()
+        ControlPrecioAlVencimientoCompra()
+        ControlPrecioCompra()
+        ControlAnioBaseCompra()
+        ControlCostosDeTransferencia()
+
+        'ControlValorNominalv
+        ControlUltimaFechaCuponCompra()
+        ControlSiguienteFechaCuponCompra()
+        ControlFechaLiquidacionCompra()
+        ControlFechaVencimientoCompra()
+        ControlPorcentajeCuponCompra()
+        'ControlYTMAlVencimientoCompra()
+        ControlPrecioAlVencimientoCompra()
+        ControlPrecioCompra()
+        ControlAnioBaseCompra()
+        ControlCostosDeTransferencia()
+
+
+    End Sub
+    Private Sub GuardarNuevoRegistro()
+        Dim res As Integer
+        RefrescarClaseEntidad()
+
+        res = oDAOPrincipal.Nuevo(oCEPrincipal)
+        If res = 1 Then
+            MsgBox("Registro Guardado")
+        Else
+            MsgBox("Algo no salio bien.")
+        End If
+
+    End Sub
+    Private Sub ActualizarRegistro()
+        Dim res As Integer
+        RefrescarClaseEntidad()
+
+        ' res = oDAOPrincipal.Actualizar(oCEPrincipal)
+
+        If res = 1 Then
+            MsgBox("Registro Guardado")
+        Else
+            MsgBox("Algo no salio bien.")
+        End If
+
+    End Sub
+    'Private Sub ActivarEdicion()
+    '    If TipoTransaccion = "C" Then
+    '        Me.TipoTransaccion = "A"
+    '        Me.btnAceptar.Text = "Guardar"
+    '    End If
+
+    'End Sub
+    Private Sub ControlPeriodosCompra()
+        Dim valor As String
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            If Me.cboPeriodosC.SelectedIndex = -1 Then
+                valor = ""
+            Else
+                If (String.IsNullOrEmpty(Me.cboPeriodosC.SelectedValue)) Then
+                    valor = String.Empty
+                Else
+                    valor = Me.cboPeriodosC.SelectedValue
+                End If
+
+            End If
+            oCEPrincipal.PeriodicidadCompra = valor
+
+        End If
+    End Sub
+
+    Function FechaTipo(ByVal ultimafecha As DateTime, ByVal frecuencia As Integer)
+        Dim periodos As Integer = 0
+        Dim Fecha As Date
+        If frecuencia = 1 Then
+            periodos = 12
+        ElseIf frecuencia = 2 Then
+            periodos = 6
+        ElseIf frecuencia = 4 Then
+            periodos = 3
+        ElseIf frecuencia = 12 Then
+            periodos = 1
+
+        End If
+        Fecha = ultimafecha.AddMonths(periodos)
+
+        Return Fecha
+    End Function
+
+    Private Sub ControlValorNominalCompra()
+
+    End Sub
+    Private Sub ControlUltimaFechaCuponCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oCEPrincipal.UltimaFechaCuponCompra = dtpUltimaFechaCuponCompra.Value.Date
+
+        End If
+    End Sub
+    Private Sub ControlSiguienteFechaCuponCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oCEPrincipal.SiguienteFechaCuponCompra = dtpSiguienteFechaCuponCompra.Value.Date
+
+        End If
+    End Sub
+    Private Sub ControlFechaLiquidacionCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oCEPrincipal.FechaLiquidacionCompra = dtpFechaLiquidacionCompra.Value.Date
+
+        End If
+    End Sub
+    Private Sub ControlFechaVencimientoCompra()
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            Me.oCEPrincipal.FechaVencimientoCompra = dtpFechaVencimientoCompra.Value.Date
+
+        End If
+    End Sub
+    Private Sub ControlPorcentajeCuponCompra()
+
+    End Sub
+    Private Sub ControlAnioBaseCompra()
+        Dim valor As Integer
+        If Me.TipoTransaccion = "N" Or Me.TipoTransaccion = "A" Then
+            valor = cboAnioBaseC.SelectedItem
+            Me.oCEPrincipal.DiasBaseCompra = valor
+
+        End If
+
+    End Sub
+
+    Private Sub txtValorNominalCompra_LostFocus(sender As Object, e As EventArgs) Handles txtValorNominalCompra.LostFocus
+        ' ControlValorNominalCompra()
+    End Sub
+
+
+    Private Sub ControlPrecioAlVencimientoCompra()
+
+
+    End Sub
+    Private Sub ControlPrecioCompra()
+
+    End Sub
+    Private Sub ControlCostosDeTransferencia()
+
+    End Sub
+    Private Sub txtPorcentajeCuponCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeCuponCompra.LostFocus
+        ControlPorcentajeCuponCompra()
+    End Sub
+    Private Sub txtPrecioAlVencimientoCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoCompra.LostFocus
+        ControlPrecioAlVencimientoCompra()
+    End Sub
+
+    Private Sub txtPrecioCompra_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioCompra.LostFocus
+        ControlPrecioCompra()
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_LostFocus(sender As Object, e As EventArgs) Handles txtCostoTransferenciaCompra.LostFocus
+        ControlCostosDeTransferencia()
+    End Sub
+
+    Private Sub dtpSiguienteFechaCuponVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpSiguienteFechaCuponVenta.ValueChanged
+        'ActivarEdicion()
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+
+    Private Sub txtCostoTransferenciaVenta_TextChanged(sender As Object, e As EventArgs)
+        'ActivarEdicion()
+    End Sub
+
+    'Private Sub PrepararTablaImpuestosYComisiones()
+    '    Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+    '    Dim oDataGridViewComboBoxColumn As DataGridViewComboBoxColumn
+
+    '    oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+    '    oDataGridViewComboBoxColumn.Name = "CodImp"
+    '    oDataGridViewComboBoxColumn.HeaderText = "Tipo Impuesto"
+    '    oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTiposImpuesto
+    '    oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+    '    oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+    '    oDataGridViewComboBoxColumn.DataPropertyName = "CodImp"
+    '    oDataGridViewComboBoxColumn.DisplayIndex = 0
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+    '    oDataGridViewComboBoxColumn = New DataGridViewComboBoxColumn
+    '    oDataGridViewComboBoxColumn.Name = "TipoOper"
+    '    oDataGridViewComboBoxColumn.HeaderText = "Tipo Operación"
+    '    oDataGridViewComboBoxColumn.DataSource = oDAOGeneral.ListaTipoOperacion
+    '    oDataGridViewComboBoxColumn.ValueMember = "Codigo"
+    '    oDataGridViewComboBoxColumn.DisplayMember = "Descripcion"
+    '    oDataGridViewComboBoxColumn.DataPropertyName = "TipoOper"
+    '    oDataGridViewComboBoxColumn.DisplayIndex = 1
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewComboBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "PorcImp"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Porcentaje"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "PorcImp"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTPorcentaje
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 2
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "MontoSujeto"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Monto Sujeto"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "MontoSujeto"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+    '    oDataGridViewTextBoxColumn.ReadOnly = True
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 3
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "MontoImp"
+    '    oDataGridViewTextBoxColumn.HeaderText = "Monto Impuesto"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "MontoImp"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+    '    oDataGridViewTextBoxColumn.DisplayIndex = 4
+    '    oDataGridViewTextBoxColumn.ReadOnly = True
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+    '    oDataGridViewTextBoxColumn.Name = "CodInv"
+    '    oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+    '    oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+    '    oDataGridViewTextBoxColumn.Visible = False
+    '    Me.dgvImpuestosYComisiones.Columns.Add(oDataGridViewTextBoxColumn)
+
+    '    Me.dgvImpuestosYComisiones.DataSource = oCEPrincipal.ImpuestosYComisiones
+    'End Sub
+    'Private Sub PrepararImpuestosYComisiones(ByVal IdFila As Integer)
+    '    Dim vFila As DataGridViewRow = dgvImpuestosYComisiones.Rows(IdFila)
+    '    If vFila.IsNewRow Then
+    '        vFila.Cells("TipoOper").Value = "V"
+    '        vFila.Cells("PorcImp").Value = 0
+    '        vFila.Cells("MontoSujeto").Value = oCEPrincipal.ValorTransadoVenta
+    '        vFila.Cells("MontoImp").Value = 0.00
+    '    End If
+    'End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs)
+        'ActivarEdicion()
+        'PrepararImpuestosYComisiones(e.RowIndex)
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellContentClick
+        Formato()
+    End Sub
+
+    Private Sub dgvImpuestosYComisiones_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs)
+        'ActivarEdicion()
+        oCEPrincipal.ImpuestosYComisiones.AcceptChanges()
+    End Sub
+
+    Private Sub PrepararTablaIngresos()
+
+        Dim CantidadColumnas As Integer = dgvIngresos.ColumnCount
+        If CantidadColumnas = 0 Then
+
+
+
+
+            Dim oDataGridViewTextBoxColumn As DataGridViewTextBoxColumn
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "CodInv"
+            oDataGridViewTextBoxColumn.DataPropertyName = "CodInv"
+            oDataGridViewTextBoxColumn.HeaderText = "Código Inversión"
+            oDataGridViewTextBoxColumn.ValueType = GetType(String)
+            oDataGridViewTextBoxColumn.Visible = False
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "NumCupon"
+            oDataGridViewTextBoxColumn.DataPropertyName = "NumCupon"
+            oDataGridViewTextBoxColumn.HeaderText = "No. Cupón"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Integer)
+            oDataGridViewTextBoxColumn.Visible = False
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "Correlativo"
+            oDataGridViewTextBoxColumn.DataPropertyName = "Correlativo"
+            oDataGridViewTextBoxColumn.HeaderText = "No. Cupón"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Integer)
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+
+
+
+
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "FechaCupon"
+            oDataGridViewTextBoxColumn.DataPropertyName = "FechaCupon"
+            oDataGridViewTextBoxColumn.HeaderText = "Fecha Cupón"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Date)
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "Dias"
+            oDataGridViewTextBoxColumn.DataPropertyName = "Dias"
+            oDataGridViewTextBoxColumn.HeaderText = "Dias "
+            oDataGridViewTextBoxColumn.ValueType = GetType(Integer)
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "Ingreso"
+            oDataGridViewTextBoxColumn.DataPropertyName = "Ingreso"
+            oDataGridViewTextBoxColumn.HeaderText = "Ingreso"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+            oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "PorcentajeImpuesto"
+            oDataGridViewTextBoxColumn.DataPropertyName = "PorcImpuesto"
+            oDataGridViewTextBoxColumn.HeaderText = "% Impuesto"
+            oDataGridViewTextBoxColumn.ValueType = GetType(String)
+            oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "MontoImpuesto"
+            oDataGridViewTextBoxColumn.DataPropertyName = "MontoImpuesto"
+            oDataGridViewTextBoxColumn.HeaderText = "Impuesto"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+            oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+
+            oDataGridViewTextBoxColumn = New DataGridViewTextBoxColumn
+            oDataGridViewTextBoxColumn.Name = "Liquido"
+            oDataGridViewTextBoxColumn.DataPropertyName = "Liquido"
+            oDataGridViewTextBoxColumn.HeaderText = "Liquido"
+            oDataGridViewTextBoxColumn.ValueType = GetType(Double)
+            oDataGridViewTextBoxColumn.DefaultCellStyle.Format = Configuraciones.CodigoTXTMontos
+            Me.dgvIngresos.Columns.Add(oDataGridViewTextBoxColumn)
+        End If
+    End Sub
+
+    Private Sub txtValorNominalVenta_LostFocus(sender As Object, e As EventArgs) Handles txtValorNominalVenta.LostFocus
+        ControlValorNominalVenta()
+    End Sub
+    Private Sub ControlValorNominalVenta()
+
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeCuponVenta.LostFocus
+        ControlPorcentajeCuponVenta()
+    End Sub
+    Private Sub ControlPorcentajeCuponVenta()
+
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoVenta.LostFocus
+        ControlPrecioAlVencimientoVenta()
+    End Sub
+    Private Sub ControlPrecioAlVencimientoVenta()
+
+    End Sub
+
+    Private Sub txtPrecioVenta_LostFocus(sender As Object, e As EventArgs) Handles txtPrecioVenta.LostFocus
+        ControlPrecioVenta()
+    End Sub
+    Private Sub ControlPrecioVenta()
+
+    End Sub
+
+    Private Sub dgvIngresos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
+
+
+
+    End Sub
+
+
+
+
+
+    Private Sub dgvIngresos_CellBeginEdit(sender As Object, e As DataGridViewCellCancelEventArgs) Handles dgvIngresos.CellBeginEdit
+        'ActivarEdicion()
+
+    End Sub
+
+    Private Sub dgvIngresos_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellEndEdit
+        Dim Tabla As String = Instrumento()
+
+        If Not Tabla = "TIT" Then
+
+            CalculoIngresosBONO()
+        End If
+
+        'Calculos()
+    End Sub
+
+    Private Sub dgvIngresos_UserDeletedRow(sender As Object, e As DataGridViewRowEventArgs) Handles dgvIngresos.UserDeletedRow
+        'ActivarEdicion()
+        oCEPrincipal.Ingresos.AcceptChanges()
+    End Sub
+
+    Private Sub txtValorNominal_Op_TextChanged(sender As Object, e As EventArgs) Handles txtValorNominal_Op.TextChanged
+
+    End Sub
+
+    Private Sub LLenarResultadosOperacion()
+
+        Dim FechaCompra = dtpFechaLiquidacionCompra.Value
+        Dim FechaVenta = dtpFechaLiquidacionVenta.Value
+        Dim Dias As Integer = Operaciones.Dias(FechaCompra, FechaVenta, IndexBaseC)
+
+
+
+
+        txtValorNominal_Op.Text = Operaciones.ConvertirDecimal(txtValorNominalCompra.Text.ToString)
+        txtPlazo_Op.Text = Operaciones.ConvertirDecimal(PlazoOperacion().ToString)
+        txtPrecioCompra_Op.Text = Operaciones.ConvertirDecimal(txtPrecioCompra.Text.ToString)
+        txtPrecioVenta_Op.Text = Operaciones.ConvertirDecimal(txtPrecioVenta.Text.ToString)
+        txtGananciaPerdidaCapital_Op.Text = Operaciones.ConvertirDecimal(GananciaPerdida().ToString)
+        txtIngresosPorIntereses_Op.Text = Operaciones.ConvertirDecimal(IngresosInteres().ToString)
+        txtCostosTotales_Op.Text = Operaciones.ConvertirDecimal(CostosTotales().ToString)
+        txtGananciaPerdidaTotal_Op.Text = Operaciones.ConvertirDecimal(MontoGananciaPerdida().ToString)
+        txtRendimientoGananciaPerdida_Op.Text = Operaciones.ConvertirDecimal(RendimientoGananciaPerdida(Dias, FechaCompra, FechaVenta, IndexBaseC).ToString)
+        txtRendimientoIntereses_Op.Text = Operaciones.ConvertirDecimal(RendimientoInteres(Dias, FechaCompra, FechaVenta, IndexBaseC).ToString)
+        txtRendimientoAntesISR_Op.Text = Operaciones.ConvertirDecimal(RendimientoNeto(Dias, FechaCompra, FechaVenta, IndexBaseC).ToString)
+        txtRendimientoDespuesISR_Op.Text = Operaciones.ConvertirDecimal(RendimientoNetoDespues(Dias, FechaCompra, FechaVenta, IndexBaseC).ToString)
+    End Sub
+
+    Private Function PlazoOperacion()
+        Dim FechaVenta As Date = dtpFechaLiquidacionVenta.Value
+        Dim FechaCompra As Date = dtpFechaLiquidacionCompra.Value
+        Dim Dias = Operaciones.Dias(FechaCompra, FechaVenta, IndexBaseC)
+        Return Dias
+    End Function
+
+    Private Function GananciaPerdida()
+        Dim ValorTrasadoVenta = txtValorTransadoVenta.Text
+        Dim ValorTrasadoCompra = txtValorTransadoCompra.Text
+
+        Dim Total = ValorTrasadoVenta - ValorTrasadoCompra
+        Return Total
+    End Function
+
+    Private Function IngresosInteres()
+        Dim Registros = dgvIngresos.Rows.Count
+        Dim Suma As Double = 0.0
+        Registros = Registros - 2
+        For i As Integer = 0 To Registros
+
+            Suma = Suma + Double.Parse(dgvIngresos.Item(4, i).Value)
+        Next
+        Dim InteresAcumulado = txtInteresAcumuladoVenta.Text
+        Return (Suma + InteresAcumulado)
+    End Function
+
+    Private Function CostosTotales()
+        Dim ComisionCompraCasa = txtComisionCompraCasa.Text
+        Dim ComisionVentaCasa = txtComisionVentaCasa.Text
+
+        Dim ComisionCompraBolsa = txtComisionCompraBolsa.Text
+        Dim ComisionVentaBolsa = txtComisionVentaBolsa.Text
+        Dim CostoTransferenciaCompra = txtCostoTransferenciaCompra.Text
+        If (Double.TryParse(ComisionCompraCasa, Nothing) And Double.TryParse(ComisionCompraBolsa, Nothing) And Double.TryParse(CostoTransferenciaCompra, Nothing) And Double.TryParse(ComisionCompraBolsa, Nothing) And Double.TryParse(ComisionVentaBolsa, Nothing)) Then
+            Dim Total = (CDec(ComisionCompraCasa) + CDec(ComisionCompraBolsa) + CDec(CostoTransferenciaCompra) + CDec(ComisionVentaCasa) + CDec(ComisionVentaBolsa)) * -1
+
+            Return Total
+        End If
+        Return "0"
+    End Function
+
+    Private Function MontoGananciaPerdida()
+        Dim GananciaPerdida = txtGananciaPerdidaCapital_Op.Text
+        Dim CostosTotales = txtCostosTotales_Op.Text
+        Dim IngresoInteres = txtIngresosPorIntereses_Op.Text
+
+        Dim Total = CDec(GananciaPerdida) + CDec(CostosTotales) + txtIngresosPorIntereses_Op.Text
+
+        Return Total
+    End Function
+
+    Private Function RendimientoGananciaPerdida(ByVal Dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim GananciaCapital = txtGananciaPerdidaCapital_Op.Text
+        Dim ValorNominal = txtValorNominal_Op.Text
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0) Then
+            Valor = GananciaCapital / ValorNominal * 360 / Dias
+            Return (Valor * 100).ToString() + "%"
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = GananciaCapital / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = GananciaCapital / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = GananciaCapital / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = GananciaCapital / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = GananciaCapital / ValorNominal * 360 / DiasPrimeraFecha
+                PrOpc2 = GananciaCapital / ValorNominal * 360 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 360 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = GananciaCapital / ValorNominal * 360 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+        End If
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        Return (Valor * 100).ToString() + "%"
+
+    End Function
+
+    Private Function RendimientoInteres(ByVal Dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim IngresosInteres = txtIngresosPorIntereses_Op.Text
+        Dim ValorNominal = txtValorNominal_Op.Text
+
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0) Then
+            Valor = IngresosInteres / ValorNominal * 360 / Dias
+            Return (Valor * 100).ToString() + "%"
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = IngresosInteres / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = IngresosInteres / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = IngresosInteres / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = IngresosInteres / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = IngresosInteres / ValorNominal * 360 / DiasPrimeraFecha
+                PrOpc2 = IngresosInteres / ValorNominal * 360 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 360 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = IngresosInteres / ValorNominal * 360 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+        End If
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+
+    Private Function RendimientoNeto(ByVal Dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim MontoGananciaPerdidaTotal = txtGananciaPerdidaTotal_Op.Text
+        Dim ValorNominal = txtValorNominal_Op.Text
+
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0) Then
+            Valor = MontoGananciaPerdidaTotal / ValorNominal * 360 / Dias
+            Return (Valor * 100).ToString() + "%"
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = MontoGananciaPerdidaTotal / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = MontoGananciaPerdidaTotal / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = MontoGananciaPerdidaTotal / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = MontoGananciaPerdidaTotal / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = MontoGananciaPerdidaTotal / ValorNominal * 360 / DiasPrimeraFecha
+                PrOpc2 = MontoGananciaPerdidaTotal / ValorNominal * 360 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 360 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = MontoGananciaPerdidaTotal / ValorNominal * 360 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+        End If
+
+
+
+
+
+
+
+    End Function
+
+    Private Function Recibido()
+        Dim Registros = dgvIngresos.Rows.Count
+        Dim Suma As Double = 0.0
+        Registros = Registros - 1
+        For i As Integer = 0 To Registros
+
+            If (Not String.IsNullOrEmpty(dgvIngresos.Rows(i).Cells("Ingreso").Value)) Then
+                Suma = Suma + Double.Parse(dgvIngresos.Rows(i).Cells("Ingreso").Value)
+            End If
+
+
+        Next
+        Return Suma
+    End Function
+
+
+
+    Private Function RendimientoNetoDespues(ByVal Dias As Integer, ByVal Fecha1 As Date, ByVal Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim Registros = dgvIngresos.Rows.Count
+        Dim Suma As Double = 0.0
+        Registros = Registros - 1
+        For i As Integer = 0 To Registros
+
+            If (Not String.IsNullOrEmpty(dgvIngresos.Rows(i).Cells("MontoImpuesto").Value)) Then
+                Suma = Suma + Double.Parse(dgvIngresos.Rows(i).Cells("MontoImpuesto").Value)
+            End If
+
+
+        Next
+        Dim MontoGananciaTotal = txtGananciaPerdidaTotal_Op.Text
+        Dim Impuesto = Suma
+        Dim ValorNominal = txtValorNominal_Op.Text
+
+
+
+
+
+
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0) Then
+            Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 360 / Dias
+            Return (Valor * 100).ToString() + "%"
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = (MontoGananciaTotal - Impuesto) / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = (MontoGananciaTotal - Impuesto) / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 365 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 366 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = (MontoGananciaTotal - Impuesto) / ValorNominal * 366 / DiasPrimeraFecha
+                PrOpc2 = (MontoGananciaTotal - Impuesto) / ValorNominal * 365 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 366 / DiasPrimeraFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 365 / DiasSegundaFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = (MontoGananciaTotal - Impuesto) / ValorNominal * 360 / DiasPrimeraFecha
+                PrOpc2 = (MontoGananciaTotal - Impuesto) / ValorNominal * 360 / DiasSegundaFecha
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 360 / DiasSegundaFecha
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = (MontoGananciaTotal - Impuesto) / ValorNominal * 360 / DiasPrimeraFecha
+            Else
+                Valor = 0
+            End If
+            Return (Valor * 100).ToString() + "%"
+
+        End If
+
+
+
+
+
+
+
+
+
+
+    End Function
+
+
+    Private Sub TabPage4_Click(sender As Object, e As EventArgs) Handles TabPage4.Click
+
+
+    End Sub
+
+
+    Private Sub TabPage1_Click(sender As Object, e As EventArgs) Handles TabPage1.Click
+
+    End Sub
+
+    Private Function CalcularIngreso(ByVal ValorNominal As Double, ByVal Cupon As Double, ByVal Dias As Integer)
+        Dim Base As Integer = 365
+        Dim Calculo = ValorNominal * Cupon * Dias / Base
+        Return Calculo
+    End Function
+
+
+    Private Sub TabPage2_Click(sender As Object, e As EventArgs) Handles TbIngresos.Click
+        If (dgvIngresos.Rows.Count > 1) Then
+
+        End If
+
+    End Sub
+
+
+
+    Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
+        TipoTransaccion = "M"
+        btnAceptar.Text = "Modificar"
+
+        'btnAccionComisiones.Text = "Modificar"
+    End Sub
+
+    Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
+        TipoTransaccion = "N"
+        btnAceptar.Text = "Nuevo"
+
+        'btnAccionComisiones.Text = "Nuevo"
+    End Sub
+
+    Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
+        TipoTransaccion = "B"
+        btnAceptar.Text = "Eliminar"
+
+        'btnAccionComisiones.Text = "Eliminar"
+    End Sub
+
+    Private Sub txtYTMAlVencimientoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtYTMAlVencimientoCompra.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtPorcentajeInteresAcumuladoVenta_TextChanged(sender As Object, e As EventArgs)
+    End Sub
+
+    Private Sub txtYTMAlVencimientoComisionCompra_TextChanged(sender As Object, e As EventArgs) Handles txtYTMAlVencimientoComisionCompra.TextChanged
+
+    End Sub
+
+    Private Sub txtValorNominalVenta_TextChanged(sender As Object, e As EventArgs) Handles txtValorNominalVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeCuponVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtValorNominalCompra_TextChanged(sender As Object, e As EventArgs) Handles txtValorNominalCompra.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtPrecioSucioCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioSucioCompra.TextChanged
+
+    End Sub
+
+    Private Sub Button1_Click(sender As Object, e As EventArgs)
+        RefrescarValorControles()
+    End Sub
+
+    Private Sub txtPrecioVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub btnAccionIngreso_Click(sender As Object, e As EventArgs)
+        'If (TipoTransaccion = "N") Then
+        '    NuevoIngreso(False, 0)
+        'ElseIf (TipoTransaccion = "M") Then
+        '    ModificarIngreso()
+        'ElseIf (TipoTransaccion = "B") Then
+        '    EliminarIngreso()
+        'End If
+    End Sub
+
+    Private Sub TabControl1_TabIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.TabIndexChanged
+
+        Formato()
+        Formato()
+    End Sub
+
+    Private Sub dgvIngresos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellClick
+        Index = e.RowIndex
+        PrepararCalculos()
+        Formato()
+
+    End Sub
+
+    Private Sub txtDiasAcumuladosCompra_TextChanged(sender As Object, e As EventArgs) Handles txtDiasAcumuladosCompra.TextChanged
+
+    End Sub
+
+    Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged
+        ValidacionErrores()
+        BotonQuitar()
+        If (dgvIngresos.Rows.Count < 2) Then
+
+        End If
+        If (TabCampos.SelectedIndex = 2) Or (TabCampos.SelectedIndex = 1) Then
+            LLenarResultadosOperacion()
+        End If
+    End Sub
+
+    Private Sub dtpUltimaFechaCuponVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpUltimaFechaCuponVenta.ValueChanged
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub dtpFechaLiquidacionVenta_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaLiquidacionVenta.ValueChanged
+        Formato()
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtYTMAlVencimientoVenta_TextChanged(sender As Object, e As EventArgs) Handles txtYTMAlVencimientoVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+
+    End Sub
+
+    Private Sub btnAmortizacion_Click(sender As Object, e As EventArgs)
+        frmResultadoTitularizacion.Show()
+    End Sub
+
+
+
+
+    'Function ColecccionComisiones()
+    '    Dim coleccion As New Collection
+    '    Dim TipoImp, TipOp, CodImp, PorcImp, MontoImp As String
+    '    TipoImp = dgvImpuestosYComisiones.CurrentRow.Cells("NumCupon").Value
+    '    TipOp = dgvImpuestosYComisiones.CurrentRow.Cells(1).Value
+    '    CodImp = dgvImpuestosYComisiones.CurrentRow.Cells(2).Value
+    '    PorcImp = CDec(dgvImpuestosYComisiones.CurrentRow.Cells(3).Value.ToString.TrimEnd("%") / 100)
+    '    MontoImp = dgvImpuestosYComisiones.CurrentRow.Cells(4).Value.ToString.TrimEnd("%")
+
+    '    coleccion.Add(TipoImp)
+    '    coleccion.Add(TipOp)
+    '    coleccion.Add(CodImp)
+    '    coleccion.Add(PorcImp)
+    '    coleccion.Add(MontoImp)
+    '    Return coleccion
+    'End Function
+
+
+    Function ColeccionIngresos(ByRef index As Integer)
+        Dim coleccion As New Collection
+
+
+        Dim NoCupon, Fecha, Ingreso, PorcImpuesto, Impuesto, Dias, Liquido As String
+        NoCupon = dgvIngresos.Rows(index).Cells("NumCupon").Value
+        Fecha = dgvIngresos.Rows(index).Cells("FechaCupon").Value
+        Dias = dgvIngresos.Rows(index).Cells("Dias").Value
+        Ingreso = dgvIngresos.Rows(index).Cells("Ingreso").Value
+
+        PorcImpuesto = dgvIngresos.Rows(index).Cells("PorcentajeImpuesto").Value
+        If Not PorcImpuesto Is Nothing Then
+            PorcImpuesto = CDec((PorcImpuesto.ToString().Trim("%")) / 100)
+        End If
+        Impuesto = dgvIngresos.Rows(index).Cells("MontoImpuesto").Value
+        Liquido = dgvIngresos.Rows(index).Cells("Liquido").Value
+        coleccion.Add(NoCupon)
+        coleccion.Add(Fecha)
+        coleccion.Add(Dias)
+        coleccion.Add(Ingreso)
+        coleccion.Add(PorcImpuesto)
+        coleccion.Add(Impuesto)
+        coleccion.Add(Liquido)
+        Return coleccion
+    End Function
+
+
+
+
+    'Sub NuevaComision()
+    '    Dim coleccion = ColecccionComisiones()
+    '    BonosConsulta.NuevoImpuesto(coleccion, Codigo)
+    'End Sub
+
+    Sub NuevoIngreso(ByVal AgregarModificar As Boolean, ByVal Cantidad As Integer)
+        Dim i As Integer = 0
+
+        Dim Index = dgvIngresos.Rows.Count - 2
+
+        i = Cantidad
+        While i <= Index
+
+
+
+
+            Dim coleccion = ColeccionIngresos(i)
+            If (BonosConsulta.NuevoIngreso(coleccion, Codigo, Instrumento) Is Nothing) Then
+
+                Exit Sub
+            End If
+            i += 1
+        End While
+        MsgBox("Registro de ingresos actualizados")
+
+    End Sub
+    'Sub ModificarComision()
+    '    Dim coleccion = ColecccionComisiones()
+    '    BonosConsulta.ModificarImpuesto(coleccion, Codigo)
+    'End Sub
+
+
+    Function Instrumento()
+        Dim codigo As String = Variables.Codigo
+        Dim Tabla As String = String.Empty
+
+
+
+        If codigo.IndexOf("TIT") > -1 Then
+            Tabla = "TIT"
+        ElseIf codigo.IndexOf("EURB") > -1 Then
+            Tabla = "EURB"
+        ElseIf codigo.IndexOf("BONO") > -1 Then
+            Tabla = "BONO"
+
+        ElseIf codigo.IndexOf("CINV") > -1 Then
+            Tabla = "CINV"
+
+        End If
+        Return Tabla
+    End Function
+
+    Function CanRegistros()
+        Dim Tabla As String = String.Empty
+        Dim Ins As String = Instrumento()
+        If (Ins = "TIT") Then
+            Tabla = "TIT0_0"
+        ElseIf (Ins = "EURB") Then
+            Tabla = "EURB1"
+        ElseIf (Ins = "BONO") Then
+            Tabla = "BON1"
+
+        ElseIf (Ins = "CINV") Then
+            Tabla = "CIN1"
+
+        End If
+        Dim Codigo = Variables.Codigo
+        Dim Cantidad As Integer = oDAOGeneral.CantidadRegistros(Codigo, Tabla)
+
+        Return Cantidad
+    End Function
+
+    Function ModificarIngreso()
+        Dim i As Integer = 0
+        Dim Cantidad As Integer = dgvIngresos.Rows.Count - 2
+        Dim Diccionario As New Dictionary(Of Integer, Collection)
+        While i <= Cantidad
+
+
+            Dim coleccion = ColeccionIngresos(i)
+            Diccionario.Add(i, coleccion)
+            i += 1
+        End While
+
+
+
+        Return Diccionario
+    End Function
+
+    Sub EliminarComision()
+        BonosConsulta.EliminarImpuesto(Codigo)
+    End Sub
+
+    Sub EliminarIngreso()
+
+
+        BonosConsulta.EliminarIngresoCompleto(Codigo, Instrumento)
+    End Sub
+
+    'Private Sub btnAccionComisiones_Click(sender As Object, e As EventArgs)
+    '    'If (TipoTransaccion = "N") Then
+    '    '    NuevaComision()
+    '    'ElseIf (TipoTransaccion = "M") Then
+    '    '    ModificarComision()
+    '    ElseIf (TipoTransaccion = "B") Then
+    '        EliminarComision()
+    '    End If
+    'End Sub
+
+
+
+    'Sub CargarComisiones()
+
+    '    Dim codigo As String = Variables.Codigo
+    '    Dim dr = BonosConsulta.CargarImpuestos(codigo)
+    '    While dr.Read
+    '        dgvImpuestosYComisiones.Rows.Add(dr("TipoImp"), dr("TipoOp"), dr("CodImp"), dr("PorcImp"), dr("MontoImp"))
+    '    End While
+
+
+    'End Sub
+
+    Sub CargarIngresos()
+
+        Dim codigo As String = Variables.Codigo
+
+        Dim dr = BonosConsulta.CargarIngreso(codigo, Instrumento)
+
+        While dr.Read
+            Dim Porc = dr("PorcImpuesto")
+            If String.IsNullOrEmpty(Porc.ToString) Then
+                Porc = "0.0%"
+            Else
+                Porc = (Porc * 100).ToString + "%"
+            End If
+            dgvIngresos.Rows.Add("", dr("NumCupon"), "", dr("FechaCupon"), dr("Dias"), dr("Ingreso"), Porc, dr("MontoImpuesto"), dr("Liquido"))
+        End While
+
+
+    End Sub
+
+    Private Sub txtComisionPorCompraCasa_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorCompraCasa.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtComisionPorBolsaCompra_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorBolsaCompra.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+
+    End Sub
+
+    Private Sub txtComisionPorVentaCasa_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorVentaCasa.TextChanged
+
+
+        Calculos()
+
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtComisionPorBolsaVenta_TextChanged(sender As Object, e As EventArgs) Handles txtComisionPorBolsaVenta.TextChanged
+
+        Calculos()
+        ValidacionErrores()
+    End Sub
+
+    Private Sub txtMontoARecibir_TextChanged(sender As Object, e As EventArgs) Handles txtMontoARecibir.TextChanged
+
+        Calculos()
+    End Sub
+
+    Private Sub txtCostosTotales_Op_TextChanged(sender As Object, e As EventArgs) Handles txtCostosTotales_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtRendimientoDespuesISR_Op_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoDespuesISR_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtPrecioSucioVenta_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioSucioVenta.TextChanged
+
+    End Sub
+
+    Private Sub txtGananciaPerdidaCapital_Op_TextChanged(sender As Object, e As EventArgs) Handles txtGananciaPerdidaCapital_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtValorNominalCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtValorNominalCompra.KeyPress
+        If String.IsNullOrEmpty(txtValorNominalCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtValorNominalCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtValorNominalCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtValorNominalVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtValorNominalVenta.KeyPress
+        If String.IsNullOrEmpty(txtValorNominalVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtValorNominalVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtValorNominalVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPorcentajeCuponCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeCuponCompra.KeyPress
+        If String.IsNullOrEmpty(txtPorcentajeCuponCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtPorcentajeCuponCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPorcentajeCuponCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeCuponVenta.KeyPress
+        If String.IsNullOrEmpty(txtPorcentajeCuponVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtPorcentajeCuponVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPorcentajeCuponVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtYTMAlVencimientoCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtYTMAlVencimientoCompra.KeyPress
+        If String.IsNullOrEmpty(txtYTMAlVencimientoCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtYTMAlVencimientoCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtYTMAlVencimientoCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtYTMAlVencimientoVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtYTMAlVencimientoVenta.KeyPress
+        If String.IsNullOrEmpty(txtYTMAlVencimientoVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtYTMAlVencimientoVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtYTMAlVencimientoVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioAlVencimientoCompra.KeyPress
+        If String.IsNullOrEmpty(txtPrecioAlVencimientoCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioAlVencimientoCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioAlVencimientoCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioAlVencimientoVenta.KeyPress
+        If String.IsNullOrEmpty(txtPrecioAlVencimientoVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioAlVencimientoVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioAlVencimientoVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioCompra.KeyPress
+        If String.IsNullOrEmpty(txtPrecioCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrecioVenta.KeyPress
+        If String.IsNullOrEmpty(txtPrecioVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtPrecioVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtPrecioVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorCompraCasa_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorCompraCasa.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorCompraCasa.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorCompraCasa.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorCompraCasa.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorVentaCasa_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorVentaCasa.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorVentaCasa.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorVentaCasa.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorVentaCasa.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorBolsaCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorBolsaCompra.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorBolsaCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorBolsaCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorBolsaCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtComisionPorBolsaVenta_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtComisionPorBolsaVenta.KeyPress
+        If String.IsNullOrEmpty(txtComisionPorBolsaVenta.Text) Then
+            If e.KeyChar = "." Then
+                txtComisionPorBolsaVenta.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtComisionPorBolsaVenta.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCostoTransferenciaCompra.KeyPress
+        If String.IsNullOrEmpty(txtCostoTransferenciaCompra.Text) Then
+            If e.KeyChar = "." Then
+                txtCostoTransferenciaCompra.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtCostoTransferenciaCompra.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtMontoARecibir_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMontoARecibir.KeyPress
+        If String.IsNullOrEmpty(txtMontoARecibir.Text) Then
+            If e.KeyChar = "." Then
+                txtMontoARecibir.Text = "0"
+                Exit Sub
+            End If
+        End If
+
+        If (Not txtMontoARecibir.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
+            Operaciones.ValidarEntrada(sender, e, True)
+
+        Else
+
+            Operaciones.ValidarEntrada(sender, e, False)
+
+        End If
+    End Sub
+
+    Private Sub txtPrecioCompra_Op_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioCompra_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtPrecioVenta_Op_TextChanged(sender As Object, e As EventArgs) Handles txtPrecioVenta_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtInteresAcumuladoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtInteresAcumuladoCompra.TextChanged
+
+    End Sub
+
+    Sub AsignacionPeriodicidad()
+        Dim Periodicidad As String = cboPeriodosC.SelectedValue
+
+        If (Periodicidad = "M") Then
+            TipoPeriodicidad = 1
+        ElseIf (Periodicidad = "T") Then
+            TipoPeriodicidad = 3
+        ElseIf (Periodicidad = "S") Then
+            TipoPeriodicidad = 6
+        ElseIf (Periodicidad = "A") Then
+            TipoPeriodicidad = 12
+        End If
+    End Sub
+
+    Sub PrepararCalculos()
+
+        AsignacionPeriodicidad()
+        Dim Index = dgvIngresos.CurrentRow.Index
+        Dim IndexAnterior = Index - 1
+        Dim Respaldo As String = Format(dtpSiguienteFechaCuponCompra.Value, "dd/MM/yyyy")
+        Dim FechaSig = CDate(Respaldo)
+        Dim Fechaliq = dtpFechaLiquidacionCompra.Value
+        Dim FechaCupon, Dias, Ingreso, PorcentajeImpuesto, MontoImpuesto, Liquido
+
+        FechaCupon = dgvIngresos.Rows(Index).Cells("FechaCupon").Value
+        Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
+        Ingreso = dgvIngresos.Rows(Index).Cells("Ingreso").Value
+        PorcentajeImpuesto = dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value
+        If (Not PorcentajeImpuesto Is Nothing) Then
+            PorcentajeImpuesto = CDec(PorcentajeImpuesto.ToString.Trim("%")) / 100
+        Else
+            PorcentajeImpuesto = "0.0%"
+        End If
+        MontoImpuesto = dgvIngresos.Rows(Index).Cells("MontoImpuesto").Value
+        Liquido = dgvIngresos.Rows(Index).Cells("Liquido").Value
+        If (String.IsNullOrEmpty(FechaCupon)) Then
+            If (Index = 0) Then
+                FechaCupon = FechaSig
+            Else
+                Dim FechaAnterior As Date = dgvIngresos.Rows(IndexAnterior).Cells("FechaCupon").Value
+                FechaCupon = Operaciones.Meses(TipoPeriodicidad, FechaAnterior, FechaSig)
+            End If
+            dgvIngresos.Rows(Index).Cells("FechaCupon").Value = FechaCupon
+        End If
+
+        If (String.IsNullOrEmpty(Dias)) Then
+            Dim Dia As Integer = 0
+            If (Index = 0) Then
+
+                Dia = Operaciones.DiasAcumulados(Fechaliq, FechaSig, IndexBaseC)
+            Else
+                Dim DiaAnterior As Date = dgvIngresos.Rows(IndexAnterior).Cells("FechaCupon").Value
+                Dim DiaActual = dgvIngresos.Rows(Index).Cells("FechaCupon").Value
+                Dia = Operaciones.DiasAcumulados(DiaAnterior, DiaActual, IndexBaseC)
+            End If
+            dgvIngresos.Rows(Index).Cells("Dias").Value = Dia
+        End If
+        If (String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("NumCupon").Value)) Then
+            dgvIngresos.Rows(Index).Cells("NumCupon").Value = Correlativo()
+        End If
+
+
+        If (String.IsNullOrEmpty(Ingreso)) Then
+            dgvIngresos.Rows(Index).Cells("Ingreso").Value = 0
+        End If
+
+
+        If (Index = 0) Then
+            If (String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value)) Then
+
+
+                dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value = "0.0%"
+            End If
+        Else
+            dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value = dgvIngresos.Rows(IndexAnterior).Cells("PorcentajeImpuesto").Value
+        End If
+        If dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value.ToString.IndexOf("%") = -1 Then
+            dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value = dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value.ToString + "%"
+        End If
+        If (String.IsNullOrEmpty(MontoImpuesto)) Then
+            dgvIngresos.Rows(Index).Cells("MontoImpuesto").Value = 0
+        End If
+
+        If (String.IsNullOrEmpty(Liquido)) Then
+            dgvIngresos.Rows(Index).Cells("Liquido").Value = 0
+        End If
+        CorrelativoSinBD()
+    End Sub
+
+    Function Correlativo()
+        Dim Index As Integer = 0
+        Dim IndexCantidad As Integer = dgvIngresos.Rows.Count - 2
+        Dim NumeroMayor As Integer = 0
+        While Index <= IndexCantidad
+            Dim Numero As Integer = dgvIngresos.Rows(Index).Cells("NumCupon").Value
+            If Numero > NumeroMayor Then
+                NumeroMayor = Numero
+            End If
+            Index += 1
+        End While
+        Return NumeroMayor + 1
+    End Function
+
+    Sub CorrelativoSinBD()
+        Dim Index As Integer = 0
+        Dim IndexCantidad As Integer = dgvIngresos.Rows.Count - 2
+        Dim NumeroMayor As Integer = 0
+        While Index <= IndexCantidad
+
+            dgvIngresos.Rows(Index).Cells("Correlativo").Value = Index + 1
+            Index += 1
+
+        End While
+
+    End Sub
+
+    Function PeriodoGracia()
+        Dim FechaEmision As Date = Variables.FechaEmisionTIT
+        Dim FechaPeriodoGracia As Date = FechaEmision
+        Dim CantidadPeriodoGracia As Integer = 0
+        Dim TipoPeriodoGracia As String = Variables.TipoPeriodoGracia
+        Dim CantidadPeriodo As String = Variables.CantidadPeriodo
+
+        If String.IsNullOrEmpty(CantidadPeriodo) Or CantidadPeriodo = "0" Then
+
+            Return False
+
+        Else
+            CantidadPeriodoGracia = CantidadPeriodo
+        End If
+
+        If TipoPeriodoGracia = "D" Or TipoPeriodoGracia = "M" Or TipoPeriodoGracia = "A" Then
+            If TipoPeriodoGracia = "D" Then
+                FechaPeriodoGracia = FechaEmision.AddDays(CantidadPeriodoGracia)
+            ElseIf TipoPeriodoGracia = "M" Then
+                FechaPeriodoGracia = FechaEmision.AddMonths(CantidadPeriodoGracia)
+            Else
+                FechaPeriodoGracia = FechaEmision.AddYears(CantidadPeriodoGracia)
+            End If
+            Return FechaPeriodoGracia
+        Else
+            Return False
+        End If
+
+
+
+    End Function
+
+
+
+
+
+
+
+
+
+    Function IngresosIntereses(ByVal ValorNominal As Double, ByVal PorcCupon As Double, ByVal Dias As Integer, ByVal Fecha1 As Date, Fecha2 As Date, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+
+        If (IndexBase = 0) Then
+            Valor = ValorNominal * PorcCupon * Dias / 360
+            Return Valor
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha360Bi(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha360(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+            Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+            DiasPrimeraFecha = Operaciones.DiasDespuesCambioPrimeraFecha366Varios(Fecha1, Fecha2)
+            DiasSegundaFecha = Operaciones.DiasDespuesCambioPrimeraFecha365Varios(Fecha1, Fecha2)
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorNominal * PorcCupon * DiasPrimeraFecha / 360
+                PrOpc2 = ValorNominal * PorcCupon * DiasSegundaFecha / 360
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasSegundaFecha / 360
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorNominal * PorcCupon * DiasPrimeraFecha / 360
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+        End If
+        Return Valor
+    End Function
+
+
+    Function IngresosInteresesTIT(ByVal ValorSaldo As Double, ByVal PorcCupon As Double, ByVal Dias As Integer, ByVal PrimerosDias As Integer, ByVal RestantesDias As Integer, ByVal IndexBase As Integer)
+        Dim Valor As Double = 0
+        Dim DiasPrimeraFecha = 0, DiasSegundaFecha = 0
+        DiasPrimeraFecha = PrimerosDias
+        DiasSegundaFecha = RestantesDias
+
+        If (IndexBase = 0) Then
+            Valor = ValorSaldo * PorcCupon * Dias / 360
+            Return Valor
+        ElseIf (IndexBase = 1) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+
+
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorSaldo * PorcCupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorSaldo * PorcCupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+        ElseIf (IndexBase = 2) Then
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorSaldo * PorcCupon * DiasPrimeraFecha / 366
+                PrOpc2 = ValorSaldo * PorcCupon * DiasSegundaFecha / 365
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasSegundaFecha / 365
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasPrimeraFecha / 366
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+
+
+
+
+
+        Else
+            Dim PrOpc1 = 0.0, PrOpc2 = 0.0
+
+            If (DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                PrOpc1 = ValorSaldo * PorcCupon * DiasPrimeraFecha / 360
+                PrOpc2 = ValorSaldo * PorcCupon * DiasSegundaFecha / 360
+                Valor = PrOpc1 + PrOpc2
+            ElseIf (Not DiasPrimeraFecha > 0 And DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasSegundaFecha / 360
+            ElseIf (DiasPrimeraFecha > 0 And Not DiasSegundaFecha > 0) Then
+                Valor = ValorSaldo * PorcCupon * DiasPrimeraFecha / 360
+            Else
+                Valor = 0
+            End If
+            Return Valor
+
+        End If
+        Return Valor
+    End Function
+
+    Function Impuestos(ByVal Ingresos As Double, PorcentajeRenta As Double)
+        Dim Total As Double
+        Total = Ingresos * PorcentajeRenta
+        Return Total
+    End Function
+
+
+    Function Liquido(ByVal Ingreso As Double, ByVal Renta As Double)
+        Dim Total As Double
+        Total = Ingreso - Renta
+        Return Total
+    End Function
+
+    Sub CalculoIngresosBONO()
+        Dim Ingreso As Double = 0
+        Dim ValorNominal = 0.0, PorcCupon = 0.0, Ingresos = 0.0, PorcentajeRenta = 0.0
+        Dim IngresosInt = 0.0, Impuestos = 0.0, Liquido = 0.0
+        ValorNominal = CDec(txtValorNominalCompra.Text)
+        PorcCupon = CDec(txtPorcentajeCuponCompra.Text.ToString.Trim("%")) / 100
+        Dim Index As Integer = dgvIngresos.CurrentRow.Index
+        Dim Fecha1 As Date = Date.Now.Date
+        Dim Fecha2 As Date = Date.Now.Date
+        Dim Dias As Integer = dgvIngresos.Rows(Index).Cells("Dias").Value
+        If (Index = 0) Then
+            Dim RespaldoFecha As String = Format(dtpFechaLiquidacionCompra.Value, "yyyy/MM/dd")
+            Fecha1 = RespaldoFecha
+            Fecha2 = dgvIngresos.Rows(Index).Cells("FechaCupon").Value
+        Else
+            Fecha1 = dgvIngresos.Rows(Index - 1).Cells("FechaCupon").Value
+            Fecha2 = dgvIngresos.Rows(Index).Cells("FechaCupon").Value
+        End If
+
+
+
+
+
+        If (Not dgvIngresos.CurrentRow.Cells("PorcentajeImpuesto").Value Is Nothing) Then
+            PorcentajeRenta = CDec(dgvIngresos.Rows(Index).Cells("PorcentajeImpuesto").Value.ToString.Trim("%")) / 100
+
+        Else
+            PorcentajeRenta = 0
+        End If
+
+
+
+        IngresosInt = IngresosIntereses(ValorNominal, PorcCupon, Dias, Fecha1, Fecha2, IndexBaseC)
+        Ingresos = Me.Impuestos(IngresosInt, PorcentajeRenta)
+        Liquido = Me.Liquido(IngresosInt, Ingresos)
+
+
+        dgvIngresos.CurrentRow.Cells("Ingreso").Value = IngresosInt
+        dgvIngresos.CurrentRow.Cells("MontoImpuesto").Value = Ingresos
+        dgvIngresos.CurrentRow.Cells("Liquido").Value = Liquido
+
+    End Sub
+
+
+
+
+
+
+
+
+
+
+
+    Sub PrepararIngresosTIT(ByVal Index As Integer, ByRef Amortizacion As DataGridView)
+
+        AsignacionPeriodicidad()
+
+        Dim IndexAnterior = Index - 1
+        Dim Respaldo As String = Format(dtpSiguienteFechaCuponCompra.Value, "dd/MM/yyyy")
+
+
+        Dim Dias, Ingreso, PorcentajeImpuesto, MontoImpuesto, Liquido, PorcentajeImpuestoAnterior
+
+
+        Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
+        Ingreso = dgvIngresos.Rows(Index).Cells("Ingreso").Value
+        PorcentajeImpuesto = 10
+        If (Not PorcentajeImpuesto Is Nothing) Then
+            PorcentajeImpuesto = CDec(PorcentajeImpuesto.ToString.Trim("%")) / 100
+        Else
+            PorcentajeImpuesto = "0.0%"
+        End If
+        MontoImpuesto = 0
+        Liquido = 0
+
+
+
+        'If (String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("NumCupon").Value)) Then
+        '    dgvIngresos.Rows(Index).Cells("NumCupon").Value = Correlativo()
+        'End If
+
+
+
+
+
+        If (Index = 0) Then
+
+
+
+            PorcentajeImpuestoAnterior = "10.0%"
+        Else
+
+            PorcentajeImpuestoAnterior = dgvIngresos.Rows(IndexAnterior).Cells("PorcentajeImpuesto").Value
+        End If
+
+
+        Dim Dia As Integer = 0
+        If Not String.IsNullOrEmpty(Amortizacion.Rows(Index).Cells("Dias").Value) Then
+            Dia = Amortizacion.Rows(Index).Cells("Dias").Value
+        End If
+
+        Dim Fecha As Date = Date.Now.Date
+        If Not String.IsNullOrEmpty(Amortizacion.Rows(Index).Cells("Fecha").Value) Then
+            Fecha = Amortizacion.Rows(Index).Cells("Fecha").Value
+        End If
+
+
+
+        dgvIngresos.Rows.Add(0, 0, 0, Fecha, Dia, 0, PorcentajeImpuestoAnterior, 0, 0)
+
+
+
+
+
+
+
+
+
+
+    End Sub
+
+
+
+    Sub CalculoIngresosTIT()
+
+
+        Dim FechaPeriodoGracia = PeriodoGracia()
+        Dim CantidadAmortizacion As Integer = Variables.dgvAmortizacion.Rows.Count - 1
+        Dim Amortizacion = Variables.dgvAmortizacion
+
+
+
+
+        Dim Index As Integer = 0
+        Dim j As Integer = 0
+
+        While Index <= CantidadAmortizacion
+
+            PrepararIngresosTIT(Index, Amortizacion)
+
+            Index += 1
+        End While
+
+
+
+        While j <= CantidadAmortizacion
+            Dim PrimerosDias As Double = Amortizacion.Rows(j).Cells("PrimerosDias").Value
+            Dim RestantesDias As Double = Amortizacion.Rows(j).Cells("RestantesDias").Value
+
+
+            Dim FechaActualCupon = dgvIngresos.Rows(j).Cells("FechaCupon").Value
+            Dim Ingreso As Double = 0
+            Dim ValorSaldo = 0.0, PorcCupon = 0.0, Ingresos = 0.0, PorcentajeRenta = 0.0
+            Dim IngresosInt = 0.0, Impuestos = 0.0, Liquido = 0.0
+            Dim SaldoPendiente As Double = 0
+
+            'If TypeOf FechaPeriodoGracia Is Boolean Then
+            If j = 0 Then
+
+                ValorSaldo = Variables.MontoCompraTIT
+            Else
+
+                ValorSaldo = Amortizacion.Rows(j - 1).Cells("Saldos").Value
+            End If
+
+
+
+            'Else
+            '    If FechaPeriodoGracia < FechaActualCupon Then
+
+            '        ValorSaldo = Amortizacion.Rows(j - 1).Cells("Saldos").Value
+            '    Else
+            '        ValorSaldo = Variables.MontoCompraTIT
+            '    End If
+            'End If
+
+
+
+
+
+
+
+
+
+
+
+
+            PorcCupon = CDec(txtPorcentajeCuponCompra.Text.ToString.Trim("%")) / 100
+
+            Dim Fecha1 As Date = Date.Now.Date
+            Dim Fecha2 As Date = Date.Now.Date
+            Dim Dias As Integer = dgvIngresos.Rows(j).Cells("Dias").Value
+            If (j = 0) Then
+                Dim RespaldoFecha As String = Format(dtpFechaLiquidacionCompra.Value, "yyyy/MM/dd")
+                Fecha1 = RespaldoFecha
+                Fecha2 = dgvIngresos.Rows(j).Cells("FechaCupon").Value
+            Else
+                Fecha1 = dgvIngresos.Rows(j - 1).Cells("FechaCupon").Value
+                Fecha2 = dgvIngresos.Rows(j).Cells("FechaCupon").Value
+            End If
+
+
+
+
+
+            If (Not dgvIngresos.Rows(j).Cells("PorcentajeImpuesto").Value Is Nothing) Then
+                PorcentajeRenta = CDec(dgvIngresos.Rows(j).Cells("PorcentajeImpuesto").Value.ToString.Trim("%")) / 100
+
+            Else
+                PorcentajeRenta = 0
+            End If
+
+
+
+            IngresosInt = IngresosInteresesTIT(ValorSaldo, PorcCupon, Dias, PrimerosDias, RestantesDias, IndexBaseC)
+            Ingresos = Me.Impuestos(IngresosInt, PorcentajeRenta)
+            Liquido = Me.Liquido(IngresosInt, Ingresos)
+
+
+            dgvIngresos.Rows(j).Cells("Ingreso").Value = IngresosInt
+            dgvIngresos.Rows(j).Cells("MontoImpuesto").Value = Ingresos
+            dgvIngresos.Rows(j).Cells("Liquido").Value = Liquido
+            j += 1
+        End While
+    End Sub
+
+    Private Sub txtPorcentajeInteresAcumuladoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeInteresAcumuladoCompra.TextChanged
+
+    End Sub
+
+    Private Sub btnQuitar_Click(sender As Object, e As EventArgs) Handles btnQuitar.Click
+        QuitarFila()
+        Calculos()
+    End Sub
+
+    Sub QuitarFila()
+        Dim CantidadFilas As Integer = dgvIngresos.Rows.Count - 1
+        If CantidadFilas > 0 Then
+
+
+
+
+            Dim result As Integer = MsgBox("¿Está seguro que desea eliminar la fila?", MsgBoxStyle.OkCancel)
+            ' Test result.
+            Dim codigo As String = Variables.Codigo
+            Dim Numero As Integer = dgvIngresos.CurrentRow.Cells("NumCupon").Value
+            If result = MsgBoxResult.Ok Then
+                Try
+                    dgvIngresos.Rows.Remove(dgvIngresos.CurrentRow)
+                    BonosConsulta.EliminarIngreso(codigo, Numero, Instrumento)
+                Catch ex As Exception
+                    MsgBox("No ha seleccionado una fila")
+                End Try
+
+
+
+            End If
+
+        Else
+            MsgBox("Actualmente no tiene registros")
+
+        End If
+
+    End Sub
+
+    Private Sub txtCuponesRecibidos_TextChanged(sender As Object, e As EventArgs) Handles txtCuponesRecibidos.TextChanged
+
+    End Sub
+
+    Private Sub txtIngresosPorIntereses_Op_TextChanged(sender As Object, e As EventArgs) Handles txtIngresosPorIntereses_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtRendimientoGananciaPerdida_Op_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoGananciaPerdida_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtRendimientoIntereses_Op_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoIntereses_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtRendimientoAntesISR_Op_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoAntesISR_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtPlazo_Op_TextChanged(sender As Object, e As EventArgs) Handles txtPlazo_Op.TextChanged
+
+    End Sub
+
+    Private Sub txtDiasAcumuladosVenta_TextChanged(sender As Object, e As EventArgs) Handles txtDiasAcumuladosVenta.TextChanged
+
+    End Sub
+
+    Private Sub pnlPie_Paint(sender As Object, e As PaintEventArgs) Handles pnlPie.Paint
+
+    End Sub
+
+    Private Sub txtValorNominalCompra_Leave(sender As Object, e As EventArgs) Handles txtValorNominalCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPorcentajeCuponCompra_Leave(sender As Object, e As EventArgs) Handles txtPorcentajeCuponCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtYTMAlVencimientoCompra_Leave(sender As Object, e As EventArgs) Handles txtYTMAlVencimientoCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoCompra_Leave(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPrecioCompra_Leave(sender As Object, e As EventArgs) Handles txtPrecioCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorCompraCasa_Leave(sender As Object, e As EventArgs) Handles txtComisionPorCompraCasa.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorBolsaCompra_Leave(sender As Object, e As EventArgs) Handles txtComisionPorBolsaCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_Leave(sender As Object, e As EventArgs) Handles txtCostoTransferenciaCompra.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtValorNominalVenta_Leave(sender As Object, e As EventArgs) Handles txtValorNominalVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_Leave(sender As Object, e As EventArgs) Handles txtPorcentajeCuponVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtYTMAlVencimientoVenta_Leave(sender As Object, e As EventArgs) Handles txtYTMAlVencimientoVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_Leave(sender As Object, e As EventArgs) Handles txtPrecioAlVencimientoVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtPrecioVenta_Leave(sender As Object, e As EventArgs) Handles txtPrecioVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorVentaCasa_Leave(sender As Object, e As EventArgs) Handles txtComisionPorVentaCasa.Leave
+        Formato()
+    End Sub
+
+    Private Sub txtComisionPorBolsaVenta_Leave(sender As Object, e As EventArgs) Handles txtComisionPorBolsaVenta.Leave
+        Formato()
+    End Sub
+
+    Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles btnIngresos.Click
+        CalculoIngresosTIT()
+    End Sub
+
+    Private Sub txtValorNominalCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtValorNominalCompra.KeyUp
+        If txtValorNominalCompra.Text = "." Then
+            txtValorNominalCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPorcentajeCuponCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPorcentajeCuponCompra.KeyUp
+        If txtPorcentajeCuponCompra.Text = "." Then
+            txtPorcentajeCuponCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtYTMAlVencimientoCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtYTMAlVencimientoCompra.KeyUp
+        If txtYTMAlVencimientoCompra.Text = "." Then
+            txtYTMAlVencimientoCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioAlVencimientoCompra.KeyUp
+        If txtPrecioAlVencimientoCompra.Text = "." Then
+            txtPrecioAlVencimientoCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPrecioCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioCompra.KeyUp
+        If txtPrecioCompra.Text = "." Then
+            txtPrecioCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorCompraCasa_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorCompraCasa.KeyUp
+        If txtComisionPorCompraCasa.Text = "." Then
+            txtComisionPorCompraCasa.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorBolsaCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorBolsaCompra.KeyUp
+        If txtComisionPorBolsaCompra.Text = "." Then
+            txtComisionPorBolsaCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtCostoTransferenciaCompra_KeyUp(sender As Object, e As KeyEventArgs) Handles txtCostoTransferenciaCompra.KeyUp
+        If txtCostoTransferenciaCompra.Text = "." Then
+            txtCostoTransferenciaCompra.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtValorNominalVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtValorNominalVenta.KeyUp
+        If txtValorNominalVenta.Text = "." Then
+            txtValorNominalVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPorcentajeCuponVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPorcentajeCuponVenta.KeyUp
+        If txtPorcentajeCuponVenta.Text = "." Then
+            txtPorcentajeCuponVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtYTMAlVencimientoVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtYTMAlVencimientoVenta.KeyUp
+        If txtYTMAlVencimientoVenta.Text = "." Then
+            txtYTMAlVencimientoVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPrecioAlVencimientoVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioAlVencimientoVenta.KeyUp
+        If txtPrecioAlVencimientoVenta.Text = "." Then
+            txtPrecioAlVencimientoVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtPrecioVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPrecioVenta.KeyUp
+        If txtPrecioVenta.Text = "." Then
+            txtPrecioVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorVentaCasa_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorVentaCasa.KeyUp
+        If txtComisionPorVentaCasa.Text = "." Then
+            txtComisionPorVentaCasa.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub txtComisionPorBolsaVenta_KeyUp(sender As Object, e As KeyEventArgs) Handles txtComisionPorBolsaVenta.KeyUp
+        If txtComisionPorBolsaVenta.Text = "." Then
+            txtComisionPorBolsaVenta.Text = ".0"
+        End If
+    End Sub
+
+    Private Sub dgvIngresos_KeyPress(sender As Object, e As KeyPressEventArgs) Handles dgvIngresos.KeyPress
+        Formato()
+    End Sub
+
+    Private Sub dgvIngresos_Leave(sender As Object, e As EventArgs) Handles dgvIngresos.Leave
+
+    End Sub
+
+    Private Sub dgvIngresos_Click(sender As Object, e As EventArgs) Handles dgvIngresos.Click
+        Formato()
+    End Sub
+
+    Private Sub dgvIngresos_CellLeave(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellLeave
+        Formato()
+    End Sub
+
+    Sub ValidacionErrores()
+
+        If Not String.IsNullOrEmpty(txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%")) Then
+
+
+
+            If Double.IsNaN(txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoCompra.Text = "0.0%"
+            End If
+
+            If Double.IsInfinity(txtPorcentajeInteresAcumuladoCompra.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoCompra.Text = "0.0%"
+            End If
+
+        End If
+
+
+        If Not String.IsNullOrEmpty(txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%")) Then
+
+            If Double.IsNaN(txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoVenta.Text = "0.0%"
+            End If
+
+            If Double.IsInfinity(txtPorcentajeInteresAcumuladoVenta.Text.ToString.Trim("%")) Then
+                txtPorcentajeInteresAcumuladoVenta.Text = "0.0%"
+            End If
+
+        End If
+
+
+
+
+
+
+
+        If Not String.IsNullOrEmpty(txtPrecioSucioCompra.Text.ToString.Trim("%")) Then
+
+            If Double.IsNaN(txtPrecioSucioCompra.Text.ToString.Trim("%")) Then
+                txtPrecioSucioCompra.Text = "0.0%"
+            End If
+
+            If Double.IsInfinity(txtPrecioSucioCompra.Text.ToString.Trim("%")) Then
+                txtPrecioSucioCompra.Text = "0.0%"
+            End If
+
+        End If
+
+
+
+        If Not String.IsNullOrEmpty(txtPrecioSucioVenta.Text.ToString.Trim("%")) Then
+
+            If Double.IsNaN(txtPrecioSucioVenta.Text.ToString.Trim("%")) Then
+                txtPrecioSucioVenta.Text = "0.0%"
+            End If
+
+
+            If Double.IsInfinity(txtPrecioSucioVenta.Text.ToString.Trim("%")) Then
+                txtPrecioSucioVenta.Text = "0.0%"
+            End If
+        End If
+
+
+    End Sub
+
+
+
+
+    Sub BotonQuitar()
+        If TabCampos.SelectedIndex = 1 Then
+            btnQuitar.Visible = True
+            btnQuitar.Enabled = True
+        Else
+            btnQuitar.Visible = False
+            btnQuitar.Enabled = False
+        End If
+    End Sub
+
+    Private Sub lblRedencion_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub txtValorTransadoVenta_TextChanged(sender As Object, e As EventArgs) Handles txtValorTransadoVenta.TextChanged
+
+    End Sub
+
+
+
+
+    Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
+
+    End Sub
+
+    Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
+
+    End Sub
+
+    Sub CargarTransladoNuevo()
+        Dim Existe As Boolean = ExisteInversion()
+        If CantFormAbierto = False Then
+            If Not RetCodigoInversionExiste And Not Existe Then
+                Dim TipoTransaccionCompraVenta As String = Variables.TipoTransaccionCompraVenta
+                If TipoTransaccionCompraVenta = "C" Then
+                    txtValorNominalCompra.Text = Variables.RetMonto
+                    txtPrecioCompra.Text = Variables.RetPrecio
+                    txtPorcentajeCuponCompra.Text = Variables.RetRendimiento
+                ElseIf TipoTransaccionCompraVenta = "V" Then
+                    txtValorNominalVenta.Text = Variables.RetMonto
+                    txtPrecioVenta.Text = Variables.RetPrecio
+                    txtPorcentajeCuponVenta.Text = Variables.RetRendimiento
+                End If
+            End If
+        End If
+    End Sub
+
+    Private Sub btnVenderTitulo_Click(sender As Object, e As EventArgs) Handles btnVenderTitulo.Click
+
+        If Variables.InvocadorProInv = "frmINV" Then
+            Dim TrasladarDatos As New TrasladarDatosCMVTA
+            Dim General As New DAOGeneral
+            Dim Codigo = Variables.Codigo
+            Dim Tabla As String = "INV0"
+            TrasladarDatos = RellenarDatosCMVTA()
+            Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
+            If Existe Then
+                Dim CodigoInversion As String = Variables.Codigo
+                Dim frmPINVCMVTA As New frmPIN("V", CodigoInversion, TrasladarDatos)
+                frmINV.Close()
+                Me.Close()
+                frmPINVCMVTA.ShowDialog()
+            End If
+        End If
+
+    End Sub
+
+
+    Function RellenarDatosCMVTA()
+        Dim TrasladarDatos As New TrasladarDatosCMVTA
+        TrasladarDatos.BaseCINV = Operaciones.ConvertirEntero(cboAnioBaseC.SelectedIndex.ToString)
+        TrasladarDatos.CuponCINV = Operaciones.ConvertirDecimal(txtPorcentajeCuponCompra.Text.ToString)
+        TrasladarDatos.FechaLiquidacionCINV = Operaciones.ConvertirFecha(dtpFechaLiquidacionCompra.Value.ToString)
+        TrasladarDatos.FechaVencimientoCINV = Operaciones.ConvertirFecha(dtpFechaVencimientoCompra.Value.ToString)
+        TrasladarDatos.PeriodicidadCINV = cboPeriodosC.SelectedValue.ToString
+        TrasladarDatos.PorcentajeComisionBolsaCINV = Operaciones.ConvertirDecimal(txtComisionPorBolsaCompra.Text.ToString)
+        TrasladarDatos.PorcentajeComisionCasaCINV = Operaciones.ConvertirDecimal(txtComisionPorCompraCasa.Text.ToString)
+        TrasladarDatos.PrecioCompraCINV = Operaciones.ConvertirDecimal(txtPrecioCompra.Text.ToString)
+        TrasladarDatos.PrecioVencimientoCINV = Operaciones.ConvertirDecimal(txtPrecioAlVencimientoCompra.Text.ToString)
+        TrasladarDatos.UltimaFechaCuponCINV = Operaciones.ConvertirFecha(dtpUltimaFechaCuponCompra.Value)
+        TrasladarDatos.ValorNominalCINV = Operaciones.ConvertirDecimal(txtValorNominalCompra.Text.ToString)
+        TrasladarDatos.YTMVencimientoCINV = Operaciones.ConvertirDecimal(txtYTMAlVencimientoCompra.Text.ToString)
+        TrasladarDatos.NombreInstrumento = "CINV"
+        TrasladarDatos.AgregarCMVTA = True
+        Return TrasladarDatos
+    End Function
+End Class

+ 582 - 0
FRM/frmColaTitulos.Designer.vb

@@ -0,0 +1,582 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
+Partial Class frmColaTitulos
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()>
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()>
+    Private Sub InitializeComponent()
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle13 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle14 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle15 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle16 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle17 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle18 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Dim DataGridViewCellStyle19 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
+        Me.lblTitulo = New System.Windows.Forms.Label()
+        Me.dgvColaReportos = New System.Windows.Forms.DataGridView()
+        Me.dgvGeneradosReportos = New System.Windows.Forms.DataGridView()
+        Me.lblPropuestaTitulo = New System.Windows.Forms.Label()
+        Me.lblGenerados = New System.Windows.Forms.Label()
+        Me.grpPropuesta = New System.Windows.Forms.GroupBox()
+        Me.grpTitulos = New System.Windows.Forms.GroupBox()
+        Me.lblDetalles = New System.Windows.Forms.Label()
+        Me.btnGenerarReporto = New System.Windows.Forms.Button()
+        Me.dgvDetalles = New System.Windows.Forms.DataGridView()
+        Me.Button1 = New System.Windows.Forms.Button()
+        Me.dgvColaTitulos = New System.Windows.Forms.DataGridView()
+        Me.btnGenerarTitulo = New System.Windows.Forms.Button()
+        Me.Label2 = New System.Windows.Forms.Label()
+        Me.dgvGenerarTitulos = New System.Windows.Forms.DataGridView()
+        Me.Label3 = New System.Windows.Forms.Label()
+        Me.GroupBox2 = New System.Windows.Forms.GroupBox()
+        Me.dgvTitulosRaiz = New System.Windows.Forms.DataGridView()
+        Me.Label4 = New System.Windows.Forms.Label()
+        Me.dgvReporteados = New System.Windows.Forms.DataGridView()
+        Me.Label1 = New System.Windows.Forms.Label()
+        Me.dgvEspApro = New System.Windows.Forms.DataGridView()
+        Me.Label5 = New System.Windows.Forms.Label()
+        Me.btnVerEstado = New System.Windows.Forms.Button()
+        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
+        Me.grpCancelados = New System.Windows.Forms.GroupBox()
+        Me.dgvCancelados = New System.Windows.Forms.DataGridView()
+        Me.Label7 = New System.Windows.Forms.Label()
+        CType(Me.dgvColaReportos, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.dgvGeneradosReportos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.grpPropuesta.SuspendLayout()
+        Me.grpTitulos.SuspendLayout()
+        CType(Me.dgvDetalles, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.dgvColaTitulos, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.dgvGenerarTitulos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.GroupBox2.SuspendLayout()
+        CType(Me.dgvTitulosRaiz, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.dgvReporteados, System.ComponentModel.ISupportInitialize).BeginInit()
+        CType(Me.dgvEspApro, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.GroupBox1.SuspendLayout()
+        Me.grpCancelados.SuspendLayout()
+        CType(Me.dgvCancelados, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.SuspendLayout()
+        '
+        'lblTitulo
+        '
+        Me.lblTitulo.Anchor = System.Windows.Forms.AnchorStyles.Top
+        Me.lblTitulo.AutoSize = True
+        Me.lblTitulo.Font = New System.Drawing.Font("Trebuchet MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        Me.lblTitulo.ForeColor = System.Drawing.Color.White
+        Me.lblTitulo.Location = New System.Drawing.Point(-152, 9)
+        Me.lblTitulo.Name = "lblTitulo"
+        Me.lblTitulo.Size = New System.Drawing.Size(256, 24)
+        Me.lblTitulo.TabIndex = 81
+        Me.lblTitulo.Text = "Administración de Arbitraje"
+        '
+        'dgvColaReportos
+        '
+        Me.dgvColaReportos.AllowUserToAddRows = False
+        Me.dgvColaReportos.AllowUserToDeleteRows = False
+        DataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black
+        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Black
+        Me.dgvColaReportos.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
+        Me.dgvColaReportos.BackgroundColor = System.Drawing.Color.CornflowerBlue
+        Me.dgvColaReportos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle2.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvColaReportos.DefaultCellStyle = DataGridViewCellStyle2
+        Me.dgvColaReportos.GridColor = System.Drawing.Color.Gray
+        Me.dgvColaReportos.Location = New System.Drawing.Point(19, 42)
+        Me.dgvColaReportos.Name = "dgvColaReportos"
+        Me.dgvColaReportos.RowHeadersVisible = False
+        DataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black
+        Me.dgvColaReportos.RowsDefaultCellStyle = DataGridViewCellStyle3
+        Me.dgvColaReportos.Size = New System.Drawing.Size(1281, 194)
+        Me.dgvColaReportos.TabIndex = 82
+        '
+        'dgvGeneradosReportos
+        '
+        Me.dgvGeneradosReportos.AllowUserToAddRows = False
+        Me.dgvGeneradosReportos.AllowUserToDeleteRows = False
+        Me.dgvGeneradosReportos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvGeneradosReportos.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvGeneradosReportos.BackgroundColor = System.Drawing.Color.Khaki
+        Me.dgvGeneradosReportos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle4.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvGeneradosReportos.DefaultCellStyle = DataGridViewCellStyle4
+        Me.dgvGeneradosReportos.Location = New System.Drawing.Point(632, 40)
+        Me.dgvGeneradosReportos.Name = "dgvGeneradosReportos"
+        Me.dgvGeneradosReportos.RowHeadersVisible = False
+        DataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black
+        Me.dgvGeneradosReportos.RowsDefaultCellStyle = DataGridViewCellStyle5
+        Me.dgvGeneradosReportos.Size = New System.Drawing.Size(668, 194)
+        Me.dgvGeneradosReportos.TabIndex = 83
+        '
+        'lblPropuestaTitulo
+        '
+        Me.lblPropuestaTitulo.AutoSize = True
+        Me.lblPropuestaTitulo.ForeColor = System.Drawing.Color.White
+        Me.lblPropuestaTitulo.Location = New System.Drawing.Point(577, 26)
+        Me.lblPropuestaTitulo.Name = "lblPropuestaTitulo"
+        Me.lblPropuestaTitulo.Size = New System.Drawing.Size(127, 13)
+        Me.lblPropuestaTitulo.TabIndex = 84
+        Me.lblPropuestaTitulo.Text = "Información de los Titulos"
+        '
+        'lblGenerados
+        '
+        Me.lblGenerados.AutoSize = True
+        Me.lblGenerados.ForeColor = System.Drawing.Color.White
+        Me.lblGenerados.Location = New System.Drawing.Point(863, 24)
+        Me.lblGenerados.Name = "lblGenerados"
+        Me.lblGenerados.Size = New System.Drawing.Size(247, 13)
+        Me.lblGenerados.TabIndex = 85
+        Me.lblGenerados.Text = "Titulos que se pueden Reportear (Solo Finalizados)"
+        '
+        'grpPropuesta
+        '
+        Me.grpPropuesta.Controls.Add(Me.dgvColaReportos)
+        Me.grpPropuesta.Controls.Add(Me.lblPropuestaTitulo)
+        Me.grpPropuesta.ForeColor = System.Drawing.Color.White
+        Me.grpPropuesta.Location = New System.Drawing.Point(5, 308)
+        Me.grpPropuesta.Name = "grpPropuesta"
+        Me.grpPropuesta.Size = New System.Drawing.Size(1306, 253)
+        Me.grpPropuesta.TabIndex = 86
+        Me.grpPropuesta.TabStop = False
+        Me.grpPropuesta.Text = "Generar Propuesta de Inversión"
+        '
+        'grpTitulos
+        '
+        Me.grpTitulos.Controls.Add(Me.lblDetalles)
+        Me.grpTitulos.Controls.Add(Me.btnGenerarReporto)
+        Me.grpTitulos.Controls.Add(Me.dgvDetalles)
+        Me.grpTitulos.Controls.Add(Me.Button1)
+        Me.grpTitulos.Controls.Add(Me.dgvColaTitulos)
+        Me.grpTitulos.Controls.Add(Me.btnGenerarTitulo)
+        Me.grpTitulos.Controls.Add(Me.Label2)
+        Me.grpTitulos.Controls.Add(Me.dgvGenerarTitulos)
+        Me.grpTitulos.Controls.Add(Me.Label3)
+        Me.grpTitulos.ForeColor = System.Drawing.Color.White
+        Me.grpTitulos.Location = New System.Drawing.Point(5, 36)
+        Me.grpTitulos.Name = "grpTitulos"
+        Me.grpTitulos.Size = New System.Drawing.Size(1306, 266)
+        Me.grpTitulos.TabIndex = 87
+        Me.grpTitulos.TabStop = False
+        Me.grpTitulos.Text = "Generar Listas"
+        '
+        'lblDetalles
+        '
+        Me.lblDetalles.AutoSize = True
+        Me.lblDetalles.Location = New System.Drawing.Point(710, 19)
+        Me.lblDetalles.Name = "lblDetalles"
+        Me.lblDetalles.Size = New System.Drawing.Size(94, 13)
+        Me.lblDetalles.TabIndex = 93
+        Me.lblDetalles.Text = "Detalles de Titulos"
+        '
+        'btnGenerarReporto
+        '
+        Me.btnGenerarReporto.BackColor = System.Drawing.Color.WhiteSmoke
+        Me.btnGenerarReporto.ForeColor = System.Drawing.Color.Black
+        Me.btnGenerarReporto.Location = New System.Drawing.Point(244, 216)
+        Me.btnGenerarReporto.Name = "btnGenerarReporto"
+        Me.btnGenerarReporto.Size = New System.Drawing.Size(153, 44)
+        Me.btnGenerarReporto.TabIndex = 88
+        Me.btnGenerarReporto.Text = "Generar Reporto"
+        Me.btnGenerarReporto.UseVisualStyleBackColor = False
+        '
+        'dgvDetalles
+        '
+        Me.dgvDetalles.AllowUserToAddRows = False
+        Me.dgvDetalles.AllowUserToDeleteRows = False
+        Me.dgvDetalles.BackgroundColor = System.Drawing.Color.DodgerBlue
+        Me.dgvDetalles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle6.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvDetalles.DefaultCellStyle = DataGridViewCellStyle6
+        Me.dgvDetalles.GridColor = System.Drawing.Color.Gray
+        Me.dgvDetalles.Location = New System.Drawing.Point(450, 35)
+        Me.dgvDetalles.Name = "dgvDetalles"
+        DataGridViewCellStyle7.ForeColor = System.Drawing.Color.Black
+        Me.dgvDetalles.RowsDefaultCellStyle = DataGridViewCellStyle7
+        Me.dgvDetalles.Size = New System.Drawing.Size(586, 225)
+        Me.dgvDetalles.TabIndex = 86
+        '
+        'Button1
+        '
+        Me.Button1.BackColor = System.Drawing.Color.WhiteSmoke
+        Me.Button1.ForeColor = System.Drawing.Color.Black
+        Me.Button1.Location = New System.Drawing.Point(45, 35)
+        Me.Button1.Name = "Button1"
+        Me.Button1.Size = New System.Drawing.Size(149, 225)
+        Me.Button1.TabIndex = 92
+        Me.Button1.Text = "Preparar Reporto (Lista)"
+        Me.Button1.UseVisualStyleBackColor = False
+        '
+        'dgvColaTitulos
+        '
+        Me.dgvColaTitulos.AllowUserToAddRows = False
+        Me.dgvColaTitulos.AllowUserToDeleteRows = False
+        Me.dgvColaTitulos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvColaTitulos.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvColaTitulos.BackgroundColor = System.Drawing.Color.LightGray
+        Me.dgvColaTitulos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle8.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvColaTitulos.DefaultCellStyle = DataGridViewCellStyle8
+        Me.dgvColaTitulos.Location = New System.Drawing.Point(200, 35)
+        Me.dgvColaTitulos.Name = "dgvColaTitulos"
+        Me.dgvColaTitulos.RowHeadersVisible = False
+        DataGridViewCellStyle9.ForeColor = System.Drawing.Color.Black
+        Me.dgvColaTitulos.RowsDefaultCellStyle = DataGridViewCellStyle9
+        Me.dgvColaTitulos.Size = New System.Drawing.Size(244, 175)
+        Me.dgvColaTitulos.TabIndex = 82
+        '
+        'btnGenerarTitulo
+        '
+        Me.btnGenerarTitulo.BackColor = System.Drawing.Color.WhiteSmoke
+        Me.btnGenerarTitulo.ForeColor = System.Drawing.Color.Black
+        Me.btnGenerarTitulo.Location = New System.Drawing.Point(1090, 216)
+        Me.btnGenerarTitulo.Name = "btnGenerarTitulo"
+        Me.btnGenerarTitulo.Size = New System.Drawing.Size(153, 44)
+        Me.btnGenerarTitulo.TabIndex = 91
+        Me.btnGenerarTitulo.Text = "Generar Titulo"
+        Me.btnGenerarTitulo.UseVisualStyleBackColor = False
+        '
+        'Label2
+        '
+        Me.Label2.AutoSize = True
+        Me.Label2.Location = New System.Drawing.Point(241, 19)
+        Me.Label2.Name = "Label2"
+        Me.Label2.Size = New System.Drawing.Size(168, 13)
+        Me.Label2.TabIndex = 84
+        Me.Label2.Text = "En Espera (Generar Pool Reporto)"
+        '
+        'dgvGenerarTitulos
+        '
+        Me.dgvGenerarTitulos.AllowUserToAddRows = False
+        Me.dgvGenerarTitulos.AllowUserToDeleteRows = False
+        Me.dgvGenerarTitulos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvGenerarTitulos.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvGenerarTitulos.BackgroundColor = System.Drawing.Color.LightGray
+        Me.dgvGenerarTitulos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle10.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvGenerarTitulos.DefaultCellStyle = DataGridViewCellStyle10
+        Me.dgvGenerarTitulos.Location = New System.Drawing.Point(1042, 35)
+        Me.dgvGenerarTitulos.Name = "dgvGenerarTitulos"
+        Me.dgvGenerarTitulos.RowHeadersVisible = False
+        DataGridViewCellStyle11.ForeColor = System.Drawing.Color.Black
+        Me.dgvGenerarTitulos.RowsDefaultCellStyle = DataGridViewCellStyle11
+        Me.dgvGenerarTitulos.ScrollBars = System.Windows.Forms.ScrollBars.None
+        Me.dgvGenerarTitulos.Size = New System.Drawing.Size(244, 175)
+        Me.dgvGenerarTitulos.TabIndex = 89
+        '
+        'Label3
+        '
+        Me.Label3.AutoSize = True
+        Me.Label3.Location = New System.Drawing.Point(1087, 19)
+        Me.Label3.Name = "Label3"
+        Me.Label3.Size = New System.Drawing.Size(154, 13)
+        Me.Label3.TabIndex = 90
+        Me.Label3.Text = "Hábilitado Para Generar Titulos"
+        '
+        'GroupBox2
+        '
+        Me.GroupBox2.Controls.Add(Me.dgvTitulosRaiz)
+        Me.GroupBox2.Controls.Add(Me.Label4)
+        Me.GroupBox2.Controls.Add(Me.dgvReporteados)
+        Me.GroupBox2.Controls.Add(Me.Label1)
+        Me.GroupBox2.ForeColor = System.Drawing.Color.White
+        Me.GroupBox2.Location = New System.Drawing.Point(5, 1120)
+        Me.GroupBox2.Name = "GroupBox2"
+        Me.GroupBox2.Size = New System.Drawing.Size(1306, 276)
+        Me.GroupBox2.TabIndex = 88
+        Me.GroupBox2.TabStop = False
+        Me.GroupBox2.Text = "Titulos Reporteados y Raiz"
+        '
+        'dgvTitulosRaiz
+        '
+        Me.dgvTitulosRaiz.AllowUserToAddRows = False
+        Me.dgvTitulosRaiz.AllowUserToDeleteRows = False
+        Me.dgvTitulosRaiz.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvTitulosRaiz.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvTitulosRaiz.BackgroundColor = System.Drawing.Color.SandyBrown
+        Me.dgvTitulosRaiz.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle12.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle12.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvTitulosRaiz.DefaultCellStyle = DataGridViewCellStyle12
+        Me.dgvTitulosRaiz.Location = New System.Drawing.Point(632, 42)
+        Me.dgvTitulosRaiz.Name = "dgvTitulosRaiz"
+        Me.dgvTitulosRaiz.RowHeadersVisible = False
+        DataGridViewCellStyle13.ForeColor = System.Drawing.Color.Black
+        Me.dgvTitulosRaiz.RowsDefaultCellStyle = DataGridViewCellStyle13
+        Me.dgvTitulosRaiz.Size = New System.Drawing.Size(668, 194)
+        Me.dgvTitulosRaiz.TabIndex = 88
+        '
+        'Label4
+        '
+        Me.Label4.AutoSize = True
+        Me.Label4.Location = New System.Drawing.Point(959, 26)
+        Me.Label4.Name = "Label4"
+        Me.Label4.Size = New System.Drawing.Size(143, 13)
+        Me.Label4.TabIndex = 89
+        Me.Label4.Text = "Raiz Titulos (Visualizar Flujo )"
+        '
+        'dgvReporteados
+        '
+        Me.dgvReporteados.AllowUserToAddRows = False
+        Me.dgvReporteados.AllowUserToDeleteRows = False
+        Me.dgvReporteados.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvReporteados.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvReporteados.BackgroundColor = System.Drawing.Color.Salmon
+        Me.dgvReporteados.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle14.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle14.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvReporteados.DefaultCellStyle = DataGridViewCellStyle14
+        Me.dgvReporteados.Location = New System.Drawing.Point(13, 42)
+        Me.dgvReporteados.Name = "dgvReporteados"
+        Me.dgvReporteados.RowHeadersVisible = False
+        DataGridViewCellStyle15.ForeColor = System.Drawing.Color.Black
+        Me.dgvReporteados.RowsDefaultCellStyle = DataGridViewCellStyle15
+        Me.dgvReporteados.Size = New System.Drawing.Size(602, 194)
+        Me.dgvReporteados.TabIndex = 86
+        '
+        'Label1
+        '
+        Me.Label1.AutoSize = True
+        Me.Label1.Location = New System.Drawing.Point(262, 26)
+        Me.Label1.Name = "Label1"
+        Me.Label1.Size = New System.Drawing.Size(102, 13)
+        Me.Label1.TabIndex = 87
+        Me.Label1.Text = "Titulos Reporteados"
+        '
+        'dgvEspApro
+        '
+        Me.dgvEspApro.AllowUserToAddRows = False
+        Me.dgvEspApro.AllowUserToDeleteRows = False
+        Me.dgvEspApro.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvEspApro.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvEspApro.BackgroundColor = System.Drawing.Color.LightGreen
+        Me.dgvEspApro.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle16.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle16.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvEspApro.DefaultCellStyle = DataGridViewCellStyle16
+        Me.dgvEspApro.Location = New System.Drawing.Point(13, 40)
+        Me.dgvEspApro.Name = "dgvEspApro"
+        Me.dgvEspApro.RowHeadersVisible = False
+        DataGridViewCellStyle17.ForeColor = System.Drawing.Color.Black
+        Me.dgvEspApro.RowsDefaultCellStyle = DataGridViewCellStyle17
+        Me.dgvEspApro.Size = New System.Drawing.Size(602, 194)
+        Me.dgvEspApro.TabIndex = 90
+        '
+        'Label5
+        '
+        Me.Label5.AutoSize = True
+        Me.Label5.ForeColor = System.Drawing.Color.White
+        Me.Label5.Location = New System.Drawing.Point(215, 24)
+        Me.Label5.Name = "Label5"
+        Me.Label5.Size = New System.Drawing.Size(149, 13)
+        Me.Label5.TabIndex = 91
+        Me.Label5.Text = "Titulos Esperando Aprobación"
+        '
+        'btnVerEstado
+        '
+        Me.btnVerEstado.Location = New System.Drawing.Point(270, 9)
+        Me.btnVerEstado.Name = "btnVerEstado"
+        Me.btnVerEstado.Size = New System.Drawing.Size(111, 26)
+        Me.btnVerEstado.TabIndex = 89
+        Me.btnVerEstado.Text = "Ver Estado"
+        Me.btnVerEstado.UseVisualStyleBackColor = True
+        '
+        'GroupBox1
+        '
+        Me.GroupBox1.Controls.Add(Me.dgvEspApro)
+        Me.GroupBox1.Controls.Add(Me.Label5)
+        Me.GroupBox1.Controls.Add(Me.dgvGeneradosReportos)
+        Me.GroupBox1.Controls.Add(Me.lblGenerados)
+        Me.GroupBox1.ForeColor = System.Drawing.Color.White
+        Me.GroupBox1.Location = New System.Drawing.Point(5, 570)
+        Me.GroupBox1.Name = "GroupBox1"
+        Me.GroupBox1.Size = New System.Drawing.Size(1306, 253)
+        Me.GroupBox1.TabIndex = 90
+        Me.GroupBox1.TabStop = False
+        Me.GroupBox1.Text = "Titulos en Espera y Habilitados"
+        '
+        'grpCancelados
+        '
+        Me.grpCancelados.Controls.Add(Me.dgvCancelados)
+        Me.grpCancelados.Controls.Add(Me.Label7)
+        Me.grpCancelados.ForeColor = System.Drawing.Color.White
+        Me.grpCancelados.Location = New System.Drawing.Point(5, 829)
+        Me.grpCancelados.Name = "grpCancelados"
+        Me.grpCancelados.Size = New System.Drawing.Size(638, 276)
+        Me.grpCancelados.TabIndex = 91
+        Me.grpCancelados.TabStop = False
+        Me.grpCancelados.Text = "Cancelados"
+        '
+        'dgvCancelados
+        '
+        Me.dgvCancelados.AllowUserToAddRows = False
+        Me.dgvCancelados.AllowUserToDeleteRows = False
+        Me.dgvCancelados.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
+        Me.dgvCancelados.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells
+        Me.dgvCancelados.BackgroundColor = System.Drawing.Color.Salmon
+        Me.dgvCancelados.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        DataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
+        DataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Window
+        DataGridViewCellStyle18.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+        DataGridViewCellStyle18.ForeColor = System.Drawing.Color.White
+        DataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight
+        DataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText
+        DataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
+        Me.dgvCancelados.DefaultCellStyle = DataGridViewCellStyle18
+        Me.dgvCancelados.Location = New System.Drawing.Point(13, 42)
+        Me.dgvCancelados.Name = "dgvCancelados"
+        Me.dgvCancelados.RowHeadersVisible = False
+        DataGridViewCellStyle19.ForeColor = System.Drawing.Color.Black
+        Me.dgvCancelados.RowsDefaultCellStyle = DataGridViewCellStyle19
+        Me.dgvCancelados.Size = New System.Drawing.Size(602, 194)
+        Me.dgvCancelados.TabIndex = 86
+        '
+        'Label7
+        '
+        Me.Label7.AutoSize = True
+        Me.Label7.Location = New System.Drawing.Point(262, 26)
+        Me.Label7.Name = "Label7"
+        Me.Label7.Size = New System.Drawing.Size(63, 13)
+        Me.Label7.TabIndex = 87
+        Me.Label7.Text = "Cancelados"
+        '
+        'frmColaTitulos
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.AutoScroll = True
+        Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
+        Me.ClientSize = New System.Drawing.Size(1336, 605)
+        Me.Controls.Add(Me.grpCancelados)
+        Me.Controls.Add(Me.GroupBox1)
+        Me.Controls.Add(Me.btnVerEstado)
+        Me.Controls.Add(Me.GroupBox2)
+        Me.Controls.Add(Me.grpTitulos)
+        Me.Controls.Add(Me.grpPropuesta)
+        Me.Controls.Add(Me.lblTitulo)
+        Me.Name = "frmColaTitulos"
+        Me.Text = "frmColaTitulos"
+        CType(Me.dgvColaReportos, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.dgvGeneradosReportos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.grpPropuesta.ResumeLayout(False)
+        Me.grpPropuesta.PerformLayout()
+        Me.grpTitulos.ResumeLayout(False)
+        Me.grpTitulos.PerformLayout()
+        CType(Me.dgvDetalles, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.dgvColaTitulos, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.dgvGenerarTitulos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.GroupBox2.ResumeLayout(False)
+        Me.GroupBox2.PerformLayout()
+        CType(Me.dgvTitulosRaiz, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.dgvReporteados, System.ComponentModel.ISupportInitialize).EndInit()
+        CType(Me.dgvEspApro, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.GroupBox1.ResumeLayout(False)
+        Me.GroupBox1.PerformLayout()
+        Me.grpCancelados.ResumeLayout(False)
+        Me.grpCancelados.PerformLayout()
+        CType(Me.dgvCancelados, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.ResumeLayout(False)
+        Me.PerformLayout()
+
+    End Sub
+
+    Friend WithEvents lblTitulo As Label
+    Friend WithEvents dgvColaReportos As DataGridView
+    Friend WithEvents dgvGeneradosReportos As DataGridView
+    Friend WithEvents lblPropuestaTitulo As Label
+    Friend WithEvents lblGenerados As Label
+    Friend WithEvents grpPropuesta As GroupBox
+    Friend WithEvents grpTitulos As GroupBox
+    Friend WithEvents dgvColaTitulos As DataGridView
+    Friend WithEvents Label2 As Label
+    Friend WithEvents dgvDetalles As DataGridView
+    Friend WithEvents btnGenerarReporto As Button
+    Friend WithEvents btnGenerarTitulo As Button
+    Friend WithEvents dgvGenerarTitulos As DataGridView
+    Friend WithEvents Label3 As Label
+    Friend WithEvents Button1 As Button
+    Friend WithEvents GroupBox2 As GroupBox
+    Friend WithEvents lblDetalles As Label
+    Friend WithEvents dgvReporteados As DataGridView
+    Friend WithEvents Label1 As Label
+    Friend WithEvents dgvTitulosRaiz As DataGridView
+    Friend WithEvents Label4 As Label
+    Friend WithEvents dgvEspApro As DataGridView
+    Friend WithEvents Label5 As Label
+    Friend WithEvents btnVerEstado As Button
+    Friend WithEvents GroupBox1 As GroupBox
+    Friend WithEvents grpCancelados As GroupBox
+    Friend WithEvents dgvCancelados As DataGridView
+    Friend WithEvents Label7 As Label
+End Class

+ 120 - 0
FRM/frmColaTitulos.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 443 - 0
FRM/frmColaTitulos.vb

@@ -0,0 +1,443 @@
+Public Class frmColaTitulos
+    Dim Cola As New ColaDAO
+    Dim Operaciones As New Operaciones
+    Public CodigoAsociado As String = String.Empty
+    Private Sub frmColaTitulos_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        Inicializacion()
+    End Sub
+
+    Sub Inicializacion()
+        OcultarColumnas()
+        CargarTablas()
+        OcultarColumnasCargadas()
+    End Sub
+
+    Sub OcultarColumnas()
+        If Not dgvDetalles Is Nothing Then
+            If Not dgvDetalles.Columns Is Nothing Then
+
+
+
+                If Not dgvDetalles.Columns("CodigoEmpresa") Is Nothing Then
+                    dgvDetalles.Columns("CodigoEmpresa").Visible = False
+                End If
+
+                If Not dgvDetalles.Columns("CodigoInstrumento") Is Nothing Then
+                    dgvDetalles.Columns("CodigoInstrumento").Visible = False
+                End If
+
+
+
+                If Not dgvDetalles.Columns("CodigoAsociacion") Is Nothing Then
+                    dgvDetalles.Columns("CodigoAsociacion").Visible = False
+                End If
+                If Not dgvDetalles.Columns("IdFlujo") Is Nothing Then
+                    dgvDetalles.Columns("IdFlujo").Visible = False
+                End If
+
+                If Not dgvDetalles.Columns("IdLisRep") Is Nothing Then
+                    dgvDetalles.Columns("IdLisRep").Visible = False
+                End If
+            End If
+            End If
+    End Sub
+
+
+    Sub OcultarColumnasCargadas()
+        If Not dgvDetalles Is Nothing Then
+            If Not dgvDetalles.Columns Is Nothing Then
+
+
+                If Not dgvColaReportos.Columns("IdSeleccionTitulo") Is Nothing Then
+                    dgvColaReportos.Columns("IdSeleccionTitulo").Visible = False
+                End If
+
+
+
+
+
+                If Not dgvColaReportos.Columns("Nombre Empresa") Is Nothing Then
+                    dgvColaReportos.Columns("Nombre Empresa").Visible = False
+                End If
+
+                If Not dgvColaReportos.Columns("Nombre Instrumento") Is Nothing Then
+                    dgvColaReportos.Columns("Nombre Instrumento").Visible = False
+                End If
+
+
+
+
+
+                If Not dgvColaReportos.Columns("IdFlujo") Is Nothing Then
+                    dgvColaReportos.Columns("IdFlujo").Visible = False
+                End If
+
+                If Not dgvColaReportos.Columns("IdECT") Is Nothing Then
+                    dgvColaReportos.Columns("IdECT").Visible = False
+                End If
+                If Not dgvColaReportos.Columns("EstadoProceso") Is Nothing Then
+                    dgvColaReportos.Columns("EstadoProceso").Visible = False
+                End If
+                If Not dgvColaReportos.Columns("CodigoEmpresa") Is Nothing Then
+                    dgvColaReportos.Columns("CodigoEmpresa").Visible = False
+                End If
+
+                If Not dgvColaReportos.Columns("CodigoInstrumento") Is Nothing Then
+                    dgvColaReportos.Columns("CodigoInstrumento").Visible = False
+                End If
+
+
+
+            End If
+        End If
+
+
+
+
+    End Sub
+
+
+
+
+
+
+
+
+    Sub CargarTablaGenerarReporto()
+        Dim dt As New DataTable
+        Dim Tipo As String = "GenerarReporto"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvColaTitulos.DataSource = dt
+    End Sub
+
+    Sub CargarTablaTituloEspAprobacionPropuesta()
+        Dim dt As New DataTable
+        Dim Tipo As String = "TituloEspAprobacionPropuesta"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvEspApro.DataSource = dt
+    End Sub
+
+
+
+    Sub CargarTablaTitulosParaReportear()
+        Dim dt As New DataTable
+        Dim Tipo As String = "TitulosParaReportear"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvGeneradosReportos.DataSource = dt
+    End Sub
+
+    Sub CargarTablaCancelado()
+        Dim dt As New DataTable
+        Dim Tipo As String = "TituloCancelado"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvCancelados.DataSource = dt
+    End Sub
+
+    Sub CargarTablaTitulosReporteados()
+        Dim dt As New DataTable
+        Dim Tipo As String = "TitulosReporteados"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvReporteados.DataSource = dt
+    End Sub
+
+
+    Sub CargarTablaTitulosRaiz()
+        Dim dt As New DataTable
+        Dim Tipo As String = "TitulosRaiz"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvTitulosRaiz.DataSource = dt
+    End Sub
+
+
+    Sub CargarTablaGenerarMasTitulos()
+        Dim dt As New DataTable
+        Dim Tipo As String = "GenerarMasTitulos"
+        Dim CodigoAsociado As String = ""
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvGenerarTitulos.DataSource = dt
+    End Sub
+
+
+
+    Sub CargarTablaDetallesGenerarReporto()
+        Dim dt As New DataTable
+        Dim Tipo As String = "DetallesGenerarReporto"
+        Dim CodigoAsociado As String = dgvColaTitulos.CurrentRow.Cells("CodigoAsociado").Value.ToString
+
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvDetalles.DataSource = dt
+    End Sub
+
+
+    Sub CargarTablaDetallesGenerarMasTitulos()
+        Dim dt As New DataTable
+        Dim Tipo As String = "DetallesGenerarMasTitulos"
+        Dim CodigoAsociado As String = dgvGenerarTitulos.CurrentRow.Cells("CodigoAsociado").Value.ToString
+
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvDetalles.DataSource = dt
+    End Sub
+
+
+
+
+    Sub CargarTablas()
+        CargarTablaGenerarReporto()
+        CargarTablaGenerarMasTitulos()
+        CargarTablaDetallesSinAsignar()
+        CargarTablaTituloEspAprobacionPropuesta()
+        CargarTablaCancelado()
+        CargarTablaTitulosParaReportear()
+        CargarTablaTitulosReporteados()
+        CargarTablaTitulosRaiz()
+
+    End Sub
+
+
+    Sub CargarTablaDetallesSinAsignar()
+        Dim dt As New DataTable
+        Dim Tipo As String = "DetallesTitulosSinAsignar"
+        Dim CodigoAsociado As String = String.Empty
+
+        dt = Cola.TablasArbitraje(Tipo, CodigoAsociado)
+        dgvColaReportos.DataSource = dt
+    End Sub
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    Private Sub dgvCola_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvColaReportos.CellClick
+
+        GenerarPropuesta()
+    End Sub
+
+
+
+    Sub GenerarPropuesta()
+
+
+        If MsgBox("¿Esta Seguro de Crear Este Titulo?", MsgBoxStyle.OkCancel) = DialogResult.OK Then
+
+
+            Dim DicDatosInversion As New Dictionary(Of String, String)
+            Dim IdSeleccionTitulo As Integer = 0
+            Dim CodigoAsociado As String = String.Empty
+            Dim CodigoReporto As String = String.Empty
+            Dim NombreInstrumento As String = String.Empty
+            Dim NombreEmpresa As String = String.Empty
+            Dim SaldoAplicadoTitulo As Double = 0
+            Dim IdFlujo As Integer = 0
+            Dim IdECT As Integer = 0
+
+
+
+            CodigoReporto = dgvColaReportos.CurrentRow.Cells("CodigoReporto").Value.ToString
+            IdFlujo = Operaciones.ConvertirEntero(dgvColaReportos.CurrentRow.Cells("IdFlujo").Value.ToString)
+            IdECT = Operaciones.ConvertirEntero(dgvColaReportos.CurrentRow.Cells("IdECT").Value.ToString)
+            CodigoAsociado = dgvColaReportos.CurrentRow.Cells("CodigoAsociado").Value.ToString
+            NombreInstrumento = dgvColaReportos.CurrentRow.Cells("CodigoInstrumento").Value.ToString
+            NombreEmpresa = dgvColaReportos.CurrentRow.Cells("CodigoEmpresa").Value.ToString
+            SaldoAplicadoTitulo = Operaciones.ConvertirDecimal(dgvColaReportos.CurrentRow.Cells("MontoTitulo").Value.ToString)
+
+
+
+            DicDatosInversion.Add("CodigoAsociado", CodigoAsociado)
+            DicDatosInversion.Add("CodigoReporto", CodigoReporto)
+            DicDatosInversion.Add("NombreInstrumento", NombreInstrumento)
+            DicDatosInversion.Add("NombreEmpresa", NombreEmpresa)
+            DicDatosInversion.Add("SaldoAplicadoTitulo", SaldoAplicadoTitulo)
+            DicDatosInversion.Add("IdFlujo", IdFlujo)
+            DicDatosInversion.Add("IdECT", IdECT)
+
+
+
+
+            Dim frmGenerarPropuesta As New frmPIN(DicDatosInversion)
+            frmGenerarPropuesta.Show()
+        End If
+    End Sub
+
+    Private Sub dgvColaTitulos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvColaTitulos.CellClick
+        CargarTablaDetallesGenerarReporto()
+        OcultarColumnas()
+    End Sub
+
+    Private Sub btnGenerarReporto_Click(sender As Object, e As EventArgs) Handles btnGenerarReporto.Click
+        CrearReportoVenta()
+
+    End Sub
+
+    Sub CrearReportoVenta()
+
+        If dgvColaTitulos.Rows.Count = 0 Or dgvDetalles.Rows.Count = 0 Then
+
+            MsgBox("No se ha seleccionado una Asociación")
+        Else
+            Dim CodigoAsociacion As String = String.Empty
+            Dim Empresa As String = String.Empty
+            Dim MontoGenerado As Double = 0
+            Dim Index As Integer = 0
+            Dim Cantidad As Integer = dgvDetalles.Rows.Count - 1
+            Dim DicDatos As New Dictionary(Of String, Object)
+            Dim Coleccion As New Collection
+            Dim Monto As Double = 0
+            While (Index <= Cantidad)
+                Dim DicUnionTablas As New Dictionary(Of String, Object)
+                Empresa = dgvDetalles.Rows(Index).Cells("CodigoEmpresa").Value.ToString
+                CodigoAsociacion = dgvDetalles.Rows(Index).Cells("CodigoAsociado").Value.ToString
+                Monto += Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("MontoUsado").Value.ToString)
+                DicUnionTablas.Add("CodigoTitulos", dgvDetalles.Rows(Index).Cells("CodigoTitulo").Value.ToString)
+                DicUnionTablas.Add("IdFlujo", Operaciones.ConvertirEntero(dgvDetalles.Rows(Index).Cells("IdFlujo").Value.ToString))
+                DicUnionTablas.Add("IdLisRep", Operaciones.ConvertirEntero(dgvDetalles.Rows(Index).Cells("IdLisRep").Value.ToString))
+                Coleccion.Add(DicUnionTablas)
+                Index += 1
+            End While
+            DicDatos.Add("Empresa", Empresa)
+            DicDatos.Add("CodigoAsociacion", CodigoAsociacion)
+            DicDatos.Add("MontoUsado", Monto)
+            DicDatos.Add("ColUnionTablas", Coleccion)
+
+            Dim frmInv As New frmINV(DicDatos)
+            frmInv.Show()
+        End If
+    End Sub
+
+    Private Sub dgvGenerarTitulos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvGenerarTitulos.CellClick
+        CargarTablaDetallesGenerarMasTitulos()
+        OcultarColumnas()
+    End Sub
+
+    Private Sub btnGenerarTitulo_Click(sender As Object, e As EventArgs) Handles btnGenerarTitulo.Click
+
+        GenerarTitulo()
+
+    End Sub
+
+    Sub GenerarTitulo()
+        If dgvDetalles.Rows.Count <= 0 Then
+            MsgBox("No se ha seleccionado una Asociacion")
+        Else
+            Dim DicDatos As New Dictionary(Of String, Object)
+            DicDatos = ObtenerDatosGenerarTitulos()
+
+            Dim GenerarTitulo As New frmSeleccionTitulosReportos(DicDatos)
+            GenerarTitulo.Show()
+        End If
+    End Sub
+
+    Function ObtenerDatosGenerarTitulos() As Dictionary(Of String, Object)
+
+        Dim DicDatos As New Dictionary(Of String, Object)
+
+
+        Dim CodigoAsociacion As String = String.Empty
+        Dim CodigoReporto As String = String.Empty
+        Dim Id As Integer = 0
+        Dim Empresa As String = String.Empty
+        Dim Monto As Double = 0
+        Dim Index As Integer = 0
+        Dim NombreEmpresa As String = String.Empty
+        Dim Cantidad As Integer = dgvDetalles.Rows.Count - 1
+        Dim IdFlujo As Integer = 0
+        While (Index <= Cantidad)
+            Monto += Operaciones.ConvertirDecimal(dgvDetalles.Rows(Index).Cells("MontoUsado").Value.ToString)
+            Empresa = dgvDetalles.Rows(Index).Cells("CodigoEmpresa").Value.ToString
+            NombreEmpresa = dgvDetalles.Rows(Index).Cells("Empresa").Value.ToString
+            If IdFlujo = 0 Then
+                IdFlujo = Operaciones.ConvertirEntero(dgvDetalles.Rows(Index).Cells("IdFlujo").Value.ToString)
+            End If
+                    CodigoReporto = dgvDetalles.Rows(Index).Cells("CodigoReporto").Value
+                    Index += 1
+        End While
+
+
+
+
+
+        CodigoAsociacion = dgvGenerarTitulos.CurrentRow.Cells("CodigoAsociado").Value.ToString
+        DicDatos.Add("CodigoAsociado", CodigoAsociacion)
+        DicDatos.Add("MontoUsado", Monto)
+        DicDatos.Add("Empresa", Empresa)
+        DicDatos.Add("NombreEmpresa", NombreEmpresa)
+        DicDatos.Add("CodigoReporto", CodigoReporto)
+        DicDatos.Add("IdFlujo", IdFlujo)
+        Return DicDatos
+
+
+    End Function
+
+    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
+        frmSeleccionPoolTitulos.Show()
+    End Sub
+
+    Private Sub dgvGeneradosReportos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvGeneradosReportos.CellContentClick
+
+    End Sub
+
+    Private Sub btnVerEstado_Click(sender As Object, e As EventArgs) Handles btnVerEstado.Click
+
+    End Sub
+
+    Private Sub dgvColaReportos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvColaReportos.CellContentClick
+
+    End Sub
+
+    Private Sub dgvEspApro_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvEspApro.CellContentClick
+
+    End Sub
+
+    Private Sub dgvGeneradosReportos_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvGeneradosReportos.CellClick
+
+    End Sub
+
+
+    Sub VisualizarFlujo()
+
+        CodigoAsociado = dgvTitulosRaiz.CurrentRow.Cells("CodigoAsociado").Value
+        If CodigoAsociado = "Sin Asignar" Then
+            MsgBox("Sin Pasado")
+
+        Else
+            Dim frmFluArbitraje As New frmFlujoArbitraje(CodigoAsociado)
+            frmFluArbitraje.Show()
+        End If
+
+
+    End Sub
+
+
+
+
+    Private Sub dgvTitulosRaiz_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvTitulosRaiz.CellClick
+        VisualizarFlujo()
+    End Sub
+
+    Private Sub dgvTitulosRaiz_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvTitulosRaiz.CellContentClick
+
+    End Sub
+
+    Private Sub Button2_Click(sender As Object, e As EventArgs)
+
+    End Sub
+
+    Private Sub dgvDetalles_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvDetalles.CellContentClick
+
+    End Sub
+End Class

+ 55 - 0
FRM/frmCostosReportos.Designer.vb

@@ -0,0 +1,55 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class frmCostosReportos
+    Inherits System.Windows.Forms.Form
+
+    'Form reemplaza a Dispose para limpiar la lista de componentes.
+    <System.Diagnostics.DebuggerNonUserCode()> _
+    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+        Try
+            If disposing AndAlso components IsNot Nothing Then
+                components.Dispose()
+            End If
+        Finally
+            MyBase.Dispose(disposing)
+        End Try
+    End Sub
+
+    'Requerido por el Diseñador de Windows Forms
+    Private components As System.ComponentModel.IContainer
+
+    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
+    'Se puede modificar usando el Diseñador de Windows Forms.  
+    'No lo modifique con el editor de código.
+    <System.Diagnostics.DebuggerStepThrough()> _
+    Private Sub InitializeComponent()
+        Me.dgvReportoCostos = New System.Windows.Forms.DataGridView()
+        CType(Me.dgvReportoCostos, System.ComponentModel.ISupportInitialize).BeginInit()
+        Me.SuspendLayout()
+        '
+        'dgvReportoCostos
+        '
+        Me.dgvReportoCostos.AllowUserToAddRows = False
+        Me.dgvReportoCostos.AllowUserToDeleteRows = False
+        Me.dgvReportoCostos.BackgroundColor = System.Drawing.Color.White
+        Me.dgvReportoCostos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+        Me.dgvReportoCostos.Dock = System.Windows.Forms.DockStyle.Fill
+        Me.dgvReportoCostos.Location = New System.Drawing.Point(0, 0)
+        Me.dgvReportoCostos.Name = "dgvReportoCostos"
+        Me.dgvReportoCostos.Size = New System.Drawing.Size(856, 356)
+        Me.dgvReportoCostos.TabIndex = 0
+        '
+        'frmCostosReportos
+        '
+        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+        Me.ClientSize = New System.Drawing.Size(856, 356)
+        Me.Controls.Add(Me.dgvReportoCostos)
+        Me.Name = "frmCostosReportos"
+        Me.Text = "frmCostosReportos"
+        CType(Me.dgvReportoCostos, System.ComponentModel.ISupportInitialize).EndInit()
+        Me.ResumeLayout(False)
+
+    End Sub
+
+    Friend WithEvents dgvReportoCostos As DataGridView
+End Class

+ 120 - 0
FRM/frmCostosReportos.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 28 - 0
FRM/frmCostosReportos.vb

@@ -0,0 +1,28 @@
+Public Class frmCostosReportos
+    Private Sub frmCostosReportos_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+        CargarDatosBusqueda()
+    End Sub
+
+
+    Sub CargarDatosBusqueda()
+        Dim ReportoVenta As New ReportosDAO
+        Dim ds As New DataSet
+        Dim FechaOperacion1 As Date = Date.Today.Date
+        Dim FechaOperacion2 As Date = Date.Today.Date
+        Dim Empresa As String = ""
+        Dim CasaCorredora As String = ""
+        Dim Estado As String = ""
+
+
+
+
+
+
+        ds = ReportoVenta.FiltroReportoCostos()
+        dgvReportoCostos.DataSource = ds.Tables(0)
+
+
+
+
+    End Sub
+End Class

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác