frmINV.vb 119 KB

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