| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484 |
- Public Class frmPIN_Temporal
- 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
- Dim InstrumentoFinanciero As Object
- Dim ResultadoMsgBox As Integer
- Dim IdPIN As Integer
- Dim IdIF As String
- Dim Operaciones As New Operaciones
- Dim oInversionDAO As New InversionDAO
- Private _PlazosFactor As String
- Private Sub frmPIN_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Dim TipoTransaccionTMP As String = TipoTransaccion
- TipoTransaccion = "X"
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.PAIS' Puede moverla o quitarla según sea necesario.
- Me.PAISTableAdapter.Fill(Me.InversionesDataSet1.PAIS)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.ECALRI' Puede moverla o quitarla según sea necesario.
- Me.ECALRITableAdapter.Fill(Me.InversionesDataSet1.ECALRI)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.CALRI' Puede moverla o quitarla según sea necesario.
- Me.CALRITableAdapter.Fill(Me.InversionesDataSet1.CALRI)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.EMIS' Puede moverla o quitarla según sea necesario.
- Me.EMISTableAdapter.Fill(Me.InversionesDataSet1.EMIS)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.INFI' Puede moverla o quitarla según sea necesario.
- Me.INFITableAdapter.Fill(Me.InversionesDataSet1.INFI)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.EMPR' Puede moverla o quitarla según sea necesario.
- Me.EMPRTableAdapter.Fill(Me.InversionesDataSet1.EMPR)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.PIN0' Puede moverla o quitarla según sea necesario.
- Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet.PIN0' Puede moverla o quitarla según sea necesario.
- Call CargarEstadosDocumento()
- Call CargarEstadosAutorizacion()
- Call CargarOrigenDeFondos()
- Call CargarTipoOperacion()
- Call CargarTiposMercado()
- Call CargarTipoRenta()
- Call CargarTipoTasa()
- Call CargarPlazos()
- Call CargarPeriodicidades()
- 'Call CargarRegistro(0)
- TipoTransaccion = TipoTransaccionTMP
- If TipoTransaccion Is Nothing Then
- TipoTransaccion = "N"
- End If
- If TipoTransaccion = "N" Then
- Call NuevaPropuesta()
- ElseIf TipoTransaccion = "B" Then
- 'Call CargarPropuesta()
- End If
- 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
- 'PIN0BindingSource.SuspendBinding()
- 'PIN0BindingSource.ResumeBinding()
- 'gpbInversión.Visible = False
- 'NuevaPropuesta()
- txtCodigoInversion.Text = String.Empty
- End Sub
- Private Sub CargarRegistro(posicion As Integer)
- Dim cargar As New DataTable
- cargar = oInversionDAO.ListaCodigosPropuesta()
- cbxEmpresas.SelectedValue = cargar.Rows(posicion)(1).ToString
- txtAsunto.Text = cargar.Rows(posicion)(2).ToString
- cbxInstrumentosFinancieros.SelectedValue = cargar.Rows(posicion)(3).ToString
- txtMontoInversion.Text = cargar.Rows(posicion)(4).ToString
- txtPrecio.Text = cargar.Rows(posicion)(5).ToString
- txtRendimiento.Text = cargar.Rows(posicion)(6).ToString
- txtPlazoNumero.Text = cargar.Rows(posicion)(7).ToString
- cbxPlazosFactor.SelectedValue = cargar.Rows(posicion)(8).ToString
- txtIngresos.Text = cargar.Rows(posicion)(9).ToString
- cbxOrigenDeFondos.SelectedValue = cargar.Rows(posicion)(10).ToString
- cbxEmisores.SelectedValue = cargar.Rows(posicion)(11).ToString
- cbxCalificacionDeRiesgo.SelectedValue = cargar.Rows(posicion)(12).ToString
- cbxCalificadoraDeRiesgo.SelectedValue = cargar.Rows(posicion)(13).ToString
- cbxPaises.SelectedValue = cargar.Rows(posicion)(14).ToString
- cbxTipoMercado.SelectedValue = cargar.Rows(posicion)(15).ToString
- txtCodigoInversion.Text = cargar.Rows(posicion)(16).ToString
- cbxEstadoDocumento.SelectedValue = cargar.Rows(posicion)(17).ToString
- cbxTipoOperacion.SelectedValue = cargar.Rows(posicion)(18).ToString
- dtpFechaDocumento.Value = cargar.Rows(posicion)(19)
- cbxAutorizacion.SelectedValue = cargar.Rows(posicion)(20).ToString
- End Sub
- Private Sub UsuarioPrivilegio()
- If chkUsuario.Checked = False Then
- gpbInversión.Visible = False
- Else
- gpbInversión.Visible = True
- End If
- End Sub
- Private Sub CargarEstadosDocumento()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxEstadoDocumento.DataSource = oDAOPropuestasDeInversion.ListaEstadoDocumento.Tables("EstadosDocumento")
- Me.cbxEstadoDocumento.DisplayMember = "Descripcion"
- Me.cbxEstadoDocumento.ValueMember = "Codigo"
- Me.cbxEstadoDocumento.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarEstadosAutorizacion()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxAutorizacion.DataSource = oDAOGeneral.ListaEstadoAutorizacion
- Me.cbxAutorizacion.DisplayMember = "Descripcion"
- Me.cbxAutorizacion.ValueMember = "Codigo"
- Me.cbxAutorizacion.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarEmpresas()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxEmpresas.DataSource = oDAOGeneral.ListaEmpresas
- Me.cbxEmpresas.DisplayMember = "Descripcion"
- Me.cbxEmpresas.ValueMember = "Codigo"
- Me.cbxEmpresas.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarInstrumentosFinancieros()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxInstrumentosFinancieros.DataSource = oDAOGeneral.ListaInstrumentos
- Me.cbxInstrumentosFinancieros.DisplayMember = "Descripcion"
- Me.cbxInstrumentosFinancieros.ValueMember = "Codigo"
- Me.cbxInstrumentosFinancieros.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarEmisores()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxEmisores.DataSource = oDAOGeneral.ListaEmisores
- Me.cbxEmisores.DisplayMember = "Descripcion"
- Me.cbxEmisores.ValueMember = "Codigo"
- Me.cbxEmisores.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarCalificacionDeRiesgo()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxCalificacionDeRiesgo.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo
- Me.cbxCalificacionDeRiesgo.DisplayMember = "Descripcion"
- Me.cbxCalificacionDeRiesgo.ValueMember = "Codigo"
- Me.cbxCalificacionDeRiesgo.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarCalificadoraDeRiesgo()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxCalificadoraDeRiesgo.DataSource = oDAOGeneral.ListaEmpresasCalificadoras
- Me.cbxCalificadoraDeRiesgo.DisplayMember = "Descripcion"
- Me.cbxCalificadoraDeRiesgo.ValueMember = "Codigo"
- Me.cbxCalificadoraDeRiesgo.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarOrigenDeFondos()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos
- Me.cbxOrigenDeFondos.DisplayMember = "Descripcion"
- Me.cbxOrigenDeFondos.ValueMember = "Codigo"
- Me.cbxOrigenDeFondos.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarPlazos()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxPlazosFactor.DataSource = oDAOGeneral.ListaPlazosFactor
- Me.cbxPlazosFactor.DisplayMember = "Descripcion"
- Me.cbxPlazosFactor.ValueMember = "Codigo"
- Me.cbxPlazosFactor.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarTipoOperacion()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion
- Me.cbxTipoOperacion.DisplayMember = "Descripcion"
- Me.cbxTipoOperacion.ValueMember = "Codigo"
- Me.cbxTipoOperacion.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarPaises()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion
- Me.cbxPaises.DisplayMember = "Descripcion"
- Me.cbxPaises.ValueMember = "Codigo"
- Me.cbxPaises.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub CargarTiposMercado()
- Dim vTipoTransaccion As String = TipoTransaccion
- TipoTransaccion = "X"
- Me.cbxTipoMercado.DataSource = oDAOGeneral.ListaTiposMercado
- Me.cbxTipoMercado.DisplayMember = "Descripcion"
- Me.cbxTipoMercado.ValueMember = "Codigo"
- Me.cbxTipoMercado.SelectedIndex = -1
- TipoTransaccion = vTipoTransaccion
- End Sub
- Private Sub NuevaPropuesta()
- If oPropuestaInversionCE Is Nothing Then
- oPropuestaInversionCE = New CEPropuestaInversion
- End If
- HabilitarControles()
- LimpiarControles()
- Me.cbxEstadoDocumento.SelectedValue = "A"
- Me.cbxAutorizacion.SelectedValue = "P"
- Me.btnAccion.Text = "Guardar"
- Me.txtCodigoInversion.ReadOnly = True
- End Sub
- Private Sub GuardarPropuesta()
- RefrescarValoresControles()
- If ValoresValidos() Then
- If InstrumentoFinanciero Is Nothing Then
- ResultadoMsgBox = MessageBox.Show("No se ha ingresado detalles del Instrumento." & vbCrLf & "Desea continuar sin detalles?", "Sin Detalles", MessageBoxButtons.YesNo)
- If ResultadoMsgBox = DialogResult.Yes Then
- 'oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, InstrumentoFinanciero, False)
- 'Me.Dispose()
- End If
- Else
- 'oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, InstrumentoFinanciero)
- 'Me.Dispose()
- End If
- Else
- MessageBox.Show("Campos Imcompletos", "Error")
- End If
- End Sub
- Sub GuardarInstrumentoFinanciero()
- Dim vRetorno As Integer
- Dim vCodigoInversion As String = oPropuestaInversionCE.CodigoInversion
- If Not InstrumentoFinanciero Is Nothing Then
- Dim oAccionesCE As AccionesCE
- If InstrumentoFinanciero.GetType.ToString = oAccionesCE.GetType.ToString Then
- Dim oDAOAcciones As AccionesDAO = New AccionesDAO
- vRetorno = oDAOAcciones.Nuevo(InstrumentoFinanciero, 1, "P")
- End If
- If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEBonos" Then
- Dim oDAOBonos As BonosDAO = New BonosDAO
- vRetorno = oDAOBonos.Nuevo(InstrumentoFinanciero, 1, "P")
- End If
- If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEDAP" Then
- Dim oDAODAP As DepositosAPlazoDAO = New DepositosAPlazoDAO
- vRetorno = oDAODAP.Nuevo(InstrumentoFinanciero, 1, "P")
- End If
- If InstrumentoFinanciero.GetType.ToString = "Inversiones.CELetes" Then
- Dim oDAOLetes As LETESDAO = New LETESDAO
- vRetorno = oDAOLetes.Nuevo(InstrumentoFinanciero, vCodigoInversion)
- End If
- If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEReportos" Then
- Dim oDAOReportos As ReportosDAO = New ReportosDAO
- vRetorno = oDAOReportos.Nuevo(InstrumentoFinanciero, 1, "P")
- End If
- End If
- End Sub
- Private Sub EliminarPropuesta()
- End Sub
- Private Sub ActualizarPropuesta(ByVal parametro As String)
- Dim retorno As Integer
- RefrescarValoresControles()
- retorno = oDAOPropuestasDeInversion.Actualizar(oPropuestaInversionCE, parametro, "")
- If retorno = 0 Then
- MsgBox("Registro Actualizado", MsgBoxStyle.Information)
- CargarPropuesta(IdPIN)
- 'TipoTransaccion = "C"
- 'btnAccion.Text = "Aceptar"
- 'DeshabilitarControles()
- End If
- End Sub
- Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxEmpresas.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 cbxInstrumentosFinancieros.SelectedIndexChanged
- ControlInstrumento()
- End Sub
- Private Sub txtMontoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtMontoInversion.TextChanged
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtMontoInversion.Text, valor)
- If Not vParse Then
- Me.lblMontoInversionErr.Visible = True
- Else
- Me.lblMontoInversionErr.Visible = False
- End If
- End Sub
- Private Sub txtMontoInversion_LostFocus(sender As Object, e As EventArgs) Handles txtMontoInversion.LostFocus
- ControlMontoInversion()
- End Sub
- Private Sub txtPrecio_TextChanged(sender As Object, e As EventArgs) Handles txtPrecio.TextChanged
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtPrecio.Text, valor)
- If Not vParse Then
- lblPrecioErr.Visible = True
- Else
- lblPrecioErr.Visible = False
- End If
- End Sub
- Private Sub txtPrecio_LostFocus(sender As Object, e As EventArgs) Handles txtPrecio.LostFocus
- ControlPrecio()
- End Sub
- Private Sub txtRendimiento_TextChanged(sender As Object, e As EventArgs) Handles txtRendimiento.TextChanged
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(txtRendimiento.Text.Replace("%", ""), valor)
- If Not vParse Then
- Me.lblRendimientoErr.Visible = True
- Else
- Me.lblRendimientoErr.Visible = False
- End If
- End Sub
- Private Sub txtRendimiento_LostFocus(sender As Object, e As EventArgs) Handles txtRendimiento.LostFocus
- ControlRendimiento()
- End Sub
- Private Sub cboPlazos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxPlazosFactor.SelectedIndexChanged
- ControlPlazoFactor()
- End Sub
- Private Sub txtPlazoNumero_TextChanged(sender As Object, e As EventArgs) Handles txtPlazoNumero.TextChanged
- If TipoTransaccion = "N" Then
- Dim vParse As Boolean = True
- Dim valor As Integer = 0
- If Me.txtPlazoNumero.Text.Length > 0 Then
- vParse = Integer.TryParse(Me.txtPlazoNumero.Text, valor)
- End If
- If Not vParse Then
- Me.lblPlazoErrr.Visible = True
- Else
- Me.lblPlazoErrr.Visible = False
- End If
- End If
- End Sub
- Private Sub txtPlazoNumero_LostFocus(sender As Object, e As EventArgs) Handles txtPlazoNumero.LostFocus
- ControlPlazoNumero()
- End Sub
- Private Sub txtIngresos_TextChanged(sender As Object, e As EventArgs) Handles txtIngresos.TextChanged
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtIngresos.Text, valor)
- If Not vParse Then
- Me.lblingresosErr.Visible = True
- Else
- Me.lblingresosErr.Visible = False
- End If
- End Sub
- Private Sub cboOrigenDeFodos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxOrigenDeFondos.SelectedIndexChanged
- ControlOrigenDeFondos()
- End Sub
- Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxEmisores.SelectedIndexChanged
- ControlEmisores()
- End Sub
- Private Sub cboCalificacionDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxCalificacionDeRiesgo.SelectedIndexChanged
- ControlCalificacionesDeRiesgo()
- End Sub
- Private Sub cboCalificadoraDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxCalificadoraDeRiesgo.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 cbxEstadoDocumento.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) Handles txtIngresos.LostFocus
- ControlIngresos()
- End Sub
- Private Sub PrepararBusqueda()
- TipoTransaccion = "B"
- oPropuestaInversionCE = Nothing
- oPropuestaInversionCE = New CEPropuestaInversion
- LimpiarControles()
- HabilitarControles()
- PrepararControlesParaBusqueda()
- End Sub
- Private Sub CargarPropuesta(pId As Integer)
- oPropuestaInversionCE = Nothing
- 'oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(pId)
- Dim vCodigoEmpresa As String = oPropuestaInversionCE.CodigoEmpresa
- If vCodigoEmpresa.Length = 0 Then
- Me.cbxEmpresas.SelectedIndex = -1
- Else
- Me.cbxEmpresas.SelectedValue = vCodigoEmpresa
- End If
- Me.txtAsunto.Text = oPropuestaInversionCE.Asunto
- Dim vCodigoInstrumentoFinanciero As String = oPropuestaInversionCE.CodigoInstrumentoFinanciero
- If vCodigoInstrumentoFinanciero.Length = 0 Then
- Me.cbxInstrumentosFinancieros.SelectedIndex = -1
- Else
- Me.cbxInstrumentosFinancieros.SelectedValue = vCodigoInstrumentoFinanciero
- End If
- Me.txtMontoInversion.Text = oPropuestaInversionCE.MontoInversion.ToString(Configuraciones.CodigoTXTMontos)
- Me.txtPrecio.Text = oPropuestaInversionCE.Precio.ToString(Configuraciones.CodigoTXTMontos)
- Me.txtRendimiento.Text = oPropuestaInversionCE.Rendimiento.ToString(Configuraciones.CodigoTXTPorcentaje)
- Me.txtPlazoNumero.Text = oPropuestaInversionCE.PlazoNumero
- Dim vPlazoFactor As String = oPropuestaInversionCE.PlazoFactor
- If vPlazoFactor.Length = 0 Then
- Me.cbxPlazosFactor.SelectedIndex = -1
- Else
- Me.cbxPlazosFactor.SelectedValue = vPlazoFactor
- End If
- Me.txtIngresos.Text = oPropuestaInversionCE.Ingresos.ToString(Configuraciones.CodigoTXTMontos)
- Dim vOrigenDeFondos As String = oPropuestaInversionCE.OrigenDeFondos
- If vOrigenDeFondos.Length = 0 Then
- Me.cbxOrigenDeFondos.SelectedIndex = -1
- Else
- Me.cbxOrigenDeFondos.SelectedValue = vOrigenDeFondos
- End If
- Dim vCodigoEmisor As String = oPropuestaInversionCE.CodigoEmisor
- If vCodigoEmisor = 0 Then
- Me.cbxEmisores.SelectedIndex = -1
- Else
- Me.cbxEmisores.SelectedValue = vCodigoEmisor
- End If
- Dim vCodigoCalificacionDeRiesgo As String = oPropuestaInversionCE.CodigoCalificacionDeRiesgo
- If vCodigoCalificacionDeRiesgo.Length = 0 Then
- Me.cbxCalificacionDeRiesgo.SelectedIndex = -1
- Else
- Me.cbxCalificacionDeRiesgo.SelectedValue = vCodigoCalificacionDeRiesgo
- End If
- Dim vCodigoEmpresaCalificadora As String = oPropuestaInversionCE.CodigoEmpresaCalificadora
- If vCodigoEmpresaCalificadora.Length = 0 Then
- Me.cbxCalificadoraDeRiesgo.SelectedIndex = -1
- Else
- Me.cbxCalificadoraDeRiesgo.SelectedValue = vCodigoEmpresaCalificadora
- End If
- Me.txtJustificacion.Text = oPropuestaInversionCE.Justificacion
- Me.txtComentarios.Text = oPropuestaInversionCE.Comentarios
- Me.txtCodigoInversion.Text = oPropuestaInversionCE.CodigoInversion
- Me.txtCodigoInversion.ReadOnly = True
- Dim vEstadoDocumento As String = oPropuestaInversionCE.EstadoDocumento
- If vEstadoDocumento.Length = 0 Then
- Me.cbxEstadoDocumento.SelectedIndex = -1
- Else
- Me.cbxEstadoDocumento.SelectedValue = vEstadoDocumento
- End If
- Dim vFechaDocumento As Date
- If Not Date.TryParse(oPropuestaInversionCE.FechaDocumento, vFechaDocumento) Then
- vFechaDocumento = Date.MinValue.Date
- End If
- Me.dtpFechaDocumento.Value = vFechaDocumento
- Dim vTipoOperacion As String = oPropuestaInversionCE.TipoOperacion
- If String.IsNullOrEmpty(vTipoOperacion) Then
- Me.cbxTipoOperacion.SelectedIndex = -1
- Else
- Me.cbxTipoOperacion.SelectedValue = vTipoOperacion
- End If
- Dim vEstadoAut As String = oPropuestaInversionCE.EstadoAutorizacion
- If vEstadoAut.Length = 0 Then
- Me.cbxAutorizacion.SelectedIndex = -1
- Else
- Me.cbxAutorizacion.SelectedValue = vEstadoAut
- End If
- Dim vTipoMercado As String = oPropuestaInversionCE.TipoMercado
- If String.IsNullOrEmpty(vTipoMercado) Then
- cbxTipoMercado.SelectedIndex = -1
- Else
- Me.cbxTipoMercado.SelectedValue = vTipoMercado
- End If
- Dim vPais As String = oPropuestaInversionCE.Pais
- If String.IsNullOrEmpty(vPais) Then
- cbxPaises.SelectedIndex = -1
- Else
- cbxPaises.SelectedValue = vPais
- End If
- TipoTransaccion = "C"
- IdPIN = pId
- IdIF = vCodigoInstrumentoFinanciero
- Me.btnAccion.Text = "Aceptar"
- RefrescarControles()
- End Sub
- 'NAVEGACION
- Sub PrimerRegistro()
- End Sub
- Sub RegistroAnterior()
- End Sub
- Sub SiguienteRegistro()
- End Sub
- Sub UltimoRegistro()
- End Sub
- Private Sub BloquearEmpresaInstrumento()
- cbxEmpresas.Enabled = False
- cbxInstrumentosFinancieros.Enabled = False
- End Sub
- '***FIN NAVEGACION
- Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
- 'cboEstadoDocumento.SelectedIndexChanged()
- 'cboEstadoDocumento_SelectedIndexChanged()
- If TipoTransaccion = "B" Then
- LanzarBusqueda()
- ElseIf TipoTransaccion = "N" Then
- GuardarPropuesta()
- GuardarInstrumentoFinanciero()
- LimpiarControles()
- txtCodigoInversion.ReadOnly = True
- 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
- Refrescar()
- 'PIN0BindingSource.SuspendBinding()
- ElseIf TipoTransaccion = "A" Then
- Dim posicion = PIN0BindingSource.Position
- ActualizarPropuesta(txtCodigoInversion.Text)
- Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
- Refrescar()
- PIN0BindingSource.Position = posicion
- 'PIN0BindingSource.SuspendBinding()
- DeshabilitarControles()
- End If
- End Sub
- Private Sub LanzarBusqueda()
- Dim frmBuscar As New frmBuscarDeLista
- 'frmBuscar.DatosPropuesta = oPropuestaInversionCE
- If frmBuscar.ShowDialog = DialogResult.OK Then
- If Not frmBuscar.CodigoPrincipal = Nothing Then
- CargarPropuesta(frmBuscar.CodigoPrincipal)
- End If
- End If
- End Sub
- Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs)
- PrimerRegistro()
- End Sub
- Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs)
- RegistroAnterior()
- End Sub
- Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
- SiguienteRegistro()
- End Sub
- Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs)
- UltimoRegistro()
- 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)
- EliminarPropuesta()
- 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 cbxEmpresas.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
- ControlCodigoInversion()
- End Sub
- Private Sub ControlEmpresa()
- If TipoTransaccion = "N" Then
- oPropuestaInversionCE.CodigoEmpresa = Me.cbxEmpresas.SelectedValue
- GenerarCodigoDeInversion()
- End If
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.CodigoEmpresa = Me.cbxEmpresas.SelectedValue
- End If
- End Sub
- Private Sub ControlAsunto()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.Asunto = Me.txtAsunto.Text
- End If
- End Sub
- Private Sub ControlInstrumento()
- If TipoTransaccion = "N" Then
- oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cbxInstrumentosFinancieros.SelectedValue
- GenerarCodigoDeInversion()
- End If
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Then
- oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cbxInstrumentosFinancieros.SelectedValue
- End If
- End Sub
- Private Sub ControlMontoInversion()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtMontoInversion.Text, valor)
- If Not vParse Then
- lblMontoInversionErr.Visible = True
- Else
- oPropuestaInversionCE.MontoInversion = valor
- Me.txtMontoInversion.Text = oPropuestaInversionCE.MontoInversion.ToString(Configuraciones.CodigoTXTMontos)
- lblMontoInversionErr.Visible = False
- End If
- End If
- End Sub
- Private Sub ControlPrecio()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtPrecio.Text, valor)
- If Not vParse Then
- lblPrecioErr.Visible = True
- Else
- oPropuestaInversionCE.Precio = valor
- Me.txtPrecio.Text = oPropuestaInversionCE.Precio.ToString(Configuraciones.CodigoTXTMontos)
- lblPrecioErr.Visible = False
- End If
- End If
- End Sub
- Private Sub ControlRendimiento()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(txtRendimiento.Text.Replace("%", ""), valor)
- If Not vParse Then
- Me.lblRendimientoErr.Visible = True
- Else
- oPropuestaInversionCE.Rendimiento = valor / 100
- txtRendimiento.Text = oPropuestaInversionCE.Rendimiento.ToString(Configuraciones.CodigoTXTPorcentaje)
- Me.lblRendimientoErr.Visible = False
- End If
- End If
- End Sub
- Private Sub ControlPlazoNumero()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- Dim vParse As Boolean = True
- Dim valor As Integer = 0
- If Me.txtPlazoNumero.Text.Length > 0 Then
- vParse = Integer.TryParse(Me.txtPlazoNumero.Text, valor)
- End If
- If Not vParse Then
- Me.lblPlazoErrr.Visible = True
- Else
- oPropuestaInversionCE.PlazoNumero = valor
- Me.lblPlazoErrr.Visible = False
- End If
- End If
- End Sub
- Private Sub ControlPlazoFactor()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.PlazoFactor = Me.cbxPlazosFactor.SelectedValue
- End If
- End Sub
- Private Sub ControlIngresos()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- Dim vParse As Boolean
- Dim valor As Double
- vParse = Double.TryParse(Me.txtIngresos.Text, valor)
- If Not vParse Then
- Me.lblingresosErr.Visible = True
- Else
- oPropuestaInversionCE.Ingresos = valor
- Me.txtIngresos.Text = oPropuestaInversionCE.Ingresos.ToString(Configuraciones.CodigoTXTMontos)
- Me.lblingresosErr.Visible = False
- End If
- End If
- End Sub
- Private Sub ControlOrigenDeFondos()
- If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.OrigenDeFondos = Me.cbxOrigenDeFondos.SelectedValue
- End If
- End Sub
- Private Sub ControlEmisores()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.CodigoEmisor = Me.cbxEmisores.SelectedValue
- End If
- End Sub
- Private Sub ControlCalificacionesDeRiesgo()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.CodigoCalificacionDeRiesgo = Me.cbxCalificacionDeRiesgo.SelectedValue
- End If
- End Sub
- Private Sub ControlCalificadoraDeRiesgo()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.CodigoEmpresaCalificadora = Me.cbxCalificadoraDeRiesgo.SelectedValue
- End If
- End Sub
- Private Sub ControlTipoMercado()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.TipoMercado = Me.cbxTipoMercado.SelectedValue
- End If
- End Sub
- Private Sub ControlPais()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.Pais = Me.cbxPaises.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 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.cbxEstadoDocumento.SelectedValue
- End If
- End Sub
- Private Sub ControlEstadoAutorizacion()
- If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
- oPropuestaInversionCE.EstadoAutorizacion = Me.cbxAutorizacion.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.cbxTipoOperacion.SelectedValue
- End If
- End Sub
- Private Sub LimpiarControles()
- Dim vCero As Double = 0
- Dim vCerotxt As String = vCero.ToString(Configuraciones.CodigoTXTMontos)
- Me.cbxEmpresas.SelectedIndex = -1
- Me.txtAsunto.Text = String.Empty
- Me.cbxInstrumentosFinancieros.SelectedIndex = -1
- Me.txtMontoInversion.Text = vCerotxt
- Me.txtPrecio.Text = vCerotxt
- Me.txtRendimiento.Text = vCerotxt
- Me.txtPlazoNumero.Text = String.Empty
- Me.cbxPlazosFactor.SelectedIndex = -1
- Me.txtIngresos.Text = vCerotxt
- Me.cbxOrigenDeFondos.SelectedIndex = -1
- Me.cbxEmisores.SelectedIndex = -1
- Me.cbxCalificacionDeRiesgo.SelectedIndex = -1
- Me.cbxCalificadoraDeRiesgo.SelectedIndex = -1
- Me.txtJustificacion.Text = String.Empty
- Me.txtComentarios.Text = String.Empty
- Me.txtCodigoInversion.Text = String.Empty
- Me.txtCodigoInversion.ReadOnly = False
- Me.cbxEstadoDocumento.SelectedIndex = -1
- Me.cbxAutorizacion.SelectedIndex = -1
- Me.dtpFechaDocumento.Value = Date.Now.Date
- Me.cbxTipoOperacion.SelectedIndex = -1
- Me.cbxTipoMercado.SelectedIndex = -1
- Me.cbxPaises.SelectedIndex = -1
- End Sub
- Private Sub RefrescarValoresControles()
- ControlEmpresa()
- ControlAsunto()
- ControlInstrumento()
- ControlMontoInversion()
- ControlPrecio()
- ControlRendimiento()
- ControlPlazoNumero()
- ControlPlazoFactor()
- ControlIngresos()
- ControlOrigenDeFondos()
- ControlEmisores()
- ControlCalificacionesDeRiesgo()
- ControlCalificadoraDeRiesgo()
- ControlJustificacion()
- ControlComentarios()
- ControlCodigoInversion()
- ControlEstadoDocumento()
- ControlEstadoAutorizacion()
- ControlFechaDocumento()
- ControlTipoOperacion()
- ControlTipoMercado()
- ControlPais()
- End Sub
- Private Function ValoresValidos() As Boolean
- Dim retorno As Boolean = True
- If TipoTransaccion = "N" Then
- If oPropuestaInversionCE.CodigoEmpresa.Length = 0 Then retorno = False
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero.Length = 0 Then retorno = False
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero.Length = 0 Then retorno = False
- If oPropuestaInversionCE.EstadoDocumento.Length = 0 Then retorno = False
- If oPropuestaInversionCE.EstadoAutorizacion.Length = 0 Then retorno = False
- If (String.IsNullOrEmpty(oPropuestaInversionCE.TipoOperacion)) Then
- retorno = False
- Else
- If oPropuestaInversionCE.TipoOperacion.Length = 0 Then retorno = False
- End If
- End If
- Return retorno
- End Function
- Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxTipoOperacion.SelectedIndexChanged
- ControlTipoOperacion()
- End Sub
- Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
- Variables.Codigo = txtCodigoInversion.Text
- 'If Not oDAOGeneral.PropuestaTieneInstrumentoAsociado(oPropuestaInversionCE.CodigoInversion, oPropuestaInversionCE.TipoInstrumentoFinanciero) Then
- ' MsgBox("Esta Propuesta no tiene un detalle asociado.", MsgBoxStyle.Critical)
- ' GoTo Salida
- 'End If
- If oPropuestaInversionCE.TipoInstrumentoFinanciero = "FINV" Then
- frmFOIN.Show()
- End If
- If oPropuestaInversionCE.TipoInstrumentoFinanciero = "FUTU" Or oPropuestaInversionCE.TipoInstrumentoFinanciero = "OPC" Then
- frmFuturos.Show()
- End If
- If Not oPropuestaInversionCE Is Nothing Then
- If oPropuestaInversionCE.TipoInstrumentoFinanciero = "ACC" Then
- Dim oFormulario As New frmAcciones
- If TipoTransaccion = "C" Then
- oFormulario.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
- oFormulario.ShowDialog()
- End If
- If TipoTransaccion = "N" Then
- oFormulario.TipoTransaccion = "N"
- If oFormulario.ShowDialog = DialogResult.OK Then
- Me.oCEAcciones = New AccionesCE
- Me.oCEAcciones = oFormulario.RetornarObjeto
- InstrumentoFinanciero = Me.oCEAcciones
- oFormulario.Dispose()
- End If
- End If
- End If
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero = "LETE" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "CETE" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "PBUR" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "VCN" Then
- Dim oFormulario As New frmLetes
- If TipoTransaccion = "C" Then
- Dim vValidar As Integer
- Dim vCodigoInversion As String = oPropuestaInversionCE.CodigoInversion
- vValidar = oDAOLETES.Comprobar(vCodigoInversion)
- If vValidar > 0 Then
- 'MsgBox("Se encuentran detalles.")
- oFormulario.CargarRegistro(vCodigoInversion)
- oFormulario.ShowDialog()
- Else
- MsgBox("No se encuentran detalles del instrumento.")
- End If
- 'oFormulario.CargarRegistro(IdPIN, "P")
- 'oFormulario.ShowDialog()
- End If
- If TipoTransaccion = "N" Then
- oFormulario.Modo = "N"
- If oFormulario.ShowDialog = DialogResult.OK Then
- Me.oCELetes = New LETESCE
- Me.oCELetes = oFormulario.RetornarObjeto
- InstrumentoFinanciero = Me.oCELetes
- oFormulario.Dispose()
- End If
- End If
- End If
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero = "BONO" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "CINV" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "TIT" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "EURB" Then
- Dim oFormulario As New frmCertificadosDeInversion
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero = "CINV" Then
- If TipoTransaccion = "C" Then
- oFormulario.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
- oFormulario.ShowDialog()
- End If
- If TipoTransaccion = "N" Then
- oFormulario.TipoTransaccion = "N"
- If oFormulario.ShowDialog = DialogResult.OK Then
- Dim oCE As New CertificadoDeInversionCE
- oCE = oFormulario.RetornarObjeto
- InstrumentoFinanciero = oCE
- oFormulario.Dispose()
- End If
- End If
- ElseIf oPropuestaInversionCE.CodigoInstrumentoFinanciero = "CINV" Then
- oFormulario.ShowDialog()
- ElseIf oPropuestaInversionCE.CodigoInstrumentoFinanciero = "BONO" Or oPropuestaInversionCE.CodigoInstrumentoFinanciero = "EURB" Then
- oFormulario.ShowDialog()
- End If
- End If
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero = "DAP" Then
- Dim oFormulario As New frmDepositosAPlazo
- If TipoTransaccion = "C" Then
- oFormulario.CargarRegistro(IdPIN, "P")
- oFormulario.ShowDialog()
- End If
- If TipoTransaccion = "N" Then
- 'oFormulario.Modo = "N"
- If oFormulario.ShowDialog = DialogResult.OK Then
- Me.oCEDAP = New DepositosAPlazoCE
- Me.oCEDAP = oFormulario.RetornarObjeto
- InstrumentoFinanciero = Me.oCEDAP
- oFormulario.Dispose()
- End If
- End If
- End If
- If oPropuestaInversionCE.CodigoInstrumentoFinanciero = "REPO" Then
- Dim oFormulario As New frmReporto
- If TipoTransaccion = "C" Then
- oFormulario.ShowDialog()
- End If
- If TipoTransaccion = "N" Then
- oFormulario.Modo = "N"
- If oFormulario.ShowDialog = DialogResult.OK Then
- Me.oCEReportos = New ReportosCE
- InstrumentoFinanciero = oCEReportos
- oFormulario.Dispose()
- End If
- End If
- End If
- End If
- Salida:
- End Sub
- Private Sub navNuevo_Click(sender As Object, e As EventArgs)
- NuevaPropuesta()
- End Sub
- Private Sub DeshabilitarControles()
- cbxEmpresas.Enabled = False
- txtAsunto.ReadOnly = True
- cbxInstrumentosFinancieros.Enabled = False
- txtMontoInversion.ReadOnly = True
- txtPrecio.ReadOnly = True
- txtRendimiento.ReadOnly = True
- txtPlazoNumero.ReadOnly = True
- cbxPlazosFactor.Enabled = False
- txtIngresos.ReadOnly = True
- cbxOrigenDeFondos.Enabled = False
- cbxEmisores.Enabled = False
- cbxCalificacionDeRiesgo.Enabled = False
- cbxCalificadoraDeRiesgo.Enabled = False
- txtJustificacion.ReadOnly = True
- txtComentarios.ReadOnly = True
- cbxTipoOperacion.Enabled = False
- cbxEstadoDocumento.Enabled = False
- cbxAutorizacion.Enabled = False
- dtpFechaDocumento.Enabled = False
- cbxTipoMercado.Enabled = False
- cbxPaises.Enabled = False
- txtCodigoInversion.ReadOnly = True
- End Sub
- Private Sub HabilitarControles()
- cbxEmpresas.Enabled = True
- txtAsunto.ReadOnly = False
- cbxInstrumentosFinancieros.Enabled = True
- txtMontoInversion.ReadOnly = False
- txtPrecio.ReadOnly = False
- txtRendimiento.ReadOnly = False
- txtPlazoNumero.ReadOnly = False
- cbxPlazosFactor.Enabled = True
- txtIngresos.ReadOnly = False
- cbxOrigenDeFondos.Enabled = True
- cbxEmisores.Enabled = True
- cbxCalificacionDeRiesgo.Enabled = True
- cbxCalificadoraDeRiesgo.Enabled = True
- txtJustificacion.ReadOnly = False
- txtComentarios.ReadOnly = False
- cbxTipoOperacion.Enabled = True
- cbxAutorizacion.Enabled = True
- dtpFechaDocumento.Enabled = True
- cbxTipoMercado.Enabled = True
- cbxPaises.Enabled = True
- cbxEstadoDocumento.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 cbxAutorizacion.SelectedIndexChanged
- ControlEstadoAutorizacion()
- End Sub
- Private Sub btnActivar_Click(sender As Object, e As EventArgs) Handles btnActivar.Click
- Variables.Plazo = txtPlazoNumero.Text
- If (cbxPlazosFactor.SelectedValue = Nothing) Then
- Variables.PlazoFact = ""
- Else
- Variables.PlazoFact = cbxPlazosFactor.SelectedValue.ToString()
- End If
- ' If TipoTransaccion = "C" Then
- If oPropuestaInversionCE.EstadoDocumento <> "C" Then
- 'SI NO ESTA CERRADA
- If oPropuestaInversionCE.EstadoAutorizacion <> "A" Then
- 'SI NO ESTA AUTORIZADA
- Else
- 'ESTA AUTORIZADA
- Dim Id = oDAOPropuestasDeInversion.IdRegistro(txtCodigoInversion.Text)
- ConvertirEnInversion(Id)
- End If
- Else
- 'SI NO ESTA CERRADA
- End If
- 'End If
- End Sub
- Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxPaises.SelectedIndexChanged
- ControlPais()
- End Sub
- Private Sub cboTipoMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxTipoMercado.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)
- If vConversion = 1 Then
- MsgBox("Completo")
- CargarPropuesta(vIdPropuesta)
- Else
- MsgBox("Error")
- End If
- End If
- End Sub
- Private Sub RefrescarControles()
- If TipoTransaccion = "C" Then
- RestaurarControlesDeBusqueda()
- DeshabilitarControles()
- End If
- If TipoTransaccion = "B" Then
- HabilitarControles()
- End If
- If TipoTransaccion = "A" Then
- HabilitarControles()
- cbxEstadoDocumento.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(cbxPeriodicidad.SelectedValue)) Then
- Me.cbxPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
- Me.cbxPeriodicidad.DisplayMember = "Descripcion"
- Me.cbxPeriodicidad.ValueMember = "Codigo"
- Me.cbxPeriodicidad.SelectedIndex = -1
- End If
- End Sub
- Private Sub CargarTipoRenta()
- Me.cbxRenta.DataSource = oDAOGeneral.ListaTipoRenta
- Me.cbxRenta.DisplayMember = "Descripcion"
- Me.cbxRenta.ValueMember = "Codigo"
- Me.cbxRenta.SelectedIndex = -1
- End Sub
- Private Sub CargarTipoTasa()
- Me.cbxTasa.DataSource = oDAOGeneral.ListaTipoTasa
- Me.cbxTasa.DisplayMember = "Descripcion"
- Me.cbxTasa.ValueMember = "Codigo"
- Me.cbxTasa.SelectedIndex = -1
- End Sub
- Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxPeriodicidad.SelectedIndexChanged
- End Sub
- Private Sub cboTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxTasa.SelectedIndexChanged
- End Sub
- Private Sub navEliminar_Click(sender As Object, e As EventArgs)
- If (Borrar() = 0) Then
- LimpiarControles()
- End If
- ' CargarNavegador()
- Refrescar()
- btnAccion.Text = "Buscar"
- 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 navNuevo_Click_1(sender As Object, e As EventArgs) Handles navNuevo.Click
- 'gpbInversión.Visible = False
- NuevaPropuesta()
- PIN0BindingSource.SuspendBinding()
- Refrescar()
- TipoTransaccion = "N"
- End Sub
- Private Sub DeshabilitarBotonesBusqueda()
- 'cboEmpresas.Enabled =
- 'txtAsunto.ReadOnly =
- 'cboInstrumentosFinancieros.Enabled =
- txtMontoInversion.ReadOnly = True
- txtPrecio.ReadOnly = True
- txtRendimiento.ReadOnly = True
- txtPlazoNumero.ReadOnly = True
- cbxPlazosFactor.Enabled = False
- txtIngresos.ReadOnly = True
- cbxOrigenDeFondos.Enabled = False
- ' cboEmisores.Enabled =
- cbxCalificacionDeRiesgo.Enabled =
- cbxCalificadoraDeRiesgo.Enabled = False
- txtJustificacion.ReadOnly = True
- txtComentarios.ReadOnly = True
- cbxTipoOperacion.Enabled = False
- ' cboEstadoDocumento.Enabled =
- cbxAutorizacion.Enabled = False
- dtpFechaDocumento.Enabled = False
- cbxTipoMercado.Enabled = False
- cbxPaises.Enabled = False
- End Sub
- Private Sub navBuscar_Click_1(sender As Object, e As EventArgs) Handles navBuscar.Click
- 'HabilitarControles()
- 'DeshabilitarBotonesBusqueda()
- 'gpbInversión.Visible = False
- PrepararBusqueda()
- ''PIN0BindingSource.SuspendBinding()
- TipoTransaccion = "B"
- End Sub
- Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
- btnAccion.Text = "Actualizar"
- HabilitarControles()
- TipoTransaccion = "M"
- Operaciones.TipoOperacion = "M"
- UsuarioPrivilegio()
- PrepararModificacion()
- Refrescar()
- BloquearEmpresaInstrumento()
- TipoTransaccion = "A"
- 'PIN0BindingSource.SuspendBinding()
- 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
- If (Operaciones.TipoOperacion = "M") Then
- UsuarioPrivilegio()
- Else
- 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
- If (BorrarPropuesta() = 0) Then
- LimpiarControles()
- End If
- PIN0BindingSource.SuspendBinding()
- Refrescar()
- btnAccion.Text = "Buscar"
- HabilitarControles()
- DeshabilitarBotonesBusqueda()
- PrepararBusqueda()
- End Sub
- Public Function BorrarPropuesta()
- 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
- Else
- Return 1
- End If
- End Function
- Private Sub Navegador_RefreshItems_1(sender As Object, e As EventArgs) Handles oBindingNavigator.RefreshItems
- End Sub
- Private Sub PIN0BindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles PIN0BindingSource.CurrentChanged
- End Sub
- Private Sub navRegistroAnterior_Click_1(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
- 'btnAccion.Text = "Aceptar"
- 'DeshabilitarControles()
- End Sub
- Private Sub navPrimerRegistro_Click_1(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
- btnAccion.Text = "Aceptar"
- DeshabilitarControles()
- End Sub
- Private Sub navUltimoRegistro_Click_1(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
- btnAccion.Text = "Aceptar"
- DeshabilitarControles()
- End Sub
- Private Sub PrepararControlesParaBusqueda()
- cbxEmpresas.BackColor = Configuraciones.ColorFondoBusqueda
- txtAsunto.BackColor = Configuraciones.ColorFondoBusqueda
- cbxInstrumentosFinancieros.BackColor = Configuraciones.ColorFondoBusqueda
- txtCodigoInversion.BackColor = Configuraciones.ColorFondoBusqueda
- btnAccion.Text = "Buscar"
- End Sub
- Private Sub RestaurarControlesDeBusqueda()
- cbxEmpresas.BackColor = Color.White
- txtAsunto.BackColor = Color.White
- cbxInstrumentosFinancieros.BackColor = Color.White
- txtCodigoInversion.BackColor = Color.White
- End Sub
- Private Sub btnVistaPreliminar_Click(sender As Object, e As EventArgs) Handles navVistaPreliminar.Click
- Impresion(True)
- End Sub
- Private Sub btnImprimir_Click(sender As Object, e As EventArgs) Handles navImprimir.Click
- Impresion(False)
- End Sub
- Private Sub Impresion(ByVal pVistaPreliminar As Boolean)
- If Not IdPIN = Nothing Then
- Dim oImprimir As New frmImprimir
- 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 btnRequisicionDePago_Click(sender As Object, e As EventArgs) Handles btnRequisicionDePago.Click
- 'Dim oRequisicionDePago As New frmReqPago
- 'oRequisicionDePago.CodigoInversion = oPropuestaInversionCE.CodigoInversion
- 'oRequisicionDePago.CodigoEmpresa = oPropuestaInversionCE.CodigoEmpresa
- 'oRequisicionDePago.ShowDialog()
- End Sub
- End Class
|