frmINV.vb 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742
  1. Public Class frmINV
  2. Dim oDAOGeneral As New DAOGeneral
  3. Dim oInversionCE As New InversionesCE
  4. Dim oInversionDAO As New InversionDAO
  5. Dim controladores As New Controldores
  6. Dim frmAcciones As frmAcciones
  7. Dim FormAcciones As frmAcciones
  8. Dim FormFuturos As frmFuturos
  9. Dim FormPrestamoEmpresarial As frmPrestamoEmpresariales
  10. Dim FormPrestamoPersonal As frmPrestamoPersonal
  11. Dim FormRepo As frmReporto
  12. Dim FormLete As frmLetes
  13. Dim FormCINV As frmCertificadosDeInversion
  14. Dim FormDAP As frmDepositosAPlazo
  15. Dim IsReporto As Boolean = False
  16. Dim FormNEST As frmNotaEstructurada
  17. Dim FormFOIN As frmFOIN
  18. Dim frmBuscar As New frmBuscarDeLista(2)
  19. Dim Operaciones As New Operaciones
  20. Private TipoOperacion As String = String.Empty
  21. Dim oInstrumentoFinanciero As Object
  22. Dim Modo As String = "NM"
  23. Dim Col_Empresas As New Collection
  24. Dim Col_Emisor As New Collection
  25. Dim Col_EstDocumento As New Collection
  26. Dim Col_Instrumento As New Collection
  27. Dim Col_CalRiesgo As New Collection
  28. Dim Col_TipOperacion As New Collection
  29. Dim Col_OriFond As New Collection
  30. Dim Col_CalERiesgo As New Collection
  31. Dim Col_EstadoProceso As New Collection
  32. Dim Col_Plazo As New Collection
  33. Dim Col_Pais As New Collection
  34. Dim Col_TipMercado As New Collection
  35. Dim ConDatos As Integer = 0
  36. Public EnviadoContaduria As Boolean = False
  37. Public DocumentoAnexado As Boolean = False
  38. Private TipoOperacionRepo As String = String.Empty
  39. Private GenerarReportoVenta As Boolean = False
  40. Private DicDatos As New Dictionary(Of String, Object)
  41. Private MontoReportoVenta As Double = 0
  42. Private CodigoAsociacion As String = String.Empty
  43. Private HabilitarAsociacion As Boolean = False
  44. Private EstadoReporto As String = String.Empty
  45. Private ColUnionTablas As New Collection
  46. Sub New()
  47. ' Esta llamada es exigida por el diseñador.
  48. InitializeComponent()
  49. ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
  50. Variables.TrasladarCMVTA = Nothing
  51. End Sub
  52. Sub New(ByRef DicDatos As Dictionary(Of String, Object))
  53. Me.New
  54. Me.DicDatos = DicDatos
  55. GenerarReportoVenta = True
  56. Variables.TrasladarCMVTA = Nothing
  57. navNuevo.Enabled = True
  58. End Sub
  59. Sub ConfigurarReportoVenta()
  60. HabilitarAsociacion = True
  61. Dim CodigoAsociacion As String = String.Empty
  62. Dim Empresa As String = String.Empty
  63. Dim Monto As Double = 0
  64. If DicDatos.ContainsKey("CodigoAsociacion") Then
  65. CodigoAsociacion = DicDatos.Item("CodigoAsociacion").ToString
  66. End If
  67. If DicDatos.ContainsKey("Empresa") Then
  68. Empresa = DicDatos.Item("Empresa").ToString
  69. End If
  70. If DicDatos.ContainsKey("MontoUsado") Then
  71. Monto = Operaciones.ConvertirDecimal(DicDatos.Item("MontoUsado").ToString)
  72. End If
  73. If DicDatos.ContainsKey("ColUnionTablas") Then
  74. ColUnionTablas = DicDatos.Item("ColUnionTablas")
  75. End If
  76. MontoReportoVenta = Monto
  77. Me.CodigoAsociacion = CodigoAsociacion
  78. If GenerarReportoVenta Then
  79. Navegador.Enabled = False
  80. Modo = "NM"
  81. btnAccion.Text = "Guardar"
  82. ModoInversion()
  83. PrepararNuevo()
  84. cboEmpresas.Enabled = False
  85. cboEstadoDocumento.Enabled = False
  86. cboTipoOperacion.Enabled = False
  87. cboOrigenDeFondos.Enabled = False
  88. cboInstrumentos.Enabled = False
  89. cboEstadoProceso.Enabled = False
  90. cboEmpresas.SelectedValue = Empresa
  91. cboEstadoDocumento.SelectedValue = "A"
  92. cboTipoOperacion.SelectedValue = "C"
  93. cboOrigenDeFondos.SelectedValue = "D"
  94. cboInstrumentos.SelectedValue = "REPOVENTA"
  95. cboEstadoProceso.SelectedValue = "R"
  96. End If
  97. End Sub
  98. Private Sub frmInversiones_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  99. 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario.
  100. frmProgreso.PgbProgreso.Value = 1
  101. Call CargarEstadosInversion()
  102. frmProgreso.PgbProgreso.Value = 5
  103. Call CargarEmpresas()
  104. frmProgreso.PgbProgreso.Value = 10
  105. Call CargarInstrumentosFinancieros()
  106. frmProgreso.PgbProgreso.Value = 15
  107. Call CargarEmisores()
  108. frmProgreso.PgbProgreso.Value = 20
  109. Call CargarCalificacionDeRiesgo()
  110. frmProgreso.PgbProgreso.Value = 22
  111. Call CargarCalificadoraDeRiesgo()
  112. frmProgreso.PgbProgreso.Value = 25
  113. Call CargarPaises()
  114. frmProgreso.PgbProgreso.Value = 30
  115. Call CargarTiposMercado()
  116. frmProgreso.PgbProgreso.Value = 35
  117. Call CargarTipoRenta()
  118. frmProgreso.PgbProgreso.Value = 40
  119. Call CargarTipoTasa()
  120. frmProgreso.PgbProgreso.Value = 45
  121. Call CargarPlazos()
  122. frmProgreso.PgbProgreso.Value = 50
  123. Call CargarPeriodicidades()
  124. frmProgreso.PgbProgreso.Value = 55
  125. Call CargarOrigenFondo()
  126. frmProgreso.PgbProgreso.Value = 60
  127. Call CargarEstadoProceso()
  128. frmProgreso.PgbProgreso.Value = 65
  129. Call CargarTipoOperacion()
  130. frmProgreso.PgbProgreso.Value = 70
  131. PrepararBusqueda()
  132. frmProgreso.PgbProgreso.Value = 75
  133. CargarNavegador()
  134. frmProgreso.PgbProgreso.Value = 80
  135. frmProgreso.PgbProgreso.Value = 85
  136. ConfiguracionInicial()
  137. frmProgreso.PgbProgreso.Value = 87
  138. frmProgreso.PgbProgreso.Value = 90
  139. ModoInversion()
  140. frmProgreso.PgbProgreso.Value = 92
  141. TipoOperacion = "B"
  142. DeshabilitarControles()
  143. ColoresBloqueados()
  144. frmProgreso.PgbProgreso.Value = 94
  145. Me.btnAccion.Text = "Aceptar"
  146. EstadoBoton()
  147. frmProgreso.PgbProgreso.Value = 96
  148. Modificar()
  149. frmProgreso.PgbProgreso.Value = 100
  150. frmProgreso.Visible = False
  151. ConfigurarReportoVenta()
  152. btnRequisicionDePago.Visible = False
  153. End Sub
  154. Sub CodigoCompra()
  155. Dim CodigoCompra As String = String.Empty
  156. If Not String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
  157. CodigoCompra = txtCodigoCompra.Text.ToString
  158. End If
  159. If Not String.IsNullOrEmpty(CodigoCompra) Then
  160. lblCodigoCompra.Visible = True
  161. txtCodigoCompra.Visible = True
  162. txtCodigoCompra.Text = CodigoCompra
  163. Else
  164. lblCodigoCompra.Visible = False
  165. txtCodigoCompra.Visible = False
  166. End If
  167. End Sub
  168. Private Function CamposRequeridos() As Integer
  169. If String.IsNullOrEmpty(txtNombreManual.Text.ToString) Then
  170. MsgBox("Ingrese el nombre del titulo")
  171. Return 1
  172. End If
  173. If (String.IsNullOrEmpty(Me.cboEmpresas.SelectedValue)) Then
  174. MsgBox("Seleccione una Empresa")
  175. Return 1
  176. End If
  177. If (String.IsNullOrEmpty(Me.cboInstrumentos.SelectedValue)) Then
  178. MsgBox("Seleccione un Instrumento")
  179. Return 1
  180. End If
  181. If (String.IsNullOrEmpty(Me.cboTiposMercado.SelectedValue)) Then
  182. MsgBox("Seleccione un Tipo de Mercado")
  183. Return 1
  184. End If
  185. If (String.IsNullOrEmpty(Me.cboPaises.SelectedValue)) Then
  186. MsgBox("Seleccione un Pais")
  187. Return 1
  188. End If
  189. If (String.IsNullOrEmpty(Me.cboEstadoDocumento.SelectedValue)) Then
  190. MsgBox("Error con los campos del titulo")
  191. Return 1
  192. End If
  193. If (String.IsNullOrEmpty(Me.cboTipoOperacion.SelectedValue)) Then
  194. MsgBox("Error con los campos del titulo")
  195. Return 1
  196. End If
  197. If (String.IsNullOrEmpty(Me.cboOrigenDeFondos.SelectedValue)) Then
  198. MsgBox("Error con los campos del titulo")
  199. Return 1
  200. End If
  201. If (String.IsNullOrEmpty(Me.cboEstadoProceso.SelectedValue)) Then
  202. MsgBox("Error con los campos del titulo")
  203. Return 1
  204. End If
  205. Dim ExisteReportoVenta As Boolean = ReportoVenta()
  206. If ExisteReportoVenta Then
  207. Return 0
  208. Else
  209. MsgBox("Agregue un registro en el detalle")
  210. Return 1
  211. End If
  212. Return 0
  213. End Function
  214. Private Sub CargarNavegador()
  215. vBindingSource.DataSource = oInversionDAO.ListaCodigosInversion
  216. Navegador.BindingSource = vBindingSource
  217. End Sub
  218. Private Sub CargarTipoOperacion()
  219. Me.cboTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion
  220. Me.cboTipoOperacion.DisplayMember = "Descripcion"
  221. Me.cboTipoOperacion.ValueMember = "Codigo"
  222. Col_TipOperacion = AgregarCheckbox(cboTipoOperacion, flpTipoOperacion)
  223. Me.cboTipoOperacion.SelectedIndex = -1
  224. End Sub
  225. Private Sub CargarOrigenFondo()
  226. Me.cboOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos
  227. Me.cboOrigenDeFondos.DisplayMember = "Descripcion"
  228. Me.cboOrigenDeFondos.ValueMember = "Codigo"
  229. Col_OriFond = AgregarCheckbox(cboOrigenDeFondos, flpOrigenFondos)
  230. Me.cboOrigenDeFondos.SelectedIndex = 0
  231. End Sub
  232. Private Sub CargarEstadoProceso()
  233. Me.cboEstadoProceso.DataSource = oDAOGeneral.ListaEstadoProceso
  234. Me.cboEstadoProceso.DisplayMember = "Descripcion"
  235. Me.cboEstadoProceso.ValueMember = "Codigo"
  236. Col_EstadoProceso = AgregarCheckbox(cboEstadoProceso, flpEstadoProceso)
  237. Me.cboEstadoProceso.SelectedIndex = -1
  238. End Sub
  239. Private Sub CargarPeriodicidades()
  240. Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
  241. Me.cboPeriodicidad.DisplayMember = "Descripcion"
  242. Me.cboPeriodicidad.ValueMember = "Codigo"
  243. Me.cboPeriodicidad.SelectedIndex = -1
  244. End Sub
  245. Private Sub CargarPlazos()
  246. Me.cboPlazoFactor.DataSource = oDAOGeneral.ListaPlazosFactor
  247. Me.cboPlazoFactor.DisplayMember = "Descripcion"
  248. Me.cboPlazoFactor.ValueMember = "Codigo"
  249. Col_Plazo = AgregarCheckbox(cboPlazoFactor, flpPlazo)
  250. Me.cboPlazoFactor.SelectedIndex = -1
  251. End Sub
  252. Private Sub CargarTipoRenta()
  253. Me.cboTipoRenta.DataSource = oDAOGeneral.ListaTipoRenta
  254. Me.cboTipoRenta.DisplayMember = "Descripcion"
  255. Me.cboTipoRenta.ValueMember = "Codigo"
  256. Me.cboTipoRenta.SelectedIndex = -1
  257. End Sub
  258. Private Sub CargarTipoTasa()
  259. Me.cboTipoTasa.DataSource = oDAOGeneral.ListaTipoTasa
  260. Me.cboTipoTasa.DisplayMember = "Descripcion"
  261. Me.cboTipoTasa.ValueMember = "Codigo"
  262. Me.cboTipoTasa.SelectedIndex = -1
  263. End Sub
  264. Private Sub CargarEstadosInversion()
  265. Me.cboEstadoDocumento.DataSource = oDAOGeneral.ListaEstadoInversion
  266. Me.cboEstadoDocumento.DisplayMember = "Descripcion"
  267. Me.cboEstadoDocumento.ValueMember = "Codigo"
  268. Col_EstDocumento = AgregarCheckbox(cboEstadoDocumento, flpEstadoDocumento)
  269. Me.cboEstadoDocumento.SelectedIndex = -1
  270. End Sub
  271. Private Sub CargarEmpresas()
  272. Me.cboEmpresas.DataSource = oDAOGeneral.ListaEmpresas
  273. Me.cboEmpresas.DisplayMember = "Descripcion"
  274. Me.cboEmpresas.ValueMember = "Codigo"
  275. Col_Empresas = AgregarCheckbox(cboEmpresas, flpEmpresas)
  276. Me.cboEmpresas.SelectedIndex = -1
  277. End Sub
  278. Private Sub CargarInstrumentosFinancieros()
  279. Me.cboInstrumentos.DataSource = oDAOGeneral.ListaInstrumentos("Inversion")
  280. Me.cboInstrumentos.DisplayMember = "Descripcion"
  281. Me.cboInstrumentos.ValueMember = "Codigo"
  282. Col_Instrumento = AgregarCheckbox(cboInstrumentos, flpInstrumentos)
  283. Me.cboInstrumentos.SelectedIndex = -1
  284. End Sub
  285. Private Sub CargarEmisores()
  286. Me.cboEmisores.DataSource = oDAOGeneral.ListaEmisores
  287. Me.cboEmisores.DisplayMember = "Descripcion"
  288. Me.cboEmisores.ValueMember = "Codigo"
  289. Col_Emisor = AgregarCheckbox(cboEmisores, flpEmisor)
  290. Me.cboEmisores.SelectedIndex = -1
  291. End Sub
  292. Private Sub CargarCalificacionDeRiesgo()
  293. Me.cboCalificaciones.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo
  294. Me.cboCalificaciones.DisplayMember = "Descripcion"
  295. Me.cboCalificaciones.ValueMember = "Codigo"
  296. Col_CalRiesgo = AgregarCheckbox(cboCalificaciones, flpCalificacionRiesgo)
  297. Me.cboCalificaciones.SelectedIndex = -1
  298. End Sub
  299. Private Sub CargarCalificadoraDeRiesgo()
  300. Me.cboCalificadoras.DataSource = oDAOGeneral.ListaEmpresasCalificadoras
  301. Me.cboCalificadoras.DisplayMember = "Descripcion"
  302. Me.cboCalificadoras.ValueMember = "Codigo"
  303. Col_CalERiesgo = AgregarCheckbox(cboCalificadoras, flpCalificadoraRiesgo)
  304. Me.cboCalificadoras.SelectedIndex = -1
  305. End Sub
  306. Private Sub CargarPaises()
  307. Me.cboPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion
  308. Me.cboPaises.DisplayMember = "Descripcion"
  309. Me.cboPaises.ValueMember = "Codigo"
  310. Col_Pais = AgregarCheckbox(cboPaises, flpPais)
  311. Me.cboPaises.SelectedIndex = -1
  312. End Sub
  313. Private Sub CargarTiposMercado()
  314. Me.cboTiposMercado.DataSource = oDAOGeneral.ListaTiposMercado
  315. Me.cboTiposMercado.DisplayMember = "Descripcion"
  316. Me.cboTiposMercado.ValueMember = "Codigo"
  317. Col_TipMercado = AgregarCheckbox(cboTiposMercado, flpTipoMercado)
  318. Me.cboTiposMercado.SelectedIndex = -1
  319. End Sub
  320. Private Sub navBuscar_Click(sender As Object, e As EventArgs) Handles navBuscar.Click
  321. Modo = "B"
  322. ModoInversion()
  323. End Sub
  324. Private Sub PrepararBusqueda()
  325. HabilitarControles()
  326. LimpiarControles()
  327. oInversionCE = Nothing
  328. oInversionCE = New InversionesCE
  329. DeshabilitarControles()
  330. ColoresBloqueados()
  331. dtpFechaDocumento.Enabled = False
  332. TipoOperacion = "B"
  333. Me.btnAccion.Text = "Buscar"
  334. End Sub
  335. Private Sub HabilitarControles()
  336. cboEmpresas.Enabled = True
  337. cboInstrumentos.Enabled = True
  338. cboEmisores.Enabled = True
  339. cboCalificaciones.Enabled = True
  340. cboCalificadoras.Enabled = True
  341. cboPaises.Enabled = True
  342. cboTiposMercado.Enabled = True
  343. txtCodigoInversion.ReadOnly = False
  344. cboEstadoDocumento.Enabled = True
  345. dtpFechaDocumento.Enabled = True
  346. txtNombreManual.ReadOnly = False
  347. txtCodigoManual.ReadOnly = False
  348. cboPlazoFactor.Enabled = True
  349. cboPeriodicidad.Enabled = True
  350. cboTipoOperacion.Enabled = True
  351. cboOrigenDeFondos.Enabled = True
  352. cboTipoRenta.Enabled = True
  353. cboTipoTasa.Enabled = True
  354. txtPlazoNum.ReadOnly = False
  355. cboTipoOperacion.BackColor = Color.White
  356. cboOrigenDeFondos.BackColor = Color.White
  357. cboTipoRenta.BackColor = Color.White
  358. cboTipoTasa.BackColor = Color.White
  359. cboEmpresas.BackColor = Color.White
  360. cboInstrumentos.BackColor = Color.White
  361. cboEmisores.BackColor = Color.White
  362. cboCalificaciones.BackColor = Color.White
  363. cboCalificadoras.BackColor = Color.White
  364. cboTipoOperacion.BackColor = Color.White
  365. cboOrigenDeFondos.BackColor = Color.White
  366. cboEstadoProceso.BackColor = Color.White
  367. Me.cboPaises.BackColor = Color.White
  368. Me.cboTiposMercado.BackColor = Color.White
  369. Me.txtNombreManual.BackColor = Color.White
  370. Me.cboPeriodicidad.BackColor = Color.White
  371. Me.txtPlazoNum.BackColor = Color.White
  372. Me.cboPlazoFactor.BackColor = Color.White
  373. Me.cboTipoRenta.BackColor = Color.White
  374. Me.cboTipoTasa.BackColor = Color.White
  375. Me.txtCodigoInversion.BackColor = Color.White
  376. Me.txtCodigoManual.BackColor = Color.White
  377. Me.cboEstadoDocumento.BackColor = Color.White
  378. End Sub
  379. Private Sub DeshabilitarControles()
  380. cboEmpresas.Enabled = False
  381. cboInstrumentos.Enabled = False
  382. cboEmisores.Enabled = False
  383. cboCalificaciones.Enabled = False
  384. cboCalificadoras.Enabled = False
  385. cboPaises.Enabled = False
  386. cboTiposMercado.Enabled = False
  387. txtCodigoInversion.ReadOnly = True
  388. cboEstadoDocumento.Enabled = False
  389. txtNombreManual.ReadOnly = True
  390. txtCodigoManual.ReadOnly = True
  391. cboTipoOperacion.Enabled = False
  392. cboOrigenDeFondos.Enabled = False
  393. cboTipoRenta.Enabled = False
  394. cboTipoTasa.Enabled = False
  395. cboPeriodicidad.Enabled = False
  396. cboPlazoFactor.Enabled = False
  397. txtPlazoNum.ReadOnly = True
  398. End Sub
  399. Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresas.SelectedIndexChanged
  400. ControlEmpresas()
  401. End Sub
  402. Private Sub ControlEmpresas()
  403. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  404. oInversionCE.CodigoEmpresa = cboEmpresas.SelectedValue
  405. End If
  406. If TipoOperacion = "N" Then
  407. ActualizarCodigoNuevo()
  408. End If
  409. End Sub
  410. Private Sub ControlCodigoIFManual()
  411. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  412. oInversionCE.CodigoManual = txtCodigoManual.Text
  413. End If
  414. End Sub
  415. Private Sub Buscar()
  416. If frmBuscarDeLista.ShowDialog = DialogResult.OK Then
  417. If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then
  418. CargarRegistro(frmBuscarDeLista.CodigoPrincipal)
  419. End If
  420. End If
  421. End Sub
  422. Public Sub CargarRegistro(ByVal IdRegistro As Integer)
  423. TipoOperacion = "C"
  424. Dim Id As Integer = 0
  425. If ConDatos > 0 Then
  426. Id = ConDatos
  427. Else
  428. Id = IdRegistro
  429. End If
  430. oInversionCE = oInversionDAO.CargarRegistro(Id)
  431. Dim a = vBindingSource.Find("DocId", Id)
  432. vBindingSource.Position = vBindingSource.Find("DocId", Id)
  433. ConDatos = 0
  434. RefrescarValoresDeControles()
  435. RefrescarEstadoControles()
  436. ColoresBloqueados()
  437. Me.btnAccion.Text = "Aceptar"
  438. End Sub
  439. Sub ColoresBloqueados()
  440. Me.cboEmpresas.BackColor = Configuraciones.ColorFondoPredefinido()
  441. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  442. Me.cboInstrumentos.BackColor = Configuraciones.ColorFondoPredefinido()
  443. Me.cboEmisores.BackColor = Configuraciones.ColorFondoPredefinido()
  444. Me.cboCalificaciones.BackColor = Configuraciones.ColorFondoPredefinido()
  445. Me.cboCalificadoras.BackColor = Configuraciones.ColorFondoPredefinido()
  446. Me.txtCodigoManual.BackColor = Configuraciones.ColorFondoPredefinido()
  447. Me.cboPaises.BackColor = Configuraciones.ColorFondoPredefinido()
  448. Me.cboTiposMercado.BackColor = Configuraciones.ColorFondoPredefinido()
  449. Me.txtNombreManual.BackColor = Configuraciones.ColorFondoPredefinido()
  450. Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoPredefinido()
  451. Me.txtPlazoNum.BackColor = Configuraciones.ColorFondoPredefinido()
  452. Me.cboPlazoFactor.BackColor = Configuraciones.ColorFondoPredefinido()
  453. Me.cboTipoRenta.BackColor = Configuraciones.ColorFondoPredefinido()
  454. Me.cboTipoTasa.BackColor = Configuraciones.ColorFondoPredefinido()
  455. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  456. Me.txtCodigoManual.BackColor = Configuraciones.ColorFondoPredefinido()
  457. Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoPredefinido()
  458. End Sub
  459. Function ReportoVenta()
  460. If GenerarReportoVenta Then
  461. Try
  462. If Not Variables.ColeccionREPO.count Is Nothing Then
  463. If Variables.ColeccionREPO.count = 0 Then
  464. Return False
  465. Else
  466. Return True
  467. End If
  468. Return False
  469. Else
  470. Return False
  471. End If
  472. Catch ex As Exception
  473. Return False
  474. End Try
  475. End If
  476. Return True
  477. End Function
  478. Private Sub Guardar()
  479. oInversionCE.CodigoIversion = txtCodigoInversion.Text
  480. oInversionCE.EstadoReporto = EstadoReporto
  481. Dim retorno As Integer
  482. If TipoOperacion = "N" Then
  483. If GenerarReportoVenta Then
  484. Dim diccionario = Variables.ColeccionREPO
  485. If Not diccionario Is Nothing Then
  486. If String.IsNullOrEmpty(EstadoReporto) Then
  487. retorno = 0
  488. Else
  489. retorno = oInversionDAO.NuevoConReportoVenta(oInversionCE, diccionario, txtCodigoInversion.Text, CodigoAsociacion, EstadoReporto, ColUnionTablas)
  490. End If
  491. diccionario = Nothing
  492. End If
  493. Else
  494. If String.IsNullOrEmpty(EstadoReporto) Then
  495. retorno = 0
  496. Else
  497. retorno = oInversionDAO.Nuevo(oInversionCE)
  498. End If
  499. End If
  500. End If
  501. If TipoOperacion = "M" Then
  502. retorno = oInversionDAO.Modificar(oInversionCE)
  503. If retorno >= 1 Then
  504. EstadoBoton()
  505. End If
  506. End If
  507. If retorno >= 1 Then
  508. oInversionCE.IdDeDocumento = vBindingSource.Current("DocId")
  509. CargarRegistro(oInversionCE.IdDeDocumento)
  510. MsgBox("Operación Completada.")
  511. End If
  512. End Sub
  513. Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
  514. ControlEstadoProceso()
  515. If TipoOperacion = "B" Then
  516. Buscar()
  517. End If
  518. If TipoOperacion = "N" Or TipoOperacion = "M" Then
  519. If (CamposRequeridos() = 0) Then
  520. If (Not String.IsNullOrEmpty(txtPlazoNum.Text)) Then
  521. Variables.Plazo = txtPlazoNum.Text
  522. End If
  523. If (Not String.IsNullOrEmpty(cboPlazoFactor.SelectedValue)) Then
  524. Variables.PlazoFact = cboPlazoFactor.SelectedValue
  525. End If
  526. ControlFechaDocumento()
  527. Guardar()
  528. If Not GenerarReportoVenta Then
  529. Dim Codigo As String = txtCodigoInversion.Text
  530. GuardarFamilia(Codigo)
  531. End If
  532. CargarNavegador()
  533. Refrescar()
  534. End If
  535. End If
  536. Modificar()
  537. End Sub
  538. Sub GuardarFamilia(ByVal Instrumento As String)
  539. If Instrumento.IndexOf("LETE") > -1 Then
  540. Dim oDAOLetes As New LETESDAO
  541. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  542. If ColeccionLETE.Count > 0 Then
  543. oDAOLetes.NuevoIngreso(ColeccionLETE, "LETE")
  544. ColeccionLETE.Clear()
  545. End If
  546. End If
  547. If Instrumento.IndexOf("PBUR") > -1 Then
  548. Dim oDAOLetes As New LETESDAO
  549. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  550. If ColeccionLETE.Count > 0 Then
  551. oDAOLetes.NuevoIngreso(ColeccionLETE, "PBUR")
  552. ColeccionLETE.Clear()
  553. End If
  554. End If
  555. If Instrumento.IndexOf("VCN") > -1 Then
  556. Dim oDAOLetes As New LETESDAO
  557. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  558. If ColeccionLETE.Count > 0 Then
  559. oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN")
  560. ColeccionLETE.Clear()
  561. End If
  562. End If
  563. If Instrumento.IndexOf("CETE") > -1 Then
  564. Dim oDAOLetes As New LETESDAO
  565. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  566. If ColeccionLETE.Count > 0 Then
  567. oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE")
  568. ColeccionLETE.Clear()
  569. End If
  570. End If
  571. If Instrumento.IndexOf("ACC") > -1 Then
  572. Dim oDAOACC As New AccionesDAO
  573. Dim ColeccionACC As Collection = Variables.ColeccionACC
  574. If ColeccionACC.Count > 0 Then
  575. oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC)
  576. ColeccionACC.Clear()
  577. FormAcciones.Dispose()
  578. End If
  579. End If
  580. If Instrumento.IndexOf("CINV") > -1 Then
  581. Dim oDAOCINV As New CertificadosDeInversionDAO
  582. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  583. If ColeccionCINV.Count > 0 Then
  584. oDAOCINV.Nuevo(ColeccionCINV, "CINV")
  585. ColeccionCINV.Clear()
  586. End If
  587. End If
  588. If Instrumento.IndexOf("BONO") > -1 Then
  589. Dim oDAOCINV As New CertificadosDeInversionDAO
  590. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  591. If ColeccionCINV.Count > 0 Then
  592. oDAOCINV.Nuevo(ColeccionCINV, "BONO")
  593. ColeccionCINV.Clear()
  594. End If
  595. End If
  596. If Instrumento.IndexOf("EURB0") > -1 Then
  597. Dim oDAOCINV As New CertificadosDeInversionDAO
  598. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  599. If ColeccionCINV.Count > 0 Then
  600. oDAOCINV.Nuevo(ColeccionCINV, "EURB")
  601. ColeccionCINV.Clear()
  602. End If
  603. End If
  604. If Instrumento.IndexOf("TIT") > -1 Then
  605. Dim oDAOCINV As New CertificadosDeInversionDAO
  606. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  607. If ColeccionCINV.Count > 0 Then
  608. oDAOCINV.Nuevo(ColeccionCINV, "TIT")
  609. ColeccionCINV.Clear()
  610. End If
  611. End If
  612. If Instrumento.IndexOf("DAP") > -1 Then
  613. Dim oDAODAP As New DepositosAPlazoDAO
  614. Dim ColeccionDAP As Collection = Variables.ColeccionDAP
  615. Dim diccionario = Variables.ColeccionDAPDi
  616. If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then
  617. oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo)
  618. ColeccionDAP.Clear()
  619. diccionario = Nothing
  620. End If
  621. End If
  622. If Instrumento.IndexOf("NEST") > -1 Then
  623. Dim oDAONEST As New DAONotaEstructurada
  624. Dim ColeccionNEST As Collection = Variables.ColeccionNEST
  625. Dim diccionario = Variables.ColeccionNESTDi
  626. If ColeccionNEST.Count > 0 And Not diccionario Is Nothing Then
  627. oDAONEST.NuevoDato(ColeccionNEST, diccionario, Variables.Codigo)
  628. ColeccionNEST.Clear()
  629. diccionario = Nothing
  630. End If
  631. End If
  632. If Instrumento.IndexOf("FUTU") > -1 Then
  633. Dim oDAOFUTU As New FuturosDAO
  634. Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU
  635. If ColeccionFUTU.Count > 0 Then
  636. oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU)
  637. ColeccionFUTU.Clear()
  638. End If
  639. End If
  640. If Instrumento.IndexOf("OPC") > -1 Then
  641. Dim oDAOOPC As New FuturosDAO
  642. Dim ColeccionOPC As Collection = Variables.ColeccionFUTU
  643. If ColeccionOPC.Count > 0 Then
  644. oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC)
  645. ColeccionOPC.Clear()
  646. End If
  647. End If
  648. If Instrumento.IndexOf("PEMP") > -1 Then
  649. Dim oDAOPEMP As New PrestamoEmpresarialDAO
  650. Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP
  651. Dim diccionario = Variables.ColeccionPEMPDi
  652. If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then
  653. oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo")
  654. ColeccionPEMP.Clear()
  655. diccionario = Nothing
  656. End If
  657. End If
  658. If Instrumento.IndexOf("PPER") > -1 Then
  659. Dim oDAOPPER As New PrestamoPersonalDAO
  660. Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR
  661. Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE
  662. Dim diccionario = Variables.ColeccionPPERAMORTDi
  663. If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then
  664. oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo")
  665. ColeccionPPERDEUDOR.Clear()
  666. ColeccionPPERDETALLE.Clear()
  667. diccionario = Nothing
  668. End If
  669. End If
  670. If Instrumento.IndexOf("REPOVENTA") > -1 Then
  671. Dim oDAOREPO As New ReportosDAO
  672. Dim diccionario = Variables.ColeccionREPO
  673. If Not diccionario Is Nothing Then
  674. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA")
  675. diccionario = Nothing
  676. End If
  677. ElseIf Instrumento.IndexOf("REPO") > -1 And Not Instrumento.IndexOf("REPOVENTA") > -1 Then
  678. Dim oDAOREPO As New ReportosDAO
  679. Dim diccionario = Variables.ColeccionREPO
  680. If Not diccionario Is Nothing Then
  681. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0")
  682. diccionario = Nothing
  683. End If
  684. End If
  685. If Instrumento.IndexOf("FINV") > -1 Then
  686. Dim oDAOFOIN As New FondoInversionDAO
  687. Dim ColeccionFOIN As Collection = Variables.ColeccionFINV
  688. Dim diccionario = Variables.ColeccionFINVDi
  689. If ColeccionFINV.Count > 0 And Not diccionario Is Nothing Then
  690. oDAOFOIN.ProcesoDatos(ColeccionFINV, Variables.Codigo, diccionario, "Nuevo")
  691. ColeccionFOIN.Clear()
  692. diccionario = Nothing
  693. End If
  694. End If
  695. End Sub
  696. Private Sub RefrescarValoresDeControles()
  697. If Not oInversionCE Is Nothing Then
  698. Dim vCodCompra As String = oInversionCE.CodigoCompra.ToString
  699. If vCodCompra.Length = 0 Then
  700. txtCodigoCompra.Text = String.Empty
  701. Else
  702. txtCodigoCompra.Text = vCodCompra
  703. End If
  704. Dim vEmpresa As String = oInversionCE.CodigoEmpresa
  705. If vEmpresa.Length = 0 Then
  706. cboEmpresas.SelectedIndex = -1
  707. Else
  708. cboEmpresas.SelectedValue = vEmpresa
  709. End If
  710. Dim vInstrumento As String = oInversionCE.CodigoInstrumentoFinanciero
  711. If vInstrumento.Length = 0 Then
  712. cboInstrumentos.SelectedIndex = -1
  713. Else
  714. cboInstrumentos.SelectedValue = vInstrumento
  715. End If
  716. Dim vEmisor As String = oInversionCE.CodigoEmisor
  717. If vEmisor.Length = 0 Then
  718. cboEmisores.SelectedIndex = -1
  719. Else
  720. cboEmisores.SelectedValue = vEmisor
  721. End If
  722. Dim vCalificacionDeRiesgo As String = oInversionCE.CodigoCalificacionDeRiesgo
  723. If vCalificacionDeRiesgo.Length = 0 Then
  724. cboCalificaciones.SelectedIndex = -1
  725. Else
  726. cboCalificaciones.SelectedValue = vCalificacionDeRiesgo
  727. End If
  728. Dim vCalificadora As String = oInversionCE.CodigoEmpresaCalificadora
  729. If vCalificadora.Length = 0 Then
  730. cboCalificadoras.SelectedIndex = -1
  731. Else
  732. cboCalificadoras.SelectedValue = vCalificadora
  733. End If
  734. Dim vPais As String = oInversionCE.Pais
  735. If vPais.Length = 0 Then
  736. cboPaises.SelectedIndex = -1
  737. Else
  738. cboPaises.SelectedValue = vPais
  739. End If
  740. Dim vTipoMercado As String = oInversionCE.TipoMercado
  741. If vTipoMercado.Length = 0 Then
  742. cboTiposMercado.SelectedIndex = -1
  743. Else
  744. cboTiposMercado.SelectedValue = vTipoMercado
  745. End If
  746. Dim vCodigoInversion As String = oInversionCE.CodigoIversion
  747. If vCodigoInversion.Length = 0 Then
  748. txtCodigoInversion.Text = String.Empty
  749. Else
  750. txtCodigoInversion.Text = vCodigoInversion
  751. End If
  752. Dim vEstadoDoc As String = oInversionCE.EstadoDocumento
  753. If vEstadoDoc.Length = 0 Then
  754. cboEstadoDocumento.SelectedIndex = -1
  755. Else
  756. cboEstadoDocumento.SelectedValue = vEstadoDoc
  757. End If
  758. Dim vNombreManualIF As String = oInversionCE.NombreManual
  759. txtNombreManual.Text = vNombreManualIF
  760. Dim vCodigoManual As String = oInversionCE.CodigoManual
  761. txtCodigoManual.Text = vCodigoManual
  762. Dim vPeriodicidad As String = oInversionCE.Periodicidad.ToString
  763. If vPeriodicidad.Length = 0 Then
  764. cboPeriodicidad.SelectedIndex = -1
  765. Else
  766. cboPeriodicidad.SelectedValue = vPeriodicidad
  767. End If
  768. Dim vPlazoNum As String = oInversionCE.PlazoNumero.ToString
  769. Me.txtPlazoNum.Text = vPlazoNum
  770. Dim vPlazoFactor As String = oInversionCE.PlazoFactor.ToString
  771. If vPlazoFactor.Length = 0 Then
  772. cboPlazoFactor.SelectedIndex = -1
  773. Else
  774. cboPlazoFactor.SelectedValue = vPlazoFactor
  775. End If
  776. Dim vTipoRenta As String = oInversionCE.TipoRenta
  777. If vTipoRenta.Length = 0 Then
  778. cboTipoRenta.SelectedIndex = -1
  779. Else
  780. cboTipoRenta.SelectedValue = vTipoRenta
  781. End If
  782. Dim vTipoTasa As String = oInversionCE.TipoTasa
  783. If vTipoTasa.Length = 0 Then
  784. cboTipoTasa.SelectedIndex = -1
  785. Else
  786. cboTipoTasa.SelectedValue = vTipoTasa
  787. End If
  788. Dim vComentarios As String = oInversionCE.Comentarios.ToString
  789. Me.txtNotas.Text = vComentarios
  790. Dim vTipoOper As String = oInversionCE.TipoOperacion.ToString
  791. If vTipoOper.Length = 0 Then
  792. cboTipoOperacion.SelectedIndex = -1
  793. Else
  794. cboTipoOperacion.SelectedValue = vTipoOper
  795. End If
  796. Dim vEstadoProceso As String = oInversionCE.EstadoProceso.ToString
  797. If vEstadoProceso.Length = 0 Then
  798. cboEstadoProceso.SelectedIndex = -1
  799. Else
  800. cboEstadoProceso.SelectedValue = vEstadoProceso
  801. End If
  802. Dim vOFondo As String = oInversionCE.OFondo.ToString
  803. If vOFondo.Length = 0 Then
  804. cboOrigenDeFondos.SelectedIndex = -1
  805. Else
  806. cboOrigenDeFondos.SelectedValue = vOFondo
  807. End If
  808. Dim vFecha As String = oInversionCE.FechaDocumento.ToString
  809. If vFecha.Length = 0 Then
  810. dtpFechaDocumento.Value = Date.Today.Date
  811. Else
  812. dtpFechaDocumento.Value = vFecha
  813. End If
  814. End If
  815. End Sub
  816. Private Sub RefrescarEstadoControles()
  817. If TipoOperacion = "C" Then
  818. DeshabilitarControles()
  819. End If
  820. If TipoOperacion = "B" Then
  821. HabilitarControles()
  822. End If
  823. End Sub
  824. Private Sub LimpiarControles()
  825. Me.cboEmpresas.SelectedIndex = -1
  826. Me.cboInstrumentos.SelectedIndex = -1
  827. Me.cboEmisores.SelectedIndex = -1
  828. Me.cboCalificaciones.SelectedIndex = -1
  829. Me.cboCalificadoras.SelectedIndex = -1
  830. Me.cboPaises.SelectedIndex = -1
  831. Me.cboTiposMercado.SelectedIndex = -1
  832. Me.txtCodigoInversion.Text = String.Empty
  833. Me.cboEstadoDocumento.SelectedIndex = -1
  834. Me.txtNombreManual.Text = String.Empty
  835. Me.cboPeriodicidad.SelectedIndex = -1
  836. Me.txtPlazoNum.Text = String.Empty
  837. Me.cboPlazoFactor.SelectedIndex = -1
  838. Me.cboTipoRenta.SelectedIndex = -1
  839. Me.cboTipoTasa.SelectedIndex = -1
  840. Me.txtCodigoManual.Text = String.Empty
  841. Me.txtNotas.Text = String.Empty
  842. End Sub
  843. Sub SetPeriodicidad()
  844. Dim Periodicidad As String = String.Empty
  845. Dim General As New DAOGeneral
  846. Dim Codigo As String = Variables.Codigo
  847. Periodicidad = General.Periodicidad(Codigo, "INV0")
  848. If Not String.IsNullOrEmpty(Periodicidad) Then
  849. cboPeriodicidad.SelectedValue = Periodicidad
  850. End If
  851. End Sub
  852. Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
  853. Variables.InvocadorProInv = "frmINV"
  854. Variables.TipoOperacionCMVTA = cboTipoOperacion.SelectedValue
  855. ''#########################################################################
  856. If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
  857. Variables.Codigo = txtCodigoInversion.Text.ToString
  858. Else
  859. Variables.Codigo = txtCodigoCompra.Text.ToString
  860. End If
  861. ''#########################################################################
  862. Dim NuevaPosInstrumento As Boolean = False
  863. ''#########################################################################
  864. If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
  865. Variables.CodigoComparativo = Variables.Codigo
  866. Else
  867. If Not Variables.CodigoComparativo = Variables.Codigo Then
  868. NuevaPosInstrumento = True
  869. End If
  870. End If
  871. ''#########################################################################
  872. If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
  873. CodigoInstrumento = txtCodigoInversion.Text.ToString
  874. Else
  875. CodigoInstrumento = txtCodigoCompra.Text.ToString
  876. End If
  877. ''#########################################################################
  878. Variables.InvPro = "I"
  879. SetPeriodicidad()
  880. ''#########################################################################
  881. Dim TipOperacion As String = oInversionCE.TipoOperacion
  882. ''#########################################################################
  883. If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
  884. Variables.CodigoComparativo = Variables.Codigo
  885. Else
  886. If Not Variables.CodigoComparativo = Variables.Codigo Then
  887. NuevaPosInstrumento = True
  888. End If
  889. End If
  890. ''#########################################################################
  891. ''#########################################################################
  892. ''#########################################################################
  893. If CodigoInstrumento.IndexOf("FINV") > -1 Then
  894. Dim ExistInstrumento As Boolean = ExisteInstrumento("FINV")
  895. Try
  896. If ExistInstrumento Then
  897. FormFOIN.Dispose()
  898. FormFOIN = New frmFOIN
  899. FormFOIN.ShowDialog()
  900. Else
  901. If NuevaPosInstrumento Then
  902. Variables.CodigoComparativo = String.Empty
  903. FormFOIN.Dispose()
  904. FormFOIN = New frmFOIN
  905. FormFOIN.ShowDialog()
  906. Else
  907. FormFOIN.ShowDialog()
  908. End If
  909. End If
  910. Catch ex As Exception
  911. FormFOIN = New frmFOIN
  912. FormFOIN.ShowDialog()
  913. End Try
  914. End If
  915. ''#########################################################################
  916. ''#########################################################################
  917. If CodigoInstrumento.IndexOf("FUTU") > -1 Or CodigoInstrumento.IndexOf("OPC") > -1 Then
  918. Dim ExistInstrumento As Boolean
  919. If CodigoInstrumento.IndexOf("FUTU") > -1 Then
  920. ExistInstrumento = ExisteInstrumento("FUT0")
  921. Else
  922. ExistInstrumento = ExisteInstrumento("OPC0")
  923. End If
  924. Try
  925. If ExistInstrumento Then
  926. FormFuturos.Dispose()
  927. FormFuturos = New frmFuturos(TipOperacion)
  928. FormFuturos.ShowDialog()
  929. Else
  930. If NuevaPosInstrumento Then
  931. Variables.CodigoComparativo = String.Empty
  932. FormFuturos.Dispose()
  933. FormFuturos = New frmFuturos(TipOperacion)
  934. FormFuturos.ShowDialog()
  935. Else
  936. FormFuturos = New frmFuturos(TipOperacion)
  937. FormFuturos.ShowDialog()
  938. End If
  939. End If
  940. Catch ex As Exception
  941. FormFuturos = New frmFuturos(TipOperacion)
  942. FormFuturos.ShowDialog()
  943. End Try
  944. End If
  945. ''#########################################################################
  946. ''#########################################################################
  947. ''#########################################################################
  948. ''#########################################################################
  949. If CodigoInstrumento.IndexOf("REPO") > -1 Or CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  950. Dim ExistInstrumento As Boolean
  951. If CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  952. ExistInstrumento = ExisteInstrumento("REP0VENTA")
  953. Else
  954. ExistInstrumento = ExisteInstrumento("REP0")
  955. End If
  956. Try
  957. If ExistInstrumento Then
  958. FormRepo.Dispose()
  959. FormRepo = New frmReporto
  960. If GenerarReportoVenta Then
  961. FormRepo.txtMonto.Text = MontoReportoVenta
  962. End If
  963. FormRepo.ShowDialog()
  964. Else
  965. If NuevaPosInstrumento Then
  966. Variables.CodigoComparativo = String.Empty
  967. FormRepo.Dispose()
  968. FormRepo = New frmReporto
  969. If GenerarReportoVenta Then
  970. FormRepo.txtMonto.Text = MontoReportoVenta
  971. End If
  972. FormRepo.ShowDialog()
  973. Else
  974. If GenerarReportoVenta Then
  975. FormRepo.txtMonto.Text = MontoReportoVenta
  976. End If
  977. FormRepo.ShowDialog()
  978. End If
  979. End If
  980. Catch ex As Exception
  981. FormRepo = New frmReporto
  982. If GenerarReportoVenta Then
  983. FormRepo.txtMonto.Text = MontoReportoVenta
  984. End If
  985. FormRepo.ShowDialog()
  986. End Try
  987. End If
  988. ''#########################################################################
  989. ''#########################################################################
  990. ''#########################################################################
  991. ''#########################################################################
  992. If CodigoInstrumento.IndexOf("PPER") > -1 Then
  993. Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0")
  994. Try
  995. If ExistInstrumento Then
  996. FormPrestamoPersonal.Dispose()
  997. FormPrestamoPersonal = New frmPrestamoPersonal
  998. FormPrestamoPersonal.ShowDialog()
  999. Else
  1000. If NuevaPosInstrumento Then
  1001. Variables.CodigoComparativo = String.Empty
  1002. FormPrestamoPersonal.Dispose()
  1003. FormPrestamoPersonal = New frmPrestamoPersonal
  1004. FormPrestamoPersonal.ShowDialog()
  1005. Else
  1006. FormPrestamoPersonal.ShowDialog()
  1007. End If
  1008. End If
  1009. Catch ex As Exception
  1010. FormPrestamoPersonal = New frmPrestamoPersonal
  1011. FormPrestamoPersonal.ShowDialog()
  1012. End Try
  1013. End If
  1014. ''#########################################################################
  1015. ''#########################################################################
  1016. ''#########################################################################
  1017. ''#########################################################################
  1018. If CodigoInstrumento.IndexOf("PEMP") > -1 Then
  1019. Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0")
  1020. Try
  1021. If ExistInstrumento Then
  1022. FormPrestamoEmpresarial.Dispose()
  1023. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1024. FormPrestamoEmpresarial.ShowDialog()
  1025. Else
  1026. If NuevaPosInstrumento Then
  1027. Variables.CodigoComparativo = String.Empty
  1028. FormPrestamoEmpresarial.Dispose()
  1029. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1030. FormPrestamoEmpresarial.ShowDialog()
  1031. Else
  1032. FormPrestamoEmpresarial.ShowDialog()
  1033. End If
  1034. End If
  1035. Catch ex As Exception
  1036. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1037. FormPrestamoEmpresarial.ShowDialog()
  1038. End Try
  1039. End If
  1040. ''#########################################################################
  1041. ''#########################################################################
  1042. ''#########################################################################
  1043. ''#########################################################################
  1044. Dim Acciones As Integer = 0
  1045. If CodigoInstrumento.IndexOf("ACC") > -1 Then
  1046. Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0")
  1047. Try
  1048. If ExistInstrumento Then
  1049. FormAcciones.Dispose()
  1050. FormAcciones = New frmAcciones(TipOperacion)
  1051. FormAcciones.CargarRegistro(oInversionCE.CodigoIversion)
  1052. FormAcciones.ShowDialog()
  1053. Else
  1054. If NuevaPosInstrumento Then
  1055. Variables.CodigoComparativo = String.Empty
  1056. FormAcciones.Dispose()
  1057. FormAcciones = New frmAcciones(TipOperacion)
  1058. FormAcciones.ShowDialog()
  1059. Else
  1060. FormAcciones.Dispose()
  1061. FormAcciones = New frmAcciones(TipOperacion)
  1062. FormAcciones.ShowDialog()
  1063. End If
  1064. End If
  1065. Catch ex As Exception
  1066. FormAcciones = New frmAcciones(TipOperacion)
  1067. FormAcciones.ShowDialog()
  1068. End Try
  1069. End If
  1070. ''#########################################################################
  1071. ''#########################################################################
  1072. ''#########################################################################
  1073. ''#########################################################################
  1074. If CodigoInstrumento.IndexOf("LETE") > -1 Or CodigoInstrumento.IndexOf("PBUR") > -1 Or CodigoInstrumento.IndexOf("VCN") > -1 Or CodigoInstrumento.IndexOf("CETE") > -1 Then
  1075. Dim ExistInstrumento As Boolean
  1076. If CodigoInstrumento.IndexOf("LETE") > -1 Then
  1077. ExistInstrumento = ExisteInstrumento("LET0")
  1078. ElseIf CodigoInstrumento.IndexOf("PBUR") > -1 Then
  1079. ExistInstrumento = ExisteInstrumento("PBUR")
  1080. ElseIf CodigoInstrumento.IndexOf("VCN") > -1 Then
  1081. ExistInstrumento = ExisteInstrumento("VCN")
  1082. Else
  1083. ExistInstrumento = ExisteInstrumento("CET0")
  1084. End If
  1085. Try
  1086. If ExistInstrumento Then
  1087. FormLete.Dispose()
  1088. FormLete = New frmLetes
  1089. FormLete.ShowDialog()
  1090. Else
  1091. If NuevaPosInstrumento Then
  1092. Variables.CodigoComparativo = String.Empty
  1093. FormLete.Dispose()
  1094. FormLete = New frmLetes
  1095. FormLete.ShowDialog()
  1096. Else
  1097. FormLete.ShowDialog()
  1098. End If
  1099. End If
  1100. Catch ex As Exception
  1101. FormLete = New frmLetes
  1102. FormLete.ShowDialog()
  1103. End Try
  1104. End If
  1105. ''#########################################################################
  1106. ''#########################################################################
  1107. ''#########################################################################
  1108. ''#########################################################################
  1109. If CodigoInstrumento.IndexOf("BONO") > -1 Or CodigoInstrumento.IndexOf("CINV") > -1 Or CodigoInstrumento.IndexOf("TIT") > -1 Or CodigoInstrumento.IndexOf("EURB") > -1 Then
  1110. Dim ExistInstrumento As Boolean
  1111. If CodigoInstrumento.IndexOf("BONO") > -1 Then
  1112. ExistInstrumento = ExisteInstrumento("BON0")
  1113. ElseIf CodigoInstrumento.IndexOf("CINV") > -1 Then
  1114. ExistInstrumento = ExisteInstrumento("CIN0")
  1115. ElseIf CodigoInstrumento.IndexOf("TIT") > -1 Then
  1116. ExistInstrumento = ExisteInstrumento("TIT")
  1117. Else
  1118. ExistInstrumento = ExisteInstrumento("EURB0")
  1119. End If
  1120. Try
  1121. If ExistInstrumento Then
  1122. FormCINV.Dispose()
  1123. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1124. FormCINV.CargarRegistro(oInversionCE.CodigoIversion)
  1125. FormCINV.ShowDialog()
  1126. Else
  1127. If NuevaPosInstrumento Then
  1128. Variables.CodigoComparativo = String.Empty
  1129. FormCINV.Dispose()
  1130. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1131. FormCINV.ShowDialog()
  1132. Else
  1133. FormCINV.ShowDialog()
  1134. End If
  1135. End If
  1136. Catch ex As Exception
  1137. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1138. FormCINV.ShowDialog()
  1139. End Try
  1140. End If
  1141. ''#########################################################################
  1142. ''#########################################################################
  1143. If CodigoInstrumento.IndexOf("DAP") > -1 Then
  1144. Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0")
  1145. Try
  1146. If ExistInstrumento Then
  1147. FormDAP.Dispose()
  1148. FormDAP = New frmDepositosAPlazo
  1149. FormDAP.CargarRegistro(oInversionCE.CodigoIversion)
  1150. FormDAP.ShowDialog()
  1151. Else
  1152. If NuevaPosInstrumento Then
  1153. Variables.CodigoComparativo = String.Empty
  1154. FormDAP.Dispose()
  1155. FormDAP = New frmDepositosAPlazo
  1156. FormDAP.ShowDialog()
  1157. Else
  1158. FormDAP.ShowDialog()
  1159. End If
  1160. End If
  1161. Catch ex As Exception
  1162. FormDAP = New frmDepositosAPlazo
  1163. FormDAP.ShowDialog()
  1164. End Try
  1165. End If
  1166. ''#########################################################################
  1167. ''#########################################################################
  1168. ''#########################################################################
  1169. ''#########################################################################
  1170. If CodigoInstrumento.IndexOf("NEST") > -1 Then
  1171. Dim ExistInstrumento As Boolean = ExisteInstrumento("NEST0")
  1172. Try
  1173. If ExistInstrumento Then
  1174. FormNEST.Dispose()
  1175. FormNEST = New frmNotaEstructurada
  1176. FormNEST.CargarRegistro(oInversionCE.CodigoIversion)
  1177. FormNEST.ShowDialog()
  1178. Else
  1179. If NuevaPosInstrumento Then
  1180. Variables.CodigoComparativo = String.Empty
  1181. FormNEST.Dispose()
  1182. FormNEST = New frmNotaEstructurada
  1183. FormNEST.ShowDialog()
  1184. Else
  1185. FormNEST.ShowDialog()
  1186. End If
  1187. End If
  1188. Catch ex As Exception
  1189. FormNEST = New frmNotaEstructurada
  1190. FormNEST.ShowDialog()
  1191. End Try
  1192. End If
  1193. End Sub
  1194. ''#########################################################################
  1195. ''#########################################################################
  1196. ''#########################################################################
  1197. Function ExisteInstrumento(ByVal Tabla As String)
  1198. Dim General As New DAOGeneral
  1199. If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
  1200. Variables.Codigo = txtCodigoInversion.Text.ToString
  1201. Else
  1202. Variables.Codigo = txtCodigoCompra.Text.ToString
  1203. End If
  1204. Dim Codigo As String = Variables.Codigo
  1205. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1206. Return Existe
  1207. End Function
  1208. ''#########################################################################
  1209. Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
  1210. Modificar()
  1211. End Sub
  1212. Sub Modificar()
  1213. Dim General As New DAOGeneral
  1214. Dim Codigo As String = txtCodigoInversion.Text
  1215. Dim Valor As String = General.EstadoInversion(Codigo)
  1216. If Valor = "C" Then
  1217. Modo = "NM"
  1218. ModoInversion()
  1219. PrepararEdicion()
  1220. End If
  1221. End Sub
  1222. Private Sub PrepararEdicion()
  1223. TipoOperacion = "M"
  1224. HabilitarControles()
  1225. btnAccion.Text = "Modificar"
  1226. End Sub
  1227. Private Sub txtCodigoManual_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoManual.TextChanged
  1228. ControlCodigoIFManual()
  1229. End Sub
  1230. Private Sub txtCodigoManual_LostFocus(sender As Object, e As EventArgs) Handles txtCodigoManual.LostFocus
  1231. ControlCodigoIFManual()
  1232. End Sub
  1233. Private Sub vBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles vBindingSource.CurrentChanged
  1234. If Me.TipoOperacion = "C" Then
  1235. CargarRegistro(vBindingSource.Current("DocId").ToString)
  1236. End If
  1237. End Sub
  1238. Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
  1239. If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
  1240. Try
  1241. CargarRegistro(vBindingSource.Current("DocId").ToString)
  1242. Catch ex As Exception
  1243. End Try
  1244. ElseIf Me.TipoOperacion = "C" Then
  1245. vBindingSource.MoveNext()
  1246. End If
  1247. EstadoBoton()
  1248. End Sub
  1249. Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
  1250. If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
  1251. Try
  1252. CargarRegistro(vBindingSource.Current("DocId").ToString)
  1253. Catch ex As Exception
  1254. End Try
  1255. ElseIf Me.TipoOperacion = "C" Then
  1256. vBindingSource.MovePrevious()
  1257. End If
  1258. EstadoBoton()
  1259. End Sub
  1260. Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
  1261. If Me.TipoOperacion = "B" Then
  1262. Me.TipoOperacion = "C"
  1263. vBindingSource.MoveFirst()
  1264. Try
  1265. CargarRegistro(vBindingSource.Current("DocId").ToString)
  1266. Catch ex As Exception
  1267. End Try
  1268. ElseIf Me.TipoOperacion = "C" Then
  1269. vBindingSource.MoveFirst()
  1270. End If
  1271. EstadoBoton()
  1272. End Sub
  1273. Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
  1274. If Me.TipoOperacion = "B" Then
  1275. Me.TipoOperacion = "C"
  1276. vBindingSource.MoveLast()
  1277. Try
  1278. CargarRegistro(vBindingSource.Current("DocId").ToString)
  1279. Catch ex As Exception
  1280. End Try
  1281. ElseIf Me.TipoOperacion = "C" Then
  1282. vBindingSource.MoveLast()
  1283. End If
  1284. EstadoBoton()
  1285. End Sub
  1286. Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmisores.SelectedIndexChanged
  1287. ControlEmisores()
  1288. End Sub
  1289. Private Sub ControlEmisores()
  1290. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1291. oInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue
  1292. End If
  1293. End Sub
  1294. Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs) Handles Navegador.RefreshItems
  1295. End Sub
  1296. Private Sub cboInstrumentos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboInstrumentos.SelectedIndexChanged
  1297. ControlInstrumentos()
  1298. controladores.TInstrumento = cboInstrumentos.SelectedIndex
  1299. End Sub
  1300. Private Sub ControlInstrumentos()
  1301. If Not String.IsNullOrEmpty(TipoOperacion) Then
  1302. If (Not String.IsNullOrEmpty(Me.cboInstrumentos.SelectedValue)) Then
  1303. oInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentos.SelectedValue
  1304. End If
  1305. End If
  1306. If TipoOperacion = "N" Then
  1307. ActualizarCodigoNuevo()
  1308. End If
  1309. End Sub
  1310. Private Sub cboCalificaciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificaciones.SelectedIndexChanged
  1311. ControlCalificaciones()
  1312. End Sub
  1313. Private Sub ControlCalificaciones()
  1314. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1315. oInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificaciones.SelectedValue
  1316. End If
  1317. End Sub
  1318. Private Sub cboCalificadoras_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificadoras.SelectedIndexChanged
  1319. ControlCalificadoras()
  1320. End Sub
  1321. Private Sub ControlCalificadoras()
  1322. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1323. oInversionCE.CodigoEmpresaCalificadora = cboCalificadoras.SelectedValue
  1324. End If
  1325. End Sub
  1326. Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged
  1327. ControlPaises()
  1328. End Sub
  1329. Private Sub ControlPaises()
  1330. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1331. oInversionCE.Pais = cboPaises.SelectedValue
  1332. End If
  1333. End Sub
  1334. Private Sub cboTiposMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTiposMercado.SelectedIndexChanged
  1335. ControlTiposMercado()
  1336. End Sub
  1337. Private Sub ControlTiposMercado()
  1338. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1339. oInversionCE.TipoMercado = cboTiposMercado.SelectedValue
  1340. End If
  1341. End Sub
  1342. Private Sub txtNombreManual_TextChanged(sender As Object, e As EventArgs) Handles txtNombreManual.TextChanged
  1343. End Sub
  1344. Private Sub txtNombreManual_LostFocus(sender As Object, e As EventArgs) Handles txtNombreManual.LostFocus
  1345. ControlNombreManual()
  1346. End Sub
  1347. Private Sub ControlNombreManual()
  1348. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1349. oInversionCE.NombreManual = txtNombreManual.Text
  1350. End If
  1351. End Sub
  1352. Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
  1353. ControlPeriodicidad()
  1354. Variables.Periodicidad = cboPeriodicidad.SelectedValue
  1355. End Sub
  1356. Private Sub ControlPeriodicidad()
  1357. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1358. oInversionCE.Periodicidad = cboPeriodicidad.SelectedValue
  1359. End If
  1360. End Sub
  1361. Private Sub txtPlazoNum_TextChanged(sender As Object, e As EventArgs) Handles txtPlazoNum.TextChanged
  1362. End Sub
  1363. Private Sub txtPlazoNum_LostFocus(sender As Object, e As EventArgs) Handles txtPlazoNum.LostFocus
  1364. ControlPlazoNum()
  1365. End Sub
  1366. Private Sub ControlPlazoNum()
  1367. Dim valor As Integer
  1368. Integer.TryParse(txtPlazoNum.Text, valor)
  1369. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1370. oInversionCE.PlazoNumero = valor
  1371. End If
  1372. End Sub
  1373. Private Sub cboPlazoFactor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPlazoFactor.SelectedIndexChanged
  1374. ControlPlazoFactor()
  1375. End Sub
  1376. Private Sub ControlPlazoFactor()
  1377. If (cboPlazoFactor.SelectedValue <> Nothing) Then
  1378. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1379. oInversionCE.PlazoFactor = cboPlazoFactor.SelectedValue
  1380. End If
  1381. End If
  1382. End Sub
  1383. Private Sub cboTipoRenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoRenta.SelectedIndexChanged
  1384. ControlTipoRenta()
  1385. End Sub
  1386. Private Sub ControlTipoRenta()
  1387. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1388. If (cboTipoRenta.SelectedValue <> Nothing) Then
  1389. oInversionCE.TipoRenta = cboTipoRenta.SelectedValue
  1390. End If
  1391. End If
  1392. End Sub
  1393. Private Sub cboTipoTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoTasa.SelectedIndexChanged
  1394. ControlTipoTasa()
  1395. End Sub
  1396. Private Sub ControlTipoTasa()
  1397. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  1398. oInversionCE.TipoTasa = cboTipoTasa.SelectedValue
  1399. End If
  1400. End Sub
  1401. Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged
  1402. CodigoCompra()
  1403. End Sub
  1404. Private Sub txtCodigoInversion_LostFocus(sender As Object, e As EventArgs) Handles txtCodigoInversion.LostFocus
  1405. If Me.TipoOperacion = "B" Then
  1406. ControlCodigoInversion()
  1407. End If
  1408. End Sub
  1409. Private Sub ControlCodigoInversion()
  1410. oInversionCE.CodigoIversion = txtCodigoInversion.Text
  1411. End Sub
  1412. Private Sub cboEstadoDocumento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoDocumento.SelectedIndexChanged
  1413. ControlEstadoDocumento()
  1414. End Sub
  1415. Private Sub ControlEstadoDocumento()
  1416. If Not (TypeOf cboEstadoDocumento.SelectedValue Is DataRowView) Then
  1417. If Not oInversionCE Is Nothing Then
  1418. oInversionCE.EstadoDocumento = cboEstadoDocumento.SelectedValue
  1419. End If
  1420. End If
  1421. End Sub
  1422. Private Sub txtNotas_TextChanged(sender As Object, e As EventArgs) Handles txtNotas.TextChanged
  1423. End Sub
  1424. Private Sub txtNotas_LostFocus(sender As Object, e As EventArgs) Handles txtNotas.LostFocus
  1425. ControlNotas()
  1426. End Sub
  1427. Private Sub ControlNotas()
  1428. If TipoOperacion = "N" Or TipoOperacion = "M" Then
  1429. oInversionCE.Comentarios = Me.txtNotas.Text
  1430. End If
  1431. End Sub
  1432. Private Sub ControlEstadoProceso()
  1433. If TipoOperacion = "N" Or TipoOperacion = "M" Then
  1434. oInversionCE.EstadoProceso = cboEstadoProceso.SelectedValue
  1435. End If
  1436. End Sub
  1437. Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
  1438. Modo = "NM"
  1439. btnAccion.Text = "Guardar"
  1440. ModoInversion()
  1441. PrepararNuevo()
  1442. End Sub
  1443. Private Sub PrepararNuevo()
  1444. LimpiarControles()
  1445. HabilitarControles()
  1446. oInversionCE = Nothing
  1447. oInversionCE = New InversionesCE
  1448. Me.cboEmpresas.BackColor = Color.White
  1449. Me.txtCodigoInversion.BackColor = Color.White
  1450. Me.cboInstrumentos.BackColor = Color.White
  1451. Me.cboEmisores.BackColor = Color.White
  1452. Me.cboCalificaciones.BackColor = Color.White
  1453. Me.cboCalificadoras.BackColor = Color.White
  1454. Me.txtCodigoManual.BackColor = Color.White
  1455. Me.txtCodigoInversion.Enabled = False
  1456. Me.cboEstadoDocumento.SelectedValue = "A"
  1457. Me.cboEstadoDocumento.Enabled = False
  1458. Me.cboTipoOperacion.SelectedValue = "C"
  1459. Me.cboTipoOperacion.Enabled = False
  1460. Me.cboEstadoProceso.SelectedValue = "R"
  1461. Me.cboEstadoProceso.Enabled = False
  1462. Me.cboOrigenDeFondos.SelectedValue = "D"
  1463. Me.cboOrigenDeFondos.Enabled = False
  1464. TipoOperacion = "N"
  1465. End Sub
  1466. Private Sub ActualizarCodigoNuevo()
  1467. Dim vCodigo As String
  1468. vCodigo = SeriesDAO.SiguienteCodigoInversion(oInversionCE.CodigoEmpresa, oInversionCE.CodigoInstrumentoFinanciero)
  1469. If TipoOperacion = "N" Then
  1470. Me.txtCodigoInversion.Text = vCodigo
  1471. End If
  1472. If oInversionCE.CodigoInstrumentoFinanciero = "REPOVENTA" Then
  1473. EstadoReporto = "REPORTO"
  1474. Else
  1475. EstadoReporto = "PRIMARIO"
  1476. End If
  1477. End Sub
  1478. Private Sub dtpFechaDocumento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaDocumento.ValueChanged
  1479. ControlFechaDocumento()
  1480. End Sub
  1481. Private Sub ControlFechaDocumento()
  1482. If TipoOperacion = "N" Or TipoOperacion = "M" Then
  1483. oInversionCE.FechaDocumento = dtpFechaDocumento.Value.Date
  1484. End If
  1485. End Sub
  1486. Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles btnReporte.Click
  1487. End Sub
  1488. Private Sub BoquearBotones()
  1489. Me.cboEmpresas.Enabled = False
  1490. Me.cboInstrumentos.Enabled = False
  1491. Me.cboEmisores.Enabled = False
  1492. Me.cboCalificaciones.Enabled = False
  1493. Me.cboCalificadoras.Enabled = False
  1494. Me.cboPaises.Enabled = False
  1495. Me.cboTiposMercado.Enabled = False
  1496. Me.txtNombreManual.ReadOnly = True
  1497. Me.cboPeriodicidad.Enabled = False
  1498. Me.txtPlazoNum.ReadOnly = True
  1499. Me.cboPlazoFactor.Enabled = False
  1500. Me.cboTipoRenta.Enabled = False
  1501. Me.cboTipoTasa.Enabled = False
  1502. Me.txtCodigoInversion.ReadOnly = True
  1503. Me.dtpFechaDocumento.Enabled = False
  1504. Me.txtCodigoManual.ReadOnly = True
  1505. Me.cboEstadoDocumento.Enabled = False
  1506. End Sub
  1507. Private Sub HabilitarBotones()
  1508. Me.cboEmpresas.Enabled = False
  1509. Me.cboInstrumentos.Enabled = False
  1510. Me.cboEmisores.Enabled = False
  1511. Me.cboCalificaciones.Enabled = False
  1512. Me.cboCalificadoras.Enabled = False
  1513. Me.cboPaises.Enabled = False
  1514. Me.cboTiposMercado.Enabled = False
  1515. Me.txtNombreManual.ReadOnly = True
  1516. Me.cboPeriodicidad.Enabled = False
  1517. Me.txtPlazoNum.ReadOnly = True
  1518. Me.cboPlazoFactor.Enabled = False
  1519. Me.cboTipoRenta.Enabled = False
  1520. Me.cboTipoTasa.Enabled = False
  1521. Me.txtCodigoInversion.ReadOnly = True
  1522. Me.dtpFechaDocumento.Enabled = False
  1523. Me.txtCodigoManual.ReadOnly = True
  1524. Me.cboEstadoDocumento.Enabled = False
  1525. End Sub
  1526. Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
  1527. Me.Close()
  1528. End Sub
  1529. Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
  1530. If (Borrar() = 0) Then
  1531. LimpiarControles()
  1532. End If
  1533. CargarNavegador()
  1534. Refrescar()
  1535. btnAccion.Text = "Buscar"
  1536. PrepararBusqueda()
  1537. Variables.CodigoComparativo = "NULL"
  1538. End Sub
  1539. Public Sub Refrescar()
  1540. Me.Refresh()
  1541. End Sub
  1542. Public Function Borrar()
  1543. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  1544. If (mensaje = vbOK) Then
  1545. Dim EliminarCascada As Boolean = ExisteInstrumento("PIN0")
  1546. Dim eliminar As New InversionDAO
  1547. Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "INV0", EliminarCascada)
  1548. If (valor = 1) Then
  1549. MsgBox("Error al Eliminar")
  1550. Return valor
  1551. Else
  1552. MsgBox("Registro Eliminado")
  1553. Return valor
  1554. End If
  1555. Else
  1556. Return 1
  1557. End If
  1558. End Function
  1559. Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click
  1560. End Sub
  1561. Private Sub Button1_Click(sender As Object, e As EventArgs)
  1562. frmReporto.Show()
  1563. End Sub
  1564. Private Sub Button1_Click_1(sender As Object, e As EventArgs)
  1565. frmPrestamoPersonal.ShowDialog()
  1566. End Sub
  1567. Private Sub Button1_Click_2(sender As Object, e As EventArgs)
  1568. JSON.Show()
  1569. End Sub
  1570. Sub ConfiguracionInicial()
  1571. For Each Items In pnlContenedor.Controls
  1572. If TypeOf Items Is GroupBox Then
  1573. Dim W_Tamgrp As Double = Items.Parent.Width - 10
  1574. Dim W_Tamflp As Double = W_Tamgrp - 10
  1575. Dim H_Tamgrp As Double = Items.Parent.Height - 30
  1576. Dim H_Tamflp As Double = H_Tamgrp - 30
  1577. Items.Width = W_Tamgrp
  1578. Items.Height = H_Tamgrp
  1579. Items.Location = New Point(2, 20)
  1580. For Each flItem In Items.Controls
  1581. If TypeOf flItem Is FlowLayoutPanel Then
  1582. flItem.Width = W_Tamflp
  1583. flItem.Height = H_Tamflp - 10
  1584. End If
  1585. Next
  1586. For Each item In Items.Controls
  1587. If TypeOf item Is CheckBox Then
  1588. Dim W_Tamchk As Double = item.Width + 5
  1589. item.Width = W_Tamchk
  1590. End If
  1591. Next
  1592. End If
  1593. Next
  1594. End Sub
  1595. Sub CargarTabla()
  1596. frmBuscar = New frmBuscarDeLista(2)
  1597. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1598. DiccionarioColecciones = GuardarColecciones()
  1599. Dim Data As New DataTable
  1600. Data = oInversionDAO.Buscar(DiccionarioColecciones).Tables("Resultado")
  1601. GenerarFormato(Data)
  1602. For Each Item In pnlCargaDatos.Controls
  1603. If TypeOf Item Is Form Then
  1604. Item.dispose
  1605. End If
  1606. Next
  1607. frmBuscar.dgvBuscarDeLista.DataSource = Data
  1608. frmBuscar.Dock = DockStyle.Fill
  1609. frmBuscar.TopLevel = False
  1610. frmBuscar.Parent = pnlCargaDatos
  1611. frmBuscar.Show()
  1612. End Sub
  1613. Sub GenerarFormato(ByRef Data As DataTable)
  1614. For Each Row As DataRow In Data.Rows
  1615. Dim CodigoPropuesta As String = String.Empty
  1616. Dim Estado As String = String.Empty
  1617. Dim Asunto As String = String.Empty
  1618. Dim Empresa As String = String.Empty
  1619. Dim InstrumentoFinanciero As String = String.Empty
  1620. Dim Emisor As String = String.Empty
  1621. Dim CalificacionRiesgo As String = String.Empty
  1622. Dim EmpresaCalificadora As String = String.Empty
  1623. Dim OrigenFondos As String = String.Empty
  1624. Dim Comentarios As String = String.Empty
  1625. Dim Justificaciones As String = String.Empty
  1626. Dim TipoOperacion As String = String.Empty
  1627. Dim Base As String = String.Empty
  1628. Dim Monto As String = String.Empty
  1629. Dim Precio As String = String.Empty
  1630. Dim Rendimiento As String = String.Empty
  1631. Dim CantidadPlazo As String = String.Empty
  1632. Dim TipoPlazo As String = String.Empty
  1633. Dim Ingresos As String = String.Empty
  1634. Dim FechaCreación As String = String.Empty
  1635. Dim EstadoAutorización As String = String.Empty
  1636. Dim TipoMercado As String = String.Empty
  1637. Dim Pais As String = String.Empty
  1638. CodigoPropuesta = Row("Código de Propuesta").ToString
  1639. Estado = Row("Estado").ToString
  1640. Asunto = Row("Asunto").ToString
  1641. Empresa = Row("Empresa").ToString
  1642. InstrumentoFinanciero = Row("Instrumento Financiero").ToString
  1643. Emisor = Row("Emisor").ToString
  1644. CalificacionRiesgo = Row("Calificación de Riesgo").ToString
  1645. EmpresaCalificadora = Row("Empresa Calificadora").ToString
  1646. OrigenFondos = Row("Origen de Fondos").ToString
  1647. Comentarios = Row("Comentarios").ToString
  1648. Justificaciones = Row("Justificaciones").ToString
  1649. TipoOperacion = Row("Tipo de Operacion").ToString
  1650. Base = Row("Base de Calculo").ToString
  1651. Monto = Row("Monto de Inversion").ToString
  1652. Precio = Row("Precio").ToString
  1653. Rendimiento = Row("Rendimiento").ToString
  1654. CantidadPlazo = Row("Cantidad en Plazo").ToString
  1655. TipoPlazo = Row("Tipo de Plazo").ToString
  1656. Ingresos = Row("Ingresos").ToString
  1657. FechaCreación = Row("Fecha de Creación").ToString
  1658. EstadoAutorización = Row("Estado de Autorización").ToString
  1659. TipoMercado = Row("Tipo de Mercado").ToString
  1660. Pais = Row("Pais").ToString
  1661. If String.IsNullOrEmpty(CodigoPropuesta) Then
  1662. CodigoPropuesta = " ---- ---- ---- ---- ----"
  1663. End If
  1664. If String.IsNullOrEmpty(Estado) Then
  1665. Estado = " ---- ---- ---- ---- ----"
  1666. End If
  1667. If String.IsNullOrEmpty(Asunto) Then
  1668. Asunto = " ---- ---- ---- ---- ----"
  1669. End If
  1670. If String.IsNullOrEmpty(Empresa) Then
  1671. Empresa = " ---- ---- ---- ---- ----"
  1672. End If
  1673. If String.IsNullOrEmpty(InstrumentoFinanciero) Then
  1674. InstrumentoFinanciero = " ---- ---- ---- ---- ----"
  1675. End If
  1676. If String.IsNullOrEmpty(Emisor) Then
  1677. Emisor = " ---- ---- ---- ---- ----"
  1678. End If
  1679. If String.IsNullOrEmpty(CalificacionRiesgo) Then
  1680. CalificacionRiesgo = " ---- ---- ---- ---- ----"
  1681. End If
  1682. If String.IsNullOrEmpty(EmpresaCalificadora) Then
  1683. EmpresaCalificadora = " ---- ---- ---- ---- ----"
  1684. End If
  1685. If String.IsNullOrEmpty(OrigenFondos) Then
  1686. OrigenFondos = " ---- ---- ---- ---- ----"
  1687. End If
  1688. If String.IsNullOrEmpty(Comentarios) Then
  1689. Comentarios = " ---- ---- ---- ---- ----"
  1690. End If
  1691. If String.IsNullOrEmpty(Justificaciones) Then
  1692. Justificaciones = " ---- ---- ---- ---- ----"
  1693. End If
  1694. If String.IsNullOrEmpty(TipoOperacion) Then
  1695. TipoOperacion = " ---- ---- ---- ---- ----"
  1696. End If
  1697. If String.IsNullOrEmpty(Base) Then
  1698. Base = " ---- ---- ---- ---- ----"
  1699. End If
  1700. If String.IsNullOrEmpty(Monto) Then
  1701. Monto = " ---- ---- ---- ---- ----"
  1702. End If
  1703. If String.IsNullOrEmpty(Precio) Then
  1704. Precio = " ---- ---- ---- ---- ----"
  1705. End If
  1706. If String.IsNullOrEmpty(Rendimiento) Then
  1707. Rendimiento = " ---- ---- ---- ---- ----"
  1708. End If
  1709. If String.IsNullOrEmpty(CantidadPlazo) Then
  1710. CantidadPlazo = " ---- ---- ---- ---- ----"
  1711. End If
  1712. If String.IsNullOrEmpty(TipoPlazo) Then
  1713. TipoPlazo = " ---- ---- ---- ---- ----"
  1714. End If
  1715. If String.IsNullOrEmpty(Ingresos) Then
  1716. Ingresos = " ---- ---- ---- ---- ----"
  1717. End If
  1718. If String.IsNullOrEmpty(FechaCreación) Then
  1719. FechaCreación = " ---- ---- ---- ---- ----"
  1720. End If
  1721. If String.IsNullOrEmpty(EstadoAutorización) Then
  1722. EstadoAutorización = " ---- ---- ---- ---- ----"
  1723. End If
  1724. If String.IsNullOrEmpty(TipoMercado) Then
  1725. TipoMercado = " ---- ---- ---- ---- ----"
  1726. End If
  1727. If String.IsNullOrEmpty(Pais) Then
  1728. Pais = " ---- ---- ---- ---- ----"
  1729. End If
  1730. Row("Código de Propuesta") = CodigoPropuesta
  1731. Row("Estado") = Estado
  1732. Row("Asunto") = Asunto
  1733. Row("Empresa") = Empresa
  1734. Row("Instrumento Financiero") = InstrumentoFinanciero
  1735. Row("Emisor") = Emisor
  1736. Row("Calificación de Riesgo") = CalificacionRiesgo
  1737. Row("Empresa Calificadora") = EmpresaCalificadora
  1738. Row("Origen de Fondos") = OrigenFondos
  1739. Row("Comentarios") = Comentarios
  1740. Row("Justificaciones") = Justificaciones
  1741. Row("Tipo de Operacion") = TipoOperacion
  1742. Row("Base de Calculo") = Base
  1743. Row("Monto de Inversion") = Monto
  1744. Row("Precio") = Precio
  1745. Row("Rendimiento") = Rendimiento
  1746. Row("Cantidad en Plazo") = CantidadPlazo
  1747. Row("Tipo de Plazo") = TipoPlazo
  1748. Row("Ingresos") = Ingresos
  1749. Row("Fecha de Creación") = FechaCreación
  1750. Row("Estado de Autorización") = EstadoAutorización
  1751. Row("Tipo de Mercado") = TipoMercado
  1752. Row("Pais") = Pais
  1753. Next
  1754. End Sub
  1755. Function GuardarColecciones()
  1756. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1757. DiccionarioColecciones.Add("Empresa", Col_Empresas)
  1758. DiccionarioColecciones.Add("Emisor", Col_Emisor)
  1759. DiccionarioColecciones.Add("EstDocumento", Col_EstDocumento)
  1760. DiccionarioColecciones.Add("Instrumento", Col_Instrumento)
  1761. DiccionarioColecciones.Add("CalRiesgo", Col_CalRiesgo)
  1762. DiccionarioColecciones.Add("TipOperacion", Col_TipOperacion)
  1763. DiccionarioColecciones.Add("OriFond", Col_OriFond)
  1764. DiccionarioColecciones.Add("CalERiesgo", Col_CalERiesgo)
  1765. DiccionarioColecciones.Add("Aut", Col_EstadoProceso)
  1766. DiccionarioColecciones.Add("Plazo", Col_Plazo)
  1767. DiccionarioColecciones.Add("Pais", Col_Pais)
  1768. DiccionarioColecciones.Add("TipMercado", Col_TipMercado)
  1769. Return DiccionarioColecciones
  1770. End Function
  1771. Sub ActualizarColecciones(sender As Object)
  1772. Dim Flpnombre As String = sender.parent.name
  1773. If TypeOf sender.parent Is FlowLayoutPanel Then
  1774. Dim FlpObjeto As New FlowLayoutPanel
  1775. FlpObjeto = sender.parent
  1776. If Flpnombre = "flpEmpresas" Then
  1777. Col_Empresas.Clear()
  1778. For Each Nombre In FlpObjeto.Controls
  1779. If TypeOf Nombre Is CheckBox Then
  1780. If Nombre.checked Then
  1781. Col_Empresas.Add(Nombre.name)
  1782. End If
  1783. End If
  1784. Next
  1785. ElseIf Flpnombre = "flpEmisor" Then
  1786. Col_Emisor.Clear()
  1787. For Each Nombre In FlpObjeto.Controls
  1788. If TypeOf Nombre Is CheckBox Then
  1789. If Nombre.checked Then
  1790. Col_Emisor.Add(Nombre.name)
  1791. End If
  1792. End If
  1793. Next
  1794. ElseIf Flpnombre = "flpEstadoDocumento" Then
  1795. Col_EstDocumento.Clear()
  1796. For Each Nombre In FlpObjeto.Controls
  1797. If TypeOf Nombre Is CheckBox Then
  1798. If Nombre.checked Then
  1799. Col_EstDocumento.Add(Nombre.name)
  1800. End If
  1801. End If
  1802. Next
  1803. ElseIf Flpnombre = "flpInstrumentos" Then
  1804. Col_Instrumento.Clear()
  1805. For Each Nombre In FlpObjeto.Controls
  1806. If TypeOf Nombre Is CheckBox Then
  1807. If Nombre.checked Then
  1808. Col_Instrumento.Add(Nombre.name)
  1809. End If
  1810. End If
  1811. Next
  1812. ElseIf Flpnombre = "flpCalificacionRiesgo" Then
  1813. Col_CalRiesgo.Clear()
  1814. For Each Nombre In FlpObjeto.Controls
  1815. If TypeOf Nombre Is CheckBox Then
  1816. If Nombre.checked Then
  1817. Col_CalRiesgo.Add(Nombre.name)
  1818. End If
  1819. End If
  1820. Next
  1821. ElseIf Flpnombre = "flpTipoOperacion" Then
  1822. Col_TipOperacion.Clear()
  1823. For Each Nombre In FlpObjeto.Controls
  1824. If TypeOf Nombre Is CheckBox Then
  1825. If Nombre.checked Then
  1826. Col_TipOperacion.Add(Nombre.name)
  1827. End If
  1828. End If
  1829. Next
  1830. ElseIf Flpnombre = "flpOrigenFondos" Then
  1831. Col_OriFond.Clear()
  1832. For Each Nombre In FlpObjeto.Controls
  1833. If TypeOf Nombre Is CheckBox Then
  1834. If Nombre.checked Then
  1835. Col_OriFond.Add(Nombre.name)
  1836. End If
  1837. End If
  1838. Next
  1839. ElseIf Flpnombre = "flpCalificadoraRiesgo" Then
  1840. Col_CalERiesgo.Clear()
  1841. For Each Nombre In FlpObjeto.Controls
  1842. If TypeOf Nombre Is CheckBox Then
  1843. If Nombre.checked Then
  1844. Col_CalERiesgo.Add(Nombre.name)
  1845. End If
  1846. End If
  1847. Next
  1848. ElseIf Flpnombre = "flpAutorizacion" Then
  1849. Col_EstadoProceso.Clear()
  1850. For Each Nombre In FlpObjeto.Controls
  1851. If TypeOf Nombre Is CheckBox Then
  1852. If Nombre.checked Then
  1853. Col_EstadoProceso.Add(Nombre.name)
  1854. End If
  1855. End If
  1856. Next
  1857. ElseIf Flpnombre = "flpPlazo" Then
  1858. Col_Plazo.Clear()
  1859. For Each Nombre In FlpObjeto.Controls
  1860. If TypeOf Nombre Is CheckBox Then
  1861. If Nombre.checked Then
  1862. Col_Plazo.Add(Nombre.name)
  1863. End If
  1864. End If
  1865. Next
  1866. ElseIf Flpnombre = "flpPais" Then
  1867. Col_Pais.Clear()
  1868. For Each Nombre In FlpObjeto.Controls
  1869. If TypeOf Nombre Is CheckBox Then
  1870. If Nombre.checked Then
  1871. Col_Pais.Add(Nombre.name)
  1872. End If
  1873. End If
  1874. Next
  1875. ElseIf Flpnombre = "flpTipoMercado" Then
  1876. Col_TipMercado.Clear()
  1877. For Each Nombre In FlpObjeto.Controls
  1878. If TypeOf Nombre Is CheckBox Then
  1879. If Nombre.checked Then
  1880. Col_TipMercado.Add(Nombre.name)
  1881. End If
  1882. End If
  1883. Next
  1884. End If
  1885. End If
  1886. End Sub
  1887. Function AgregarCheckbox(ByRef P_cboObjeto As ComboBox, ByRef P_flpObjeto As FlowLayoutPanel)
  1888. Dim Datos As New Dictionary(Of String, String)
  1889. Dim Col_Generica As New Collection
  1890. Dim i As Integer = 0
  1891. While i < P_cboObjeto.Items.Count
  1892. P_cboObjeto.SelectedIndex = i
  1893. Dim Valor As String = P_cboObjeto.SelectedValue
  1894. Dim Texto As String = P_cboObjeto.Text
  1895. If Not Valor Is Nothing Then
  1896. If Not String.IsNullOrEmpty(Valor.ToString) Or Not String.IsNullOrEmpty(Texto.ToString) Then
  1897. Datos.Add(Valor, Texto)
  1898. End If
  1899. End If
  1900. i += 1
  1901. End While
  1902. Dim Existe As Boolean = False
  1903. For Each item As CheckBox In P_flpObjeto.Controls
  1904. If item.Text.ToString = "Todos" Then
  1905. Existe = True
  1906. End If
  1907. Next
  1908. Dim O_ChequeTodos As New CheckBox
  1909. O_ChequeTodos.Name = "Todos" + P_flpObjeto.Name.ToString
  1910. O_ChequeTodos.Checked = True
  1911. O_ChequeTodos.Width = 250
  1912. O_ChequeTodos.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  1913. O_ChequeTodos.Text = "Todos"
  1914. O_ChequeTodos.Height = 20
  1915. O_ChequeTodos.Margin = New Padding(25, 5, 25, 5)
  1916. If Not Existe Then
  1917. P_flpObjeto.Controls.Add(O_ChequeTodos)
  1918. AddHandler O_ChequeTodos.Click, AddressOf evento
  1919. AddHandler O_ChequeTodos.CheckedChanged, AddressOf Colorevento
  1920. End If
  1921. Col_Generica.Add(O_ChequeTodos.Name)
  1922. For Each RecorrerDatos In Datos
  1923. Col_Generica.Add(RecorrerDatos.Key)
  1924. Dim O_Check As New CheckBox
  1925. Existe = False
  1926. Dim Nombre = RecorrerDatos.Value
  1927. For Each item As CheckBox In P_flpObjeto.Controls
  1928. If item.Text.ToString = Nombre.ToString Then
  1929. Existe = True
  1930. End If
  1931. Next
  1932. If Not Existe Then
  1933. O_Check.Name = RecorrerDatos.Key
  1934. O_Check.Checked = True
  1935. O_Check.Width = 250
  1936. O_Check.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  1937. O_Check.Text = Nombre
  1938. O_Check.Height = 20
  1939. O_Check.Margin = New Padding(25, 5, 25, 5)
  1940. P_flpObjeto.Controls.Add(O_Check)
  1941. AddHandler O_Check.Click, AddressOf evento
  1942. AddHandler O_Check.CheckedChanged, AddressOf Colorevento
  1943. End If
  1944. Next
  1945. Return Col_Generica
  1946. End Function
  1947. Sub eventoCargar()
  1948. For Each Item In pnlMenu.Controls
  1949. If TypeOf Item Is Panel Then
  1950. If Item.backcolor = Color.White Then
  1951. For Each Items In Item.controls
  1952. Items.backcolor = Color.WhiteSmoke
  1953. Next
  1954. Item.backcolor = Color.WhiteSmoke
  1955. End If
  1956. End If
  1957. Next
  1958. pnlContenedor.Visible = False
  1959. CargarTabla()
  1960. End Sub
  1961. Sub eventoCancelar()
  1962. For Each Item In pnlMenu.Controls
  1963. If TypeOf Item Is Panel Then
  1964. If Item.backcolor = Color.White Then
  1965. For Each Items In Item.controls
  1966. Items.backcolor = Color.WhiteSmoke
  1967. Next
  1968. Item.backcolor = Color.WhiteSmoke
  1969. End If
  1970. End If
  1971. Next
  1972. pnlContenedor.Visible = False
  1973. End Sub
  1974. Sub evento(sender As Object, e As EventArgs)
  1975. Dim P_flpObjeto As New FlowLayoutPanel
  1976. P_flpObjeto = sender.parent
  1977. If sender.Name.ToString.IndexOf("Todos") > -1 Then
  1978. CambioCheckTodos(P_flpObjeto, sender)
  1979. Else
  1980. TodosCheck(P_flpObjeto, sender, e)
  1981. End If
  1982. End Sub
  1983. Sub Colorevento(sender As Object, e As EventArgs)
  1984. If (sender.checked) Then
  1985. sender.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  1986. Else
  1987. sender.BackColor = ColorTranslator.FromHtml("Transparent")
  1988. End If
  1989. ActualizarColecciones(sender)
  1990. End Sub
  1991. Sub CambioCheckTodos(ByRef P_flpObjeto As FlowLayoutPanel, ByVal sender As Object)
  1992. Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1
  1993. Dim PrimerCheck As Boolean = True
  1994. For Each xCheckBox In P_flpObjeto.Controls
  1995. If TypeOf xCheckBox Is CheckBox Then
  1996. Dim yCheckBox As New CheckBox
  1997. yCheckBox = xCheckBox
  1998. If xCheckBox.TabIndex = 0 Then
  1999. If Not yCheckBox.Checked Then
  2000. PrimerCheck = False
  2001. End If
  2002. End If
  2003. End If
  2004. Next
  2005. If PrimerCheck Then
  2006. For Each xCheckBox In P_flpObjeto.Controls
  2007. If TypeOf xCheckBox Is CheckBox Then
  2008. Dim yCheckBox As New CheckBox
  2009. yCheckBox = xCheckBox
  2010. yCheckBox.Checked = True
  2011. End If
  2012. Next
  2013. ElseIf Not PrimerCheck Then
  2014. For Each xCheckBox In P_flpObjeto.Controls
  2015. If TypeOf xCheckBox Is CheckBox Then
  2016. Dim yCheckBox As New CheckBox
  2017. yCheckBox = xCheckBox
  2018. yCheckBox.Checked = False
  2019. End If
  2020. Next
  2021. End If
  2022. End Sub
  2023. Sub TodosCheck(ByRef P_flpObjeto As FlowLayoutPanel, sender As Object, e As EventArgs)
  2024. Dim ChequeTodos As Boolean = True
  2025. If Not sender.Name.ToString.IndexOf("Todos") > -1 Then
  2026. For Each xCheckBox In P_flpObjeto.Controls
  2027. If Not xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
  2028. If Not xCheckBox.checked Then
  2029. ChequeTodos = False
  2030. End If
  2031. End If
  2032. Next
  2033. End If
  2034. For Each xCheckBox In P_flpObjeto.Controls
  2035. If xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
  2036. xCheckBox.checked = ChequeTodos
  2037. End If
  2038. Next
  2039. End Sub
  2040. Private Sub lblEmpresa_Click(sender As Object, e As EventArgs) Handles lblEmpresa.Click
  2041. ProcesoVisibilidad(grpEmpresas)
  2042. MenuSeleccionado(sender)
  2043. CambiarPosicionPrincipal(sender.parent)
  2044. End Sub
  2045. Sub ProcesoVisibilidad(sender As Object)
  2046. For Each Items In pnlContenedor.Controls
  2047. If TypeOf Items Is GroupBox Then
  2048. Items.visible = False
  2049. End If
  2050. Next
  2051. sender.visible = True
  2052. End Sub
  2053. Sub MenuSeleccionado(sender As Object)
  2054. pnlContenedor.Visible = True
  2055. For Each Items In pnlMenu.Controls
  2056. If TypeOf Items Is Panel Then
  2057. Items.BackColor = Color.WhiteSmoke
  2058. For Each Item In Items.controls
  2059. Item.BackColor = Color.WhiteSmoke
  2060. Next
  2061. End If
  2062. Next
  2063. If TypeOf sender Is Panel Then
  2064. sender.BackColor = Color.White
  2065. For Each Item In sender.controls
  2066. Item.BackColor = Color.White
  2067. Next
  2068. End If
  2069. If TypeOf sender Is Label Then
  2070. sender.BackColor = Color.White
  2071. sender.parent.BackColor = Color.White
  2072. End If
  2073. End Sub
  2074. Sub CambiarPosicionPrincipal(sender As Object)
  2075. Dim PosicionY = sender.Location.Y
  2076. Dim PosicionX = pnlContenedor.Location.X
  2077. pnlContenedor.Location = New Point(PosicionX, PosicionY)
  2078. End Sub
  2079. Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs) Handles pnlEmpresa.Click
  2080. ProcesoVisibilidad(grpEmpresas)
  2081. MenuSeleccionado(sender)
  2082. CambiarPosicionPrincipal(sender)
  2083. End Sub
  2084. Private Sub lblInstrumento_Click(sender As Object, e As EventArgs) Handles lblInstrumento.Click
  2085. ProcesoVisibilidad(grpInstrumentos)
  2086. MenuSeleccionado(sender)
  2087. CambiarPosicionPrincipal(sender.parent)
  2088. End Sub
  2089. Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs) Handles pnlInstrumento.Paint
  2090. End Sub
  2091. Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs) Handles pnlInstrumento.Click
  2092. ProcesoVisibilidad(grpInstrumentos)
  2093. MenuSeleccionado(sender)
  2094. CambiarPosicionPrincipal(sender)
  2095. End Sub
  2096. Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click
  2097. ProcesoVisibilidad(grpOrigenFondos)
  2098. MenuSeleccionado(sender)
  2099. CambiarPosicionPrincipal(sender.parent)
  2100. End Sub
  2101. Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click
  2102. ProcesoVisibilidad(grpOrigenFondos)
  2103. MenuSeleccionado(sender)
  2104. CambiarPosicionPrincipal(sender)
  2105. End Sub
  2106. Private Sub lblPlazo_Click(sender As Object, e As EventArgs) Handles lblPlazo.Click
  2107. ProcesoVisibilidad(grpPlazo)
  2108. MenuSeleccionado(sender)
  2109. CambiarPosicionPrincipal(sender.parent)
  2110. End Sub
  2111. Private Sub pnlPlazo_Click(sender As Object, e As EventArgs) Handles pnlPlazo.Click
  2112. ProcesoVisibilidad(grpPlazo)
  2113. MenuSeleccionado(sender)
  2114. CambiarPosicionPrincipal(sender)
  2115. End Sub
  2116. Private Sub lblEmisor_Click(sender As Object, e As EventArgs) Handles lblEmisor.Click
  2117. ProcesoVisibilidad(grpEmisor)
  2118. MenuSeleccionado(sender)
  2119. CambiarPosicionPrincipal(sender.parent)
  2120. End Sub
  2121. Private Sub pnlEmisor_Click(sender As Object, e As EventArgs) Handles pnlEmisor.Click
  2122. ProcesoVisibilidad(grpEmisor)
  2123. MenuSeleccionado(sender)
  2124. CambiarPosicionPrincipal(sender)
  2125. End Sub
  2126. Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click
  2127. ProcesoVisibilidad(grpCalificacionRiesgo)
  2128. MenuSeleccionado(sender)
  2129. CambiarPosicionPrincipal(sender.parent)
  2130. End Sub
  2131. Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click
  2132. ProcesoVisibilidad(grpCalificacionRiesgo)
  2133. MenuSeleccionado(sender)
  2134. CambiarPosicionPrincipal(sender)
  2135. End Sub
  2136. Private Sub lblCalificadora_Click(sender As Object, e As EventArgs) Handles lblCalificadora.Click
  2137. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2138. MenuSeleccionado(sender)
  2139. CambiarPosicionPrincipal(sender.parent)
  2140. End Sub
  2141. Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs) Handles pnlCalificadora.Click
  2142. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2143. MenuSeleccionado(sender)
  2144. CambiarPosicionPrincipal(sender)
  2145. End Sub
  2146. Private Sub lblPais_Click(sender As Object, e As EventArgs) Handles lblPais.Click
  2147. ProcesoVisibilidad(grpPais)
  2148. MenuSeleccionado(sender)
  2149. CambiarPosicionPrincipal(sender.parent)
  2150. End Sub
  2151. Private Sub pnlPais_Click(sender As Object, e As EventArgs) Handles pnlPais.Click
  2152. ProcesoVisibilidad(grpPais)
  2153. MenuSeleccionado(sender)
  2154. CambiarPosicionPrincipal(sender)
  2155. End Sub
  2156. Private Sub lblEstado_Click(sender As Object, e As EventArgs) Handles lblEstado.Click
  2157. ProcesoVisibilidad(grpEstadoDocumento)
  2158. MenuSeleccionado(sender)
  2159. CambiarPosicionPrincipal(sender.parent)
  2160. End Sub
  2161. Private Sub pnlEstado_Click(sender As Object, e As EventArgs) Handles pnlEstado.Click
  2162. ProcesoVisibilidad(grpEstadoDocumento)
  2163. MenuSeleccionado(sender)
  2164. CambiarPosicionPrincipal(sender)
  2165. End Sub
  2166. Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs) Handles lblEstadoProceso.Click
  2167. ProcesoVisibilidad(grpEstadoProceso)
  2168. MenuSeleccionado(sender)
  2169. CambiarPosicionPrincipal(sender.parent)
  2170. End Sub
  2171. Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs) Handles pnlEstadoProceso.Click
  2172. ProcesoVisibilidad(grpEstadoProceso)
  2173. MenuSeleccionado(sender)
  2174. CambiarPosicionPrincipal(sender)
  2175. End Sub
  2176. Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click
  2177. ProcesoVisibilidad(grpTipoOperacion)
  2178. MenuSeleccionado(sender)
  2179. CambiarPosicionPrincipal(sender.parent)
  2180. End Sub
  2181. Private Sub pnlTipOper_Click(sender As Object, e As EventArgs) Handles pnlTipOper.Click
  2182. ProcesoVisibilidad(grpTipoOperacion)
  2183. MenuSeleccionado(sender)
  2184. CambiarPosicionPrincipal(sender)
  2185. End Sub
  2186. Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs) Handles lblTipoMercado.Click
  2187. ProcesoVisibilidad(grpTipoMercado)
  2188. MenuSeleccionado(sender)
  2189. CambiarPosicionPrincipal(sender.parent)
  2190. End Sub
  2191. Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs) Handles pnlTipMercado.Click
  2192. ProcesoVisibilidad(grpTipoMercado)
  2193. MenuSeleccionado(sender)
  2194. CambiarPosicionPrincipal(sender)
  2195. End Sub
  2196. Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover
  2197. EventHijoAcercar(sender)
  2198. End Sub
  2199. Sub EventPadreAcercar(ByVal sender As Object)
  2200. Acercar(sender)
  2201. For Each label In sender.Controls
  2202. Acercar(label)
  2203. Next
  2204. End Sub
  2205. Sub EventPadreAlejar(ByVal sender As Object)
  2206. Alejar(sender)
  2207. For Each label In sender.Controls
  2208. Alejar(label)
  2209. Next
  2210. End Sub
  2211. Sub EventHijoAcercar(ByVal sender As Object)
  2212. Acercar(sender)
  2213. Acercar(sender.parent)
  2214. End Sub
  2215. Sub EventHijoAlejar(ByVal sender As Object)
  2216. Alejar(sender)
  2217. Alejar(sender.parent)
  2218. End Sub
  2219. Sub Acercar(sender As Object)
  2220. If TypeOf sender Is Panel Then
  2221. If Not sender.BackColor.Name = Color.White.Name Then
  2222. sender.BackColor = Color.Turquoise
  2223. End If
  2224. Else
  2225. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2226. sender.BackColor = Color.Turquoise
  2227. End If
  2228. End If
  2229. End Sub
  2230. Sub Alejar(sender As Object)
  2231. If TypeOf sender Is Panel Then
  2232. If Not sender.BackColor.Name = Color.White.Name Then
  2233. sender.BackColor = Color.WhiteSmoke
  2234. End If
  2235. Else
  2236. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2237. sender.BackColor = Color.WhiteSmoke
  2238. End If
  2239. End If
  2240. End Sub
  2241. Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover
  2242. EventHijoAcercar(sender)
  2243. End Sub
  2244. Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover
  2245. EventHijoAcercar(sender)
  2246. End Sub
  2247. Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover
  2248. EventHijoAcercar(sender)
  2249. End Sub
  2250. Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover
  2251. EventHijoAcercar(sender)
  2252. End Sub
  2253. Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover
  2254. EventHijoAcercar(sender)
  2255. End Sub
  2256. Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover
  2257. EventHijoAcercar(sender)
  2258. End Sub
  2259. Private Sub lblPais_MouseHover(sender As Object, e As EventArgs) Handles lblPais.MouseHover
  2260. EventHijoAcercar(sender)
  2261. End Sub
  2262. Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs) Handles lblEstado.MouseHover
  2263. EventHijoAcercar(sender)
  2264. End Sub
  2265. Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles lblEstadoProceso.MouseHover
  2266. EventHijoAcercar(sender)
  2267. End Sub
  2268. Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover
  2269. EventHijoAcercar(sender)
  2270. End Sub
  2271. Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover
  2272. EventHijoAcercar(sender)
  2273. End Sub
  2274. Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover
  2275. EventPadreAcercar(sender)
  2276. End Sub
  2277. Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover
  2278. EventPadreAcercar(sender)
  2279. End Sub
  2280. Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover
  2281. EventPadreAcercar(sender)
  2282. End Sub
  2283. Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover
  2284. EventPadreAcercar(sender)
  2285. End Sub
  2286. Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover
  2287. EventPadreAcercar(sender)
  2288. End Sub
  2289. Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover
  2290. EventPadreAcercar(sender)
  2291. End Sub
  2292. Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover
  2293. EventPadreAcercar(sender)
  2294. End Sub
  2295. Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs) Handles pnlPais.MouseHover
  2296. EventPadreAcercar(sender)
  2297. End Sub
  2298. Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover
  2299. EventPadreAcercar(sender)
  2300. End Sub
  2301. Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles pnlEstadoProceso.MouseHover
  2302. EventPadreAcercar(sender)
  2303. End Sub
  2304. Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover
  2305. EventPadreAcercar(sender)
  2306. End Sub
  2307. Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover
  2308. EventPadreAcercar(sender)
  2309. End Sub
  2310. Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave
  2311. EventHijoAlejar(sender)
  2312. End Sub
  2313. Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave
  2314. EventHijoAlejar(sender)
  2315. End Sub
  2316. Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs) Handles lblPais.MouseLeave
  2317. EventHijoAlejar(sender)
  2318. End Sub
  2319. Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave
  2320. EventHijoAlejar(sender)
  2321. End Sub
  2322. Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave
  2323. EventHijoAlejar(sender)
  2324. End Sub
  2325. Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave
  2326. EventHijoAlejar(sender)
  2327. End Sub
  2328. Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave
  2329. EventHijoAlejar(sender)
  2330. End Sub
  2331. Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave
  2332. EventHijoAlejar(sender)
  2333. End Sub
  2334. Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave
  2335. EventHijoAlejar(sender)
  2336. End Sub
  2337. Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles lblEstadoProceso.MouseLeave
  2338. EventHijoAlejar(sender)
  2339. End Sub
  2340. Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave
  2341. EventHijoAlejar(sender)
  2342. End Sub
  2343. Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave
  2344. EventHijoAlejar(sender)
  2345. End Sub
  2346. Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave
  2347. EventPadreAlejar(sender)
  2348. End Sub
  2349. Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave
  2350. EventPadreAlejar(sender)
  2351. End Sub
  2352. Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave
  2353. EventPadreAlejar(sender)
  2354. End Sub
  2355. Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave
  2356. EventPadreAlejar(sender)
  2357. End Sub
  2358. Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave
  2359. EventPadreAlejar(sender)
  2360. End Sub
  2361. Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave
  2362. EventPadreAlejar(sender)
  2363. End Sub
  2364. Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave
  2365. EventPadreAlejar(sender)
  2366. End Sub
  2367. Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave
  2368. EventPadreAlejar(sender)
  2369. End Sub
  2370. Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave
  2371. EventPadreAlejar(sender)
  2372. End Sub
  2373. Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles pnlEstadoProceso.MouseLeave
  2374. EventPadreAlejar(sender)
  2375. End Sub
  2376. Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave
  2377. EventPadreAlejar(sender)
  2378. End Sub
  2379. Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave
  2380. EventPadreAlejar(sender)
  2381. End Sub
  2382. Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
  2383. eventoCargar()
  2384. End Sub
  2385. Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
  2386. eventoCancelar()
  2387. End Sub
  2388. Private Sub txtBuscar_TextChanged(sender As Object, e As EventArgs) Handles txtBuscar.TextChanged
  2389. Filtrar(sender)
  2390. End Sub
  2391. Sub Filtrar(sender As Object)
  2392. Dim TextoIngresado As String = sender.text.ToString.ToLower
  2393. Dim CajaActiva As New GroupBox
  2394. Dim CajaInterna As New FlowLayoutPanel
  2395. For Each Item In pnlContenedor.Controls
  2396. If TypeOf Item Is GroupBox Then
  2397. If Item.visible Then
  2398. CajaActiva = Item
  2399. Exit For
  2400. End If
  2401. End If
  2402. Next
  2403. For Each Item In CajaActiva.Controls
  2404. If TypeOf Item Is FlowLayoutPanel Then
  2405. CajaInterna = Item
  2406. Exit For
  2407. End If
  2408. Next
  2409. For Each Item In CajaInterna.Controls
  2410. If TypeOf Item Is CheckBox Then
  2411. If Item.text.ToString.ToLower.Contains(TextoIngresado) Then
  2412. If Not Item.visible Then
  2413. Item.visible = True
  2414. End If
  2415. Else
  2416. If Item.visible Then
  2417. Item.visible = False
  2418. End If
  2419. End If
  2420. End If
  2421. Next
  2422. End Sub
  2423. Private Sub pnlCargaDatos_Paint(sender As Object, e As PaintEventArgs) Handles pnlCargaDatos.Paint
  2424. End Sub
  2425. Public Sub CargarDatosContenedor()
  2426. If MsgBox("Desea ver esta Inversión", MsgBoxStyle.OkCancel) = DialogResult.OK Then
  2427. Dim Id As Integer = frmBuscar.dgvBuscarDeLista.CurrentRow.Cells("Id").Value
  2428. If Not Id = Nothing Then
  2429. ConDatos = Id
  2430. TipoOperacion = "B"
  2431. Modo = "NM"
  2432. ModoInversion()
  2433. CargarRegistro(Id)
  2434. TipoOperacion = "B"
  2435. Modo = "NM"
  2436. EstadoBoton()
  2437. End If
  2438. End If
  2439. End Sub
  2440. Sub ModoInversion()
  2441. Dim TbNM = TbIngresarModificar
  2442. Dim VTbBuscar = TbBuscar
  2443. If Modo = "NM" Or (TipoOperacion = "B" And Modo = "NM") Then
  2444. If Not VTbBuscar.Parent Is Nothing Then
  2445. TbBuscar.Parent = Nothing
  2446. End If
  2447. If (TbNM.Parent Is Nothing) Then
  2448. TbNM.Parent = TabCampos
  2449. End If
  2450. ElseIf Modo = "B" Then
  2451. If Not TbNM.Parent Is Nothing Then
  2452. TbNM.Parent = Nothing
  2453. End If
  2454. If (VTbBuscar.Parent Is Nothing) Then
  2455. VTbBuscar.Parent = TabCampos
  2456. End If
  2457. End If
  2458. End Sub
  2459. Private Sub ToolStripButton1_Click_1(sender As Object, e As EventArgs) Handles navRecorrer.Click
  2460. Modo = "NM"
  2461. btnAccion.Text = "Buscar"
  2462. ModoInversion()
  2463. PrepararBusqueda()
  2464. End Sub
  2465. Sub ValidarEntradaPrecionada(sender As Object, e As KeyPressEventArgs)
  2466. If String.IsNullOrEmpty(sender.Text) Then
  2467. If e.KeyChar = "." Then
  2468. sender.Text = "0"
  2469. Exit Sub
  2470. End If
  2471. End If
  2472. If (Not sender.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  2473. Operaciones.ValidarEntrada(sender, e, True)
  2474. Else
  2475. Operaciones.ValidarEntrada(sender, e, False)
  2476. End If
  2477. End Sub
  2478. Sub ValidarEntradaLevantar(ByRef sender As Object)
  2479. If sender.Text = "." Then
  2480. sender.Text = ".0"
  2481. End If
  2482. End Sub
  2483. Private Sub txtPlazoNum_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPlazoNum.KeyPress
  2484. ValidarEntradaPrecionada(sender, e)
  2485. End Sub
  2486. Private Sub txtPlazoNum_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPlazoNum.KeyUp
  2487. ValidarEntradaLevantar(sender)
  2488. End Sub
  2489. Private Sub btnRequisicionDePago_Click(sender As Object, e As EventArgs) Handles btnRequisicionDePago.Click
  2490. Dim CodigoInversion As String = txtCodigoInversion.Text
  2491. Dim Empresa As String = cboEmpresas.SelectedValue
  2492. Dim oRequisicionDePago As New frmReqPago(CodigoInversion, Empresa, "Individual")
  2493. oRequisicionDePago.ShowDialog()
  2494. End Sub
  2495. Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoProceso.SelectedIndexChanged
  2496. End Sub
  2497. Private Sub Button1_Click_3(sender As Object, e As EventArgs) Handles Button1.Click
  2498. If MsgBox("Esta Seguro de Cambiar el Estado a Corrección?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
  2499. cboEstadoProceso.SelectedValue = "C"
  2500. End If
  2501. TipoOperacion = "M"
  2502. btnAccion.Text = "Actualizar"
  2503. End Sub
  2504. Private Sub btnAprobado_Click(sender As Object, e As EventArgs) Handles btnAprobado.Click
  2505. If MsgBox("Esta Seguro de Cambiar el Estado ha Aprobado?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
  2506. cboEstadoProceso.SelectedValue = "A"
  2507. End If
  2508. TipoOperacion = "M"
  2509. btnAccion.Text = "Actualizar"
  2510. End Sub
  2511. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  2512. If MsgBox("Esta Seguro de Cambiar el Estado para Anexar?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
  2513. cboEstadoProceso.SelectedValue = "F"
  2514. End If
  2515. TipoOperacion = "M"
  2516. btnAccion.Text = "Actualizar"
  2517. End Sub
  2518. Public Sub EstadoBoton()
  2519. Dim EstadoActual = cboEstadoProceso.SelectedValue
  2520. Dim CodigoInversion As String = txtCodigoInversion.Text
  2521. If EstadoActual = "R" Then
  2522. pnlCorregir.Visible = True
  2523. pnlAprobar.Visible = True
  2524. pnlAnexar.Visible = False
  2525. btnRequisicionDePago.Visible = False
  2526. lblMensajeReq.Text = String.Empty
  2527. ElseIf EstadoActual = "A" Then
  2528. If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) Then
  2529. lblMensajeReq.Text = String.Empty
  2530. ModificacionTiempo("P", CodigoInversion, "Se ha actualizado.")
  2531. Else
  2532. pnlCorregir.Visible = False
  2533. pnlAprobar.Visible = False
  2534. pnlAnexar.Visible = False
  2535. btnRequisicionDePago.Visible = True
  2536. lblMensajeReq.Text = "Pendiente"
  2537. End If
  2538. ElseIf EstadoActual = "C" Then
  2539. pnlCorregir.Visible = False
  2540. pnlAprobar.Visible = True
  2541. pnlAnexar.Visible = False
  2542. btnRequisicionDePago.Visible = False
  2543. lblMensajeReq.Text = String.Empty
  2544. ElseIf EstadoActual = "I" Then
  2545. If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) And DocumentoAnexado Then
  2546. ModificacionTiempo("F", CodigoInversion, "Ha finalizado el proceso de la inversión, la inverión se encuentra activa completamente.")
  2547. Else
  2548. pnlCorregir.Visible = False
  2549. pnlAprobar.Visible = False
  2550. pnlAnexar.Visible = True
  2551. btnRequisicionDePago.Visible = True
  2552. lblMensajeReq.Text = String.Empty
  2553. End If
  2554. ElseIf EstadoActual = "P" Then
  2555. If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) And EnviadoContaduria Then
  2556. ModificacionTiempo("I", CodigoInversion, "Se ha enviado a contaduría.")
  2557. Else
  2558. pnlCorregir.Visible = False
  2559. pnlAprobar.Visible = False
  2560. pnlAnexar.Visible = False
  2561. btnRequisicionDePago.Visible = True
  2562. lblMensajeReq.Text = "Pendiente envio Contaduria"
  2563. End If
  2564. ElseIf EstadoActual = "F" Then
  2565. pnlCorregir.Visible = False
  2566. pnlAprobar.Visible = False
  2567. pnlAnexar.Visible = False
  2568. btnRequisicionDePago.Visible = True
  2569. lblMensajeReq.Text = String.Empty
  2570. End If
  2571. RefrescarValoresDeControles()
  2572. EstadoControladoresNAV()
  2573. End Sub
  2574. Sub ModificacionTiempo(ByVal Estado As String, ByVal CodigoInversion As String, ByVal Mensaje As String)
  2575. pnlCorregir.Visible = False
  2576. pnlAprobar.Visible = False
  2577. pnlAnexar.Visible = False
  2578. btnRequisicionDePago.Visible = False
  2579. oInversionCE.EstadoProceso = Estado
  2580. RefrescarValoresDeControles()
  2581. Dim retorno As Integer = 0
  2582. retorno = oInversionDAO.Modificar(oInversionCE)
  2583. If retorno = 1 Then
  2584. If Not Estado = "P" Then
  2585. CargarRegistro(oInversionCE.IdDeDocumento)
  2586. End If
  2587. MsgBox(Mensaje)
  2588. End If
  2589. GuardarFamilia(CodigoInversion)
  2590. CargarNavegador()
  2591. Refrescar()
  2592. EstadoBoton()
  2593. Exit Sub
  2594. End Sub
  2595. Sub EstadoControladoresNAV()
  2596. Dim Estado As String = String.Empty
  2597. If cboEstadoProceso.SelectedValue = "R" Then
  2598. Estado = "R"
  2599. ElseIf cboEstadoProceso.SelectedValue = "C" Then
  2600. Estado = "C"
  2601. ElseIf cboEstadoProceso.SelectedValue = "A" Then
  2602. Estado = "A"
  2603. ElseIf cboEstadoProceso.SelectedValue = "P" Then
  2604. Estado = "P"
  2605. ElseIf cboEstadoProceso.SelectedValue = "I" Then
  2606. Estado = "I"
  2607. ElseIf cboEstadoProceso.SelectedValue = "F" Then
  2608. Estado = "F"
  2609. End If
  2610. If Estado = "R" Or Estado = "A" Or Estado = "P" Or Estado = "I" Or Estado = "F" Then
  2611. navNuevo.Enabled = False
  2612. navModificar.Enabled = False
  2613. navEliminar.Enabled = False
  2614. navBuscar.Enabled = True
  2615. navRecorrer.Enabled = True
  2616. ElseIf Estado = "C" Then
  2617. navNuevo.Enabled = False
  2618. navModificar.Enabled = True
  2619. navEliminar.Enabled = False
  2620. navBuscar.Enabled = True
  2621. navRecorrer.Enabled = True
  2622. End If
  2623. End Sub
  2624. Private Sub cboOrigenDeFondos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOrigenDeFondos.SelectedIndexChanged
  2625. ControlOFondo()
  2626. End Sub
  2627. Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged
  2628. ControlTipoOperacion()
  2629. End Sub
  2630. Private Sub ControlTipoOperacion()
  2631. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  2632. If Not TypeOf cboTipoOperacion.SelectedValue Is DataRowView Then
  2633. oInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue
  2634. End If
  2635. End If
  2636. End Sub
  2637. Private Sub ControlOFondo()
  2638. If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
  2639. If Not TypeOf cboOrigenDeFondos.SelectedValue Is DataRowView Then
  2640. oInversionCE.OFondo = cboOrigenDeFondos.SelectedValue
  2641. End If
  2642. End If
  2643. End Sub
  2644. Private Sub btnReportoVenta_Click(sender As Object, e As EventArgs)
  2645. End Sub
  2646. Private Sub TableLayoutPanel2_Paint(sender As Object, e As PaintEventArgs)
  2647. End Sub
  2648. Private Sub txtCodigoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoCompra.TextChanged
  2649. End Sub
  2650. Private Sub TabCampos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged
  2651. CargarTabla()
  2652. End Sub
  2653. Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
  2654. End Sub
  2655. Private Sub Panel5_Paint(sender As Object, e As PaintEventArgs)
  2656. End Sub
  2657. Private Sub Panel6_Paint(sender As Object, e As PaintEventArgs)
  2658. End Sub
  2659. Private Sub TbIngresarModificar_Click(sender As Object, e As EventArgs) Handles TbIngresarModificar.Click
  2660. End Sub
  2661. Private Sub Button4_Click(sender As Object, e As EventArgs)
  2662. End Sub
  2663. Private Sub btnVerAdjunto_Click(sender As Object, e As EventArgs)
  2664. End Sub
  2665. Private Sub btnAdjuntar_Click(sender As Object, e As EventArgs)
  2666. End Sub
  2667. End Class