frmINV.vb 116 KB

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