frmPIN.vb 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098
  1. Public Class frmPIN
  2. Dim oPropuestaInversionCE As CEPropuestaInversion = New CEPropuestaInversion
  3. Dim oDAOGeneral As DAOGeneral = New DAOGeneral
  4. Dim oDAOLETES As LETESDAO = New LETESDAO
  5. Dim oDAOPropuestasDeInversion As DAOPropuestaInversion = New DAOPropuestaInversion
  6. Dim oCEAcciones As AccionesCE
  7. Dim oCEBonos As BonosCE
  8. Dim oCEDAP As DepositosAPlazoCE
  9. Dim oCELetes As LETESCE
  10. Dim oCEReportos As ReportosCE
  11. Dim TipoTransaccion As String = "B"
  12. Dim InstrumentoFinanciero As Object
  13. Dim ResultadoMsgBox As Integer
  14. Dim IdPIN As Integer
  15. Dim IdIF As String
  16. Dim FormAcciones As New frmAcciones
  17. Dim FormFuturos As New frmFuturos
  18. Dim FormPrestamoEmpresarial As New frmPrestamoEmpresariales
  19. Dim FormPrestamoPersonal As New frmPrestamoPersonal
  20. Dim FormRepo As New frmReporto
  21. Dim FormLete As New frmLetes
  22. Dim FormCINV As New frmCertificadosDeInversion
  23. Dim FormDAP As New frmDepositosAPlazo
  24. Dim Operaciones As New Operaciones
  25. Dim oInversionDAO As New InversionDAO
  26. Dim TieneDetalleInstrumento As Boolean = False
  27. Private _PlazosFactor As String
  28. Sub AgregarCheckbox(ByRef P_cboObjeto As ComboBox, ByRef P_flpObjeto As FlowLayoutPanel)
  29. Dim Datos As New Dictionary(Of String, String)
  30. Dim i As Integer = 1
  31. While i < P_cboObjeto.Items.Count
  32. P_cboObjeto.SelectedIndex = i
  33. Dim Valor As String = P_cboObjeto.SelectedValue
  34. Dim Texto As String = P_cboObjeto.Text
  35. Datos.Add(Valor, Texto)
  36. i += 1
  37. End While
  38. For Each RecorrerDatos In Datos
  39. Dim O_Check As New CheckBox
  40. Dim Existe As Boolean = False
  41. Dim Nombre = RecorrerDatos.Value
  42. For Each item As CheckBox In P_flpObjeto.Controls
  43. If item.Text.ToString = Nombre.ToString Then
  44. Existe = True
  45. End If
  46. Next
  47. If Not Existe Then
  48. O_Check.Name = RecorrerDatos.Key
  49. O_Check.Checked = True
  50. O_Check.Width = 250
  51. O_Check.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  52. O_Check.Text = Nombre
  53. P_flpObjeto.Controls.Add(O_Check)
  54. AddHandler O_Check.Click, AddressOf evento
  55. AddHandler O_Check.CheckedChanged, AddressOf Colorevento
  56. End If
  57. Existe = False
  58. Next
  59. Dim O_ChequeTodos As New CheckBox
  60. O_ChequeTodos.Name = "Todos"
  61. O_ChequeTodos.Checked = True
  62. O_ChequeTodos.Width = 250
  63. O_ChequeTodos.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  64. O_ChequeTodos.Text = "Todos"
  65. P_flpObjeto.Controls.Add(O_ChequeTodos)
  66. AddHandler O_ChequeTodos.Click, AddressOf evento
  67. AddHandler O_ChequeTodos.CheckedChanged, AddressOf Colorevento
  68. End Sub
  69. Sub evento(sender As Object, e As EventArgs)
  70. Dim P_flpObjeto As New FlowLayoutPanel
  71. P_flpObjeto = sender.parent
  72. If sender.name = "Todos" Then
  73. CambioCheckTodos(P_flpObjeto)
  74. Else
  75. TodosCheck(P_flpObjeto, sender, e)
  76. End If
  77. End Sub
  78. Sub Colorevento(sender As Object, e As EventArgs)
  79. If (sender.checked) Then
  80. sender.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  81. Else
  82. sender.BackColor = ColorTranslator.FromHtml("Transparent")
  83. End If
  84. End Sub
  85. Sub CambioCheckTodos(ByRef P_flpObjeto As FlowLayoutPanel)
  86. Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1
  87. Dim UltimoCheck As Boolean = True
  88. For Each xCheckBox In P_flpObjeto.Controls
  89. If TypeOf xCheckBox Is CheckBox Then
  90. Dim yCheckBox As New CheckBox
  91. yCheckBox = xCheckBox
  92. If xCheckBox.TabIndex = ContadorPrimario Then
  93. If Not yCheckBox.Checked Then
  94. UltimoCheck = False
  95. End If
  96. End If
  97. End If
  98. Next
  99. If UltimoCheck Then
  100. For Each xCheckBox In P_flpObjeto.Controls
  101. If TypeOf xCheckBox Is CheckBox Then
  102. Dim yCheckBox As New CheckBox
  103. yCheckBox = xCheckBox
  104. yCheckBox.Checked = True
  105. End If
  106. Next
  107. ElseIf Not UltimoCheck Then
  108. For Each xCheckBox In P_flpObjeto.Controls
  109. If TypeOf xCheckBox Is CheckBox Then
  110. Dim yCheckBox As New CheckBox
  111. yCheckBox = xCheckBox
  112. yCheckBox.Checked = False
  113. End If
  114. Next
  115. End If
  116. End Sub
  117. Sub TodosCheck(ByRef P_flpObjeto As FlowLayoutPanel, sender As Object, e As EventArgs)
  118. Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1
  119. Dim TodosCheck As Boolean = True
  120. If Not sender.name = "Todos" Then
  121. For Each xCheckBox In P_flpObjeto.Controls
  122. If TypeOf xCheckBox Is CheckBox Then
  123. Dim yCheckBox As New CheckBox
  124. yCheckBox = xCheckBox
  125. If Not yCheckBox.TabIndex = ContadorPrimario Then
  126. If Not yCheckBox.Checked Then
  127. TodosCheck = False
  128. End If
  129. End If
  130. If yCheckBox.TabIndex = ContadorPrimario Then
  131. If Not TodosCheck Then
  132. yCheckBox.Checked = False
  133. Else
  134. yCheckBox.Checked = True
  135. End If
  136. End If
  137. End If
  138. Next
  139. End If
  140. End Sub
  141. Private Sub frmPIN_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  142. 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet2.PIN0' Puede moverla o quitarla según sea necesario.
  143. Me.PIN0TableAdapter2.Fill(Me.InversionesDEVDataSet2.PIN0)
  144. 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet.PIN0' Puede moverla o quitarla según sea necesario.
  145. 'Me.PIN0TableAdapter.Fill(Me.InversionesDataSet.PIN0)
  146. 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet1.PIN0' Puede moverla o quitarla según sea necesario.
  147. 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
  148. 'TODO: esta línea de código carga datos en la tabla 'InversionesDataSet.PIN0' Puede moverla o quitarla según sea necesario.
  149. Call CargarEstadosDocumento()
  150. Call CargarEstadosAutorizacion()
  151. Call CargarEmpresas()
  152. Call CargarInstrumentosFinancieros()
  153. Call CargarEmisores()
  154. Call CargarCalificacionDeRiesgo()
  155. Call CargarCalificadoraDeRiesgo()
  156. Call CargarOrigenDeFondos()
  157. Call CargarTipoOperacion()
  158. Call CargarPaises()
  159. Call CargarTiposMercado()
  160. Call CargarTipoRenta()
  161. Call CargarTipoTasa()
  162. Call CargarPlazos()
  163. Call CargarPeriodicidades()
  164. 'Call CargarRegistro(0)
  165. If TipoTransaccion Is Nothing Then
  166. TipoTransaccion = "N"
  167. End If
  168. If TipoTransaccion = "N" Then
  169. Call NuevaPropuesta()
  170. ElseIf TipoTransaccion = "B" Then
  171. 'Call CargarPropuesta()
  172. End If
  173. 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
  174. 'PIN0BindingSource.SuspendBinding()
  175. 'PIN0BindingSource.ResumeBinding()
  176. gpbInversión.Visible = False
  177. 'NuevaPropuesta()
  178. txtCodigoInversion.Text = String.Empty
  179. HabilitarBusqueda()
  180. formato()
  181. ConfiguracionInicial()
  182. End Sub
  183. Private Sub CargarRegistro(posicion As Integer)
  184. Dim cargar As New DataTable
  185. cargar = oInversionDAO.ListaCodigosPropuesta()
  186. cboEmpresas.SelectedValue = cargar.Rows(posicion)(1).ToString
  187. txtAsunto.Text = cargar.Rows(posicion)(2).ToString
  188. cboInstrumentosFinancieros.SelectedValue = cargar.Rows(posicion)(3).ToString
  189. txtMontoInversion.Text = cargar.Rows(posicion)(4).ToString
  190. txtPrecio.Text = cargar.Rows(posicion)(5).ToString
  191. txtRendimiento.Text = cargar.Rows(posicion)(6).ToString
  192. txtPlazoNumero.Text = cargar.Rows(posicion)(7).ToString
  193. cboPlazosFactor.SelectedValue = cargar.Rows(posicion)(8).ToString
  194. txtIngresos.Text = cargar.Rows(posicion)(9).ToString
  195. cboOrigenDeFondos.SelectedValue = cargar.Rows(posicion)(10).ToString
  196. cboEmisores.SelectedValue = cargar.Rows(posicion)(11).ToString
  197. cboCalificacionDeRiesgo.SelectedValue = cargar.Rows(posicion)(12).ToString
  198. cboCalificadoraDeRiesgo.SelectedValue = cargar.Rows(posicion)(13).ToString
  199. cboPaises.SelectedValue = cargar.Rows(posicion)(14).ToString
  200. cboTipoMercado.SelectedValue = cargar.Rows(posicion)(15).ToString
  201. txtCodigoInversion.Text = cargar.Rows(posicion)(16).ToString
  202. cboEstadoDocumento.SelectedValue = cargar.Rows(posicion)(17).ToString
  203. cboTipoOperacion.SelectedValue = cargar.Rows(posicion)(18).ToString
  204. dtpFechaDocumento.Value = cargar.Rows(posicion)(19)
  205. cboAutorizacion.SelectedValue = cargar.Rows(posicion)(20).ToString
  206. End Sub
  207. Private Sub UsuarioPrivilegio()
  208. Dim codigo As String = txtCodigoInversion.Text
  209. Dim Comprobar As New DAOGeneral
  210. Dim Estado As String = Comprobar.EstadoAutorizacionPro(codigo)
  211. Dim Existe As Boolean = ExisteInstrumento("INV0")
  212. If Existe Then
  213. gpbInversión.Visible = False
  214. MsgBox("La Inversion ya existe")
  215. Else
  216. If Estado = "A" Then
  217. gpbInversión.Visible = True
  218. Else
  219. gpbInversión.Visible = False
  220. End If
  221. End If
  222. End Sub
  223. Private Sub CargarEstadosDocumento()
  224. Dim vTipoTransaccion As String = TipoTransaccion
  225. TipoTransaccion = "X"
  226. Me.cboEstadoDocumento.DataSource = oDAOPropuestasDeInversion.ListaEstadoDocumento.Tables("EstadosDocumento")
  227. Me.cboEstadoDocumento.DisplayMember = "Descripcion"
  228. Me.cboEstadoDocumento.ValueMember = "Codigo"
  229. Me.cboEstadoDocumento.SelectedIndex = -1
  230. TipoTransaccion = vTipoTransaccion
  231. AgregarCheckbox(cboEstadoDocumento, flpEstadoDocumento)
  232. End Sub
  233. Private Sub CargarEstadosAutorizacion()
  234. Dim vTipoTransaccion As String = TipoTransaccion
  235. TipoTransaccion = "X"
  236. Me.cboAutorizacion.DataSource = oDAOGeneral.ListaEstadoAutorizacion
  237. Me.cboAutorizacion.DisplayMember = "Descripcion"
  238. Me.cboAutorizacion.ValueMember = "Codigo"
  239. Me.cboAutorizacion.SelectedIndex = -1
  240. TipoTransaccion = vTipoTransaccion
  241. AgregarCheckbox(cboAutorizacion, flpAutorizacion)
  242. End Sub
  243. Private Sub CargarEmpresas()
  244. Dim vTipoTransaccion As String = TipoTransaccion
  245. TipoTransaccion = "X"
  246. Me.cboEmpresas.DataSource = oDAOGeneral.ListaEmpresas
  247. Me.cboEmpresas.DisplayMember = "Descripcion"
  248. Me.cboEmpresas.ValueMember = "Codigo"
  249. Me.cboEmpresas.SelectedIndex = -1
  250. TipoTransaccion = vTipoTransaccion
  251. AgregarCheckbox(cboEmpresas, flpEmpresas)
  252. End Sub
  253. Private Sub CargarInstrumentosFinancieros()
  254. Dim vTipoTransaccion As String = TipoTransaccion
  255. TipoTransaccion = "X"
  256. Me.cboInstrumentosFinancieros.DataSource = oDAOGeneral.ListaInstrumentos
  257. Me.cboInstrumentosFinancieros.DisplayMember = "Descripcion"
  258. Me.cboInstrumentosFinancieros.ValueMember = "Codigo"
  259. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  260. TipoTransaccion = vTipoTransaccion
  261. AgregarCheckbox(cboInstrumentosFinancieros, flpInstrumentos)
  262. End Sub
  263. Private Sub CargarEmisores()
  264. Dim vTipoTransaccion As String = TipoTransaccion
  265. TipoTransaccion = "X"
  266. Me.cboEmisores.DataSource = oDAOGeneral.ListaEmisores
  267. Me.cboEmisores.DisplayMember = "Descripcion"
  268. Me.cboEmisores.ValueMember = "Codigo"
  269. Me.cboEmisores.SelectedIndex = -1
  270. TipoTransaccion = vTipoTransaccion
  271. AgregarCheckbox(cboEmisores, flpEmisor)
  272. End Sub
  273. Private Sub CargarCalificacionDeRiesgo()
  274. Dim vTipoTransaccion As String = TipoTransaccion
  275. TipoTransaccion = "X"
  276. Me.cboCalificacionDeRiesgo.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo
  277. Me.cboCalificacionDeRiesgo.DisplayMember = "Descripcion"
  278. Me.cboCalificacionDeRiesgo.ValueMember = "Codigo"
  279. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  280. TipoTransaccion = vTipoTransaccion
  281. AgregarCheckbox(cboCalificacionDeRiesgo, flpCalificacionRiesgo)
  282. End Sub
  283. Private Sub CargarCalificadoraDeRiesgo()
  284. Dim vTipoTransaccion As String = TipoTransaccion
  285. TipoTransaccion = "X"
  286. Me.cboCalificadoraDeRiesgo.DataSource = oDAOGeneral.ListaEmpresasCalificadoras
  287. Me.cboCalificadoraDeRiesgo.DisplayMember = "Descripcion"
  288. Me.cboCalificadoraDeRiesgo.ValueMember = "Codigo"
  289. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  290. TipoTransaccion = vTipoTransaccion
  291. AgregarCheckbox(cboCalificadoraDeRiesgo, flpCalificadoraRiesgo)
  292. End Sub
  293. Private Sub CargarOrigenDeFondos()
  294. Dim vTipoTransaccion As String = TipoTransaccion
  295. TipoTransaccion = "X"
  296. Me.cboOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos
  297. Me.cboOrigenDeFondos.DisplayMember = "Descripcion"
  298. Me.cboOrigenDeFondos.ValueMember = "Codigo"
  299. Me.cboOrigenDeFondos.SelectedIndex = -1
  300. TipoTransaccion = vTipoTransaccion
  301. AgregarCheckbox(cboOrigenDeFondos, flpOrigenFondos)
  302. End Sub
  303. Private Sub CargarPlazos()
  304. Dim vTipoTransaccion As String = TipoTransaccion
  305. TipoTransaccion = "X"
  306. Me.cboPlazosFactor.DataSource = oDAOGeneral.ListaPlazosFactor
  307. Me.cboPlazosFactor.DisplayMember = "Descripcion"
  308. Me.cboPlazosFactor.ValueMember = "Codigo"
  309. Me.cboPlazosFactor.SelectedIndex = -1
  310. TipoTransaccion = vTipoTransaccion
  311. AgregarCheckbox(cboPlazosFactor, flpPlazo)
  312. End Sub
  313. Private Sub CargarTipoOperacion()
  314. Dim vTipoTransaccion As String = TipoTransaccion
  315. TipoTransaccion = "X"
  316. Me.cboTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion
  317. Me.cboTipoOperacion.DisplayMember = "Descripcion"
  318. Me.cboTipoOperacion.ValueMember = "Codigo"
  319. Me.cboTipoOperacion.SelectedIndex = -1
  320. TipoTransaccion = vTipoTransaccion
  321. AgregarCheckbox(cboTipoOperacion, flpTipoOperacion)
  322. End Sub
  323. Private Sub CargarPaises()
  324. Dim vTipoTransaccion As String = TipoTransaccion
  325. TipoTransaccion = "X"
  326. Me.cboPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion
  327. Me.cboPaises.DisplayMember = "Descripcion"
  328. Me.cboPaises.ValueMember = "Codigo"
  329. Me.cboPaises.SelectedIndex = -1
  330. TipoTransaccion = vTipoTransaccion
  331. AgregarCheckbox(cboPaises, flpPais)
  332. End Sub
  333. Private Sub CargarTiposMercado()
  334. Dim vTipoTransaccion As String = TipoTransaccion
  335. TipoTransaccion = "X"
  336. Me.cboTipoMercado.DataSource = oDAOGeneral.ListaTiposMercado
  337. Me.cboTipoMercado.DisplayMember = "Descripcion"
  338. Me.cboTipoMercado.ValueMember = "Codigo"
  339. Me.cboTipoMercado.SelectedIndex = -1
  340. TipoTransaccion = vTipoTransaccion
  341. AgregarCheckbox(cboTipoMercado, flpTipoMercado)
  342. End Sub
  343. Private Sub NuevaPropuesta()
  344. If oPropuestaInversionCE Is Nothing Then
  345. oPropuestaInversionCE = New CEPropuestaInversion
  346. End If
  347. 'TipoTransaccion = "N"
  348. HabilitarControles()
  349. LimpiarControles()
  350. Me.cboEstadoDocumento.SelectedValue = "A"
  351. Me.cboAutorizacion.SelectedValue = "P"
  352. Me.btnAccion.Text = "Guardar"
  353. Me.txtCodigoInversion.ReadOnly = True
  354. End Sub
  355. Private Function GuardarPropuesta()
  356. Dim ValidacionCorrecta As Boolean = ValoresValidos()
  357. If ValidacionCorrecta Then
  358. RefrescarValoresControles()
  359. Dim Instrumento As String = GuardarInstrumentoFinanciero()
  360. If Not TieneDetalleInstrumento Then
  361. ResultadoMsgBox = MessageBox.Show("No se ha ingresado detalles del Instrumento." & vbCrLf & "Desea continuar sin detalles?", "Sin Detalles", MessageBoxButtons.YesNo)
  362. If ResultadoMsgBox = DialogResult.Yes Then
  363. If Not String.IsNullOrEmpty(Instrumento) Then
  364. Dim Guardado As Boolean = oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, Instrumento)
  365. If Guardado Then
  366. TieneDetalleInstrumento = False
  367. End If
  368. 'Me.Dispose()
  369. End If
  370. End If
  371. Else
  372. If Not String.IsNullOrEmpty(Instrumento) Then
  373. oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, Instrumento)
  374. 'Me.Dispose()
  375. End If
  376. 'Me.Dispose()
  377. End If
  378. End If
  379. Return ValidacionCorrecta
  380. End Function
  381. Function GuardarInstrumentoFinanciero()
  382. Dim CodigoInstrumentoFinanciero As String = String.Empty
  383. Try
  384. CodigoInstrumentoFinanciero = cboInstrumentosFinancieros.SelectedValue
  385. Catch ex As Exception
  386. End Try
  387. 'Dim vRetorno As Integer
  388. 'Dim vCodigoInversion As String = " " ' oPropuestaInversionCE.CodigoIversion
  389. 'vCodigoInversion = "LETE"
  390. 'If Not InstrumentoFinanciero Is Nothing Then
  391. ' Dim oAccionesCE As AccionesCE
  392. ' If InstrumentoFinanciero.GetType.ToString = oAccionesCE.GetType.ToString Then
  393. ' Dim oDAOAcciones As AccionesDAO = New AccionesDAO
  394. ' 'vRetorno = oDAOAcciones.Nuevo(InstrumentoFinanciero, 1, "P")
  395. ' End If
  396. ' If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEBonos" Then
  397. ' Dim oDAOBonos As BonosDAO = New BonosDAO
  398. ' 'vRetorno = oDAOBonos.Nuevo(InstrumentoFinanciero, 1, "P")
  399. ' End If
  400. ' If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEDAP" Then
  401. ' Dim oDAODAP As DepositosAPlazoDAO = New DepositosAPlazoDAO
  402. ' 'vRetorno = oDAODAP.Nuevo(InstrumentoFinanciero, 1, "P")
  403. ' End If
  404. ' If InstrumentoFinanciero.GetType.ToString = "Inversiones.CELetes" Then
  405. ' Dim oDAOLetes As LETESDAO = New LETESDAO
  406. ' 'vRetorno = oDAOLetes.Nuevo(InstrumentoFinanciero, vCodigoInversion)
  407. ' End If
  408. ' If InstrumentoFinanciero.GetType.ToString = "Inversiones.CEReportos" Then
  409. ' Dim oDAOReportos As ReportosDAO = New ReportosDAO
  410. ' 'vRetorno = oDAOReportos.Nuevo(InstrumentoFinanciero, 1, "P")
  411. ' End If
  412. 'End If
  413. Return CodigoInstrumentoFinanciero
  414. End Function
  415. Private Sub EliminarPropuesta()
  416. End Sub
  417. Private Sub ActualizarPropuesta(ByVal parametro As String)
  418. Dim retorno As Integer
  419. RefrescarValoresControles()
  420. retorno = oDAOPropuestasDeInversion.Actualizar(oPropuestaInversionCE, parametro)
  421. If retorno = 0 Then
  422. MsgBox("Registro Actualizado", MsgBoxStyle.Information)
  423. CargarPropuesta(IdPIN)
  424. 'TipoTransaccion = "C"
  425. 'btnAccion.Text = "Aceptar"
  426. 'DeshabilitarControles()
  427. End If
  428. End Sub
  429. Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresas.SelectedIndexChanged
  430. ControlEmpresa()
  431. End Sub
  432. Private Sub txtAsunto_TextChanged(sender As Object, e As EventArgs) Handles txtAsunto.TextChanged
  433. End Sub
  434. Private Sub txtAsunto_LostFocus(sender As Object, e As EventArgs) Handles txtAsunto.LostFocus
  435. ControlAsunto()
  436. End Sub
  437. Private Sub cboInstrumentosFinancieros_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboInstrumentosFinancieros.SelectedIndexChanged
  438. ControlInstrumento()
  439. TieneDetalleInstrumento = False
  440. End Sub
  441. Private Sub txtMontoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtMontoInversion.TextChanged
  442. Dim vParse As Boolean
  443. Dim valor As Double
  444. vParse = Double.TryParse(Me.txtMontoInversion.Text, valor)
  445. If Not vParse Then
  446. 'Me.lblMontoInversionErr.Visible = True
  447. Else
  448. 'Me.lblMontoInversionErr.Visible = False
  449. End If
  450. ControlMontoInv()
  451. End Sub
  452. Private Sub txtMontoInversion_LostFocus(sender As Object, e As EventArgs) Handles txtMontoInversion.LostFocus
  453. ControlMontoInversion()
  454. End Sub
  455. Private Sub txtPrecio_TextChanged(sender As Object, e As EventArgs) Handles txtPrecio.TextChanged
  456. Dim vParse As Boolean
  457. Dim valor As Double
  458. vParse = Double.TryParse(Me.txtPrecio.Text, valor)
  459. If Not vParse Then
  460. 'lblPrecioErr.Visible = True
  461. Else
  462. 'lblPrecioErr.Visible = False
  463. End If
  464. ControlPr()
  465. End Sub
  466. Private Sub txtPrecio_LostFocus(sender As Object, e As EventArgs) Handles txtPrecio.LostFocus
  467. ControlPrecio()
  468. End Sub
  469. Private Sub txtRendimiento_TextChanged(sender As Object, e As EventArgs)
  470. 'Dim vParse As Boolean
  471. 'Dim valor As Double
  472. 'vParse = Double.TryParse(txtRendimiento.Text.Replace("%", ""), valor)
  473. 'If Not vParse Then
  474. ' Me.lblRendimientoErr.Visible = True
  475. 'Else
  476. ' Me.lblRendimientoErr.Visible = False
  477. 'End If
  478. 'ControlRend()
  479. End Sub
  480. Private Sub txtRendimiento_LostFocus(sender As Object, e As EventArgs)
  481. ControlRendimiento()
  482. End Sub
  483. Private Sub cboPlazos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPlazosFactor.SelectedIndexChanged
  484. ControlPlazoFactor()
  485. ControlPlazoFact()
  486. End Sub
  487. Private Sub txtPlazoNumero_TextChanged(sender As Object, e As EventArgs) Handles txtPlazoNumero.TextChanged
  488. If TipoTransaccion = "N" Then
  489. Dim vParse As Boolean = True
  490. Dim valor As Integer = 0
  491. If Me.txtPlazoNumero.Text.Length > 0 Then
  492. vParse = Integer.TryParse(Me.txtPlazoNumero.Text, valor)
  493. End If
  494. If Not vParse Then
  495. 'Me.lblPlazoErrr.Visible = True
  496. Else
  497. 'Me.lblPlazoErrr.Visible = False
  498. End If
  499. End If
  500. ControlPlazoNum()
  501. End Sub
  502. Private Sub txtPlazoNumero_LostFocus(sender As Object, e As EventArgs) Handles txtPlazoNumero.LostFocus
  503. ControlPlazoNumero()
  504. End Sub
  505. Private Sub txtIngresos_TextChanged(sender As Object, e As EventArgs) Handles txtIngresos.TextChanged
  506. Dim vParse As Boolean
  507. Dim valor As Double
  508. vParse = Double.TryParse(Me.txtIngresos.Text, valor)
  509. If Not vParse Then
  510. 'Me.lblingresosErr.Visible = True
  511. Else
  512. 'Me.lblingresosErr.Visible = False
  513. End If
  514. ControlIng()
  515. End Sub
  516. Private Sub cboOrigenDeFodos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOrigenDeFondos.SelectedIndexChanged
  517. ControlOrigenDeFondos()
  518. ControlOFon()
  519. End Sub
  520. Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmisores.SelectedIndexChanged
  521. ControlEmisores()
  522. End Sub
  523. Private Sub cboCalificacionDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificacionDeRiesgo.SelectedIndexChanged
  524. ControlCalificacionesDeRiesgo()
  525. End Sub
  526. Private Sub cboCalificadoraDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificadoraDeRiesgo.SelectedIndexChanged
  527. ControlCalificadoraDeRiesgo()
  528. End Sub
  529. Private Sub txtJustificacion_TextChanged(sender As Object, e As EventArgs) Handles txtJustificacion.TextChanged
  530. End Sub
  531. Private Sub txtJustificacion_LostFocus(sender As Object, e As EventArgs) Handles txtJustificacion.LostFocus
  532. ControlJustificacion()
  533. End Sub
  534. Private Sub txtComentarios_TextChanged(sender As Object, e As EventArgs) Handles txtComentarios.TextChanged
  535. End Sub
  536. Private Sub txtComentarios_LostFocus(sender As Object, e As EventArgs) Handles txtComentarios.LostFocus
  537. ControlComentarios()
  538. End Sub
  539. Private Sub cboEstadoDocumento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoDocumento.SelectedIndexChanged
  540. ControlEstadoDocumento()
  541. End Sub
  542. Private Sub dtpFechaDocumento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaDocumento.ValueChanged
  543. ControlFechaDocumento()
  544. End Sub
  545. Private Sub txtIngresos_LostFocus(sender As Object, e As EventArgs) Handles txtIngresos.LostFocus
  546. ControlIngresos()
  547. End Sub
  548. Private Sub PrepararBusqueda()
  549. TipoTransaccion = "B"
  550. oPropuestaInversionCE = Nothing
  551. oPropuestaInversionCE = New CEPropuestaInversion
  552. LimpiarControles()
  553. Me.btnAccion.Text = "Buscar"
  554. End Sub
  555. Private Sub CargarPropuesta(Id As Integer)
  556. oPropuestaInversionCE = Nothing
  557. oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id)
  558. Dim vCodigoEmpresa As String = oPropuestaInversionCE.CodigoEmpresa
  559. If vCodigoEmpresa.Length = 0 Then
  560. Me.cboEmpresas.SelectedIndex = -1
  561. Else
  562. Me.cboEmpresas.SelectedValue = vCodigoEmpresa
  563. End If
  564. Me.txtAsunto.Text = oPropuestaInversionCE.Asunto
  565. Dim vCodigoInstrumentoFinanciero As String = oPropuestaInversionCE.CodigoInstrumentoFinanciero
  566. If vCodigoInstrumentoFinanciero.Length = 0 Then
  567. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  568. Else
  569. Me.cboInstrumentosFinancieros.SelectedValue = vCodigoInstrumentoFinanciero
  570. End If
  571. Me.txtMontoInversion.Text = oPropuestaInversionCE.MontoInversion.ToString(Configuraciones.CodigoTXTMontos)
  572. Me.txtPrecio.Text = oPropuestaInversionCE.Precio.ToString(Configuraciones.CodigoTXTMontos)
  573. Me.txtRendimiento.Text = oPropuestaInversionCE.Rendimiento.ToString(Configuraciones.CodigoTXTPorcentaje)
  574. Me.txtPlazoNumero.Text = oPropuestaInversionCE.PlazoNumero
  575. Dim vPlazoFactor As String = oPropuestaInversionCE.PlazoFactor
  576. If vPlazoFactor.Length = 0 Then
  577. Me.cboPlazosFactor.SelectedIndex = -1
  578. Else
  579. Me.cboPlazosFactor.SelectedValue = vPlazoFactor
  580. End If
  581. Me.txtIngresos.Text = oPropuestaInversionCE.Ingresos.ToString(Configuraciones.CodigoTXTMontos)
  582. Dim vOrigenDeFondos As String = oPropuestaInversionCE.OrigenDeFondos
  583. If vOrigenDeFondos.Length = 0 Then
  584. Me.cboOrigenDeFondos.SelectedIndex = -1
  585. Else
  586. Me.cboOrigenDeFondos.SelectedValue = vOrigenDeFondos
  587. End If
  588. Dim vCodigoEmisor As String = oPropuestaInversionCE.CodigoEmisor
  589. If vCodigoEmisor = 0 Then
  590. Me.cboEmisores.SelectedIndex = -1
  591. Else
  592. Me.cboEmisores.SelectedValue = vCodigoEmisor
  593. End If
  594. Dim vCodigoCalificacionDeRiesgo As String = oPropuestaInversionCE.CodigoCalificacionDeRiesgo
  595. If vCodigoCalificacionDeRiesgo.Length = 0 Then
  596. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  597. Else
  598. Me.cboCalificacionDeRiesgo.SelectedValue = vCodigoCalificacionDeRiesgo
  599. End If
  600. Dim vCodigoEmpresaCalificadora As String = oPropuestaInversionCE.CodigoEmpresaCalificadora
  601. If vCodigoEmpresaCalificadora.Length = 0 Then
  602. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  603. Else
  604. Me.cboCalificadoraDeRiesgo.SelectedValue = vCodigoEmpresaCalificadora
  605. End If
  606. Me.txtJustificacion.Text = oPropuestaInversionCE.Justificacion
  607. Me.txtComentarios.Text = oPropuestaInversionCE.Comentarios
  608. Me.txtCodigoInversion.Text = oPropuestaInversionCE.CodigoIversion
  609. Me.txtCodigoInversion.ReadOnly = True
  610. Dim vEstadoDocumento As String = oPropuestaInversionCE.EstadoDocumento
  611. If vEstadoDocumento.Length = 0 Then
  612. Me.cboEstadoDocumento.SelectedIndex = -1
  613. Else
  614. Me.cboEstadoDocumento.SelectedValue = vEstadoDocumento
  615. End If
  616. Dim vFechaDocumento As Date
  617. If Not Date.TryParse(oPropuestaInversionCE.FechaDocumento, vFechaDocumento) Then
  618. vFechaDocumento = Date.MinValue.Date
  619. End If
  620. Me.dtpFechaDocumento.Value = vFechaDocumento
  621. Dim vTipoOperacion As String = oPropuestaInversionCE.TipoOperacion
  622. If String.IsNullOrEmpty(vTipoOperacion) Then
  623. Me.cboTipoOperacion.SelectedIndex = -1
  624. Else
  625. Me.cboTipoOperacion.SelectedValue = vTipoOperacion
  626. End If
  627. Dim vEstadoAut As String = oPropuestaInversionCE.EstadoAutorizacion
  628. If vEstadoAut.Length = 0 Then
  629. Me.cboAutorizacion.SelectedIndex = -1
  630. Else
  631. Me.cboAutorizacion.SelectedValue = vEstadoAut
  632. End If
  633. Dim vTipoMercado As String = oPropuestaInversionCE.TipoMercado
  634. If String.IsNullOrEmpty(vTipoMercado) Then
  635. cboTipoMercado.SelectedIndex = -1
  636. Else
  637. Me.cboTipoMercado.SelectedValue = vTipoMercado
  638. End If
  639. Dim vPais As String = oPropuestaInversionCE.Pais
  640. If String.IsNullOrEmpty(vPais) Then
  641. cboPaises.SelectedIndex = -1
  642. Else
  643. cboPaises.SelectedValue = vPais
  644. End If
  645. TipoTransaccion = "C"
  646. IdPIN = Id
  647. IdIF = vCodigoInstrumentoFinanciero
  648. Me.btnAccion.Text = "Aceptar"
  649. RefrescarControles()
  650. End Sub
  651. 'NAVEGACION
  652. Sub PrimerRegistro()
  653. End Sub
  654. Sub RegistroAnterior()
  655. End Sub
  656. Sub SiguienteRegistro()
  657. End Sub
  658. Sub UltimoRegistro()
  659. End Sub
  660. Private Sub BloquearEmpresaInstrumento()
  661. 'cboEmpresas.Enabled = False
  662. 'cboInstrumentosFinancieros.Enabled = False
  663. End Sub
  664. '***FIN NAVEGACION
  665. Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
  666. 'cboEstadoDocumento.SelectedIndexChanged()
  667. 'cboEstadoDocumento_SelectedIndexChanged()
  668. If TipoTransaccion = "B" Then
  669. LanzarBusqueda()
  670. ElseIf TipoTransaccion = "N" Then
  671. Dim IngresarInstrumento As Boolean = GuardarPropuesta()
  672. If IngresarInstrumento Then
  673. GuardarFamilia(Variables.Codigo)
  674. LimpiarControles()
  675. txtCodigoInversion.ReadOnly = True
  676. 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
  677. Refrescar()
  678. PIN0BindingSource.SuspendBinding()
  679. End If
  680. ElseIf TipoTransaccion = "A" Then
  681. Dim posicion = PIN0BindingSource.Position
  682. ActualizarPropuesta(txtCodigoInversion.Text)
  683. 'Me.PIN0TableAdapter1.Fill(Me.InversionesDataSet1.PIN0)
  684. Refrescar()
  685. PIN0BindingSource.Position = posicion
  686. 'PIN0BindingSource.SuspendBinding()
  687. DeshabilitarControles()
  688. End If
  689. End Sub
  690. Sub GuardarFamilia(ByVal Instrumento As String)
  691. If InStr(Instrumento, "LETE") > 0 Then
  692. Dim oDAOLetes As New LETESDAO
  693. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  694. If ColeccionLETE.Count > 0 Then
  695. oDAOLetes.NuevoIngreso(ColeccionLETE, "LETE")
  696. ColeccionLETE.Clear()
  697. End If
  698. End If
  699. If InStr(Instrumento, "PBUR") > 0 Then
  700. Dim oDAOLetes As New LETESDAO
  701. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  702. If ColeccionLETE.Count > 0 Then
  703. oDAOLetes.NuevoIngreso(ColeccionLETE, "PBUR")
  704. ColeccionLETE.Clear()
  705. End If
  706. End If
  707. If InStr(Instrumento, "VCN") > 0 Then
  708. Dim oDAOLetes As New LETESDAO
  709. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  710. If ColeccionLETE.Count > 0 Then
  711. oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN")
  712. ColeccionLETE.Clear()
  713. End If
  714. End If
  715. If InStr(Instrumento, "CETE") > 0 Then
  716. Dim oDAOLetes As New LETESDAO
  717. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  718. If ColeccionLETE.Count > 0 Then
  719. oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE")
  720. ColeccionLETE.Clear()
  721. End If
  722. End If
  723. If InStr(Instrumento, "ACC") > 0 Then
  724. Dim oDAOACC As New AccionesDAO
  725. Dim ColeccionACC As Collection = Variables.ColeccionACC
  726. If ColeccionACC.Count > 0 Then
  727. oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC)
  728. ColeccionACC.Clear()
  729. FormAcciones.Dispose()
  730. End If
  731. End If
  732. If InStr(Instrumento, "CINV") > 0 Then
  733. Dim oDAOCINV As New CertificadosDeInversionDAO
  734. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  735. If ColeccionCINV.Count > 0 Then
  736. oDAOCINV.Nuevo(ColeccionCINV, "CINV")
  737. ColeccionCINV.Clear()
  738. End If
  739. End If
  740. If InStr(Instrumento, "BONO") > 0 Then
  741. Dim oDAOCINV As New CertificadosDeInversionDAO
  742. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  743. If ColeccionCINV.Count > 0 Then
  744. oDAOCINV.Nuevo(ColeccionCINV, "BONO")
  745. ColeccionCINV.Clear()
  746. End If
  747. End If
  748. If InStr(Instrumento, "EURB0") > 0 Then
  749. Dim oDAOCINV As New CertificadosDeInversionDAO
  750. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  751. If ColeccionCINV.Count > 0 Then
  752. oDAOCINV.Nuevo(ColeccionCINV, "EURB")
  753. ColeccionCINV.Clear()
  754. End If
  755. End If
  756. If InStr(Instrumento, "TIT") > 0 Then
  757. Dim oDAOCINV As New CertificadosDeInversionDAO
  758. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  759. If ColeccionCINV.Count > 0 Then
  760. oDAOCINV.Nuevo(ColeccionCINV, "TIT")
  761. ColeccionCINV.Clear()
  762. End If
  763. End If
  764. If InStr(Instrumento, "DAP") > 0 Then
  765. Dim oDAODAP As New DepositosAPlazoDAO
  766. Dim ColeccionDAP As Collection = Variables.ColeccionDAP
  767. Dim diccionario = Variables.ColeccionDAPDi
  768. If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then
  769. oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo)
  770. ColeccionDAP.Clear()
  771. diccionario = Nothing
  772. End If
  773. End If
  774. If InStr(Instrumento, "FUTU") > 0 Then
  775. Dim oDAOFUTU As New FuturosDAO
  776. Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU
  777. If ColeccionFUTU.Count > 0 Then
  778. oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU)
  779. ColeccionFUTU.Clear()
  780. End If
  781. End If
  782. If InStr(Instrumento, "OPC") > 0 Then
  783. Dim oDAOOPC As New FuturosDAO
  784. Dim ColeccionOPC As Collection = Variables.ColeccionFUTU
  785. If ColeccionOPC.Count > 0 Then
  786. oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC)
  787. ColeccionOPC.Clear()
  788. End If
  789. End If
  790. If InStr(Instrumento, "PEMP") > 0 Then
  791. Dim oDAOPEMP As New PrestamoEmpresarialDAO
  792. Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP
  793. Dim diccionario = Variables.ColeccionPEMPDi
  794. If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then
  795. oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo")
  796. ColeccionPEMP.Clear()
  797. diccionario = Nothing
  798. End If
  799. End If
  800. If InStr(Instrumento, "PPER") > 0 Then
  801. Dim oDAOPPER As New PrestamoPersonalDAO
  802. Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR
  803. Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE
  804. Dim diccionario = Variables.ColeccionPPERAMORTDi
  805. If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then
  806. oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo")
  807. ColeccionPPERDEUDOR.Clear()
  808. ColeccionPPERDETALLE.Clear()
  809. diccionario = Nothing
  810. End If
  811. End If
  812. If InStr(Instrumento, "REPOVENTA") > 0 Then
  813. Dim oDAOREPO As New ReportosDAO
  814. Dim diccionario = Variables.ColeccionREPO
  815. If Not diccionario Is Nothing Then
  816. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA")
  817. diccionario = Nothing
  818. End If
  819. Else
  820. Dim oDAOREPO As New ReportosDAO
  821. Dim diccionario = Variables.ColeccionREPO
  822. If Not diccionario Is Nothing Then
  823. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0")
  824. diccionario = Nothing
  825. End If
  826. End If
  827. End Sub
  828. Private Sub LanzarBusqueda()
  829. frmBuscarDeLista.dgvBuscarDeLista.DataSource = oDAOPropuestasDeInversion.BuscarPropuestasInversion(oPropuestaInversionCE).Tables("Resultado")
  830. If frmBuscarDeLista.ShowDialog = DialogResult.OK Then
  831. 'Me.DocId = frmBuscarDeLista.CodigoPrincipal
  832. If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then
  833. 'CargarRegistro(frmBuscarDeLista.CodigoPrincipal)
  834. CargarPropuesta(frmBuscarDeLista.CodigoPrincipal)
  835. End If
  836. End If
  837. End Sub
  838. Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs)
  839. PrimerRegistro()
  840. End Sub
  841. Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs)
  842. RegistroAnterior()
  843. End Sub
  844. Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
  845. SiguienteRegistro()
  846. End Sub
  847. Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs)
  848. UltimoRegistro()
  849. End Sub
  850. Private Sub navNuevoRegistro_Click(sender As Object, e As EventArgs)
  851. NuevaPropuesta()
  852. End Sub
  853. Private Sub navEliminarRegistro_Click(sender As Object, e As EventArgs)
  854. EliminarPropuesta()
  855. End Sub
  856. Private Sub navBuscar_Click(sender As Object, e As EventArgs)
  857. PrepararBusqueda()
  858. End Sub
  859. Private Sub cboEmpresas_LostFocus(sender As Object, e As EventArgs) Handles cboEmpresas.LostFocus
  860. End Sub
  861. Sub GenerarCodigoDeInversion()
  862. Dim vEmpresa As String
  863. Dim vCodigoIF As String
  864. Dim oCodigo As String
  865. vEmpresa = oPropuestaInversionCE.CodigoEmpresa
  866. vCodigoIF = oPropuestaInversionCE.CodigoInstrumentoFinanciero
  867. oCodigo = SeriesDAO.SiguienteCodigoInversion(vEmpresa, vCodigoIF)
  868. Me.txtCodigoInversion.Text = oCodigo
  869. End Sub
  870. Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged
  871. ControlCodigoInversion()
  872. End Sub
  873. Private Sub ControlEmpresa()
  874. If TipoTransaccion = "N" Then
  875. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  876. GenerarCodigoDeInversion()
  877. End If
  878. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  879. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  880. End If
  881. End Sub
  882. Private Sub ControlAsunto()
  883. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  884. oPropuestaInversionCE.Asunto = Me.txtAsunto.Text
  885. End If
  886. End Sub
  887. Private Sub ControlInstrumento()
  888. If TipoTransaccion = "N" Then
  889. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  890. GenerarCodigoDeInversion()
  891. End If
  892. If TipoTransaccion = "N" Or TipoTransaccion = "B" Then
  893. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  894. End If
  895. End Sub
  896. Private Sub ControlMontoInversion()
  897. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  898. Dim vParse As Boolean
  899. Dim valor As Double
  900. vParse = Double.TryParse(Me.txtMontoInversion.Text, valor)
  901. If Not vParse Then
  902. 'lblMontoInversionErr.Visible = True
  903. Else
  904. oPropuestaInversionCE.MontoInversion = valor
  905. Me.txtMontoInversion.Text = oPropuestaInversionCE.MontoInversion.ToString(Configuraciones.CodigoTXTMontos)
  906. 'lblMontoInversionErr.Visible = False
  907. End If
  908. End If
  909. End Sub
  910. Private Sub ControlPrecio()
  911. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  912. Dim vParse As Boolean
  913. Dim valor As Double
  914. vParse = Double.TryParse(Me.txtPrecio.Text, valor)
  915. If Not vParse Then
  916. 'lblPrecioErr.Visible = True
  917. Else
  918. oPropuestaInversionCE.Precio = valor
  919. Me.txtPrecio.Text = oPropuestaInversionCE.Precio.ToString(Configuraciones.CodigoTXTMontos)
  920. 'lblPrecioErr.Visible = False
  921. End If
  922. End If
  923. End Sub
  924. Private Sub ControlRendimiento()
  925. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  926. Dim vParse As Boolean
  927. Dim valor As Double
  928. vParse = Double.TryParse(txtRendimiento.Text.Replace("%", ""), valor)
  929. If Not vParse Then
  930. 'Me.lblRendimientoErr.Visible = True
  931. Else
  932. oPropuestaInversionCE.Rendimiento = valor / 100
  933. txtRendimiento.Text = oPropuestaInversionCE.Rendimiento.ToString(Configuraciones.CodigoTXTPorcentaje)
  934. 'Me.lblRendimientoErr.Visible = False
  935. End If
  936. End If
  937. End Sub
  938. Private Sub ControlPlazoNumero()
  939. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  940. Dim vParse As Boolean = True
  941. Dim valor As Integer = 0
  942. If Me.txtPlazoNumero.Text.Length > 0 Then
  943. vParse = Integer.TryParse(Me.txtPlazoNumero.Text, valor)
  944. End If
  945. If Not vParse Then
  946. 'Me.lblPlazoErrr.Visible = True
  947. Else
  948. oPropuestaInversionCE.PlazoNumero = valor
  949. 'Me.lblPlazoErrr.Visible = False
  950. End If
  951. End If
  952. End Sub
  953. Private Sub ControlPlazoFactor()
  954. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  955. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  956. End If
  957. End Sub
  958. Private Sub ControlIngresos()
  959. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  960. Dim vParse As Boolean
  961. Dim valor As Double
  962. vParse = Double.TryParse(Me.txtIngresos.Text, valor)
  963. If Not vParse Then
  964. 'Me.lblingresosErr.Visible = True
  965. Else
  966. oPropuestaInversionCE.Ingresos = valor
  967. Me.txtIngresos.Text = oPropuestaInversionCE.Ingresos.ToString(Configuraciones.CodigoTXTMontos)
  968. 'Me.lblingresosErr.Visible = False
  969. End If
  970. End If
  971. End Sub
  972. Private Sub ControlOrigenDeFondos()
  973. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  974. oPropuestaInversionCE.OrigenDeFondos = Me.cboOrigenDeFondos.SelectedValue
  975. End If
  976. End Sub
  977. Private Sub ControlEmisores()
  978. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  979. oPropuestaInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue
  980. End If
  981. End Sub
  982. Private Sub ControlCalificacionesDeRiesgo()
  983. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  984. oPropuestaInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificacionDeRiesgo.SelectedValue
  985. End If
  986. End Sub
  987. Private Sub ControlCalificadoraDeRiesgo()
  988. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  989. oPropuestaInversionCE.CodigoEmpresaCalificadora = Me.cboCalificadoraDeRiesgo.SelectedValue
  990. End If
  991. End Sub
  992. Private Sub ControlTipoMercado()
  993. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  994. If Me.cboTipoMercado.SelectedIndex = -1 Then
  995. oPropuestaInversionCE.TipoMercado = ""
  996. Else
  997. oPropuestaInversionCE.TipoMercado = Me.cboTipoMercado.SelectedValue
  998. End If
  999. End If
  1000. End Sub
  1001. Private Sub ControlPais()
  1002. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1003. If Me.cboPaises.SelectedIndex = -1 Then
  1004. oPropuestaInversionCE.Pais = ""
  1005. Else
  1006. oPropuestaInversionCE.Pais = Me.cboPaises.SelectedValue
  1007. End If
  1008. End If
  1009. End Sub
  1010. Private Sub ControlPlazoFact()
  1011. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1012. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  1013. End If
  1014. End Sub
  1015. Private Sub ControlPlazoNum()
  1016. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1017. If String.IsNullOrEmpty(txtPlazoNumero.Text) Then
  1018. oPropuestaInversionCE.PlazoNumero = 0
  1019. Else
  1020. oPropuestaInversionCE.PlazoNumero = txtPlazoNumero.Text
  1021. End If
  1022. End If
  1023. End Sub
  1024. Private Sub ControlMontoInv()
  1025. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1026. If String.IsNullOrEmpty(txtMontoInversion.Text) Then
  1027. oPropuestaInversionCE.MontoInversion = 0
  1028. Else
  1029. oPropuestaInversionCE.MontoInversion = txtMontoInversion.Text
  1030. End If
  1031. End If
  1032. End Sub
  1033. Private Sub ControlPr()
  1034. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1035. If String.IsNullOrEmpty(txtPrecio.Text) Then
  1036. oPropuestaInversionCE.Precio = 0
  1037. Else
  1038. oPropuestaInversionCE.Precio = txtPrecio.Text
  1039. End If
  1040. End If
  1041. End Sub
  1042. Private Sub ControlRend()
  1043. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1044. If String.IsNullOrEmpty(txtRendimiento.Text.ToString.Trim("%")) Then
  1045. oPropuestaInversionCE.Rendimiento = 0
  1046. Else
  1047. oPropuestaInversionCE.Rendimiento = CDec(txtRendimiento.Text.ToString.Trim("%"))
  1048. End If
  1049. End If
  1050. End Sub
  1051. Private Sub ControlIng()
  1052. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1053. If String.IsNullOrEmpty(txtIngresos.Text) Then
  1054. oPropuestaInversionCE.Ingresos = 0
  1055. Else
  1056. oPropuestaInversionCE.Ingresos = txtIngresos.Text
  1057. End If
  1058. End If
  1059. End Sub
  1060. Private Sub ControlJustificacion()
  1061. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1062. oPropuestaInversionCE.Justificacion = Me.txtJustificacion.Text
  1063. End If
  1064. End Sub
  1065. Private Sub ControlOFon()
  1066. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1067. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1068. oPropuestaInversionCE.OrigenDeFondos = ""
  1069. Else
  1070. oPropuestaInversionCE.OrigenDeFondos = cboOrigenDeFondos.SelectedValue
  1071. End If
  1072. End If
  1073. End Sub
  1074. Private Sub ControlTipOper()
  1075. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1076. If cboTipoOperacion.SelectedIndex = -1 Then
  1077. oPropuestaInversionCE.TipoOperacion = ""
  1078. Else
  1079. oPropuestaInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue
  1080. End If
  1081. End If
  1082. End Sub
  1083. Private Sub ControlComentarios()
  1084. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1085. oPropuestaInversionCE.Comentarios = Me.txtComentarios.Text
  1086. End If
  1087. End Sub
  1088. Private Sub ControlCodigoInversion()
  1089. If TipoTransaccion = "N" Or TipoTransaccion = "B" Then
  1090. oPropuestaInversionCE.CodigoIversion = txtCodigoInversion.Text
  1091. End If
  1092. End Sub
  1093. Private Sub ControlEstadoDocumento()
  1094. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1095. oPropuestaInversionCE.EstadoDocumento = Me.cboEstadoDocumento.SelectedValue
  1096. End If
  1097. End Sub
  1098. Private Sub ControlEstadoAutorizacion()
  1099. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1100. oPropuestaInversionCE.EstadoAutorizacion = Me.cboAutorizacion.SelectedValue
  1101. End If
  1102. End Sub
  1103. Private Sub ControlFechaDocumento()
  1104. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1105. oPropuestaInversionCE.FechaDocumento = Me.dtpFechaDocumento.Value.Date
  1106. End If
  1107. End Sub
  1108. Private Sub ControlTipoOperacion()
  1109. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1110. oPropuestaInversionCE.TipoOperacion = Me.cboTipoOperacion.SelectedValue
  1111. End If
  1112. End Sub
  1113. Private Sub LimpiarControles()
  1114. Dim vCero As Double = 0
  1115. Dim vCerotxt As String = vCero.ToString(Configuraciones.CodigoTXTMontos)
  1116. Me.cboEmpresas.SelectedIndex = -1
  1117. Me.txtAsunto.Text = String.Empty
  1118. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  1119. Me.txtMontoInversion.Text = vCerotxt
  1120. Me.txtPrecio.Text = vCerotxt
  1121. Me.txtRendimiento.Text = vCerotxt
  1122. Me.txtPlazoNumero.Text = String.Empty
  1123. Me.cboPlazosFactor.SelectedIndex = -1
  1124. Me.txtIngresos.Text = vCerotxt
  1125. Me.cboOrigenDeFondos.SelectedIndex = -1
  1126. Me.cboEmisores.SelectedIndex = -1
  1127. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  1128. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  1129. Me.txtJustificacion.Text = String.Empty
  1130. Me.txtComentarios.Text = String.Empty
  1131. Me.txtCodigoInversion.Text = String.Empty
  1132. Me.txtCodigoInversion.ReadOnly = False
  1133. Me.cboEstadoDocumento.SelectedIndex = -1
  1134. Me.cboAutorizacion.SelectedIndex = -1
  1135. Me.dtpFechaDocumento.Value = Date.Now.Date
  1136. Me.cboTipoOperacion.SelectedIndex = -1
  1137. Me.cboTipoMercado.SelectedIndex = -1
  1138. Me.cboPaises.SelectedIndex = -1
  1139. End Sub
  1140. Private Sub RefrescarValoresControles()
  1141. ControlEmpresa()
  1142. ControlAsunto()
  1143. ControlInstrumento()
  1144. ControlMontoInversion()
  1145. ControlPrecio()
  1146. ControlRendimiento()
  1147. ControlPlazoNumero()
  1148. ControlPlazoFactor()
  1149. ControlIngresos()
  1150. ControlOrigenDeFondos()
  1151. ControlEmisores()
  1152. ControlCalificacionesDeRiesgo()
  1153. ControlCalificadoraDeRiesgo()
  1154. ControlJustificacion()
  1155. ControlComentarios()
  1156. ControlCodigoInversion()
  1157. ControlEstadoDocumento()
  1158. ControlEstadoAutorizacion()
  1159. ControlFechaDocumento()
  1160. ControlTipoOperacion()
  1161. ControlTipoMercado()
  1162. ControlPais()
  1163. ControlPlazoNum()
  1164. ControlPlazoFact()
  1165. ControlMontoInv()
  1166. ControlPr()
  1167. ControlRend()
  1168. ControlIng()
  1169. ControlOFon()
  1170. ControlTipOper()
  1171. End Sub
  1172. Private Function ValoresValidos() As Boolean
  1173. Dim DatosValidos As Boolean = True
  1174. If cboEmpresas.SelectedIndex = -1 Then
  1175. MsgBox("Seleccione una Empresa")
  1176. DatosValidos = False
  1177. Return DatosValidos
  1178. End If
  1179. If cboTipoOperacion.SelectedIndex = -1 Then
  1180. MsgBox("Seleccione un Tipo de Operación")
  1181. DatosValidos = False
  1182. Return DatosValidos
  1183. End If
  1184. If cboInstrumentosFinancieros.SelectedIndex = -1 Then
  1185. MsgBox("Seleccione un Instrumento")
  1186. DatosValidos = False
  1187. Return DatosValidos
  1188. End If
  1189. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1190. MsgBox("Seleccione un origen de fondos")
  1191. DatosValidos = False
  1192. Return DatosValidos
  1193. End If
  1194. Return DatosValidos
  1195. End Function
  1196. Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged
  1197. ControlTipoOperacion()
  1198. ControlTipOper()
  1199. End Sub
  1200. Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
  1201. Variables.Codigo = txtCodigoInversion.Text
  1202. Variables.Periodicidad = cboPeriodicidad.SelectedValue
  1203. TieneDetalleInstrumento = True
  1204. Dim NuevaPosInstrumento As Boolean = False
  1205. If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
  1206. Variables.CodigoComparativo = Variables.Codigo
  1207. Else
  1208. If Not Variables.CodigoComparativo = Variables.Codigo Then
  1209. NuevaPosInstrumento = True
  1210. End If
  1211. End If
  1212. Variables.InvPro = "P"
  1213. Dim CodigoInstrumento As String = txtCodigoInversion.Text
  1214. If InStr(CodigoInstrumento, "FINV") > 0 Then
  1215. frmFOIN.ShowDialog()
  1216. End If
  1217. If (InStr(CodigoInstrumento, "FUTU") > 0 Or InStr(CodigoInstrumento, "OPC") > 0) Then
  1218. Dim ExistInstrumento As Boolean
  1219. If (InStr(CodigoInstrumento, "FUTU")) Then
  1220. ExistInstrumento = ExisteInstrumento("FUT0")
  1221. Else
  1222. ExistInstrumento = ExisteInstrumento("OPC0")
  1223. End If
  1224. Try
  1225. If ExistInstrumento Then
  1226. FormFuturos.Dispose()
  1227. FormFuturos = New frmFuturos
  1228. 'FormFuturos.CargarRegistro(oInversionCE.CodigoIversion)
  1229. FormFuturos.ShowDialog()
  1230. Else
  1231. If NuevaPosInstrumento Then
  1232. Variables.CodigoComparativo = String.Empty
  1233. FormFuturos.Dispose()
  1234. FormFuturos = New frmFuturos
  1235. FormFuturos.ShowDialog()
  1236. Else
  1237. FormFuturos.ShowDialog()
  1238. End If
  1239. End If
  1240. Catch ex As Exception
  1241. FormFuturos = New frmFuturos
  1242. FormFuturos.ShowDialog()
  1243. End Try
  1244. End If
  1245. If InStr(CodigoInstrumento, "REPO") > 0 Or InStr(CodigoInstrumento, "REPOVENTA") > 0 Then
  1246. Dim ExistInstrumento As Boolean
  1247. If (InStr(CodigoInstrumento, "REPOVENTA")) Then
  1248. ExistInstrumento = ExisteInstrumento("REP0VENTA")
  1249. Else
  1250. ExistInstrumento = ExisteInstrumento("REP0")
  1251. End If
  1252. Try
  1253. If ExistInstrumento Then
  1254. FormRepo.Dispose()
  1255. FormRepo = New frmReporto
  1256. 'FormRepo.CargarRegistro(oInversionCE.CodigoIversion)
  1257. FormRepo.ShowDialog()
  1258. Else
  1259. If NuevaPosInstrumento Then
  1260. Variables.CodigoComparativo = String.Empty
  1261. FormRepo.Dispose()
  1262. FormRepo = New frmReporto
  1263. FormRepo.ShowDialog()
  1264. Else
  1265. FormRepo.ShowDialog()
  1266. End If
  1267. End If
  1268. Catch ex As Exception
  1269. FormRepo = New frmReporto
  1270. FormRepo.ShowDialog()
  1271. End Try
  1272. 'Dim frmInstrumento As New frmReporto
  1273. 'If TipoOperacion = "C" Then
  1274. ' frmInstrumento.ShowDialog()
  1275. 'End If
  1276. 'If TipoOperacion = "N" Then
  1277. ' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1278. ' Dim oCE As New ReportosCE
  1279. ' oInstrumentoFinanciero = oCE
  1280. ' frmInstrumento.Dispose()
  1281. ' Refrescar()
  1282. ' End If
  1283. 'End If
  1284. End If
  1285. If (InStr(CodigoInstrumento, "PPER") > 0) Then
  1286. Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0")
  1287. Try
  1288. If ExistInstrumento Then
  1289. FormPrestamoPersonal.Dispose()
  1290. FormPrestamoPersonal = New frmPrestamoPersonal
  1291. 'FormPrestamoPersonal.CargarRegistro(oInversionCE.CodigoIversion)
  1292. FormPrestamoPersonal.ShowDialog()
  1293. Else
  1294. If NuevaPosInstrumento Then
  1295. Variables.CodigoComparativo = String.Empty
  1296. FormPrestamoPersonal.Dispose()
  1297. FormPrestamoPersonal = New frmPrestamoPersonal
  1298. FormPrestamoPersonal.ShowDialog()
  1299. Else
  1300. FormPrestamoPersonal.ShowDialog()
  1301. End If
  1302. End If
  1303. Catch ex As Exception
  1304. FormPrestamoPersonal = New frmPrestamoPersonal
  1305. FormPrestamoPersonal.ShowDialog()
  1306. End Try
  1307. End If
  1308. If (InStr(CodigoInstrumento, "PEMP") > 0) Then
  1309. Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0")
  1310. Try
  1311. If ExistInstrumento Then
  1312. FormPrestamoEmpresarial.Dispose()
  1313. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1314. 'FormPrestamoEmpresarial.CargarRegistro(oInversionCE.CodigoIversion)
  1315. FormPrestamoEmpresarial.ShowDialog()
  1316. Else
  1317. If NuevaPosInstrumento Then
  1318. Variables.CodigoComparativo = String.Empty
  1319. FormPrestamoEmpresarial.Dispose()
  1320. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1321. FormPrestamoEmpresarial.ShowDialog()
  1322. Else
  1323. FormPrestamoEmpresarial.ShowDialog()
  1324. End If
  1325. End If
  1326. Catch ex As Exception
  1327. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1328. FormPrestamoEmpresarial.ShowDialog()
  1329. End Try
  1330. End If
  1331. Dim Acciones As Integer = 0
  1332. If InStr(CodigoInstrumento, "ACC") > 0 Then
  1333. Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0")
  1334. Try
  1335. If ExistInstrumento Then
  1336. FormAcciones.Dispose()
  1337. FormAcciones = New frmAcciones
  1338. FormAcciones.CargarRegistro(oPropuestaInversionCE.CodigoIversion)
  1339. FormAcciones.ShowDialog()
  1340. Else
  1341. If NuevaPosInstrumento Then
  1342. Variables.CodigoComparativo = String.Empty
  1343. FormAcciones.Dispose()
  1344. FormAcciones = New frmAcciones
  1345. FormAcciones.ShowDialog()
  1346. Else
  1347. FormAcciones.ShowDialog()
  1348. End If
  1349. End If
  1350. Catch ex As Exception
  1351. FormAcciones = New frmAcciones
  1352. FormAcciones.ShowDialog()
  1353. End Try
  1354. 'Dim frmInstrumento As New frmAcciones
  1355. ''frmInstrumento.Show()
  1356. 'If TipoOperacion = "C" Then
  1357. ' frmInstrumento.ShowDialog()
  1358. 'Else
  1359. ' frmInstrumento.ShowDialog()
  1360. 'End If
  1361. ''If TipoOperacion = "N" Then
  1362. '' frmInstrumento.TipoTransaccion = "N"
  1363. '' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1364. '' Dim oCE As New AccionesCE
  1365. '' oCE = frmInstrumento.RetornarObjeto
  1366. '' oInstrumentoFinanciero = oCE
  1367. '' frmInstrumento.Dispose()
  1368. '' End If
  1369. ''End If
  1370. End If
  1371. If InStr(CodigoInstrumento, "LETE") > 0 Or InStr(CodigoInstrumento, "PBUR") > 0 Or InStr(CodigoInstrumento, "VCN") > 0 Or InStr(CodigoInstrumento, "CETE") > 0 Then
  1372. Dim ExistInstrumento As Boolean
  1373. If (InStr(CodigoInstrumento, "LETE") > 0) Then
  1374. ExistInstrumento = ExisteInstrumento("LET0")
  1375. ElseIf (InStr(CodigoInstrumento, "PBUR") > 0) Then
  1376. ExistInstrumento = ExisteInstrumento("PBUR")
  1377. ElseIf (InStr(CodigoInstrumento, "VCN") > 0) Then
  1378. ExistInstrumento = ExisteInstrumento("VCN")
  1379. Else
  1380. ExistInstrumento = ExisteInstrumento("CET0")
  1381. End If
  1382. Try
  1383. If ExistInstrumento Then
  1384. FormLete.Dispose()
  1385. FormLete = New frmLetes
  1386. 'FormLete.CargarRegistro(oInversionCE.CodigoIversion)
  1387. FormLete.ShowDialog()
  1388. Else
  1389. If NuevaPosInstrumento Then
  1390. Variables.CodigoComparativo = String.Empty
  1391. FormLete.Dispose()
  1392. FormLete = New frmLetes
  1393. FormLete.ShowDialog()
  1394. Else
  1395. FormLete.ShowDialog()
  1396. End If
  1397. End If
  1398. Catch ex As Exception
  1399. FormLete = New frmLetes
  1400. FormLete.ShowDialog()
  1401. End Try
  1402. 'Dim frmInstrumento As New frmLetes
  1403. 'If TipoOperacion = "C" Then
  1404. 'frmInstrumento.CargarRegistro(oInversionCE.CodigoIversion)
  1405. ' frmInstrumento.ShowDialog()
  1406. 'End If
  1407. 'If TipoOperacion = "N" Then
  1408. ' frmInstrumento.Modo = "N"
  1409. ' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1410. ' Dim oCE As New LETESCE
  1411. ' oCE = frmInstrumento.RetornarObjeto
  1412. ' oInstrumentoFinanciero = oCE
  1413. ' frmInstrumento.Dispose()
  1414. ' End If
  1415. 'End If
  1416. End If
  1417. 'If oInversionCE.CodigoInstrumentoFinanciero = "BONO" Then
  1418. ' Dim frmInstrumento As New frmBonos
  1419. ' If TipoOperacion = "C" Then
  1420. ' frmInstrumento.CargarRegistro(oInversionCE.CodigoIversion)
  1421. ' frmInstrumento.Show()
  1422. ' End If
  1423. ' If TipoOperacion = "N" Then
  1424. ' frmInstrumento.TipoTransaccion = "N"
  1425. ' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1426. ' Dim oCE As New BonosCE
  1427. ' oCE = frmInstrumento.RetornarObjeto
  1428. ' oInstrumentoFinanciero = oCE
  1429. ' frmInstrumento.Dispose()
  1430. ' End If
  1431. ' End If
  1432. 'End If
  1433. If InStr(CodigoInstrumento, "BONO") > 0 Or InStr(CodigoInstrumento, "CINV") > 0 Or InStr(CodigoInstrumento, "TIT") > 0 Or InStr(CodigoInstrumento, "EURB") > 0 Then
  1434. 'Dim frmInstrumento As New frmCertificadosDeInversion
  1435. 'If InStr(CodigoInstrumento, "CINV") > 0 Then
  1436. ' If TipoOperacion = "C" Then
  1437. ' frmInstrumento.CargarRegistro(oInversionCE.CodigoIversion)
  1438. ' frmInstrumento.ShowDialog()
  1439. ' End If
  1440. ' If TipoOperacion = "N" Then
  1441. ' frmInstrumento.TipoTransaccion = "N"
  1442. ' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1443. ' Dim oCE As New CertificadoDeInversionCE
  1444. ' oCE = frmInstrumento.RetornarObjeto
  1445. ' oInstrumentoFinanciero = oCE
  1446. ' frmInstrumento.Dispose()
  1447. ' End If
  1448. ' End If
  1449. 'ElseIf InStr(CodigoInstrumento, "TIT") > 0 Then
  1450. ' frmInstrumento.ShowDialog()
  1451. 'ElseIf InStr(CodigoInstrumento, "EURB") > 0 Or InStr(CodigoInstrumento, "BONO") > 0 Then
  1452. ' frmInstrumento.ShowDialog()
  1453. 'End If
  1454. Dim ExistInstrumento As Boolean
  1455. If (InStr(CodigoInstrumento, "BONO") > 0) Then
  1456. ExistInstrumento = ExisteInstrumento("BON0")
  1457. ElseIf (InStr(CodigoInstrumento, "CINV") > 0) Then
  1458. ExistInstrumento = ExisteInstrumento("CIN0")
  1459. ElseIf (InStr(CodigoInstrumento, "TIT") > 0) Then
  1460. ExistInstrumento = ExisteInstrumento("TIT")
  1461. Else
  1462. ExistInstrumento = ExisteInstrumento("EURB0")
  1463. End If
  1464. Try
  1465. If ExistInstrumento Then
  1466. FormCINV.Dispose()
  1467. FormCINV = New frmCertificadosDeInversion
  1468. FormCINV.CargarRegistro(oPropuestaInversionCE.CodigoIversion)
  1469. FormCINV.ShowDialog()
  1470. MsgBox(0)
  1471. Else
  1472. If NuevaPosInstrumento Then
  1473. Variables.CodigoComparativo = String.Empty
  1474. FormCINV.Dispose()
  1475. FormCINV = New frmCertificadosDeInversion
  1476. FormCINV.ShowDialog()
  1477. Else
  1478. FormCINV.ShowDialog()
  1479. End If
  1480. End If
  1481. Catch ex As Exception
  1482. FormCINV = New frmCertificadosDeInversion
  1483. FormCINV.ShowDialog()
  1484. End Try
  1485. End If
  1486. If InStr(CodigoInstrumento, "DAP") > 0 Then
  1487. 'Dim frmInstrumento As New frmDepositosAPlazo
  1488. 'If TipoOperacion = "C" Then
  1489. Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0")
  1490. Try
  1491. If ExistInstrumento Then
  1492. FormDAP.Dispose()
  1493. FormDAP = New frmDepositosAPlazo
  1494. FormDAP.CargarRegistro(oPropuestaInversionCE.CodigoIversion)
  1495. FormDAP.ShowDialog()
  1496. Else
  1497. If NuevaPosInstrumento Then
  1498. Variables.CodigoComparativo = String.Empty
  1499. FormDAP.Dispose()
  1500. FormDAP = New frmDepositosAPlazo
  1501. FormDAP.ShowDialog()
  1502. Else
  1503. FormDAP.ShowDialog()
  1504. End If
  1505. End If
  1506. Catch ex As Exception
  1507. FormDAP = New frmDepositosAPlazo
  1508. FormDAP.ShowDialog()
  1509. End Try
  1510. 'End If
  1511. 'If TipoOperacion = "N" Then
  1512. ' frmInstrumento.TipoTransaccion = "N"
  1513. ' If frmInstrumento.ShowDialog = DialogResult.OK Then
  1514. ' Dim oCE As New DepositosAPlazoCE
  1515. ' oCE = frmInstrumento.RetornarObjeto
  1516. ' oInstrumentoFinanciero = oCE
  1517. ' frmInstrumento.Dispose()
  1518. ' Refrescar()
  1519. ' End If
  1520. 'End If
  1521. End If
  1522. End Sub
  1523. Function ExisteInstrumento(ByVal Tabla As String)
  1524. Dim General As New DAOGeneral
  1525. Dim Codigo As String = txtCodigoInversion.Text
  1526. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1527. Return Existe
  1528. End Function
  1529. Private Sub navNuevo_Click(sender As Object, e As EventArgs)
  1530. NuevaPropuesta()
  1531. End Sub
  1532. Private Sub DeshabilitarControles()
  1533. cboEmpresas.Enabled = False
  1534. txtAsunto.ReadOnly = True
  1535. cboInstrumentosFinancieros.Enabled = False
  1536. txtMontoInversion.ReadOnly = True
  1537. txtPrecio.ReadOnly = True
  1538. txtRendimiento.ReadOnly = True
  1539. txtPlazoNumero.ReadOnly = True
  1540. cboPlazosFactor.Enabled = False
  1541. txtIngresos.ReadOnly = True
  1542. cboOrigenDeFondos.Enabled = False
  1543. cboEmisores.Enabled = False
  1544. cboCalificacionDeRiesgo.Enabled = False
  1545. cboCalificadoraDeRiesgo.Enabled = False
  1546. txtJustificacion.ReadOnly = True
  1547. txtComentarios.ReadOnly = True
  1548. cboTipoOperacion.Enabled = False
  1549. cboEstadoDocumento.Enabled = False
  1550. cboAutorizacion.Enabled = False
  1551. dtpFechaDocumento.Enabled = False
  1552. cboTipoMercado.Enabled = False
  1553. cboPaises.Enabled = False
  1554. txtCodigoInversion.ReadOnly = True
  1555. End Sub
  1556. Private Sub HabilitarControles()
  1557. cboEmpresas.Enabled = True
  1558. txtAsunto.ReadOnly = False
  1559. cboInstrumentosFinancieros.Enabled = True
  1560. txtMontoInversion.ReadOnly = False
  1561. txtPrecio.ReadOnly = False
  1562. txtRendimiento.ReadOnly = False
  1563. txtPlazoNumero.ReadOnly = False
  1564. cboPlazosFactor.Enabled = True
  1565. txtIngresos.ReadOnly = False
  1566. cboOrigenDeFondos.Enabled = True
  1567. cboEmisores.Enabled = True
  1568. cboCalificacionDeRiesgo.Enabled = True
  1569. cboCalificadoraDeRiesgo.Enabled = True
  1570. txtJustificacion.ReadOnly = False
  1571. txtComentarios.ReadOnly = False
  1572. cboTipoOperacion.Enabled = True
  1573. cboAutorizacion.Enabled = False
  1574. dtpFechaDocumento.Enabled = True
  1575. cboTipoMercado.Enabled = True
  1576. cboPaises.Enabled = True
  1577. cboEstadoDocumento.Enabled = True
  1578. End Sub
  1579. Private Sub PrepararModificacion()
  1580. If oPropuestaInversionCE.EstadoDocumento = "A" Then
  1581. HabilitarControles()
  1582. TipoTransaccion = "A"
  1583. RefrescarControles()
  1584. Me.btnAccion.Text = "Actualizar"
  1585. End If
  1586. End Sub
  1587. Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAutorizacion.SelectedIndexChanged
  1588. ControlEstadoAutorizacion()
  1589. End Sub
  1590. Private Sub btnActivar_Click(sender As Object, e As EventArgs) Handles btnActivar.Click
  1591. Variables.Plazo = txtPlazoNumero.Text
  1592. If (cboPlazosFactor.SelectedValue = Nothing) Then
  1593. Variables.PlazoFact = ""
  1594. Else
  1595. Variables.PlazoFact = cboPlazosFactor.SelectedValue.ToString()
  1596. End If
  1597. If (String.IsNullOrEmpty(cboTasa.SelectedValue)) Then
  1598. Variables.TipoTasa = ""
  1599. Else
  1600. Variables.TipoTasa = cboTasa.SelectedValue.ToString()
  1601. End If
  1602. If (String.IsNullOrEmpty(cboRenta.SelectedValue)) Then
  1603. Variables.TipoRenta = ""
  1604. Else
  1605. Variables.TipoRenta = cboRenta.SelectedValue.ToString()
  1606. End If
  1607. '' If TipoTransaccion = "C" Then
  1608. 'If oPropuestaInversionCE.EstadoDocumento <> "C" Then
  1609. ' 'SI NO ESTA CERRADA
  1610. ' If oPropuestaInversionCE.EstadoAutorizacion <> "A" Then
  1611. ' 'SI NO ESTA AUTORIZADA
  1612. ' Else
  1613. 'ESTA AUTORIZADA
  1614. Variables.NombreMainIF = txtNombre.Text
  1615. Dim Id = oDAOPropuestasDeInversion.IdRegistro(txtCodigoInversion.Text)
  1616. ConvertirEnInversion(Id)
  1617. 'End If
  1618. 'Else
  1619. ' 'SI NO ESTA CERRADA
  1620. 'End If
  1621. 'End If
  1622. End Sub
  1623. Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged
  1624. ControlPais()
  1625. End Sub
  1626. Private Sub cboTipoMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoMercado.SelectedIndexChanged
  1627. ControlTipoMercado()
  1628. End Sub
  1629. Private Sub ConvertirEnInversion(Id As Integer)
  1630. If Not oPropuestaInversionCE Is Nothing Then
  1631. Dim vConversion As Integer
  1632. Dim vIdPropuesta As Integer
  1633. If (oPropuestaInversionCE.IdDeDocumento = 0) Then
  1634. vIdPropuesta = Id
  1635. Else
  1636. vIdPropuesta = oPropuestaInversionCE.IdDeDocumento
  1637. End If
  1638. vConversion = oDAOPropuestasDeInversion.ConvertirEnInversion(vIdPropuesta)
  1639. If vConversion = 1 Then
  1640. MsgBox("Completo")
  1641. CargarPropuesta(vIdPropuesta)
  1642. Else
  1643. MsgBox("Error")
  1644. End If
  1645. End If
  1646. End Sub
  1647. Private Sub RefrescarControles()
  1648. If TipoTransaccion = "C" Then
  1649. 'If oPropuestaInversionCE.EstadoDocumento = "C" Then
  1650. ' DeshabilitarControles()
  1651. 'End If
  1652. DeshabilitarControles()
  1653. End If
  1654. If TipoTransaccion = "B" Then
  1655. HabilitarControles()
  1656. End If
  1657. If TipoTransaccion = "A" Then
  1658. HabilitarControles()
  1659. cboEstadoDocumento.Enabled = False
  1660. End If
  1661. End Sub
  1662. Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
  1663. Me.Close()
  1664. End Sub
  1665. Private Sub CargarPeriodicidades()
  1666. If (String.IsNullOrEmpty(cboPeriodicidad.SelectedValue)) Then
  1667. Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
  1668. Me.cboPeriodicidad.DisplayMember = "Descripcion"
  1669. Me.cboPeriodicidad.ValueMember = "Codigo"
  1670. Me.cboPeriodicidad.SelectedIndex = -1
  1671. End If
  1672. End Sub
  1673. Private Sub CargarTipoRenta()
  1674. Me.cboRenta.DataSource = oDAOGeneral.ListaTipoRenta
  1675. Me.cboRenta.DisplayMember = "Descripcion"
  1676. Me.cboRenta.ValueMember = "Codigo"
  1677. Me.cboRenta.SelectedIndex = -1
  1678. End Sub
  1679. Private Sub CargarTipoTasa()
  1680. Me.cboTasa.DataSource = oDAOGeneral.ListaTipoTasa
  1681. Me.cboTasa.DisplayMember = "Descripcion"
  1682. Me.cboTasa.ValueMember = "Codigo"
  1683. Me.cboTasa.SelectedIndex = -1
  1684. End Sub
  1685. Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
  1686. If Not cboPeriodicidad.SelectedValue Is Nothing Then
  1687. Variables.Periodo = cboPeriodicidad.SelectedValue.ToString()
  1688. Variables.Periodicidad = cboPeriodicidad.SelectedValue.ToString()
  1689. End If
  1690. End Sub
  1691. Private Sub cboTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTasa.SelectedIndexChanged
  1692. End Sub
  1693. Private Sub navEliminar_Click(sender As Object, e As EventArgs)
  1694. If (Borrar() = 0) Then
  1695. LimpiarControles()
  1696. End If
  1697. ' CargarNavegador()
  1698. Refrescar()
  1699. btnAccion.Text = "Buscar"
  1700. PrepararBusqueda()
  1701. End Sub
  1702. Public Sub Refrescar()
  1703. Me.Refresh()
  1704. End Sub
  1705. Public Function Borrar()
  1706. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  1707. If (mensaje = vbOK) Then
  1708. Dim eliminar As New InversionDAO
  1709. Dim valor = eliminar.EliminarPropuesta(txtCodigoInversion.Text)
  1710. If (valor = 1) Then
  1711. MsgBox("Error al Eliminar")
  1712. Return valor
  1713. Else
  1714. MsgBox("Registro Eliminado")
  1715. Return valor
  1716. End If
  1717. End If
  1718. End Function
  1719. Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs)
  1720. End Sub
  1721. Private Sub navSiguienteRegistro_Click_1(sender As Object, e As EventArgs)
  1722. DeshabilitarControles()
  1723. TipoTransaccion = "M"
  1724. Operaciones.TipoOperacion = "M"
  1725. oPropuestaInversionCE.EstadoDocumento = "A"
  1726. PIN0BindingSource.ResumeBinding()
  1727. End Sub
  1728. Sub RellenarDatos()
  1729. Dim MontoPrecio As New Collection
  1730. Dim Codigo As String = txtCodigoInversion.Text
  1731. MontoPrecio = oDAOPropuestasDeInversion.TraerMontosPrecio(Codigo)
  1732. txtMontoInversion.Text = 0
  1733. txtPrecio.Text = 0
  1734. Dim TipoOperacion As String = cboTipoOperacion.SelectedValue
  1735. If Not String.IsNullOrEmpty(TipoOperacion) Then
  1736. If Not MontoPrecio.Count = 0 Then
  1737. Dim MontoPrimario As String = String.Empty
  1738. Dim MontoSecundario As String = String.Empty
  1739. Dim PrecioV As String = String.Empty
  1740. Dim PrecioC As String = String.Empty
  1741. MontoPrimario = MontoPrecio(3).ToString
  1742. MontoSecundario = MontoPrecio(4).ToString
  1743. PrecioV = MontoPrecio(5).ToString
  1744. PrecioC = MontoPrecio(6).ToString
  1745. If TipoOperacion = "C" Then
  1746. If Not String.IsNullOrEmpty(MontoSecundario) Then
  1747. txtMontoInversion.Text = MontoSecundario
  1748. End If
  1749. If Not String.IsNullOrEmpty(PrecioC) Then
  1750. txtPrecio.Text = PrecioC
  1751. End If
  1752. ElseIf TipoOperacion = "V" Then
  1753. If Not String.IsNullOrEmpty(MontoPrimario) Then
  1754. txtMontoInversion.Text = MontoPrimario
  1755. End If
  1756. If Not String.IsNullOrEmpty(PrecioV) Then
  1757. txtPrecio.Text = PrecioV
  1758. End If
  1759. End If
  1760. End If
  1761. End If
  1762. End Sub
  1763. Private Sub navNuevo_Click_1(sender As Object, e As EventArgs) Handles navNuevo.Click
  1764. gpbInversión.Visible = False
  1765. NuevaPropuesta()
  1766. PIN0BindingSource.SuspendBinding()
  1767. Refrescar()
  1768. TipoTransaccion = "N"
  1769. PreNuevoModificar()
  1770. formato()
  1771. End Sub
  1772. Private Sub DeshabilitarBotonesBusqueda()
  1773. 'cboEmpresas.Enabled =
  1774. 'txtAsunto.ReadOnly =
  1775. 'cboInstrumentosFinancieros.Enabled =
  1776. txtMontoInversion.ReadOnly = True
  1777. txtPrecio.ReadOnly = True
  1778. txtRendimiento.ReadOnly = True
  1779. txtPlazoNumero.ReadOnly = True
  1780. cboPlazosFactor.Enabled = False
  1781. txtIngresos.ReadOnly = True
  1782. cboOrigenDeFondos.Enabled = False
  1783. ' cboEmisores.Enabled =
  1784. cboCalificacionDeRiesgo.Enabled =
  1785. cboCalificadoraDeRiesgo.Enabled = False
  1786. txtJustificacion.ReadOnly = True
  1787. txtComentarios.ReadOnly = True
  1788. cboTipoOperacion.Enabled = False
  1789. ' cboEstadoDocumento.Enabled =
  1790. cboAutorizacion.Enabled = False
  1791. dtpFechaDocumento.Enabled = False
  1792. cboTipoMercado.Enabled = False
  1793. cboPaises.Enabled = False
  1794. End Sub
  1795. Sub HabilitarAut()
  1796. cboAutorizacion.Enabled = True
  1797. End Sub
  1798. Private Sub navBuscar_Click_1(sender As Object, e As EventArgs) Handles navBuscar.Click
  1799. HabilitarBusqueda()
  1800. formato()
  1801. End Sub
  1802. Sub HabilitarBusqueda()
  1803. HabilitarControles()
  1804. '' DeshabilitarBotonesBusqueda()
  1805. gpbInversión.Visible = False
  1806. ' PrepararBusqueda()
  1807. PreBusqueda()
  1808. PIN0BindingSource.SuspendBinding()
  1809. TipoTransaccion = "B"
  1810. End Sub
  1811. Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
  1812. btnAccion.Text = "Actualizar"
  1813. HabilitarControles()
  1814. TipoTransaccion = "M"
  1815. Operaciones.TipoOperacion = "M"
  1816. UsuarioPrivilegio()
  1817. PrepararModificacion()
  1818. Refrescar()
  1819. BloquearEmpresaInstrumento()
  1820. TipoTransaccion = "A"
  1821. 'PIN0BindingSource.SuspendBinding()
  1822. PreNuevoModificar()
  1823. formato()
  1824. HabilitarAut()
  1825. End Sub
  1826. Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click
  1827. End Sub
  1828. Private Sub chkUsuario_CheckedChanged(sender As Object, e As EventArgs) Handles chkUsuario.CheckedChanged
  1829. If (Operaciones.TipoOperacion = "M") Then
  1830. UsuarioPrivilegio()
  1831. Else
  1832. End If
  1833. End Sub
  1834. Private Sub BindingNavigatorCountItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorCountItem.Click
  1835. End Sub
  1836. Friend WithEvents vBindingSource As BindingSource
  1837. Private Sub navEliminar_Click_1(sender As Object, e As EventArgs) Handles navEliminar.Click
  1838. If (BorrarPropuesta() = 0) Then
  1839. LimpiarControles()
  1840. End If
  1841. PIN0BindingSource.SuspendBinding()
  1842. Refrescar()
  1843. btnAccion.Text = "Buscar"
  1844. HabilitarControles()
  1845. DeshabilitarBotonesBusqueda()
  1846. PrepararBusqueda()
  1847. Variables.CodigoComparativo = "NULL"
  1848. End Sub
  1849. Public Function BorrarPropuesta()
  1850. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  1851. If (mensaje = vbOK) Then
  1852. Dim eliminar As New InversionDAO
  1853. Dim EliminarCascada As Boolean = ExisteInstrumento("INV0")
  1854. Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "PIN0", EliminarCascada)
  1855. If (valor = 1) Then
  1856. MsgBox("Error al Eliminar")
  1857. Return valor
  1858. Else
  1859. MsgBox("Registro Eliminado")
  1860. Return valor
  1861. End If
  1862. Else
  1863. Return 1
  1864. End If
  1865. End Function
  1866. Private Sub Navegador_RefreshItems_1(sender As Object, e As EventArgs) Handles Navegador.RefreshItems
  1867. RellenarDatos()
  1868. End Sub
  1869. Private Sub PIN0BindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles PIN0BindingSource.CurrentChanged
  1870. End Sub
  1871. Private Sub navRegistroAnterior_Click_1(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
  1872. btnAccion.Text = "Aceptar"
  1873. DeshabilitarControles()
  1874. End Sub
  1875. Private Sub navPrimerRegistro_Click_1(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
  1876. btnAccion.Text = "Aceptar"
  1877. DeshabilitarControles()
  1878. End Sub
  1879. Private Sub navUltimoRegistro_Click_1(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
  1880. btnAccion.Text = "Aceptar"
  1881. DeshabilitarControles()
  1882. End Sub
  1883. Private Sub PreBusqueda()
  1884. Me.cboEmpresas.BackColor = Configuraciones.ColorFondoBusqueda()
  1885. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoBusqueda()
  1886. Me.cboInstrumentosFinancieros.BackColor = Configuraciones.ColorFondoBusqueda()
  1887. Me.cboEmisores.BackColor = Configuraciones.ColorFondoBusqueda()
  1888. Me.cboCalificacionDeRiesgo.BackColor = Configuraciones.ColorFondoBusqueda()
  1889. Me.cboCalificadoraDeRiesgo.BackColor = Configuraciones.ColorFondoBusqueda()
  1890. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoBusqueda()
  1891. Me.cboPaises.BackColor = Configuraciones.ColorFondoBusqueda()
  1892. Me.cboTipoMercado.BackColor = Configuraciones.ColorFondoBusqueda()
  1893. Me.txtNombre.BackColor = Configuraciones.ColorFondoBusqueda()
  1894. Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoBusqueda()
  1895. Me.txtPlazoNumero.BackColor = Configuraciones.ColorFondoBusqueda()
  1896. Me.cboPlazosFactor.BackColor = Configuraciones.ColorFondoBusqueda()
  1897. Me.cboRenta.BackColor = Configuraciones.ColorFondoBusqueda()
  1898. Me.cboTasa.BackColor = Configuraciones.ColorFondoBusqueda()
  1899. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoBusqueda()
  1900. Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoBusqueda()
  1901. txtMontoInversion.BackColor = Configuraciones.ColorFondoBusqueda()
  1902. txtPrecio.BackColor = Configuraciones.ColorFondoBusqueda()
  1903. txtRendimiento.BackColor = Configuraciones.ColorFondoBusqueda()
  1904. txtIngresos.BackColor = Configuraciones.ColorFondoBusqueda()
  1905. cboOrigenDeFondos.BackColor = Configuraciones.ColorFondoBusqueda()
  1906. cboTipoOperacion.BackColor = Configuraciones.ColorFondoBusqueda()
  1907. cboAutorizacion.BackColor = Configuraciones.ColorFondoBusqueda()
  1908. txtAsunto.BackColor = Configuraciones.ColorFondoBusqueda()
  1909. dtpFechaDocumento.Enabled = False
  1910. TipoTransaccion = "B"
  1911. oPropuestaInversionCE = Nothing
  1912. oPropuestaInversionCE = New CEPropuestaInversion
  1913. LimpiarControles()
  1914. Me.btnAccion.Text = "Buscar"
  1915. End Sub
  1916. Private Sub PreNuevoModificar()
  1917. Me.cboEmpresas.BackColor = Color.White
  1918. Me.txtCodigoInversion.BackColor = Color.White
  1919. Me.cboInstrumentosFinancieros.BackColor = Color.White
  1920. Me.cboEmisores.BackColor = Color.White
  1921. Me.cboCalificacionDeRiesgo.BackColor = Color.White
  1922. Me.cboCalificadoraDeRiesgo.BackColor = Color.White
  1923. Me.txtCodigoInversion.BackColor = SystemColors.Control
  1924. Me.cboPaises.BackColor = Color.White
  1925. Me.cboTipoMercado.BackColor = Color.White
  1926. Me.txtNombre.BackColor = Color.White
  1927. Me.cboPeriodicidad.BackColor = Color.White
  1928. Me.txtPlazoNumero.BackColor = Color.White
  1929. Me.cboPlazosFactor.BackColor = Color.White
  1930. Me.cboRenta.BackColor = Color.White
  1931. Me.cboTasa.BackColor = Color.White
  1932. Me.cboEstadoDocumento.BackColor = Color.White()
  1933. txtMontoInversion.BackColor = Color.White
  1934. txtPrecio.BackColor = Color.White
  1935. txtRendimiento.BackColor = Color.White
  1936. txtIngresos.BackColor = Color.White
  1937. cboOrigenDeFondos.BackColor = Color.White
  1938. cboTipoOperacion.BackColor = Color.White
  1939. cboAutorizacion.BackColor = Color.White
  1940. txtAsunto.BackColor = Color.White
  1941. End Sub
  1942. Sub formato()
  1943. If String.IsNullOrEmpty(txtMontoInversion.Text) Then
  1944. txtMontoInversion.Text = 0
  1945. End If
  1946. If String.IsNullOrEmpty(txtPrecio.Text) Then
  1947. txtPrecio.Text = 0
  1948. End If
  1949. If txtRendimiento.Text.ToString.IndexOf("%") = -1 Then
  1950. txtRendimiento.Text = txtRendimiento.Text.ToString + "%"
  1951. End If
  1952. If String.IsNullOrEmpty(txtRendimiento.Text.ToString.Trim("%")) Then
  1953. txtRendimiento.Text = "0.0%"
  1954. End If
  1955. If String.IsNullOrEmpty(txtPlazoNumero.Text) Then
  1956. txtPlazoNumero.Text = 0
  1957. End If
  1958. If String.IsNullOrEmpty(txtIngresos.Text) Then
  1959. txtIngresos.Text = 0
  1960. End If
  1961. End Sub
  1962. Private Sub txtMontoInversion_Leave(sender As Object, e As EventArgs) Handles txtMontoInversion.Leave
  1963. formato()
  1964. End Sub
  1965. Private Sub txtPrecio_Leave(sender As Object, e As EventArgs) Handles txtPrecio.Leave
  1966. formato()
  1967. End Sub
  1968. Private Sub txtRendimiento_Leave(sender As Object, e As EventArgs)
  1969. 'formato()
  1970. End Sub
  1971. Private Sub txtPlazoNumero_Leave(sender As Object, e As EventArgs) Handles txtPlazoNumero.Leave
  1972. formato()
  1973. End Sub
  1974. Private Sub txtIngresos_Leave(sender As Object, e As EventArgs) Handles txtIngresos.Leave
  1975. End Sub
  1976. Private Sub txtRendimiento_TextChanged_1(sender As Object, e As EventArgs) Handles txtRendimiento.TextChanged
  1977. ControlRend()
  1978. End Sub
  1979. Private Sub txtRendimiento_Leave_1(sender As Object, e As EventArgs) Handles txtRendimiento.Leave
  1980. formato()
  1981. End Sub
  1982. Private Sub Navegador_EndDrag(sender As Object, e As EventArgs) Handles Navegador.EndDrag
  1983. End Sub
  1984. Private Sub lblEmpresa_Click(sender As Object)
  1985. End Sub
  1986. Sub Acercar(sender As Object)
  1987. If TypeOf sender Is Panel Then
  1988. If Not sender.BackColor.Name = Color.Turquoise.Name Then
  1989. sender.BackColor = Color.White
  1990. End If
  1991. Else
  1992. If Not sender.parent.BackColor.Name = Color.Turquoise.Name Then
  1993. sender.BackColor = Color.White
  1994. End If
  1995. End If
  1996. End Sub
  1997. Sub Alejar(sender As Object)
  1998. If TypeOf sender Is Panel Then
  1999. If Not sender.BackColor.Name = Color.Turquoise.Name Then
  2000. sender.BackColor = Color.WhiteSmoke
  2001. End If
  2002. Else
  2003. If Not sender.parent.BackColor.Name = Color.Turquoise.Name Then
  2004. sender.BackColor = Color.WhiteSmoke
  2005. End If
  2006. End If
  2007. End Sub
  2008. Sub MenuSeleccionado(sender As Object)
  2009. For Each Items In pnlMenu.Controls
  2010. If TypeOf Items Is Panel Then
  2011. Items.BackColor = Color.WhiteSmoke
  2012. For Each Item In Items.controls
  2013. Item.BackColor = Color.WhiteSmoke
  2014. Next
  2015. End If
  2016. Next
  2017. sender.BackColor = Color.Turquoise
  2018. sender.parent.backcolor = Color.Turquoise
  2019. End Sub
  2020. Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover
  2021. EventHijoAcercar(sender)
  2022. End Sub
  2023. Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave
  2024. EventHijoAlejar(sender)
  2025. End Sub
  2026. Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover
  2027. EventPadreAcercar(sender)
  2028. End Sub
  2029. Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave
  2030. EventPadreAlejar(sender)
  2031. End Sub
  2032. Sub EventPadreAcercar(ByVal sender As Object)
  2033. Acercar(sender)
  2034. For Each label In sender.Controls
  2035. Acercar(label)
  2036. Next
  2037. End Sub
  2038. Sub EventPadreAlejar(ByVal sender As Object)
  2039. Alejar(sender)
  2040. For Each label In sender.Controls
  2041. Alejar(label)
  2042. Next
  2043. End Sub
  2044. Sub EventHijoAcercar(ByVal sender As Object)
  2045. Acercar(sender)
  2046. Acercar(sender.parent)
  2047. End Sub
  2048. Sub EventHijoAlejar(ByVal sender As Object)
  2049. Alejar(sender)
  2050. Alejar(sender.parent)
  2051. End Sub
  2052. Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover
  2053. EventHijoAcercar(sender)
  2054. End Sub
  2055. Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave
  2056. EventHijoAlejar(sender)
  2057. End Sub
  2058. Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover
  2059. EventPadreAcercar(sender)
  2060. End Sub
  2061. Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave
  2062. EventPadreAlejar(sender)
  2063. End Sub
  2064. Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover
  2065. EventPadreAcercar(sender)
  2066. End Sub
  2067. Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave
  2068. EventPadreAlejar(sender)
  2069. End Sub
  2070. Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover
  2071. EventHijoAcercar(sender)
  2072. End Sub
  2073. Private Sub lblPais_MouseHover(sender As Object, e As EventArgs) Handles lblPais.MouseHover
  2074. EventHijoAcercar(sender)
  2075. End Sub
  2076. Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs) Handles lblEstado.MouseHover
  2077. EventHijoAcercar(sender)
  2078. End Sub
  2079. Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseHover
  2080. EventHijoAcercar(sender)
  2081. End Sub
  2082. Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover
  2083. EventHijoAcercar(sender)
  2084. End Sub
  2085. Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover
  2086. EventHijoAcercar(sender)
  2087. End Sub
  2088. Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave
  2089. EventHijoAlejar(sender)
  2090. End Sub
  2091. Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs) Handles lblPais.MouseLeave
  2092. EventHijoAlejar(sender)
  2093. End Sub
  2094. Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave
  2095. EventHijoAlejar(sender)
  2096. End Sub
  2097. Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseLeave
  2098. EventHijoAlejar(sender)
  2099. End Sub
  2100. Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave
  2101. EventHijoAlejar(sender)
  2102. End Sub
  2103. Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave
  2104. EventHijoAlejar(sender)
  2105. End Sub
  2106. Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover
  2107. EventPadreAcercar(sender)
  2108. End Sub
  2109. Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs) Handles pnlPais.MouseHover
  2110. EventPadreAcercar(sender)
  2111. End Sub
  2112. Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover
  2113. EventPadreAcercar(sender)
  2114. End Sub
  2115. Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseHover
  2116. EventPadreAcercar(sender)
  2117. End Sub
  2118. Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover
  2119. EventPadreAcercar(sender)
  2120. End Sub
  2121. Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover
  2122. EventPadreAcercar(sender)
  2123. End Sub
  2124. Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave
  2125. EventPadreAlejar(sender)
  2126. End Sub
  2127. Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave
  2128. EventPadreAlejar(sender)
  2129. End Sub
  2130. Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave
  2131. EventPadreAlejar(sender)
  2132. End Sub
  2133. Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseLeave
  2134. EventPadreAlejar(sender)
  2135. End Sub
  2136. Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave
  2137. EventPadreAlejar(sender)
  2138. End Sub
  2139. Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave
  2140. EventPadreAlejar(sender)
  2141. End Sub
  2142. Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover
  2143. EventHijoAcercar(sender)
  2144. End Sub
  2145. Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave
  2146. EventHijoAlejar(sender)
  2147. End Sub
  2148. Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter
  2149. End Sub
  2150. Private Sub lblInstrumento_Click(sender As Object, e As EventArgs) Handles lblInstrumento.Click
  2151. ProcesoVisibilidad(grpInstrumentos)
  2152. MenuSeleccionado(lblInstrumento)
  2153. End Sub
  2154. Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover
  2155. EventHijoAcercar(sender)
  2156. End Sub
  2157. Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover
  2158. EventHijoAcercar(sender)
  2159. End Sub
  2160. Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave
  2161. EventHijoAlejar(sender)
  2162. End Sub
  2163. Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave
  2164. EventHijoAlejar(sender)
  2165. End Sub
  2166. Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover
  2167. EventPadreAcercar(sender)
  2168. End Sub
  2169. Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover
  2170. EventPadreAcercar(sender)
  2171. End Sub
  2172. Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave
  2173. EventPadreAlejar(sender)
  2174. End Sub
  2175. Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave
  2176. EventPadreAlejar(sender)
  2177. End Sub
  2178. Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover
  2179. EventHijoAcercar(sender)
  2180. End Sub
  2181. Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave
  2182. EventHijoAlejar(sender)
  2183. End Sub
  2184. Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover
  2185. EventPadreAcercar(sender)
  2186. End Sub
  2187. Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave
  2188. EventPadreAlejar(sender)
  2189. End Sub
  2190. Private Sub lblEmpresa_Click(sender As Object, e As EventArgs) Handles lblEmpresa.Click
  2191. ProcesoVisibilidad(grpEmpresas)
  2192. MenuSeleccionado(lblEmpresa)
  2193. End Sub
  2194. Sub ProcesoVisibilidad(sender As Object)
  2195. For Each Items In pnlContenedor.Controls
  2196. If TypeOf Items Is GroupBox Then
  2197. Items.visible = False
  2198. End If
  2199. Next
  2200. sender.visible = True
  2201. End Sub
  2202. Sub ConfiguracionInicial()
  2203. For Each Items In pnlContenedor.Controls
  2204. If TypeOf Items Is GroupBox Then
  2205. Dim W_Tamgrp As Double = Items.Parent.Width - 25
  2206. Dim W_Tamflp As Double = W_Tamgrp - 25
  2207. Dim H_Tamgrp As Double = Items.Parent.Height - 50
  2208. Dim H_Tamflp As Double = H_Tamgrp - 50
  2209. Items.Width = W_Tamgrp
  2210. Items.Height = H_Tamgrp
  2211. Items.Location = New Point(15, 15)
  2212. For Each flItem In Items.Controls
  2213. If TypeOf flItem Is FlowLayoutPanel Then
  2214. flItem.Width = W_Tamflp
  2215. flItem.Height = H_Tamflp
  2216. End If
  2217. Next
  2218. For Each item In Items.Controls
  2219. If TypeOf item Is CheckBox Then
  2220. Dim W_Tamchk As Double = item.Width - 20
  2221. item.Width = W_Tamchk
  2222. End If
  2223. Next
  2224. End If
  2225. Next
  2226. End Sub
  2227. Private Sub pnlEmpresa_Paint(sender As Object, e As PaintEventArgs) Handles pnlEmpresa.Paint
  2228. End Sub
  2229. Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs) Handles pnlInstrumento.Paint
  2230. End Sub
  2231. Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click
  2232. ProcesoVisibilidad(grpOrigenFondos)
  2233. MenuSeleccionado(lblOrigenFondos)
  2234. End Sub
  2235. Private Sub pnlOrigenFondos_Paint(sender As Object, e As PaintEventArgs) Handles pnlOrigenFondos.Paint
  2236. End Sub
  2237. Private Sub lblPlazo_Click(sender As Object, e As EventArgs) Handles lblPlazo.Click
  2238. ProcesoVisibilidad(grpPlazo)
  2239. MenuSeleccionado(lblPlazo)
  2240. End Sub
  2241. Private Sub pnlPlazo_Paint(sender As Object, e As PaintEventArgs) Handles pnlPlazo.Paint
  2242. End Sub
  2243. Private Sub lblEmisor_Click(sender As Object, e As EventArgs) Handles lblEmisor.Click
  2244. ProcesoVisibilidad(grpEmisor)
  2245. MenuSeleccionado(lblEmisor)
  2246. End Sub
  2247. Private Sub pnlEmisor_Paint(sender As Object, e As PaintEventArgs) Handles pnlEmisor.Paint
  2248. End Sub
  2249. Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click
  2250. ProcesoVisibilidad(grpCalificacionRiesgo)
  2251. MenuSeleccionado(lblCalificacionRiesgo)
  2252. End Sub
  2253. Private Sub pnlCalificacionRiesgo_Paint(sender As Object, e As PaintEventArgs) Handles pnlCalificacionRiesgo.Paint
  2254. End Sub
  2255. Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs) Handles pnlEmpresa.Click
  2256. ProcesoVisibilidad(grpEmpresas)
  2257. End Sub
  2258. Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs) Handles pnlInstrumento.Click
  2259. ProcesoVisibilidad(grpInstrumentos)
  2260. End Sub
  2261. Private Sub lblCalificadora_Click(sender As Object, e As EventArgs) Handles lblCalificadora.Click
  2262. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2263. MenuSeleccionado(lblCalificadora)
  2264. End Sub
  2265. Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs) Handles pnlCalificadora.Click
  2266. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2267. End Sub
  2268. Private Sub lblPais_Click(sender As Object, e As EventArgs) Handles lblPais.Click
  2269. ProcesoVisibilidad(grpPais)
  2270. MenuSeleccionado(lblPais)
  2271. End Sub
  2272. Private Sub pnlPais_Click(sender As Object, e As EventArgs) Handles pnlPais.Click
  2273. ProcesoVisibilidad(grpPais)
  2274. End Sub
  2275. Private Sub lblEstado_Click(sender As Object, e As EventArgs) Handles lblEstado.Click
  2276. ProcesoVisibilidad(grpEstadoDocumento)
  2277. MenuSeleccionado(lblEstado)
  2278. End Sub
  2279. Private Sub pnlEstado_Click(sender As Object, e As EventArgs) Handles pnlEstado.Click
  2280. ProcesoVisibilidad(grpEstadoDocumento)
  2281. End Sub
  2282. Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs) Handles lblAutorizacion.Click
  2283. ProcesoVisibilidad(grpAutorizacion)
  2284. MenuSeleccionado(lblAutorizacion)
  2285. End Sub
  2286. Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs) Handles pnlAutorizacion.Click
  2287. ProcesoVisibilidad(grpAutorizacion)
  2288. End Sub
  2289. Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click
  2290. ProcesoVisibilidad(grpTipoOperacion)
  2291. MenuSeleccionado(lblTipoOperacion)
  2292. End Sub
  2293. Private Sub pnlTipOper_Click(sender As Object, e As EventArgs) Handles pnlTipOper.Click
  2294. ProcesoVisibilidad(grpTipoOperacion)
  2295. End Sub
  2296. Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs) Handles lblTipoMercado.Click
  2297. ProcesoVisibilidad(grpTipoMercado)
  2298. MenuSeleccionado(lblTipoMercado)
  2299. End Sub
  2300. Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs) Handles pnlTipMercado.Click
  2301. ProcesoVisibilidad(grpTipoMercado)
  2302. End Sub
  2303. Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click
  2304. ProcesoVisibilidad(grpOrigenFondos)
  2305. End Sub
  2306. Private Sub pnlPlazo_Click(sender As Object, e As EventArgs) Handles pnlPlazo.Click
  2307. ProcesoVisibilidad(grpPlazo)
  2308. End Sub
  2309. Private Sub pnlEmisor_Click(sender As Object, e As EventArgs) Handles pnlEmisor.Click
  2310. ProcesoVisibilidad(grpEmisor)
  2311. End Sub
  2312. Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click
  2313. ProcesoVisibilidad(grpCalificacionRiesgo)
  2314. End Sub
  2315. End Class