Imports System.Threading Public Class frmPIN Dim oPropuestaInversionCE As CEPropuestaInversion = New CEPropuestaInversion Dim oDAOGeneral As DAOGeneral = New DAOGeneral Dim oDAOLETES As LETESDAO = New LETESDAO Dim oDAOPropuestasDeInversion As DAOPropuestaInversion = New DAOPropuestaInversion Dim oCEAcciones As AccionesCE Dim oCEBonos As BonosCE Dim oCEDAP As DepositosAPlazoCE Dim oCELetes As LETESCE Dim oCEReportos As ReportosCE Dim TipoTransaccion As String = "B" Dim InstrumentoFinanciero As Object Dim ResultadoMsgBox As Integer Dim IdPIN As Integer Dim IdIF As String Dim Modo As String = "NM" Dim oInversionCE As New InversionesCE Dim frmBuscar As frmBuscarDeLista Dim FormAcciones As frmAcciones Dim FormFuturos As frmFuturos Dim FormPrestamoEmpresarial As frmPrestamoEmpresariales Dim FormPrestamoPersonal As frmPrestamoPersonal Dim FormRepo As frmReporto Dim FormLete As frmLetes Dim FormCINV As frmCertificadosDeInversion Dim FormDAP As frmDepositosAPlazo Dim FormNEST As frmNotaEstructurada Dim FormFINV As frmFOIN Dim Operaciones As New Operaciones Dim oInversionDAO As New InversionDAO Dim TieneDetalleInstrumento As Boolean = False Dim ActivarSuspen As Boolean = True Dim LlamadaDesdeBusqueda As Boolean = False 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 CodigoInversionPrincipal As String = String.Empty Dim CodigoInversionSecundario As String = String.Empty Private isCrear As Boolean = False Private IsInstrumentoReporto As Boolean = False Private HabilitarCreacionTitulos As Boolean = False Private DicDatos As New Dictionary(Of String, String) Private CodigoAsociado As String = String.Empty Private EstadoReporto As String = "PRIMARIO" Private CodigoReporto As String = String.Empty Private IdFlujo As Integer = 0 Private IdECT As Integer = 0 Private CodigoInversionCMVTA As String = String.Empty Private TipoProcesoCMVTA As String = String.Empty Public TrasladarDatos As TrasladarDatosCMVTA Sub New() ' Esta llamada es exigida por el diseñador. InitializeComponent() ' Agregue cualquier inicialización después de la llamada a InitializeComponent(). Variables.TrasladarCMVTA = Nothing End Sub Sub New(TipoProcesoCMVTA As String, CodigoInversionCMVTA As String, TrasladarDatos As TrasladarDatosCMVTA) Me.New Me.TipoProcesoCMVTA = TipoProcesoCMVTA Me.CodigoInversionCMVTA = CodigoInversionCMVTA Me.TrasladarDatos = TrasladarDatos Variables.TrasladarCMVTA = Me.TrasladarDatos End Sub Sub ConfiguracionCMVTA() If Me.TipoProcesoCMVTA = "V" Then lblCodigoInversionCM.Visible = True txtCodigoInversionCM.Visible = True ActivarSuspen = True Modo = "NM" TipoTransaccion = "N" grbInversión.Visible = False LimpiarControles() DeshabilitarControles() HabilitarControlesCMVTA() ConfiguracionCamposCMVTA() PIN0BindingSource4.SuspendBinding() Navegador.Enabled = False TipoTransaccion = "N" End If End Sub Sub HabilitarControlesCMVTA() cboCalificacionDeRiesgo.Enabled = True End Sub Sub ConfiguracionCamposCMVTA() Dim Id As Integer = oDAOPropuestasDeInversion.IdRegistroInversion(Me.CodigoInversionCMVTA) oInversionCE = oInversionDAO.CargarRegistro(Id) cboTipoOperacion.SelectedValue = "V" cboOrigenDeFondos.SelectedValue = "NA" cboEstadoDocumento.SelectedValue = "A" cboAutorizacion.SelectedValue = "P" txtCodigoInversionCM.Text = oInversionCE.CodigoIversion txtNombre.Text = oInversionCE.NombreManual cboEmpresas.SelectedValue = oInversionCE.CodigoEmpresa cboEmisores.SelectedValue = oInversionCE.CodigoEmisor cboInstrumentosFinancieros.SelectedValue = oInversionCE.CodigoInstrumentoFinanciero cboCalificacionDeRiesgo.SelectedValue = oInversionCE.CodigoCalificacionDeRiesgo cboPeriodicidad.SelectedValue = oInversionCE.Periodicidad cboCalificadoraDeRiesgo.SelectedValue = oInversionCE.CodigoEmpresaCalificadora cboTipoMercado.SelectedValue = oInversionCE.TipoMercado cboPaises.SelectedValue = oInversionCE.Pais cboRenta.SelectedValue = oInversionCE.TipoRenta cboTasa.SelectedValue = oInversionCE.TipoTasa End Sub Sub New(DicDatos As Dictionary(Of String, String)) Me.New HabilitarCreacionTitulos = True EstadoReporto = "SECUNDARIO" Me.DicDatos = DicDatos If DicDatos.ContainsKey("CodigoAsociado") Then CodigoAsociado = DicDatos.Item("CodigoAsociado").ToString End If If DicDatos.ContainsKey("CodigoReporto") Then CodigoReporto = DicDatos.Item("CodigoReporto").ToString End If If DicDatos.ContainsKey("IdFlujo") Then IdFlujo = DicDatos.Item("IdFlujo").ToString End If If DicDatos.ContainsKey("IdECT") Then IdECT = DicDatos.Item("IdECT").ToString End If End Sub Private _PlazosFactor As String Function AgregarCheckbox(ByRef P_cboObjeto As ComboBox, ByRef P_flpObjeto As FlowLayoutPanel) Dim Datos As New Dictionary(Of String, String) Dim Col_Generica As New Collection Dim i As Integer = 0 While i < P_cboObjeto.Items.Count P_cboObjeto.SelectedIndex = i Dim Valor As String = P_cboObjeto.SelectedValue If P_cboObjeto.SelectedValue Is Nothing Then Return Col_Generica End If Dim Texto As String = P_cboObjeto.Text Datos.Add(Valor, Texto) i += 1 End While Dim Existe As Boolean = False For Each item As CheckBox In P_flpObjeto.Controls If item.Text.ToString = "Todos" Then Existe = True End If Next Dim O_ChequeTodos As New CheckBox O_ChequeTodos.Name = "Todos" + P_flpObjeto.Name.ToString O_ChequeTodos.Checked = True O_ChequeTodos.Width = 250 O_ChequeTodos.BackColor = ColorTranslator.FromHtml("#EAEAE8") O_ChequeTodos.Text = "Todos" O_ChequeTodos.Height = 20 O_ChequeTodos.Margin = New Padding(25, 5, 25, 5) Col_Generica.Add(O_ChequeTodos.Name) If Not Existe Then P_flpObjeto.Controls.Add(O_ChequeTodos) AddHandler O_ChequeTodos.Click, AddressOf evento AddHandler O_ChequeTodos.CheckedChanged, AddressOf Colorevento End If For Each RecorrerDatos In Datos Col_Generica.Add(RecorrerDatos.Key) Dim O_Check As New CheckBox Existe = False Dim Nombre = RecorrerDatos.Value For Each item As CheckBox In P_flpObjeto.Controls If item.Text.ToString = Nombre.ToString Then Existe = True End If Next If Not Existe Then O_Check.Name = RecorrerDatos.Key O_Check.Checked = True O_Check.Width = 250 O_Check.BackColor = ColorTranslator.FromHtml("#EAEAE8") O_Check.Text = Nombre O_Check.Height = 20 O_Check.Margin = New Padding(25, 5, 25, 5) P_flpObjeto.Controls.Add(O_Check) AddHandler O_Check.Click, AddressOf evento AddHandler O_Check.CheckedChanged, AddressOf Colorevento End If Existe = False Next Return Col_Generica End Function Sub eventoCargar() For Each Item In pnlMenu.Controls If TypeOf Item Is Panel Then If Item.backcolor = Color.White Then For Each Items In Item.controls Items.backcolor = Color.WhiteSmoke Next Item.backcolor = Color.WhiteSmoke End If End If Next pnlContenedor.Visible = False CargarTabla() End Sub Sub eventoCancelar() For Each Item In pnlMenu.Controls If TypeOf Item Is Panel Then If Item.backcolor = Color.White Then For Each Items In Item.controls Items.backcolor = Color.WhiteSmoke Next Item.backcolor = Color.WhiteSmoke End If End If Next pnlContenedor.Visible = False End Sub Sub evento(sender As Object, e As EventArgs) Dim P_flpObjeto As New FlowLayoutPanel P_flpObjeto = sender.parent If sender.Name.ToString.IndexOf("Todos") > -1 Then CambioCheckTodos(P_flpObjeto, sender) Else TodosCheck(P_flpObjeto, sender, e) End If End Sub Sub Colorevento(sender As Object, e As EventArgs) If (sender.checked) Then sender.BackColor = ColorTranslator.FromHtml("#EAEAE8") Else sender.BackColor = ColorTranslator.FromHtml("Transparent") End If ActualizarColecciones(sender) End Sub Sub ActualizarColecciones(sender As Object) Dim Flpnombre As String = sender.parent.name If TypeOf sender.parent Is FlowLayoutPanel Then Dim FlpObjeto As New FlowLayoutPanel FlpObjeto = sender.parent If Flpnombre = "flpEmpresas" Then Col_Empresas.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Empresas.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpEmisor" Then Col_Emisor.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Emisor.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpEstadoDocumento" Then Col_EstDocumento.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_EstDocumento.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpInstrumentos" Then Col_Instrumento.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Instrumento.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpCalificacionRiesgo" Then Col_CalRiesgo.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_CalRiesgo.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpTipoOperacion" Then Col_TipOperacion.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_TipOperacion.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpOrigenFondos" Then Col_OriFond.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_OriFond.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpCalificadoraRiesgo" Then Col_CalERiesgo.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_CalERiesgo.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpAutorizacion" Then Col_Aut.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Aut.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpPlazo" Then Col_Plazo.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Plazo.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpPais" Then Col_Pais.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_Pais.Add(Nombre.name) End If End If Next ElseIf Flpnombre = "flpTipoMercado" Then Col_TipMercado.Clear() For Each Nombre In FlpObjeto.Controls If TypeOf Nombre Is CheckBox Then If Nombre.checked Then Col_TipMercado.Add(Nombre.name) End If End If Next End If End If End Sub Sub CambioCheckTodos(ByRef P_flpObjeto As FlowLayoutPanel, ByVal sender As Object) Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1 Dim PrimerCheck As Boolean = True For Each xCheckBox In P_flpObjeto.Controls If TypeOf xCheckBox Is CheckBox Then Dim yCheckBox As New CheckBox yCheckBox = xCheckBox If xCheckBox.TabIndex = 0 Then If Not yCheckBox.Checked Then PrimerCheck = False End If End If End If Next If PrimerCheck Then For Each xCheckBox In P_flpObjeto.Controls If TypeOf xCheckBox Is CheckBox Then Dim yCheckBox As New CheckBox yCheckBox = xCheckBox yCheckBox.Checked = True End If Next ElseIf Not PrimerCheck Then For Each xCheckBox In P_flpObjeto.Controls If TypeOf xCheckBox Is CheckBox Then Dim yCheckBox As New CheckBox yCheckBox = xCheckBox yCheckBox.Checked = False End If Next End If End Sub Sub TodosCheck(ByRef P_flpObjeto As FlowLayoutPanel, sender As Object, e As EventArgs) Dim ChequeTodos As Boolean = True If Not sender.Name.ToString.IndexOf("Todos") > -1 Then For Each xCheckBox In P_flpObjeto.Controls If Not xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then If Not xCheckBox.checked Then ChequeTodos = False End If End If Next End If For Each xCheckBox In P_flpObjeto.Controls If xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then xCheckBox.checked = ChequeTodos End If Next End Sub Private Sub frmPIN_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario. TipoTransaccion = "N" txtCodigoInversion.Text = String.Empty frmProgreso.PgbProgreso.Value = 1 CargarEstadosDocumento() frmProgreso.PgbProgreso.Value = 5 CargarEstadosAutorizacion() frmProgreso.PgbProgreso.Value = 10 CargarEmpresas() frmProgreso.PgbProgreso.Value = 15 CargarInstrumentosFinancieros() frmProgreso.PgbProgreso.Value = 20 CargarEmisores() frmProgreso.PgbProgreso.Value = 25 Call CargarCalificacionDeRiesgo() frmProgreso.PgbProgreso.Value = 30 Call CargarCalificadoraDeRiesgo() frmProgreso.PgbProgreso.Value = 35 Call CargarOrigenDeFondos() frmProgreso.PgbProgreso.Value = 40 Call CargarTipoOperacion() frmProgreso.PgbProgreso.Value = 45 Call CargarPaises() frmProgreso.PgbProgreso.Value = 50 Call CargarTiposMercado() frmProgreso.PgbProgreso.Value = 55 Call CargarTipoRenta() frmProgreso.PgbProgreso.Value = 60 Call CargarTipoTasa() frmProgreso.PgbProgreso.Value = 65 Call CargarPlazos() frmProgreso.PgbProgreso.Value = 70 Call CargarPeriodicidades() frmProgreso.PgbProgreso.Value = 75 HabilitarBusqueda() ControlCambio() frmProgreso.PgbProgreso.Value = 85 ConfiguracionInicial() frmProgreso.PgbProgreso.Value = 90 PIN0BindingSource4.SuspendBinding() Nuevo() BindingNavigatorPositionItem.Enabled = False frmProgreso.PgbProgreso.Value = 95 HabilitarControles() frmProgreso.PgbProgreso.Value = 100 frmProgreso.Visible = False AdaptarTituloNuevoRepo() ConfiguracionCMVTA() TipoTransaccion = "N" End Sub Sub AdaptarTituloNuevoRepo() If HabilitarCreacionTitulos Then TipoTransaccion = "N" Dim NombreInstrumento As String = String.Empty Dim NombreEmpresa As String = String.Empty Dim SaldoAplicadoTitulo As Double = 0 If DicDatos.ContainsKey("NombreInstrumento") Then NombreInstrumento = DicDatos.Item("NombreInstrumento").ToString End If If DicDatos.ContainsKey("NombreEmpresa") Then NombreEmpresa = DicDatos.Item("NombreEmpresa").ToString End If If DicDatos.ContainsKey("SaldoAplicadoTitulo") Then SaldoAplicadoTitulo = Operaciones.ConvertirDecimal(DicDatos.Item("SaldoAplicadoTitulo").ToString) End If Navegador.Enabled = False cboEmpresas.Enabled = False cboInstrumentosFinancieros.Enabled = False cboOrigenDeFondos.Enabled = False cboTipoOperacion.SelectedValue = "C" cboOrigenDeFondos.SelectedValue = "REPOVENTA" cboEmpresas.SelectedValue = NombreEmpresa cboInstrumentosFinancieros.SelectedValue = NombreInstrumento End If End Sub Sub Nuevo() Modo = "NM" Operaciones.TipoOperacion = "N" grbInversión.Visible = False Refrescar() PreNuevoModificar() ModoPropuesta() LimpiarControles() NuevaPropuesta() End Sub Private Sub UsuarioPrivilegio(ByVal TipoTransaccion As String, sender As Object) Dim UsuarioPri As Boolean = sender.checked If (TipoTransaccion = "A" Or TipoTransaccion = "B") And UsuarioPri Then Dim codigo As String = txtCodigoInversion.Text Dim Comprobar As New DAOGeneral Dim Estado As String = Comprobar.EstadoAutorizacionPro(codigo) Dim Existe As Boolean = ExisteInstrumentoReal("INV0") If Existe Then grbInversión.Visible = False MsgBox("La Inversion ya existe") sender.checked = False Else If Estado = "A" Then grbInversión.Visible = True Else grbInversión.Visible = False sender.checked = False End If End If Else sender.checked = False grbInversión.Visible = False End If End Sub Private Sub CargarEstadosDocumento() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboEstadoDocumento.DataSource = oDAOPropuestasDeInversion.ListaEstadoDocumento.Tables("EstadosDocumento") Me.cboEstadoDocumento.DisplayMember = "Descripcion" Me.cboEstadoDocumento.ValueMember = "Codigo" Col_EstDocumento = AgregarCheckbox(cboEstadoDocumento, flpEstadoDocumento) Me.cboEstadoDocumento.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarEstadosAutorizacion() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboAutorizacion.DataSource = oDAOGeneral.ListaEstadoAutorizacion Me.cboAutorizacion.DisplayMember = "Descripcion" Me.cboAutorizacion.ValueMember = "Codigo" Col_Aut = AgregarCheckbox(cboAutorizacion, flpAutorizacion) Me.cboAutorizacion.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarEmpresas() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboEmpresas.DataSource = oDAOGeneral.ListaEmpresas Me.cboEmpresas.DisplayMember = "Descripcion" Me.cboEmpresas.ValueMember = "Codigo" Col_Empresas = AgregarCheckbox(cboEmpresas, flpEmpresas) Me.cboEmpresas.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarInstrumentosFinancieros() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboInstrumentosFinancieros.DataSource = oDAOGeneral.ListaInstrumentos("Propuesta") Me.cboInstrumentosFinancieros.DisplayMember = "Descripcion" Me.cboInstrumentosFinancieros.ValueMember = "Codigo" AgregarCheckbox(cboInstrumentosFinancieros, flpInstrumentos) Me.cboInstrumentosFinancieros.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarEmisores() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboEmisores.DataSource = oDAOGeneral.ListaEmisores Me.cboEmisores.DisplayMember = "Descripcion" Me.cboEmisores.ValueMember = "Codigo" Col_Emisor = AgregarCheckbox(cboEmisores, flpEmisor) Me.cboEmisores.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarCalificacionDeRiesgo() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboCalificacionDeRiesgo.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo Me.cboCalificacionDeRiesgo.DisplayMember = "Descripcion" Me.cboCalificacionDeRiesgo.ValueMember = "Codigo" Col_CalRiesgo = AgregarCheckbox(cboCalificacionDeRiesgo, flpCalificacionRiesgo) Me.cboCalificacionDeRiesgo.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarCalificadoraDeRiesgo() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboCalificadoraDeRiesgo.DataSource = oDAOGeneral.ListaEmpresasCalificadoras Me.cboCalificadoraDeRiesgo.DisplayMember = "Descripcion" Me.cboCalificadoraDeRiesgo.ValueMember = "Codigo" Col_CalERiesgo = AgregarCheckbox(cboCalificadoraDeRiesgo, flpCalificadoraRiesgo) Me.cboCalificadoraDeRiesgo.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarOrigenDeFondos() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos Me.cboOrigenDeFondos.DisplayMember = "Descripcion" Me.cboOrigenDeFondos.ValueMember = "Codigo" Col_OriFond = AgregarCheckbox(cboOrigenDeFondos, flpOrigenFondos) Me.cboOrigenDeFondos.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarPlazos() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboPlazosFactor.DataSource = oDAOGeneral.ListaPlazosFactor Me.cboPlazosFactor.DisplayMember = "Descripcion" Me.cboPlazosFactor.ValueMember = "Codigo" Col_Plazo = AgregarCheckbox(cboPlazosFactor, flpPlazo) Me.cboPlazosFactor.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarTipoOperacion() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion Me.cboTipoOperacion.DisplayMember = "Descripcion" Me.cboTipoOperacion.ValueMember = "Codigo" Col_TipOperacion = AgregarCheckbox(cboTipoOperacion, flpTipoOperacion) Me.cboTipoOperacion.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarPaises() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion Me.cboPaises.DisplayMember = "Descripcion" Me.cboPaises.ValueMember = "Codigo" Col_Pais = AgregarCheckbox(cboPaises, flpPais) Me.cboPaises.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub CargarTiposMercado() Dim vTipoTransaccion As String = TipoTransaccion TipoTransaccion = "X" Me.cboTipoMercado.DataSource = oDAOGeneral.ListaTiposMercado Me.cboTipoMercado.DisplayMember = "Descripcion" Me.cboTipoMercado.ValueMember = "Codigo" Col_TipMercado = AgregarCheckbox(cboTipoMercado, flpTipoMercado) Me.cboTipoMercado.SelectedIndex = -1 TipoTransaccion = vTipoTransaccion End Sub Private Sub NuevaPropuesta() If oPropuestaInversionCE Is Nothing Then oPropuestaInversionCE = New CEPropuestaInversion End If LimpiarControles() Me.cboEstadoDocumento.SelectedValue = "A" Me.cboAutorizacion.SelectedValue = "P" Me.cboTipoOperacion.SelectedValue = "C" Me.cboOrigenDeFondos.SelectedValue = "D" Me.btnAccion.Text = "Guardar" Me.txtCodigoInversion.ReadOnly = True End Sub Private Function GuardarPropuesta() Dim ValidacionCorrecta As Boolean = ValoresValidos() Dim Guardado As Boolean = False Dim Estado As String = "Correcto" If ValidacionCorrecta Then If TieneDetalleInstrumento Then ResultadoMsgBox = DialogResult.Yes Else ResultadoMsgBox = MessageBox.Show("No se ha ingresado detalles del Instrumento." & vbCrLf & "Desea continuar sin detalles?", "Sin Detalles", MessageBoxButtons.YesNo) End If If ValidacionCorrecta Then If ResultadoMsgBox = DialogResult.Yes Then If EstadoReporto = "PRIMARIO" Then Guardado = oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, TipoProcesoCMVTA, CodigoInversionCMVTA) ElseIf EstadoReporto = "SECUNDARIO" Then Guardado = oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, CodigoAsociado, EstadoReporto, CodigoReporto, IdFlujo, IdECT) Else Estado = "Error" End If Else Estado = "Omitir" End If End If Else Estado = "ValidacionIncorrecta" End If Return Estado End Function Private Sub ActualizarPropuesta(ByVal parametro As String) Dim retorno As Integer RefrescarValoresControles() retorno = oDAOPropuestasDeInversion.Actualizar(oPropuestaInversionCE, parametro, EstadoReporto) If retorno = 0 Then MsgBox("Registro Actualizado", MsgBoxStyle.Information) CargarPropuesta(IdPIN) End If End Sub Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresas.SelectedIndexChanged ControlEmpresa() End Sub Private Sub txtAsunto_TextChanged(sender As Object, e As EventArgs) Handles txtAsunto.TextChanged End Sub Private Sub txtAsunto_LostFocus(sender As Object, e As EventArgs) Handles txtAsunto.LostFocus ControlAsunto() End Sub Private Sub cboInstrumentosFinancieros_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboInstrumentosFinancieros.SelectedIndexChanged ControlInstrumento() TieneDetalleInstrumento = False End Sub Private Sub txtMontoInversion_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub txtMontoInversion_LostFocus(sender As Object, e As EventArgs) End Sub Private Sub txtPrecio_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub txtPrecio_LostFocus(sender As Object, e As EventArgs) End Sub Private Sub txtRendimiento_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub txtRendimiento_LostFocus(sender As Object, e As EventArgs) End Sub Private Sub cboPlazos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPlazosFactor.SelectedIndexChanged ControlPlazoFactor() ControlPlazoFact() End Sub Private Sub txtPlazoNumero_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub txtPlazoNumero_LostFocus(sender As Object, e As EventArgs) End Sub Private Sub txtIngresos_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub cboOrigenDeFodos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOrigenDeFondos.SelectedIndexChanged ControlOrigenDeFondos() ControlOFon() End Sub Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmisores.SelectedIndexChanged ControlEmisores() End Sub Private Sub cboCalificacionDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificacionDeRiesgo.SelectedIndexChanged ControlCalificacionesDeRiesgo() End Sub Private Sub cboCalificadoraDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificadoraDeRiesgo.SelectedIndexChanged ControlCalificadoraDeRiesgo() End Sub Private Sub txtJustificacion_TextChanged(sender As Object, e As EventArgs) Handles txtJustificacion.TextChanged End Sub Private Sub txtJustificacion_LostFocus(sender As Object, e As EventArgs) Handles txtJustificacion.LostFocus ControlJustificacion() End Sub Private Sub txtComentarios_TextChanged(sender As Object, e As EventArgs) Handles txtComentarios.TextChanged End Sub Private Sub txtComentarios_LostFocus(sender As Object, e As EventArgs) Handles txtComentarios.LostFocus ControlComentarios() End Sub Private Sub cboEstadoDocumento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoDocumento.SelectedIndexChanged ControlEstadoDocumento() End Sub Private Sub dtpFechaDocumento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaDocumento.ValueChanged ControlFechaDocumento() End Sub Private Sub txtIngresos_LostFocus(sender As Object, e As EventArgs) End Sub Private Sub PrepararBusqueda() TipoTransaccion = "B" oPropuestaInversionCE = Nothing oPropuestaInversionCE = New CEPropuestaInversion LimpiarControles() End Sub Private Sub CargarPropuesta(Id As Integer) oPropuestaInversionCE = Nothing oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id) IdPIN = Id Dim vCodigoEmpresa As String = oPropuestaInversionCE.CodigoEmpresa.ToString If vCodigoEmpresa.Length = 0 Then Me.cboEmpresas.SelectedIndex = -1 Else Me.cboEmpresas.SelectedValue = vCodigoEmpresa End If Me.txtAsunto.Text = oPropuestaInversionCE.Asunto.ToString Dim vCodigoInstrumentoFinanciero As String = oPropuestaInversionCE.CodigoInstrumentoFinanciero.ToString If vCodigoInstrumentoFinanciero.Length = 0 Then Me.cboInstrumentosFinancieros.SelectedIndex = -1 Else Me.cboInstrumentosFinancieros.SelectedValue = vCodigoInstrumentoFinanciero.ToString End If Dim vPlazoFactor As String = oPropuestaInversionCE.PlazoFactor.ToString If vPlazoFactor.Length = 0 Then Me.cboPlazosFactor.SelectedIndex = -1 Else Me.cboPlazosFactor.SelectedValue = vPlazoFactor.ToString End If Dim vOrigenDeFondos As String = oPropuestaInversionCE.OrigenDeFondos.ToString If vOrigenDeFondos.Length = 0 Then Me.cboOrigenDeFondos.SelectedIndex = -1 Else Me.cboOrigenDeFondos.SelectedValue = vOrigenDeFondos.ToString End If Dim vCodigoEmisor As String = oPropuestaInversionCE.CodigoEmisor.ToString If vCodigoEmisor = 0 Then Me.cboEmisores.SelectedIndex = -1 Else Me.cboEmisores.SelectedValue = vCodigoEmisor.ToString End If Dim vCodigoCalificacionDeRiesgo As String = oPropuestaInversionCE.CodigoCalificacionDeRiesgo.ToString If vCodigoCalificacionDeRiesgo.Length = 0 Then Me.cboCalificacionDeRiesgo.SelectedIndex = -1 Else Me.cboCalificacionDeRiesgo.SelectedValue = vCodigoCalificacionDeRiesgo.ToString End If Dim vCodigoEmpresaCalificadora As String = oPropuestaInversionCE.CodigoEmpresaCalificadora.ToString If vCodigoEmpresaCalificadora.Length = 0 Then Me.cboCalificadoraDeRiesgo.SelectedIndex = -1 Else Me.cboCalificadoraDeRiesgo.SelectedValue = vCodigoEmpresaCalificadora.ToString End If Me.txtJustificacion.Text = oPropuestaInversionCE.Justificacion.ToString Me.txtComentarios.Text = oPropuestaInversionCE.Comentarios.ToString Me.txtCodigoInversion.Text = oPropuestaInversionCE.CodigoInversion.ToString Me.txtCodigoInversion.ReadOnly = True Dim vEstadoDocumento As String = oPropuestaInversionCE.EstadoDocumento.ToString If vEstadoDocumento.Length = 0 Then Me.cboEstadoDocumento.SelectedIndex = -1 Else Me.cboEstadoDocumento.SelectedValue = vEstadoDocumento.ToString End If Dim vFechaDocumento As Date = Date.Today.Date If Not Date.TryParse(oPropuestaInversionCE.FechaDocumento.ToString, vFechaDocumento.ToString) Then vFechaDocumento = Date.Today.Date End If Me.dtpFechaDocumento.Value = vFechaDocumento.ToString Dim vTipoOperacion As String = oPropuestaInversionCE.TipoOperacion.ToString If String.IsNullOrEmpty(vTipoOperacion) Then Me.cboTipoOperacion.SelectedIndex = -1 Else Me.cboTipoOperacion.SelectedValue = vTipoOperacion.ToString End If Dim vEstadoAut As String = oPropuestaInversionCE.EstadoAutorizacion.ToString If vEstadoAut.Length = 0 Then Me.cboAutorizacion.SelectedIndex = 0 Else Me.cboAutorizacion.SelectedValue = vEstadoAut.ToString End If Dim vTipoMercado As String = oPropuestaInversionCE.TipoMercado.ToString If String.IsNullOrEmpty(vTipoMercado) Then cboTipoMercado.SelectedIndex = -1 Else Me.cboTipoMercado.SelectedValue = vTipoMercado.ToString End If Dim vPais As String = oPropuestaInversionCE.Pais.ToString If String.IsNullOrEmpty(vPais) Then cboPaises.SelectedIndex = -1 Else cboPaises.SelectedValue = vPais End If Dim vTipoRenta As String = oPropuestaInversionCE.TipoRenta.ToString If String.IsNullOrEmpty(vTipoRenta) Then cboRenta.SelectedIndex = -1 Else cboRenta.SelectedValue = vTipoRenta End If Dim vTipoTasa As String = oPropuestaInversionCE.TipoTasa.ToString If String.IsNullOrEmpty(vTipoTasa) Then cboTasa.SelectedIndex = -1 Else cboTasa.SelectedValue = vTipoTasa End If Dim vPeriodicidad As String = oPropuestaInversionCE.Periodicidad.ToString If String.IsNullOrEmpty(vPeriodicidad) Then cboPeriodicidad.SelectedIndex = -1 Else cboPeriodicidad.SelectedValue = vPeriodicidad End If Dim vNombre As String = oPropuestaInversionCE.NombreManual.ToString txtNombre.Text = vNombre TipoTransaccion = "C" IdPIN = Id IdIF = vCodigoInstrumentoFinanciero Me.btnAccion.Text = "Aceptar" End Sub 'NAVEGACION '***FIN NAVEGACION Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click If TipoTransaccion = "N" Then Dim CrearInstrumento As String = String.Empty If Not TrasladarDatos Is Nothing Then If TrasladarDatos.AgregarCMVTA Then CrearInstrumento = "Correcto" Else CrearInstrumento = GuardarPropuesta() End If Else CrearInstrumento = GuardarPropuesta() End If If CrearInstrumento = "Correcto" Then GuardarFamilia(txtCodigoInversion.Text) txtCodigoInversion.ReadOnly = True Refrescar() LimpiarControles() Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) If BindingNavigatorPositionItem.Enabled Then BindingNavigatorPositionItem.Enabled = False End If Nuevo() ElseIf CrearInstrumento = "Omitir" Then MsgBox("No se creo los detalles del instrumento") If BindingNavigatorPositionItem.Enabled Then BindingNavigatorPositionItem.Enabled = False End If ElseIf CrearInstrumento = "Error" Then MsgBox("Error al crear instrumento") If BindingNavigatorPositionItem.Enabled Then BindingNavigatorPositionItem.Enabled = False End If End If ElseIf TipoTransaccion = "A" Then Dim posicion = PIN0BindingSource4.Position ActualizarPropuesta(txtCodigoInversion.Text) Refrescar() If Not LlamadaDesdeBusqueda Then Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) PIN0BindingSource4.Position = posicion End If ControlCambio() End If End Sub Sub GuardarFamilia(ByVal Instrumento As String) If Not TrasladarDatos Is Nothing Then If TrasladarDatos.AgregarCMVTA Then Dim ValidacionCorrecta As Boolean = ValoresValidos() If ValidacionCorrecta Then Dim CodigoCompra As String = txtCodigoInversionCM.Text Dim CodigoVenta As String = txtCodigoInversion.Text Dim NombreTabla As String = String.Empty Dim Coleccion As New Collection If Instrumento.IndexOf("OPC") > -1 Then NombreTabla = "OPC0" Coleccion = Variables.ColeccionFUTU ElseIf Instrumento.IndexOf("FUTU") > -1 Then NombreTabla = "FUT0" Coleccion = Variables.ColeccionFUTU ElseIf Instrumento.IndexOf("ACC") > -1 Then NombreTabla = "ACC0" Coleccion = Variables.ColeccionACC ElseIf Instrumento.IndexOf("CINV") > -1 Then NombreTabla = "CIN0" Coleccion = Variables.ColeccionCINV ElseIf Instrumento.IndexOf("BONO") > -1 Then NombreTabla = "BON0" Coleccion = Variables.ColeccionCINV ElseIf Instrumento.IndexOf("EURB") > -1 Then NombreTabla = "EURB0" Coleccion = Variables.ColeccionCINV ElseIf Instrumento.IndexOf("TIT") > -1 Then NombreTabla = "TIT" Coleccion = Variables.ColeccionCINV Else MsgBox("Error al crear Titulo") NombreTabla = "Error" End If If Not Coleccion Is Nothing Then If Coleccion.Count > 0 Then oDAOGeneral.GenerarCMVTA(CodigoCompra, CodigoVenta, NombreTabla, Coleccion, oPropuestaInversionCE) Else MsgBox("Error al crear Titulo") End If Else MsgBox("Error al crear Titulo") End If Else MsgBox("Error al crear Titulo") End If End If Else If Instrumento.IndexOf("LETE") > -1 Then Dim oDAOLetes As New LETESDAO Dim ColeccionLETE As Collection = Variables.ColeccionLETE If ColeccionLETE.Count > 0 Then oDAOLetes.NuevoIngreso(ColeccionLETE, "LETE") ColeccionLETE.Clear() End If End If If Instrumento.IndexOf("PBUR") > -1 Then Dim oDAOLetes As New LETESDAO Dim ColeccionLETE As Collection = Variables.ColeccionLETE If ColeccionLETE.Count > 0 Then oDAOLetes.NuevoIngreso(ColeccionLETE, "PBUR") ColeccionLETE.Clear() End If End If If Instrumento.IndexOf("VCN") > -1 Then Dim oDAOLetes As New LETESDAO Dim ColeccionLETE As Collection = Variables.ColeccionLETE If ColeccionLETE.Count > 0 Then oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN") ColeccionLETE.Clear() End If End If If Instrumento.IndexOf("CETE") > -1 Then Dim oDAOLetes As New LETESDAO Dim ColeccionLETE As Collection = Variables.ColeccionLETE If ColeccionLETE.Count > 0 Then oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE") ColeccionLETE.Clear() End If End If If Instrumento.IndexOf("ACC") > -1 Then Dim oDAOACC As New AccionesDAO Dim ColeccionACC As Collection = Variables.ColeccionACC If ColeccionACC.Count > 0 Then oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC) ColeccionACC.Clear() FormAcciones.Dispose() End If End If If Instrumento.IndexOf("CINV") > -1 Then Dim oDAOCINV As New CertificadosDeInversionDAO Dim ColeccionCINV As Collection = Variables.ColeccionCINV If ColeccionCINV.Count > 0 Then oDAOCINV.Nuevo(ColeccionCINV, "CINV") ColeccionCINV.Clear() End If End If If Instrumento.IndexOf("BONO") > -1 Then Dim oDAOCINV As New CertificadosDeInversionDAO Dim ColeccionCINV As Collection = Variables.ColeccionCINV If ColeccionCINV.Count > 0 Then oDAOCINV.Nuevo(ColeccionCINV, "BONO") ColeccionCINV.Clear() End If End If If Instrumento.IndexOf("EURB0") > -1 Then Dim oDAOCINV As New CertificadosDeInversionDAO Dim ColeccionCINV As Collection = Variables.ColeccionCINV If ColeccionCINV.Count > 0 Then oDAOCINV.Nuevo(ColeccionCINV, "EURB") ColeccionCINV.Clear() End If End If If Instrumento.IndexOf("TIT") > -1 Then Dim oDAOCINV As New CertificadosDeInversionDAO Dim ColeccionCINV As Collection = Variables.ColeccionCINV If ColeccionCINV.Count > 0 Then oDAOCINV.Nuevo(ColeccionCINV, "TIT") ColeccionCINV.Clear() End If End If If Instrumento.IndexOf("DAP") > -1 Then Dim oDAODAP As New DepositosAPlazoDAO Dim ColeccionDAP As Collection = Variables.ColeccionDAP Dim diccionario = Variables.ColeccionDAPDi If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo) ColeccionDAP.Clear() diccionario = Nothing End If End If If Instrumento.IndexOf("NEST") > -1 Then Dim oDAONEST As New DAONotaEstructurada Dim ColeccionDAP As Collection = Variables.ColeccionNEST Dim diccionario = Variables.ColeccionNESTDi If ColeccionNEST.Count > 0 And Not diccionario Is Nothing Then oDAONEST.NuevoDato(ColeccionNEST, diccionario, Variables.Codigo) ColeccionNEST.Clear() diccionario = Nothing End If End If If Instrumento.IndexOf("FINV") > -1 Then Dim oDAOFINV As New FondoInversionDAO Dim ColeccionFINV As Collection = Variables.ColeccionFINV Dim diccionario = Variables.ColeccionFINVDi If ColeccionFINV.Count > 0 And Not diccionario Is Nothing Then oDAOFINV.ProcesoDatos(ColeccionFINV, Variables.Codigo, diccionario, "Nuevo") ColeccionFINV.Clear() diccionario = Nothing End If End If If Instrumento.IndexOf("FUTU") > -1 Then Dim oDAOFUTU As New FuturosDAO Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU If ColeccionFUTU.Count > 0 Then oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU) ColeccionFUTU.Clear() End If End If If Instrumento.IndexOf("OPC") > -1 Then Dim oDAOOPC As New FuturosDAO Dim ColeccionOPC As Collection = Variables.ColeccionFUTU If ColeccionOPC.Count > 0 Then oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC) ColeccionOPC.Clear() End If End If If Instrumento.IndexOf("PEMP") > -1 Then Dim oDAOPEMP As New PrestamoEmpresarialDAO Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP Dim diccionario = Variables.ColeccionPEMPDi If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo") ColeccionPEMP.Clear() diccionario = Nothing End If End If If Instrumento.IndexOf("PPER") > -1 Then Dim oDAOPPER As New PrestamoPersonalDAO Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE Dim diccionario = Variables.ColeccionPPERAMORTDi If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo") ColeccionPPERDEUDOR.Clear() ColeccionPPERDETALLE.Clear() diccionario = Nothing End If End If If Instrumento.IndexOf("REPOVENTA") > -1 Then Dim oDAOREPO As New ReportosDAO Dim diccionario = Variables.ColeccionREPO If Not diccionario Is Nothing Then oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA") diccionario = Nothing End If ElseIf Instrumento.IndexOf("REPO") > -1 And Not Instrumento.IndexOf("REPOVENTA") > -1 Then Dim oDAOREPO As New ReportosDAO Dim diccionario = Variables.ColeccionREPO If Not diccionario Is Nothing Then oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0") diccionario = Nothing End If End If End If End Sub Function GuardarColecciones() Dim DiccionarioColecciones As New Dictionary(Of String, Collection) DiccionarioColecciones.Add("Empresa", Col_Empresas) DiccionarioColecciones.Add("Emisor", Col_Emisor) DiccionarioColecciones.Add("EstDocumento", Col_EstDocumento) DiccionarioColecciones.Add("Instrumento", Col_Instrumento) DiccionarioColecciones.Add("CalRiesgo", Col_CalRiesgo) DiccionarioColecciones.Add("TipOperacion", Col_TipOperacion) DiccionarioColecciones.Add("OriFond", Col_OriFond) DiccionarioColecciones.Add("CalERiesgo", Col_CalERiesgo) DiccionarioColecciones.Add("Aut", Col_Aut) DiccionarioColecciones.Add("Plazo", Col_Plazo) DiccionarioColecciones.Add("Pais", Col_Pais) DiccionarioColecciones.Add("TipMercado", Col_TipMercado) Return DiccionarioColecciones End Function Private Sub LanzarBusqueda() Dim DiccionarioColecciones As New Dictionary(Of String, Collection) DiccionarioColecciones = GuardarColecciones() frmBuscarDeLista.dgvBuscarDeLista.DataSource = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado") If frmBuscarDeLista.ShowDialog = DialogResult.OK Then If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then CargarPropuesta(frmBuscarDeLista.CodigoPrincipal) End If End If End Sub Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs) End Sub Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs) End Sub Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs) End Sub Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs) End Sub Private Sub navNuevoRegistro_Click(sender As Object, e As EventArgs) NuevaPropuesta() End Sub Private Sub navEliminarRegistro_Click(sender As Object, e As EventArgs) End Sub Private Sub navBuscar_Click(sender As Object, e As EventArgs) PrepararBusqueda() End Sub Private Sub cboEmpresas_LostFocus(sender As Object, e As EventArgs) Handles cboEmpresas.LostFocus End Sub Sub GenerarCodigoDeInversion() Dim vEmpresa As String Dim vCodigoIF As String Dim oCodigo As String vEmpresa = oPropuestaInversionCE.CodigoEmpresa vCodigoIF = oPropuestaInversionCE.CodigoInstrumentoFinanciero oCodigo = SeriesDAO.SiguienteCodigoInversion(vEmpresa, vCodigoIF) Me.txtCodigoInversion.Text = oCodigo End Sub Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged LimpiarVariablesTraspaso() ControlCodigoInversion() ControlCambio() Variables.CodigoComparativo = String.Empty End Sub Sub ControlCambio() Dim EstadoAut As String = cboAutorizacion.SelectedValue Dim Codigo As String = txtCodigoInversion.Text If Not String.IsNullOrEmpty(Codigo) Or TipoTransaccion = "N" Then If TipoTransaccion = "N" Then pnlCambiarRev.Visible = False pnlCambiarRec.Visible = False pnlCambiarApro.Visible = False Else If Not TipoTransaccion = "A" Then If EstadoAut = "P" Then pnlCambiarRev.Visible = True pnlCambiarRec.Visible = True pnlCambiarApro.Visible = False ElseIf EstadoAut = "V" Then pnlCambiarRev.Visible = False pnlCambiarRec.Visible = True pnlCambiarApro.Visible = True ElseIf EstadoAut = "A" Or EstadoAut = "R" Then pnlCambiarRev.Visible = False pnlCambiarRec.Visible = False pnlCambiarApro.Visible = False TipoTransaccion = "B" End If End If End If End If EstadoControladoresNAV() End Sub Private Sub ControlEmpresa() If TipoTransaccion = "N" Then oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue GenerarCodigoDeInversion() End If If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue End If End Sub Private Sub ControlAsunto() oPropuestaInversionCE.Asunto = Me.txtAsunto.Text End Sub Private Sub ControlInstrumento() If TipoTransaccion = "N" Then oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue GenerarCodigoDeInversion() End If If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue End If End Sub Private Sub ControlPlazoFactor() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue End If End Sub Private Sub ControlOrigenDeFondos() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.OrigenDeFondos = Me.cboOrigenDeFondos.SelectedValue End If End Sub Private Sub ControlEmisores() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue End If End Sub Private Sub ControlCalificacionesDeRiesgo() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificacionDeRiesgo.SelectedValue End If End Sub Private Sub ControlCalificadoraDeRiesgo() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.CodigoEmpresaCalificadora = Me.cboCalificadoraDeRiesgo.SelectedValue End If End Sub Private Sub ControlTipoMercado() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then If Me.cboTipoMercado.SelectedIndex = -1 Then oPropuestaInversionCE.TipoMercado = "" Else oPropuestaInversionCE.TipoMercado = Me.cboTipoMercado.SelectedValue End If End If End Sub Private Sub ControlPais() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then If Me.cboPaises.SelectedIndex = -1 Then oPropuestaInversionCE.Pais = "" Else oPropuestaInversionCE.Pais = Me.cboPaises.SelectedValue End If End If End Sub Private Sub ControlPlazoFact() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue End If End Sub Private Sub ControlJustificacion() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.Justificacion = Me.txtJustificacion.Text End If End Sub Private Sub ControlOFon() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then If cboOrigenDeFondos.SelectedIndex = -1 Then oPropuestaInversionCE.OrigenDeFondos = "" Else oPropuestaInversionCE.OrigenDeFondos = cboOrigenDeFondos.SelectedValue End If End If End Sub Private Sub ControlTipOper() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then If cboTipoOperacion.SelectedIndex = -1 Then oPropuestaInversionCE.TipoOperacion = "" Else oPropuestaInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue End If End If End Sub Private Sub ControlComentarios() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.Comentarios = Me.txtComentarios.Text End If End Sub Private Sub ControlCodigoInversion() If TipoTransaccion = "N" Or TipoTransaccion = "B" Then oPropuestaInversionCE.CodigoInversion = txtCodigoInversion.Text End If End Sub Private Sub ControlEstadoDocumento() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.EstadoDocumento = Me.cboEstadoDocumento.SelectedValue End If End Sub Private Sub ControlEstadoAutorizacion() If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then oPropuestaInversionCE.EstadoAutorizacion = Me.cboAutorizacion.SelectedValue End If End Sub Private Sub ControlFechaDocumento() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.FechaDocumento = Me.dtpFechaDocumento.Value.Date End If End Sub Private Sub ControlTipoOperacion() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.TipoOperacion = Me.cboTipoOperacion.SelectedValue End If End Sub Private Sub ControlNombre() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.NombreManual = txtNombre.Text End If End Sub Private Sub ControlTipoRenta() If TipoTransaccion = "N" Or TipoTransaccion = "A" Then If Not TypeOf Me.cboRenta.SelectedValue Is DataRowView Then oPropuestaInversionCE.TipoRenta = Me.cboRenta.SelectedValue End If End If End Sub Private Sub ControlTasa() If Not TypeOf Me.cboTasa.SelectedValue Is DataRowView Then If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.TipoTasa = Me.cboTasa.SelectedValue End If End If End Sub Private Sub ControlPeriodicidad() If Not TypeOf Me.cboPeriodicidad.SelectedValue Is DataRowView Then If TipoTransaccion = "N" Or TipoTransaccion = "A" Then oPropuestaInversionCE.Periodicidad = Me.cboPeriodicidad.SelectedValue End If End If End Sub Private Sub LimpiarControles() Dim vCero As Double = 0 Dim vCerotxt As String = vCero.ToString(Configuraciones.CodigoTXTMontos) Me.cboEmpresas.SelectedIndex = -1 Me.txtAsunto.Text = String.Empty Me.cboInstrumentosFinancieros.SelectedIndex = -1 Me.cboPlazosFactor.SelectedIndex = -1 Me.cboOrigenDeFondos.SelectedIndex = 0 Me.cboEmisores.SelectedIndex = -1 Me.cboCalificacionDeRiesgo.SelectedIndex = -1 Me.cboCalificadoraDeRiesgo.SelectedIndex = -1 Me.txtJustificacion.Text = String.Empty Me.txtComentarios.Text = String.Empty Me.txtCodigoInversion.Text = String.Empty Me.txtCodigoInversion.ReadOnly = True Me.cboEstadoDocumento.SelectedValue = "A" Me.cboAutorizacion.SelectedValue = "P" Me.dtpFechaDocumento.Value = Date.Now.Date Me.cboTipoOperacion.SelectedValue = "C" Me.cboTipoMercado.SelectedIndex = -1 Me.cboPaises.SelectedIndex = -1 End Sub Private Sub RefrescarValoresControles() ControlEmpresa() ControlAsunto() ControlInstrumento() ControlPlazoFactor() ControlOrigenDeFondos() ControlEmisores() ControlCalificacionesDeRiesgo() ControlCalificadoraDeRiesgo() ControlJustificacion() ControlComentarios() ControlCodigoInversion() ControlEstadoDocumento() ControlEstadoAutorizacion() ControlFechaDocumento() ControlTipoOperacion() ControlTipoMercado() ControlPais() ControlPlazoFact() ControlOFon() ControlTipOper() ControlNombre() ControlTipoRenta() ControlTasa() ControlPeriodicidad() End Sub Private Function ValoresValidos() As Boolean Dim DatosValidos As Boolean = True If String.IsNullOrEmpty(txtNombre.Text.ToString) Then MsgBox("Ingrese el nombre del titulo") DatosValidos = False Return DatosValidos End If If cboEmpresas.SelectedIndex = -1 Then MsgBox("Seleccione una Empresa") DatosValidos = False Return DatosValidos End If If cboInstrumentosFinancieros.SelectedIndex = -1 Then MsgBox("Seleccione un Instrumento") DatosValidos = False Return DatosValidos End If If cboTipoMercado.SelectedIndex = -1 Then MsgBox("Seleccione un Tipo de Mercado") DatosValidos = False Return DatosValidos End If If cboPaises.SelectedIndex = -1 Then MsgBox("Seleccione un Pais") DatosValidos = False Return DatosValidos End If If cboEstadoDocumento.SelectedIndex = -1 Then MsgBox("Error con los campos del titulo") DatosValidos = False Return DatosValidos End If If cboTipoOperacion.SelectedIndex = -1 Then MsgBox("Error con los campos del titulo") DatosValidos = False Return DatosValidos End If If cboOrigenDeFondos.SelectedIndex = -1 Then MsgBox("Error con los campos del titulo") DatosValidos = False Return DatosValidos End If If cboAutorizacion.SelectedIndex = -1 Then MsgBox("Error con los campos del titulo") DatosValidos = False Return DatosValidos End If Return DatosValidos End Function Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged ControlTipoOperacion() ControlTipOper() ActualizarEstado(sender) End Sub Sub ActualizarEstado(sender As Object) Dim TOp As String = String.Empty If Not TypeOf sender.selectedvalue Is DataRowView Then If Not sender.selectedvalue Is Nothing Then TOp = sender.selectedvalue FormFuturos = New frmFuturos(TOp) FormAcciones = New frmAcciones(TOp) FormCINV = New frmCertificadosDeInversion(TOp) End If End If End Sub Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click Dim ProTipoTransaccionCompraVenta As String = cboTipoOperacion.SelectedValue.ToString Dim ProNueva As String = TipoTransaccion Dim CodigoExiste As String = txtCodigoInversion.Text.ToString Dim CodigoInstrumentoExiste As String = Operaciones.ConvertirCadena(cboInstrumentosFinancieros.SelectedValue) ''################################################################ Variables.TipoOperacionCMVTA = cboTipoOperacion.SelectedValue Variables.InvocadorProInv = "frmPIN" ''################################################################ ''################################################################ Variables.Periodicidad = cboPeriodicidad.SelectedValue ''################################################################ ''################################################################ Dim TipOperacion As String = oPropuestaInversionCE.TipoOperacion ''################################################################ TieneDetalleInstrumento = True ''################################################################ Dim NuevaPosInstrumento As Boolean = False ''################################################################ Variables.Codigo = txtCodigoInversion.Text.ToString If String.IsNullOrEmpty(Variables.CodigoComparativo) Then Variables.CodigoComparativo = Variables.Codigo NuevaPosInstrumento = True Else If Not Variables.CodigoComparativo = Variables.Codigo Then NuevaPosInstrumento = True End If End If ''################################################################ Variables.InvPro = "P" ''################################################################ Dim CodigoInstrumento As String = String.Empty ''################################################################ CodigoInstrumento = txtCodigoInversion.Text.ToString ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("FINV") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFINV") Dim ExistInstrumento As Boolean = ExisteInstrumento("FINV") Try If ExistInstrumento Then FormFINV.Dispose() FormFINV = New frmFOIN FormFINV.ShowDialog() Else If NuevaPosInstrumento Then FormFINV.Dispose() FormFINV = New frmFOIN FormFINV.ShowDialog() Else FormFINV.ShowDialog() End If End If Catch ex As Exception FormFINV = New frmFOIN FormFINV.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If (CodigoInstrumento.IndexOf("FUTU") > -1 Or CodigoInstrumento.IndexOf("OPC") > -1) Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFuturos") Dim ExistInstrumento As Boolean If (CodigoInstrumento.IndexOf("FUTU") > -1) Then ExistInstrumento = ExisteInstrumento("FUT0") Else ExistInstrumento = ExisteInstrumento("OPC0") End If Try If ExistInstrumento Then CantFormAbierto = False FormFuturos.Dispose() FormFuturos = New frmFuturos(TipOperacion) FormFuturos.ShowDialog() Else If NuevaPosInstrumento Then CantFormAbierto = False FormFuturos.Dispose() FormFuturos = New frmFuturos(TipOperacion) FormFuturos.ShowDialog() Else CantFormAbierto = True FormFuturos.ShowDialog() End If End If Catch ex As Exception CantFormAbierto = False FormFuturos = New frmFuturos(TipOperacion) FormFuturos.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("REPO") > -1 Or CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaReporto") Dim ExistInstrumento As Boolean If CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then ExistInstrumento = ExisteInstrumento("REP0VENTA") Else ExistInstrumento = ExisteInstrumento("REP0") End If Try If ExistInstrumento Then FormRepo.Dispose() FormRepo = New frmReporto FormRepo.ShowDialog() Else If NuevaPosInstrumento Then FormRepo.Dispose() FormRepo = New frmReporto FormRepo.ShowDialog() Else FormRepo.ShowDialog() End If End If Catch ex As Exception FormRepo = New frmReporto FormRepo.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("PPER") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaPrestamoPersonal") Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0") Try If ExistInstrumento Then FormPrestamoPersonal.Dispose() FormPrestamoPersonal = New frmPrestamoPersonal FormPrestamoPersonal.ShowDialog() Else If NuevaPosInstrumento Then FormPrestamoPersonal.Dispose() FormPrestamoPersonal = New frmPrestamoPersonal FormPrestamoPersonal.ShowDialog() Else FormPrestamoPersonal.ShowDialog() End If End If Catch ex As Exception FormPrestamoPersonal = New frmPrestamoPersonal FormPrestamoPersonal.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("PEMP") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaEmpresas") Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0") Try If ExistInstrumento Then FormPrestamoEmpresarial.Dispose() FormPrestamoEmpresarial = New frmPrestamoEmpresariales FormPrestamoEmpresarial.ShowDialog() Else If NuevaPosInstrumento Then FormPrestamoEmpresarial.Dispose() FormPrestamoEmpresarial = New frmPrestamoEmpresariales FormPrestamoEmpresarial.ShowDialog() Else FormPrestamoEmpresarial.ShowDialog() End If End If Catch ex As Exception FormPrestamoEmpresarial = New frmPrestamoEmpresariales FormPrestamoEmpresarial.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ Dim Acciones As Integer = 0 If CodigoInstrumento.IndexOf("ACC") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaAcciones") Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0") Try If ExistInstrumento Then CantFormAbierto = False FormAcciones.Dispose() FormAcciones = New frmAcciones(TipOperacion) FormAcciones.CargarRegistro(oPropuestaInversionCE.CodigoInversion) FormAcciones.ShowDialog() Else If NuevaPosInstrumento Then CantFormAbierto = False FormAcciones.Dispose() FormAcciones = New frmAcciones(TipOperacion) FormAcciones.ShowDialog() Else CantFormAbierto = True FormAcciones.ShowDialog() End If End If Catch ex As Exception CantFormAbierto = False FormAcciones = New frmAcciones(TipOperacion) FormAcciones.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("LETE") > -1 Or CodigoInstrumento.IndexOf("PBUR") > -1 Or CodigoInstrumento.IndexOf("VCN") > -1 Or CodigoInstrumento.IndexOf("CETE") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaLetes") Dim ExistInstrumento As Boolean If CodigoInstrumento.IndexOf("LETE") > -1 Then ExistInstrumento = ExisteInstrumento("LET0") ElseIf CodigoInstrumento.IndexOf("PBUR") > -1 Then ExistInstrumento = ExisteInstrumento("PBUR") ElseIf CodigoInstrumento.IndexOf("VCN") > -1 Then ExistInstrumento = ExisteInstrumento("VCN") Else ExistInstrumento = ExisteInstrumento("CET0") End If Try If ExistInstrumento Then FormLete.Dispose() FormLete = New frmLetes FormLete.ShowDialog() Else If NuevaPosInstrumento Then FormLete.Dispose() FormLete = New frmLetes FormLete.ShowDialog() Else FormLete.ShowDialog() End If End If Catch ex As Exception FormLete = New frmLetes FormLete.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("BONO") > -1 Or CodigoInstrumento.IndexOf("CINV") > -1 Or CodigoInstrumento.IndexOf("TIT") > -1 Or CodigoInstrumento.IndexOf("EURB") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaCINV") Dim ExistInstrumento As Boolean If CodigoInstrumento.IndexOf("BONO") > -1 Then ExistInstrumento = ExisteInstrumento("BON0") ElseIf CodigoInstrumento.IndexOf("CINV") > -1 Then ExistInstrumento = ExisteInstrumento("CIN0") ElseIf CodigoInstrumento.IndexOf("TIT") > -1 Then ExistInstrumento = ExisteInstrumento("TIT") Else ExistInstrumento = ExisteInstrumento("EURB0") End If Try If ExistInstrumento Then CantFormAbierto = False FormCINV.Dispose() FormCINV = New frmCertificadosDeInversion(TipOperacion) FormCINV.CargarRegistro(oPropuestaInversionCE.CodigoInversion) FormCINV.ShowDialog() Else If NuevaPosInstrumento Then CantFormAbierto = False FormCINV.Dispose() FormCINV = New frmCertificadosDeInversion(TipOperacion) FormCINV.ShowDialog() Else CantFormAbierto = True FormCINV.ShowDialog() End If End If Catch ex As Exception CantFormAbierto = False FormCINV = New frmCertificadosDeInversion(TipOperacion) FormCINV.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("DAP") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP") Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0") Try If ExistInstrumento Then FormDAP.Dispose() FormDAP = New frmDepositosAPlazo FormDAP.CargarRegistro(oPropuestaInversionCE.CodigoInversion) FormDAP.ShowDialog() Else If NuevaPosInstrumento Then FormDAP.Dispose() FormDAP = New frmDepositosAPlazo FormDAP.ShowDialog() Else FormDAP.ShowDialog() End If End If Catch ex As Exception FormDAP = New frmDepositosAPlazo FormDAP.ShowDialog() End Try End If ''################################################################ ''################################################################ ''################################################################ ''################################################################ If CodigoInstrumento.IndexOf("NEST") > -1 Then Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP") Dim ExistInstrumento As Boolean = ExisteInstrumento("NEST0") Try If ExistInstrumento Then FormNEST.Dispose() FormNEST = New frmNotaEstructurada FormNEST.CargarRegistro(oPropuestaInversionCE.CodigoInversion) FormNEST.ShowDialog() Else If NuevaPosInstrumento Then FormNEST.Dispose() FormNEST = New frmNotaEstructurada FormNEST.ShowDialog() Else FormNEST.ShowDialog() End If End If Catch ex As Exception FormNEST = New frmNotaEstructurada FormNEST.ShowDialog() End Try End If ''################################################################ ''################################################################ End Sub Function ExisteInstrumento(ByVal Tabla As String) Dim General As New DAOGeneral Variables.Codigo = txtCodigoInversion.Text.ToString Dim Codigo As String = Variables.Codigo Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla) Return Existe End Function Function ExisteInstrumentoReal(ByVal Tabla As String) Dim General As New DAOGeneral Dim Codigo As String = txtCodigoInversion.Text Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla) Return Existe End Function Private Sub navNuevo_Click(sender As Object, e As EventArgs) NuevaPropuesta() End Sub Private Sub DeshabilitarControles() cboEmpresas.Enabled = False txtAsunto.ReadOnly = True cboInstrumentosFinancieros.Enabled = False cboPlazosFactor.Enabled = False cboOrigenDeFondos.Enabled = False cboEmisores.Enabled = False cboCalificacionDeRiesgo.Enabled = False cboCalificadoraDeRiesgo.Enabled = False txtJustificacion.ReadOnly = True txtComentarios.ReadOnly = True cboTipoOperacion.Enabled = False cboEstadoDocumento.Enabled = False cboAutorizacion.Enabled = False dtpFechaDocumento.Enabled = False cboTipoMercado.Enabled = False cboPaises.Enabled = False txtCodigoInversion.ReadOnly = True cboRenta.Enabled = False cboTasa.Enabled = False cboPeriodicidad.Enabled = False End Sub Private Sub HabilitarControles() cboEmpresas.Enabled = True txtAsunto.ReadOnly = False cboInstrumentosFinancieros.Enabled = True cboPlazosFactor.Enabled = True cboOrigenDeFondos.Enabled = False cboEmisores.Enabled = True cboCalificacionDeRiesgo.Enabled = True cboCalificadoraDeRiesgo.Enabled = True txtJustificacion.ReadOnly = False txtComentarios.ReadOnly = False cboTipoOperacion.Enabled = False cboAutorizacion.Enabled = False dtpFechaDocumento.Enabled = True cboTipoMercado.Enabled = True cboPaises.Enabled = True cboEstadoDocumento.Enabled = False cboRenta.Enabled = True cboTasa.Enabled = True cboPeriodicidad.Enabled = True End Sub Private Sub PrepararModificacion() If oPropuestaInversionCE.EstadoDocumento = "A" Then HabilitarControles() TipoTransaccion = "A" RefrescarControles() Me.btnAccion.Text = "Actualizar" End If End Sub Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAutorizacion.SelectedIndexChanged ControlEstadoAutorizacion() End Sub Private Sub btnActivar_Click(sender As Object, e As EventArgs) Handles btnActivar.Click If cboTipoOperacion.SelectedValue = "C" Then Dim Id = oDAOPropuestasDeInversion.IdRegistro(txtCodigoInversion.Text) oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id) ConvertirEnInversion(Id) End If End Sub Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs) ControlPais() End Sub Private Sub cboTipoMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoMercado.SelectedIndexChanged ControlTipoMercado() End Sub Private Sub ConvertirEnInversion(Id As Integer) If Not oPropuestaInversionCE Is Nothing Then Dim vConversion As Integer Dim vIdPropuesta As Integer If (oPropuestaInversionCE.IdDeDocumento = 0) Then vIdPropuesta = Id Else vIdPropuesta = oPropuestaInversionCE.IdDeDocumento End If vConversion = oDAOPropuestasDeInversion.ConvertirEnInversion(vIdPropuesta, EstadoReporto) If vConversion = 1 Then MsgBox("El proceso de activación se ha efectuado correctamente") CargarPropuesta(vIdPropuesta) grbInversión.Visible = False TipoTransaccion = "B" chkUsuario.Checked = False Else MsgBox("Error") End If End If End Sub Private Sub RefrescarControles() If TipoTransaccion = "C" Then DeshabilitarControles() End If If TipoTransaccion = "B" Then HabilitarControles() End If If TipoTransaccion = "A" Then HabilitarControles() cboEstadoDocumento.Enabled = False End If End Sub Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click Me.Close() End Sub Private Sub CargarPeriodicidades() If (String.IsNullOrEmpty(cboPeriodicidad.SelectedValue)) Then Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad Me.cboPeriodicidad.DisplayMember = "Descripcion" Me.cboPeriodicidad.ValueMember = "Codigo" Me.cboPeriodicidad.SelectedIndex = -1 End If End Sub Private Sub CargarTipoRenta() Me.cboRenta.DataSource = oDAOGeneral.ListaTipoRenta Me.cboRenta.DisplayMember = "Descripcion" Me.cboRenta.ValueMember = "Codigo" Me.cboRenta.SelectedIndex = -1 End Sub Private Sub CargarTipoTasa() Me.cboTasa.DataSource = oDAOGeneral.ListaTipoTasa Me.cboTasa.DisplayMember = "Descripcion" Me.cboTasa.ValueMember = "Codigo" Me.cboTasa.SelectedIndex = -1 End Sub Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged ControlPeriodicidad() End Sub Private Sub cboTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTasa.SelectedIndexChanged ControlTasa() End Sub Private Sub navEliminar_Click(sender As Object, e As EventArgs) If (Borrar() = 0) Then LimpiarControles() End If Refrescar() PrepararBusqueda() End Sub Public Sub Refrescar() Me.Refresh() End Sub Public Function Borrar() Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar") If (mensaje = vbOK) Then Dim eliminar As New InversionDAO Dim valor = eliminar.EliminarPropuesta(txtCodigoInversion.Text) If (valor = 1) Then MsgBox("Error al Eliminar") Return valor Else MsgBox("Registro Eliminado") Return valor End If End If End Function Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs) End Sub Private Sub navSiguienteRegistro_Click_1(sender As Object, e As EventArgs) DeshabilitarControles() TipoTransaccion = "B" If Not BindingNavigatorPositionItem.Enabled Then PIN0BindingSource4.ResumeBinding() Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) End If End Sub Private Sub navNuevo_Click_1(sender As Object, e As EventArgs) Handles navNuevo.Click ActivarSuspen = True Modo = "NM" TipoTransaccion = "N" grbInversión.Visible = False NuevaPropuesta() PIN0BindingSource4.SuspendBinding() Refrescar() PreNuevoModificar() ModoPropuesta() LimpiarControles() HabilitarControles() TipoTransaccion = "N" cboEmpresas.Enabled = True cboInstrumentosFinancieros.Enabled = True End Sub Private Sub DeshabilitarBotonesBusqueda() cboPlazosFactor.Enabled = False cboOrigenDeFondos.Enabled = False cboCalificacionDeRiesgo.Enabled = cboCalificadoraDeRiesgo.Enabled = False txtJustificacion.ReadOnly = True txtComentarios.ReadOnly = True cboTipoOperacion.Enabled = False cboAutorizacion.Enabled = False dtpFechaDocumento.Enabled = False cboTipoMercado.Enabled = False cboPaises.Enabled = False End Sub Sub HabilitarAut() cboAutorizacion.Enabled = True End Sub Sub CambiarEstadoAut(ByVal Estado As String) If Estado = "P" Then cboAutorizacion.SelectedValue = "P" ElseIf Estado = "I" Then cboAutorizacion.SelectedValue = "I" ElseIf Estado = "V" Then cboAutorizacion.SelectedValue = "V" ElseIf Estado = "A" Then cboAutorizacion.SelectedValue = "A" ElseIf Estado = "R" Then cboAutorizacion.SelectedValue = "R" End If cboAutorizacion.BackColor = Color.White End Sub Private Sub navBuscar_Click_1(sender As Object, e As EventArgs) Handles navBuscar.Click Modo = "B" ModoPropuesta() End Sub Sub HabilitarBusqueda() HabilitarControles() grbInversión.Visible = False PreBusqueda() TipoTransaccion = "B" End Sub Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click Dim posicion = PIN0BindingSource4.Position ActivarSuspen = True Modo = "NM" btnAccion.Text = "Actualizar" HabilitarControles() TipoTransaccion = "A" Operaciones.TipoOperacion = "A" PrepararModificacion() Refrescar() TipoTransaccion = "A" PreNuevoModificar() HabilitarAut() ModoPropuesta() If Not LlamadaDesdeBusqueda Then Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) PIN0BindingSource4.Position = posicion End If cboEmpresas.Enabled = False cboInstrumentosFinancieros.Enabled = False End Sub Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click End Sub Private Sub chkUsuario_CheckedChanged(sender As Object, e As EventArgs) Handles chkUsuario.CheckedChanged Dim Codigo As String = txtCodigoInversion.Text.ToString Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo) If ExisteInstrumento Then UsuarioPrivilegio(TipoTransaccion, sender) Else MsgBox("El detalle del instrumento no ha sido ingresado o el monto de la inversión es 0") If chkUsuario.Checked Then chkUsuario.Checked = False End If End If End Sub Private Sub BindingNavigatorCountItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorCountItem.Click End Sub Friend WithEvents vBindingSource As BindingSource Private Sub navEliminar_Click_1(sender As Object, e As EventArgs) Handles navEliminar.Click Dim posicion As Integer = PIN0BindingSource4.Position If (BorrarPropuesta() = 0) Then LimpiarControles() End If PIN0BindingSource4.SuspendBinding() Refrescar() HabilitarControles() DeshabilitarBotonesBusqueda() PrepararBusqueda() Variables.CodigoComparativo = "NULL" Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) If Not posicion = 0 Then posicion -= 1 End If PIN0BindingSource4.Position = posicion End Sub Public Function BorrarPropuesta() Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar") If (mensaje = vbOK) Then Dim eliminar As New InversionDAO Dim EliminarCascada As Boolean = ExisteInstrumento("INV0") Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "PIN0", EliminarCascada) If (valor = 1) Then MsgBox("Error al Eliminar") Return valor Else MsgBox("Registro Eliminado") Return valor End If Else Return 1 End If End Function Private Sub Navegador_RefreshItems_1(sender As Object, e As EventArgs) Handles Navegador.RefreshItems End Sub Private Sub PIN0BindingSource_CurrentChanged(sender As Object, e As EventArgs) End Sub Private Sub navRegistroAnterior_Click_1(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click DeshabilitarControles() TipoTransaccion = "B" If Not BindingNavigatorPositionItem.Enabled Then PIN0BindingSource4.ResumeBinding() End If End Sub Private Sub navPrimerRegistro_Click_1(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click DeshabilitarControles() TipoTransaccion = "B" If Not BindingNavigatorPositionItem.Enabled Then PIN0BindingSource4.ResumeBinding() End If End Sub Private Sub navUltimoRegistro_Click_1(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click DeshabilitarControles() TipoTransaccion = "B" If Not BindingNavigatorPositionItem.Enabled Then PIN0BindingSource4.ResumeBinding() Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) End If End Sub Private Sub PreBusqueda() Me.cboEmpresas.BackColor = Configuraciones.ColorFondoPredefinido() Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboInstrumentosFinancieros.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboEmisores.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboCalificacionDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboCalificadoraDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboPaises.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboTipoMercado.BackColor = Configuraciones.ColorFondoPredefinido() Me.txtNombre.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboPlazosFactor.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboRenta.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboTasa.BackColor = Configuraciones.ColorFondoPredefinido() Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoPredefinido() cboOrigenDeFondos.BackColor = Configuraciones.ColorFondoPredefinido() cboTipoOperacion.BackColor = Configuraciones.ColorFondoPredefinido() cboAutorizacion.BackColor = Configuraciones.ColorFondoPredefinido() txtAsunto.BackColor = Configuraciones.ColorFondoPredefinido() dtpFechaDocumento.Enabled = False TipoTransaccion = "B" oPropuestaInversionCE = Nothing oPropuestaInversionCE = New CEPropuestaInversion LimpiarControles() End Sub Private Sub PreNuevoModificar() Me.cboEmpresas.BackColor = Color.White Me.txtCodigoInversion.BackColor = Color.White Me.cboInstrumentosFinancieros.BackColor = Color.White Me.cboEmisores.BackColor = Color.White Me.cboCalificacionDeRiesgo.BackColor = Color.White Me.cboCalificadoraDeRiesgo.BackColor = Color.White Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido() Me.cboPaises.BackColor = Color.White Me.cboTipoMercado.BackColor = Color.White Me.txtNombre.BackColor = Color.White Me.cboPeriodicidad.BackColor = Color.White Me.cboPlazosFactor.BackColor = Color.White Me.cboRenta.BackColor = Color.White Me.cboTasa.BackColor = Color.White Me.cboEstadoDocumento.BackColor = Color.White() cboOrigenDeFondos.BackColor = Color.White cboTipoOperacion.BackColor = Color.White cboAutorizacion.BackColor = Color.White txtAsunto.BackColor = Color.White End Sub Private Sub txtMontoInversion_Leave(sender As Object, e As EventArgs) End Sub Private Sub txtPrecio_Leave(sender As Object, e As EventArgs) End Sub Private Sub txtRendimiento_Leave(sender As Object, e As EventArgs) End Sub Private Sub txtPlazoNumero_Leave(sender As Object, e As EventArgs) End Sub Private Sub txtIngresos_Leave(sender As Object, e As EventArgs) End Sub Private Sub txtRendimiento_TextChanged_1(sender As Object, e As EventArgs) End Sub Private Sub txtRendimiento_Leave_1(sender As Object, e As EventArgs) End Sub Private Sub Navegador_EndDrag(sender As Object, e As EventArgs) Handles Navegador.EndDrag End Sub Private Sub lblEmpresa_Click(sender As Object) End Sub Sub Acercar(sender As Object) If TypeOf sender Is Panel Then If Not sender.BackColor.Name = Color.White.Name Then sender.BackColor = Color.Turquoise End If Else If Not sender.parent.BackColor.Name = Color.White.Name Then sender.BackColor = Color.Turquoise End If End If End Sub Sub Alejar(sender As Object) If TypeOf sender Is Panel Then If Not sender.BackColor.Name = Color.White.Name Then sender.BackColor = Color.WhiteSmoke End If Else If Not sender.parent.BackColor.Name = Color.White.Name Then sender.BackColor = Color.WhiteSmoke End If End If End Sub Sub MenuSeleccionado(sender As Object) pnlContenedor.Visible = True For Each Items In pnlMenu.Controls If TypeOf Items Is Panel Then Items.BackColor = Color.WhiteSmoke For Each Item In Items.controls Item.BackColor = Color.WhiteSmoke Next End If Next If TypeOf sender Is Panel Then sender.BackColor = Color.White For Each Item In sender.controls Item.BackColor = Color.White Next End If If TypeOf sender Is Label Then sender.BackColor = Color.White sender.parent.BackColor = Color.White End If End Sub Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Sub EventPadreAcercar(ByVal sender As Object) Acercar(sender) For Each label In sender.Controls Acercar(label) Next End Sub Sub EventPadreAlejar(ByVal sender As Object) Alejar(sender) For Each label In sender.Controls Alejar(label) Next End Sub Sub EventHijoAcercar(ByVal sender As Object) Acercar(sender) Acercar(sender.parent) End Sub Sub EventHijoAlejar(ByVal sender As Object) Alejar(sender) Alejar(sender.parent) End Sub Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblPais_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter End Sub Private Sub lblInstrumento_Click(sender As Object, e As EventArgs) End Sub Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs) EventHijoAcercar(sender) End Sub Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs) EventHijoAlejar(sender) End Sub Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs) EventPadreAcercar(sender) End Sub Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs) EventPadreAlejar(sender) End Sub Private Sub lblEmpresa_Click(sender As Object, e As EventArgs) End Sub Sub ProcesoVisibilidad(sender As Object) For Each Items In pnlContenedor.Controls If TypeOf Items Is GroupBox Then Items.visible = False End If Next sender.visible = True End Sub Sub ConfiguracionInicial() For Each Items In pnlContenedor.Controls If TypeOf Items Is GroupBox Then Dim W_Tamgrp As Double = Items.Parent.Width - 10 Dim W_Tamflp As Double = W_Tamgrp - 10 Dim H_Tamgrp As Double = Items.Parent.Height - 30 Dim H_Tamflp As Double = H_Tamgrp - 30 Items.Width = W_Tamgrp Items.Height = H_Tamgrp Items.Location = New Point(2, 20) For Each flItem In Items.Controls If TypeOf flItem Is FlowLayoutPanel Then flItem.Width = W_Tamflp flItem.Height = H_Tamflp - 10 End If Next For Each item In Items.Controls If TypeOf item Is CheckBox Then Dim W_Tamchk As Double = item.Width + 5 item.Width = W_Tamchk End If Next End If Next End Sub Private Sub pnlEmpresa_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlOrigenFondos_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub lblPlazo_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlPlazo_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub lblEmisor_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlEmisor_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlCalificacionRiesgo_Paint(sender As Object, e As PaintEventArgs) End Sub Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpEmpresas) End Sub Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpInstrumentos) End Sub Private Sub lblCalificadora_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpCalificadoraRiesgo) End Sub Private Sub lblPais_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlPais_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpPais) End Sub Private Sub lblEstado_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlEstado_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpEstadoDocumento) End Sub Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpAutorizacion) End Sub Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlTipOper_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpTipoOperacion) End Sub Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpTipoMercado) End Sub Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpOrigenFondos) End Sub Private Sub pnlPlazo_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpPlazo) End Sub Private Sub pnlEmisor_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpEmisor) End Sub Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpCalificacionRiesgo) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) End Sub Private Sub TbComentarios_Click(sender As Object, e As EventArgs) End Sub Private Sub pnlContenedor_Paint(sender As Object, e As PaintEventArgs) Handles pnlContenedor.Paint End Sub Private Sub mnuFilEmpresas_Click(sender As Object, e As EventArgs) ProcesoVisibilidad(grpEmpresas) End Sub Private Sub mnuInstrumentos_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuFilInstrumentos_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilOrigenFondos_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuOrigenFondos_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuPlazo_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuFilPlazo_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuEmisor_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuFilEmisor_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilCalRiesgo_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilCalificadora_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilPais_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilEstado_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilAut_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilTipOper_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuFilTipMercado_Click(sender As Object, e As EventArgs) End Sub Private Sub mnuVerEmpresas_Click(sender As Object, e As EventArgs) LanzarBusqueda() End Sub Private Sub mnuVerInstrumentos_Click(sender As Object, e As EventArgs) LanzarBusqueda() End Sub Private Sub mnuVerOrigenFondos_Click(sender As Object, e As EventArgs) LanzarBusqueda() End Sub Sub CambiarPosicionPrincipal(sender As Object) Dim PosicionY = sender.Location.Y Dim PosicionX = pnlContenedor.Location.X pnlContenedor.Location = New Point(PosicionX, PosicionY) End Sub Private Sub mnuEmpresas_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuCalRiesgo_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuCalificadora_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuPais_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuEstado_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuAut_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuTipOper_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub mnuTipMercado_Click(sender As Object, e As EventArgs) CambiarPosicionPrincipal(sender) End Sub Private Sub lblEmpresa_Click_1(sender As Object, e As EventArgs) Handles lblEmpresa.Click ProcesoVisibilidad(grpEmpresas) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlEmpresa_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlEmpresa.Paint End Sub Private Sub lblEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblInstrumento_Click_1(sender As Object, e As EventArgs) Handles lblInstrumento.Click ProcesoVisibilidad(grpInstrumentos) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub lblInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblPais_MouseHover_1(sender As Object, e As EventArgs) Handles lblPais.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblEstado_MouseHover_1(sender As Object, e As EventArgs) Handles lblEstado.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblTipoOperacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblTipoMercado_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover EventHijoAcercar(sender) End Sub Private Sub lblEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblPais_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPais.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblTipoOperacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave EventHijoAlejar(sender) End Sub Private Sub lblTipoMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave EventHijoAlejar(sender) End Sub Private Sub pnlEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlPais_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPais.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlEstado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlTipOper_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlTipMercado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover EventPadreAcercar(sender) End Sub Private Sub pnlEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlPais_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlTipOper_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlTipMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave EventPadreAlejar(sender) End Sub Private Sub pnlEmpresa_Click_1(sender As Object, e As EventArgs) Handles pnlEmpresa.Click ProcesoVisibilidad(grpEmpresas) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub pnlInstrumento_Click_1(sender As Object, e As EventArgs) Handles pnlInstrumento.Click ProcesoVisibilidad(grpInstrumentos) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click ProcesoVisibilidad(grpOrigenFondos) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click ProcesoVisibilidad(grpOrigenFondos) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblPlazo_Click_1(sender As Object, e As EventArgs) Handles lblPlazo.Click ProcesoVisibilidad(grpPlazo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlPlazo_Click_1(sender As Object, e As EventArgs) Handles pnlPlazo.Click ProcesoVisibilidad(grpPlazo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblEmisor_Click_1(sender As Object, e As EventArgs) Handles lblEmisor.Click ProcesoVisibilidad(grpEmisor) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlEmisor_Click_1(sender As Object, e As EventArgs) Handles pnlEmisor.Click ProcesoVisibilidad(grpEmisor) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click ProcesoVisibilidad(grpCalificacionRiesgo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click ProcesoVisibilidad(grpCalificacionRiesgo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblCalificadora_Click_1(sender As Object, e As EventArgs) Handles lblCalificadora.Click ProcesoVisibilidad(grpCalificadoraRiesgo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlCalificadora_Click_1(sender As Object, e As EventArgs) Handles pnlCalificadora.Click ProcesoVisibilidad(grpCalificadoraRiesgo) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblPais_Click_1(sender As Object, e As EventArgs) Handles lblPais.Click ProcesoVisibilidad(grpPais) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlPais_Click_1(sender As Object, e As EventArgs) Handles pnlPais.Click ProcesoVisibilidad(grpPais) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblEstado_Click_1(sender As Object, e As EventArgs) Handles lblEstado.Click ProcesoVisibilidad(grpEstadoDocumento) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlEstado_Click_1(sender As Object, e As EventArgs) Handles pnlEstado.Click ProcesoVisibilidad(grpEstadoDocumento) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblAutorizacion_Click_1(sender As Object, e As EventArgs) Handles lblAutorizacion.Click ProcesoVisibilidad(grpAutorizacion) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlAutorizacion_Click_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.Click ProcesoVisibilidad(grpAutorizacion) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblTipoOperacion_Click_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click ProcesoVisibilidad(grpTipoOperacion) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlTipOper_Click_1(sender As Object, e As EventArgs) Handles pnlTipOper.Click ProcesoVisibilidad(grpTipoOperacion) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub lblTipoMercado_Click_1(sender As Object, e As EventArgs) Handles lblTipoMercado.Click ProcesoVisibilidad(grpTipoMercado) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender.parent) End Sub Private Sub pnlTipMercado_Click_1(sender As Object, e As EventArgs) Handles pnlTipMercado.Click ProcesoVisibilidad(grpTipoMercado) MenuSeleccionado(sender) CambiarPosicionPrincipal(sender) End Sub Private Sub pnlOrigenFondos_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlOrigenFondos.Paint End Sub Private Sub pnlTipMercado_Paint(sender As Object, e As PaintEventArgs) Handles pnlTipMercado.Paint End Sub Sub CargarTabla() frmBuscar = New frmBuscarDeLista(1) Dim DiccionarioColecciones As New Dictionary(Of String, Collection) DiccionarioColecciones = GuardarColecciones() Dim Data As New DataTable Data = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado") GenerarFormato(Data) For Each Item In pnlCargaDatos.Controls If TypeOf Item Is Form Then Item.dispose End If Next frmBuscar.dgvBuscarDeLista.DataSource = Data frmBuscar.Dock = DockStyle.Fill frmBuscar.TopLevel = False frmBuscar.Parent = pnlCargaDatos frmBuscar.Show() End Sub Sub GenerarFormato(ByRef Data As DataTable) For Each Row As DataRow In Data.Rows Dim CodigoPropuesta As String = String.Empty Dim Estado As String = String.Empty Dim Asunto As String = String.Empty Dim Empresa As String = String.Empty Dim InstrumentoFinanciero As String = String.Empty Dim Emisor As String = String.Empty Dim CalificacionRiesgo As String = String.Empty Dim EmpresaCalificadora As String = String.Empty Dim OrigenFondos As String = String.Empty Dim Comentarios As String = String.Empty Dim Justificaciones As String = String.Empty Dim TipoOperacion As String = String.Empty Dim Base As String = String.Empty Dim Monto As String = String.Empty Dim Precio As String = String.Empty Dim Rendimiento As String = String.Empty Dim CantidadPlazo As String = String.Empty Dim TipoPlazo As String = String.Empty Dim Ingresos As String = String.Empty Dim FechaCreación As String = String.Empty Dim EstadoAutorización As String = String.Empty Dim TipoMercado As String = String.Empty Dim Pais As String = String.Empty CodigoPropuesta = Row("Código de Propuesta").ToString Estado = Row("Estado").ToString Asunto = Row("Asunto").ToString Empresa = Row("Empresa").ToString InstrumentoFinanciero = Row("Instrumento Financiero").ToString Emisor = Row("Emisor").ToString CalificacionRiesgo = Row("Calificación de Riesgo").ToString EmpresaCalificadora = Row("Empresa Calificadora").ToString OrigenFondos = Row("Origen de Fondos").ToString Comentarios = Row("Comentarios").ToString Justificaciones = Row("Justificaciones").ToString TipoOperacion = Row("Tipo de Operacion").ToString Base = Row("Base de Calculo").ToString Monto = Row("Monto de Inversion").ToString Precio = Row("Precio").ToString Rendimiento = Row("Rendimiento").ToString CantidadPlazo = Row("Cantidad en Plazo").ToString TipoPlazo = Row("Tipo de Plazo").ToString Ingresos = Row("Ingresos").ToString FechaCreación = Row("Fecha de Creación").ToString EstadoAutorización = Row("Estado de Autorización").ToString TipoMercado = Row("Tipo de Mercado").ToString Pais = Row("Pais").ToString If String.IsNullOrEmpty(CodigoPropuesta) Then CodigoPropuesta = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Estado) Then Estado = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Asunto) Then Asunto = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Empresa) Then Empresa = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(InstrumentoFinanciero) Then InstrumentoFinanciero = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Emisor) Then Emisor = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(CalificacionRiesgo) Then CalificacionRiesgo = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(EmpresaCalificadora) Then EmpresaCalificadora = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(OrigenFondos) Then OrigenFondos = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Comentarios) Then Comentarios = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Justificaciones) Then Justificaciones = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(TipoOperacion) Then TipoOperacion = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Base) Then Base = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Monto) Then Monto = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Precio) Then Precio = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Rendimiento) Then Rendimiento = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(CantidadPlazo) Then CantidadPlazo = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(TipoPlazo) Then TipoPlazo = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Ingresos) Then Ingresos = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(FechaCreación) Then FechaCreación = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(EstadoAutorización) Then EstadoAutorización = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(TipoMercado) Then TipoMercado = " ---- ---- ---- ---- ----" End If If String.IsNullOrEmpty(Pais) Then Pais = " ---- ---- ---- ---- ----" End If Row("Código de Propuesta") = CodigoPropuesta Row("Estado") = Estado Row("Asunto") = Asunto Row("Empresa") = Empresa Row("Instrumento Financiero") = InstrumentoFinanciero Row("Emisor") = Emisor Row("Calificación de Riesgo") = CalificacionRiesgo Row("Empresa Calificadora") = EmpresaCalificadora Row("Origen de Fondos") = OrigenFondos Row("Comentarios") = Comentarios Row("Justificaciones") = Justificaciones Row("Tipo de Operacion") = TipoOperacion Row("Base de Calculo") = Base Row("Monto de Inversion") = Monto Row("Precio") = Precio Row("Rendimiento") = Rendimiento Row("Cantidad en Plazo") = CantidadPlazo Row("Tipo de Plazo") = TipoPlazo Row("Ingresos") = Ingresos Row("Fecha de Creación") = FechaCreación Row("Estado de Autorización") = EstadoAutorización Row("Tipo de Mercado") = TipoMercado Row("Pais") = Pais Next End Sub Private Sub pnlPie_Paint(sender As Object, e As PaintEventArgs) Handles pnlPie.Paint End Sub Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles btnAceptar.Click eventoCargar() End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnCancel.Click eventoCancelar() End Sub Private Sub txtBuscar_TextChanged(sender As Object, e As EventArgs) Handles txtBuscar.TextChanged 'Filtrar(sender) Filtrar(sender) End Sub Sub Filtrar(sender As Object) Dim TextoIngresado As String = sender.text.ToString.ToLower Dim CajaActiva As New GroupBox Dim CajaInterna As New FlowLayoutPanel For Each Item In pnlContenedor.Controls If TypeOf Item Is GroupBox Then If Item.visible Then CajaActiva = Item Exit For End If End If Next For Each Item In CajaActiva.Controls If TypeOf Item Is FlowLayoutPanel Then CajaInterna = Item Exit For End If Next For Each Item In CajaInterna.Controls If TypeOf Item Is CheckBox Then If Item.text.ToString.ToLower.Contains(TextoIngresado) Then If Not Item.visible Then Item.visible = True End If Else If Item.visible Then Item.visible = False End If End If End If Next End Sub Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter End Sub Sub ModoPropuesta() Dim TbNM = TbIngresarModificar Dim VTbBuscar = TbBuscar If Modo = "NM" Or (TipoTransaccion = "B" And Modo = "NM") Then If Not VTbBuscar.Parent Is Nothing Then TbBuscar.Parent = Nothing End If If (TbNM.Parent Is Nothing) Then TbNM.Parent = TabCampos End If ElseIf Modo = "B" Then If Not TbNM.Parent Is Nothing Then TbNM.Parent = Nothing End If If (VTbBuscar.Parent Is Nothing) Then VTbBuscar.Parent = TabCampos End If End If End Sub Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles navRecorrer.Click DeshabilitarControles() PreBusqueda() Modo = "NM" ModoPropuesta() Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0) PIN0BindingSource4.ResumeBinding() btnAccion.Text = "Aceptar" End Sub Public Sub CargarDatosContenedor() If MsgBox("Desea ver esta Propuesta de Inversión", MsgBoxStyle.OkCancel) = DialogResult.OK Then Dim Id As Integer = frmBuscar.dgvBuscarDeLista.CurrentRow.Cells("Id").Value If Not Id = Nothing Then Modo = "NM" TipoTransaccion = "B" ModoPropuesta() DeshabilitarControles() PreBusqueda() CargarPropuesta(Id) LlamadaDesdeBusqueda = True End If End If End Sub Private Sub txtMontoInversion_KeyPress(sender As Object, e As KeyPressEventArgs) ValidarEntradaPrecionada(sender, e) End Sub Sub ValidarEntradaPrecionada(sender As Object, e As KeyPressEventArgs) If String.IsNullOrEmpty(sender.Text) Then If e.KeyChar = "." Then sender.Text = "0" Exit Sub End If End If If (Not sender.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then Operaciones.ValidarEntrada(sender, e, True) Else Operaciones.ValidarEntrada(sender, e, False) End If End Sub Sub ValidarEntradaLevantar(ByRef sender As Object) If sender.Text = "." Then sender.Text = ".0" End If End Sub Private Sub txtMontoInversion_KeyUp(sender As Object, e As KeyEventArgs) ValidarEntradaLevantar(sender) End Sub Private Sub txtIngresos_KeyPress(sender As Object, e As KeyPressEventArgs) ValidarEntradaPrecionada(sender, e) End Sub Private Sub txtIngresos_KeyUp(sender As Object, e As KeyEventArgs) ValidarEntradaLevantar(sender) End Sub Private Sub txtPrecio_KeyPress(sender As Object, e As KeyPressEventArgs) ValidarEntradaPrecionada(sender, e) End Sub Private Sub txtPrecio_KeyUp(sender As Object, e As KeyEventArgs) ValidarEntradaLevantar(sender) End Sub Private Sub txtRendimiento_KeyPress(sender As Object, e As KeyPressEventArgs) ValidarEntradaPrecionada(sender, e) End Sub Private Sub txtRendimiento_KeyUp(sender As Object, e As KeyEventArgs) ValidarEntradaLevantar(sender) End Sub Private Sub txtPlazoNumero_KeyPress(sender As Object, e As KeyPressEventArgs) ValidarEntradaPrecionada(sender, e) End Sub Private Sub txtPlazoNumero_KeyUp(sender As Object, e As KeyEventArgs) ValidarEntradaLevantar(sender) End Sub Private Sub btnRequisicionDePago_Click(sender As Object, e As EventArgs) End Sub Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles navVistaPrevia.Click Impresion(True) End Sub Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles navImprimir.Click Impresion(False) End Sub Private Sub Impresion(ByVal pVistaPreliminar As Boolean) Dim General As New DAOGeneral Dim Codigo As String = txtCodigoInversion.Text Dim Id = General.IdPropuesta(Codigo) IdPIN = Id If Not IdPIN = Nothing Then Dim oImprimir As New frmImprimir("PrintPropuestaDeInversion.rpt", IdPIN, True) oImprimir.NombreRPT = "PrintPropuestaDeInversion.rpt" oImprimir.IdDocumento = IdPIN If pVistaPreliminar = True Then oImprimir.ShowDialog() Else oImprimir.VistaPrevia = False oImprimir.CargarRPT() End If End If End Sub Private Sub txtNombre_TextChanged(sender As Object, e As EventArgs) Handles txtNombre.TextChanged ControlNombre() End Sub Private Sub cboRenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboRenta.SelectedIndexChanged ControlTipoRenta() End Sub Private Sub cboPaises_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged ControlPais() End Sub Private Sub grbInversión_Enter(sender As Object, e As EventArgs) Handles grbInversión.Enter End Sub Private Sub btnCambiarEstado_Click(sender As Object, e As EventArgs) Handles btnCambiarRev.Click Dim Codigo As String = txtCodigoInversion.Text.ToString Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo) If ExisteInstrumento Then ModificarEstado("V") Else MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0") End If End Sub Sub ModificarEstado(Estado As String) Dim Codigo = txtCodigoInversion.Text If Not String.IsNullOrEmpty(Codigo) Then Dim posicion = PIN0BindingSource4.Position ActivarSuspen = True Modo = "NM" btnAccion.Text = "Actualizar" PrepararModificacion() ModoPropuesta() DeshabilitarControles() CambiarEstadoAut(Estado) TipoTransaccion = "A" ControlCambio() End If End Sub Private Sub btnCambiarInter_Click(sender As Object, e As EventArgs) ModificarEstado("I") End Sub Private Sub btnCambiarApro_Click(sender As Object, e As EventArgs) Handles btnCambiarApro.Click Dim Codigo As String = txtCodigoInversion.Text.ToString Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo) If ExisteInstrumento Then ModificarEstado("A") Else MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0") End If End Sub Private Sub btnCambiarRec_Click(sender As Object, e As EventArgs) Handles btnCambiarRec.Click Dim Codigo As String = txtCodigoInversion.Text.ToString Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo) If ExisteInstrumento Then ModificarEstado("R") Else MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0") End If End Sub Sub EstadoControladoresNAV() Dim Estado As String = String.Empty If cboAutorizacion.SelectedValue = "P" Then Estado = "P" ElseIf cboAutorizacion.SelectedValue = "V" Then Estado = "V" ElseIf cboAutorizacion.SelectedValue = "A" Then Estado = "A" ElseIf cboAutorizacion.SelectedValue = "R" Then Estado = "R" End If If Estado = "P" Or Estado = "A" Or Estado = "R" Then navNuevo.Enabled = True navModificar.Enabled = False navEliminar.Enabled = False navBuscar.Enabled = True navRecorrer.Enabled = True navVistaPrevia.Enabled = True navImprimir.Enabled = True ElseIf Estado = "V" Then navNuevo.Enabled = True navModificar.Enabled = True navEliminar.Enabled = False navBuscar.Enabled = True navRecorrer.Enabled = True navVistaPrevia.Enabled = True navImprimir.Enabled = True End If End Sub Private Sub txtCodigoCompra_TextChanged(sender As Object, e As EventArgs) End Sub Private Sub pnlCambiarRev_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarRev.Paint End Sub Private Sub pnlCambiarApro_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarApro.Paint End Sub Private Sub TabCampos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged CargarTabla() End Sub Sub LimpiarVariablesTraspaso() Variables.RetMonto = 0 Variables.RetPrecio = 0 Variables.RetRendimiento = 0 Variables.RetIngresosEsp = 0 Variables.RetUnidadesAcciones = 0 Variables.RetUnidadesContratosFuturos = 0 Variables.RetCantidadContratosFuturos = 0 Variables.RetCuotaParticipacionFINV = 0 Variables.RetValorParticipacionFINV = 0 Variables.TipoTransaccionCompraVenta = "NA" Variables.RetCodigoInversionExiste = False End Sub End Class