frmINV.vb 115 KB

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