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