frmPIN.vb 146 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797
  1. 
  2. Imports System.Threading
  3. Public Class frmPIN
  4. Dim oPropuestaInversionCE As CEPropuestaInversion = New CEPropuestaInversion
  5. Dim oDAOGeneral As DAOGeneral = New DAOGeneral
  6. Dim oDAOLETES As LETESDAO = New LETESDAO
  7. Dim oDAOPropuestasDeInversion As DAOPropuestaInversion = New DAOPropuestaInversion
  8. Dim oCEAcciones As AccionesCE
  9. Dim oCEBonos As BonosCE
  10. Dim oCEDAP As DepositosAPlazoCE
  11. Dim oCELetes As LETESCE
  12. Dim oCEReportos As ReportosCE
  13. Dim TipoTransaccion As String = "B"
  14. Dim InstrumentoFinanciero As Object
  15. Dim ResultadoMsgBox As Integer
  16. Dim IdPIN As Integer
  17. Dim IdIF As String
  18. Dim Modo As String = "NM"
  19. Dim oInversionCE As New InversionesCE
  20. Dim frmBuscar As frmBuscarDeLista
  21. Dim FormAcciones As frmAcciones
  22. Dim FormFuturos As frmFuturos
  23. Dim FormPrestamoEmpresarial As frmPrestamoEmpresariales
  24. Dim FormPrestamoPersonal As frmPrestamoPersonal
  25. Dim FormRepo As frmReporto
  26. Dim FormLete As frmLetes
  27. Dim FormCINV As frmCertificadosDeInversion
  28. Dim FormDAP As frmDepositosAPlazo
  29. Dim FormNEST As frmNotaEstructurada
  30. Dim FormFINV As frmFOIN
  31. Dim Operaciones As New Operaciones
  32. Dim oInversionDAO As New InversionDAO
  33. Dim TieneDetalleInstrumento As Boolean = False
  34. Dim ActivarSuspen As Boolean = True
  35. Dim LlamadaDesdeBusqueda As Boolean = False
  36. Dim Col_Empresas As New Collection
  37. Dim Col_Emisor As New Collection
  38. Dim Col_EstDocumento As New Collection
  39. Dim Col_Instrumento As New Collection
  40. Dim Col_CalRiesgo As New Collection
  41. Dim Col_TipOperacion As New Collection
  42. Dim Col_OriFond As New Collection
  43. Dim Col_CalERiesgo As New Collection
  44. Dim Col_Aut As New Collection
  45. Dim Col_Plazo As New Collection
  46. Dim Col_Pais As New Collection
  47. Dim Col_TipMercado As New Collection
  48. Dim CodigoInversionPrincipal As String = String.Empty
  49. Dim CodigoInversionSecundario As String = String.Empty
  50. Private isCrear As Boolean = False
  51. Private IsInstrumentoReporto As Boolean = False
  52. Private HabilitarCreacionTitulos As Boolean = False
  53. Private DicDatos As New Dictionary(Of String, String)
  54. Private CodigoAsociado As String = String.Empty
  55. Private EstadoReporto As String = "PRIMARIO"
  56. Private CodigoReporto As String = String.Empty
  57. Private IdFlujo As Integer = 0
  58. Private IdECT As Integer = 0
  59. Private CodigoInversionCMVTA As String = String.Empty
  60. Private TipoProcesoCMVTA As String = String.Empty
  61. Public TrasladarDatos As TrasladarDatosCMVTA
  62. Sub New()
  63. ' Esta llamada es exigida por el diseñador.
  64. InitializeComponent()
  65. ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
  66. Variables.TrasladarCMVTA = Nothing
  67. End Sub
  68. Sub New(TipoProcesoCMVTA As String, CodigoInversionCMVTA As String, TrasladarDatos As TrasladarDatosCMVTA)
  69. Me.New
  70. Me.TipoProcesoCMVTA = TipoProcesoCMVTA
  71. Me.CodigoInversionCMVTA = CodigoInversionCMVTA
  72. Me.TrasladarDatos = TrasladarDatos
  73. Variables.TrasladarCMVTA = Me.TrasladarDatos
  74. End Sub
  75. Sub ConfiguracionCMVTA()
  76. If Me.TipoProcesoCMVTA = "V" Then
  77. lblCodigoInversionCM.Visible = True
  78. txtCodigoInversionCM.Visible = True
  79. ActivarSuspen = True
  80. Modo = "NM"
  81. TipoTransaccion = "N"
  82. grbInversión.Visible = False
  83. LimpiarControles()
  84. DeshabilitarControles()
  85. HabilitarControlesCMVTA()
  86. ConfiguracionCamposCMVTA()
  87. PIN0BindingSource4.SuspendBinding()
  88. Navegador.Enabled = False
  89. TipoTransaccion = "N"
  90. End If
  91. End Sub
  92. Sub HabilitarControlesCMVTA()
  93. cboCalificacionDeRiesgo.Enabled = True
  94. End Sub
  95. Sub ConfiguracionCamposCMVTA()
  96. Dim Id As Integer = oDAOPropuestasDeInversion.IdRegistroInversion(Me.CodigoInversionCMVTA)
  97. oInversionCE = oInversionDAO.CargarRegistro(Id)
  98. cboTipoOperacion.SelectedValue = "V"
  99. cboOrigenDeFondos.SelectedValue = "NA"
  100. cboEstadoDocumento.SelectedValue = "A"
  101. cboAutorizacion.SelectedValue = "P"
  102. txtCodigoInversionCM.Text = oInversionCE.CodigoIversion
  103. txtNombre.Text = oInversionCE.NombreManual
  104. cboEmpresas.SelectedValue = oInversionCE.CodigoEmpresa
  105. cboEmisores.SelectedValue = oInversionCE.CodigoEmisor
  106. cboInstrumentosFinancieros.SelectedValue = oInversionCE.CodigoInstrumentoFinanciero
  107. cboCalificacionDeRiesgo.SelectedValue = oInversionCE.CodigoCalificacionDeRiesgo
  108. cboPeriodicidad.SelectedValue = oInversionCE.Periodicidad
  109. cboCalificadoraDeRiesgo.SelectedValue = oInversionCE.CodigoEmpresaCalificadora
  110. cboTipoMercado.SelectedValue = oInversionCE.TipoMercado
  111. cboPaises.SelectedValue = oInversionCE.Pais
  112. cboRenta.SelectedValue = oInversionCE.TipoRenta
  113. cboTasa.SelectedValue = oInversionCE.TipoTasa
  114. End Sub
  115. Sub New(DicDatos As Dictionary(Of String, String))
  116. Me.New
  117. HabilitarCreacionTitulos = True
  118. EstadoReporto = "SECUNDARIO"
  119. Me.DicDatos = DicDatos
  120. If DicDatos.ContainsKey("CodigoAsociado") Then
  121. CodigoAsociado = DicDatos.Item("CodigoAsociado").ToString
  122. End If
  123. If DicDatos.ContainsKey("CodigoReporto") Then
  124. CodigoReporto = DicDatos.Item("CodigoReporto").ToString
  125. End If
  126. If DicDatos.ContainsKey("IdFlujo") Then
  127. IdFlujo = DicDatos.Item("IdFlujo").ToString
  128. End If
  129. If DicDatos.ContainsKey("IdECT") Then
  130. IdECT = DicDatos.Item("IdECT").ToString
  131. End If
  132. End Sub
  133. Private _PlazosFactor As String
  134. Function AgregarCheckbox(ByRef P_cboObjeto As ComboBox, ByRef P_flpObjeto As FlowLayoutPanel)
  135. Dim Datos As New Dictionary(Of String, String)
  136. Dim Col_Generica As New Collection
  137. Dim i As Integer = 0
  138. While i < P_cboObjeto.Items.Count
  139. P_cboObjeto.SelectedIndex = i
  140. Dim Valor As String = P_cboObjeto.SelectedValue
  141. If P_cboObjeto.SelectedValue Is Nothing Then
  142. Return Col_Generica
  143. End If
  144. Dim Texto As String = P_cboObjeto.Text
  145. Datos.Add(Valor, Texto)
  146. i += 1
  147. End While
  148. Dim Existe As Boolean = False
  149. For Each item As CheckBox In P_flpObjeto.Controls
  150. If item.Text.ToString = "Todos" Then
  151. Existe = True
  152. End If
  153. Next
  154. Dim O_ChequeTodos As New CheckBox
  155. O_ChequeTodos.Name = "Todos" + P_flpObjeto.Name.ToString
  156. O_ChequeTodos.Checked = True
  157. O_ChequeTodos.Width = 250
  158. O_ChequeTodos.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  159. O_ChequeTodos.Text = "Todos"
  160. O_ChequeTodos.Height = 20
  161. O_ChequeTodos.Margin = New Padding(25, 5, 25, 5)
  162. Col_Generica.Add(O_ChequeTodos.Name)
  163. If Not Existe Then
  164. P_flpObjeto.Controls.Add(O_ChequeTodos)
  165. AddHandler O_ChequeTodos.Click, AddressOf evento
  166. AddHandler O_ChequeTodos.CheckedChanged, AddressOf Colorevento
  167. End If
  168. For Each RecorrerDatos In Datos
  169. Col_Generica.Add(RecorrerDatos.Key)
  170. Dim O_Check As New CheckBox
  171. Existe = False
  172. Dim Nombre = RecorrerDatos.Value
  173. For Each item As CheckBox In P_flpObjeto.Controls
  174. If item.Text.ToString = Nombre.ToString Then
  175. Existe = True
  176. End If
  177. Next
  178. If Not Existe Then
  179. O_Check.Name = RecorrerDatos.Key
  180. O_Check.Checked = True
  181. O_Check.Width = 250
  182. O_Check.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  183. O_Check.Text = Nombre
  184. O_Check.Height = 20
  185. O_Check.Margin = New Padding(25, 5, 25, 5)
  186. P_flpObjeto.Controls.Add(O_Check)
  187. AddHandler O_Check.Click, AddressOf evento
  188. AddHandler O_Check.CheckedChanged, AddressOf Colorevento
  189. End If
  190. Existe = False
  191. Next
  192. Return Col_Generica
  193. End Function
  194. Sub eventoCargar()
  195. For Each Item In pnlMenu.Controls
  196. If TypeOf Item Is Panel Then
  197. If Item.backcolor = Color.White Then
  198. For Each Items In Item.controls
  199. Items.backcolor = Color.WhiteSmoke
  200. Next
  201. Item.backcolor = Color.WhiteSmoke
  202. End If
  203. End If
  204. Next
  205. pnlContenedor.Visible = False
  206. CargarTabla()
  207. End Sub
  208. Sub eventoCancelar()
  209. For Each Item In pnlMenu.Controls
  210. If TypeOf Item Is Panel Then
  211. If Item.backcolor = Color.White Then
  212. For Each Items In Item.controls
  213. Items.backcolor = Color.WhiteSmoke
  214. Next
  215. Item.backcolor = Color.WhiteSmoke
  216. End If
  217. End If
  218. Next
  219. pnlContenedor.Visible = False
  220. End Sub
  221. Sub evento(sender As Object, e As EventArgs)
  222. Dim P_flpObjeto As New FlowLayoutPanel
  223. P_flpObjeto = sender.parent
  224. If sender.Name.ToString.IndexOf("Todos") > -1 Then
  225. CambioCheckTodos(P_flpObjeto, sender)
  226. Else
  227. TodosCheck(P_flpObjeto, sender, e)
  228. End If
  229. End Sub
  230. Sub Colorevento(sender As Object, e As EventArgs)
  231. If (sender.checked) Then
  232. sender.BackColor = ColorTranslator.FromHtml("#EAEAE8")
  233. Else
  234. sender.BackColor = ColorTranslator.FromHtml("Transparent")
  235. End If
  236. ActualizarColecciones(sender)
  237. End Sub
  238. Sub ActualizarColecciones(sender As Object)
  239. Dim Flpnombre As String = sender.parent.name
  240. If TypeOf sender.parent Is FlowLayoutPanel Then
  241. Dim FlpObjeto As New FlowLayoutPanel
  242. FlpObjeto = sender.parent
  243. If Flpnombre = "flpEmpresas" Then
  244. Col_Empresas.Clear()
  245. For Each Nombre In FlpObjeto.Controls
  246. If TypeOf Nombre Is CheckBox Then
  247. If Nombre.checked Then
  248. Col_Empresas.Add(Nombre.name)
  249. End If
  250. End If
  251. Next
  252. ElseIf Flpnombre = "flpEmisor" Then
  253. Col_Emisor.Clear()
  254. For Each Nombre In FlpObjeto.Controls
  255. If TypeOf Nombre Is CheckBox Then
  256. If Nombre.checked Then
  257. Col_Emisor.Add(Nombre.name)
  258. End If
  259. End If
  260. Next
  261. ElseIf Flpnombre = "flpEstadoDocumento" Then
  262. Col_EstDocumento.Clear()
  263. For Each Nombre In FlpObjeto.Controls
  264. If TypeOf Nombre Is CheckBox Then
  265. If Nombre.checked Then
  266. Col_EstDocumento.Add(Nombre.name)
  267. End If
  268. End If
  269. Next
  270. ElseIf Flpnombre = "flpInstrumentos" Then
  271. Col_Instrumento.Clear()
  272. For Each Nombre In FlpObjeto.Controls
  273. If TypeOf Nombre Is CheckBox Then
  274. If Nombre.checked Then
  275. Col_Instrumento.Add(Nombre.name)
  276. End If
  277. End If
  278. Next
  279. ElseIf Flpnombre = "flpCalificacionRiesgo" Then
  280. Col_CalRiesgo.Clear()
  281. For Each Nombre In FlpObjeto.Controls
  282. If TypeOf Nombre Is CheckBox Then
  283. If Nombre.checked Then
  284. Col_CalRiesgo.Add(Nombre.name)
  285. End If
  286. End If
  287. Next
  288. ElseIf Flpnombre = "flpTipoOperacion" Then
  289. Col_TipOperacion.Clear()
  290. For Each Nombre In FlpObjeto.Controls
  291. If TypeOf Nombre Is CheckBox Then
  292. If Nombre.checked Then
  293. Col_TipOperacion.Add(Nombre.name)
  294. End If
  295. End If
  296. Next
  297. ElseIf Flpnombre = "flpOrigenFondos" Then
  298. Col_OriFond.Clear()
  299. For Each Nombre In FlpObjeto.Controls
  300. If TypeOf Nombre Is CheckBox Then
  301. If Nombre.checked Then
  302. Col_OriFond.Add(Nombre.name)
  303. End If
  304. End If
  305. Next
  306. ElseIf Flpnombre = "flpCalificadoraRiesgo" Then
  307. Col_CalERiesgo.Clear()
  308. For Each Nombre In FlpObjeto.Controls
  309. If TypeOf Nombre Is CheckBox Then
  310. If Nombre.checked Then
  311. Col_CalERiesgo.Add(Nombre.name)
  312. End If
  313. End If
  314. Next
  315. ElseIf Flpnombre = "flpAutorizacion" Then
  316. Col_Aut.Clear()
  317. For Each Nombre In FlpObjeto.Controls
  318. If TypeOf Nombre Is CheckBox Then
  319. If Nombre.checked Then
  320. Col_Aut.Add(Nombre.name)
  321. End If
  322. End If
  323. Next
  324. ElseIf Flpnombre = "flpPlazo" Then
  325. Col_Plazo.Clear()
  326. For Each Nombre In FlpObjeto.Controls
  327. If TypeOf Nombre Is CheckBox Then
  328. If Nombre.checked Then
  329. Col_Plazo.Add(Nombre.name)
  330. End If
  331. End If
  332. Next
  333. ElseIf Flpnombre = "flpPais" Then
  334. Col_Pais.Clear()
  335. For Each Nombre In FlpObjeto.Controls
  336. If TypeOf Nombre Is CheckBox Then
  337. If Nombre.checked Then
  338. Col_Pais.Add(Nombre.name)
  339. End If
  340. End If
  341. Next
  342. ElseIf Flpnombre = "flpTipoMercado" Then
  343. Col_TipMercado.Clear()
  344. For Each Nombre In FlpObjeto.Controls
  345. If TypeOf Nombre Is CheckBox Then
  346. If Nombre.checked Then
  347. Col_TipMercado.Add(Nombre.name)
  348. End If
  349. End If
  350. Next
  351. End If
  352. End If
  353. End Sub
  354. Sub CambioCheckTodos(ByRef P_flpObjeto As FlowLayoutPanel, ByVal sender As Object)
  355. Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1
  356. Dim PrimerCheck As Boolean = True
  357. For Each xCheckBox In P_flpObjeto.Controls
  358. If TypeOf xCheckBox Is CheckBox Then
  359. Dim yCheckBox As New CheckBox
  360. yCheckBox = xCheckBox
  361. If xCheckBox.TabIndex = 0 Then
  362. If Not yCheckBox.Checked Then
  363. PrimerCheck = False
  364. End If
  365. End If
  366. End If
  367. Next
  368. If PrimerCheck Then
  369. For Each xCheckBox In P_flpObjeto.Controls
  370. If TypeOf xCheckBox Is CheckBox Then
  371. Dim yCheckBox As New CheckBox
  372. yCheckBox = xCheckBox
  373. yCheckBox.Checked = True
  374. End If
  375. Next
  376. ElseIf Not PrimerCheck Then
  377. For Each xCheckBox In P_flpObjeto.Controls
  378. If TypeOf xCheckBox Is CheckBox Then
  379. Dim yCheckBox As New CheckBox
  380. yCheckBox = xCheckBox
  381. yCheckBox.Checked = False
  382. End If
  383. Next
  384. End If
  385. End Sub
  386. Sub TodosCheck(ByRef P_flpObjeto As FlowLayoutPanel, sender As Object, e As EventArgs)
  387. Dim ChequeTodos As Boolean = True
  388. If Not sender.Name.ToString.IndexOf("Todos") > -1 Then
  389. For Each xCheckBox In P_flpObjeto.Controls
  390. If Not xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
  391. If Not xCheckBox.checked Then
  392. ChequeTodos = False
  393. End If
  394. End If
  395. Next
  396. End If
  397. For Each xCheckBox In P_flpObjeto.Controls
  398. If xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
  399. xCheckBox.checked = ChequeTodos
  400. End If
  401. Next
  402. End Sub
  403. Private Sub frmPIN_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  404. 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario.
  405. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  406. 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario.
  407. TipoTransaccion = "N"
  408. txtCodigoInversion.Text = String.Empty
  409. frmProgreso.PgbProgreso.Value = 1
  410. CargarEstadosDocumento()
  411. frmProgreso.PgbProgreso.Value = 5
  412. CargarEstadosAutorizacion()
  413. frmProgreso.PgbProgreso.Value = 10
  414. CargarEmpresas()
  415. frmProgreso.PgbProgreso.Value = 15
  416. CargarInstrumentosFinancieros()
  417. frmProgreso.PgbProgreso.Value = 20
  418. CargarEmisores()
  419. frmProgreso.PgbProgreso.Value = 25
  420. Call CargarCalificacionDeRiesgo()
  421. frmProgreso.PgbProgreso.Value = 30
  422. Call CargarCalificadoraDeRiesgo()
  423. frmProgreso.PgbProgreso.Value = 35
  424. Call CargarOrigenDeFondos()
  425. frmProgreso.PgbProgreso.Value = 40
  426. Call CargarTipoOperacion()
  427. frmProgreso.PgbProgreso.Value = 45
  428. Call CargarPaises()
  429. frmProgreso.PgbProgreso.Value = 50
  430. Call CargarTiposMercado()
  431. frmProgreso.PgbProgreso.Value = 55
  432. Call CargarTipoRenta()
  433. frmProgreso.PgbProgreso.Value = 60
  434. Call CargarTipoTasa()
  435. frmProgreso.PgbProgreso.Value = 65
  436. Call CargarPlazos()
  437. frmProgreso.PgbProgreso.Value = 70
  438. Call CargarPeriodicidades()
  439. frmProgreso.PgbProgreso.Value = 75
  440. HabilitarBusqueda()
  441. ControlCambio()
  442. frmProgreso.PgbProgreso.Value = 85
  443. ConfiguracionInicial()
  444. frmProgreso.PgbProgreso.Value = 90
  445. PIN0BindingSource4.SuspendBinding()
  446. Nuevo()
  447. BindingNavigatorPositionItem.Enabled = False
  448. frmProgreso.PgbProgreso.Value = 95
  449. HabilitarControles()
  450. frmProgreso.PgbProgreso.Value = 100
  451. frmProgreso.Visible = False
  452. AdaptarTituloNuevoRepo()
  453. ConfiguracionCMVTA()
  454. TipoTransaccion = "N"
  455. End Sub
  456. Sub AdaptarTituloNuevoRepo()
  457. If HabilitarCreacionTitulos Then
  458. TipoTransaccion = "N"
  459. Dim NombreInstrumento As String = String.Empty
  460. Dim NombreEmpresa As String = String.Empty
  461. Dim SaldoAplicadoTitulo As Double = 0
  462. If DicDatos.ContainsKey("NombreInstrumento") Then
  463. NombreInstrumento = DicDatos.Item("NombreInstrumento").ToString
  464. End If
  465. If DicDatos.ContainsKey("NombreEmpresa") Then
  466. NombreEmpresa = DicDatos.Item("NombreEmpresa").ToString
  467. End If
  468. If DicDatos.ContainsKey("SaldoAplicadoTitulo") Then
  469. SaldoAplicadoTitulo = Operaciones.ConvertirDecimal(DicDatos.Item("SaldoAplicadoTitulo").ToString)
  470. End If
  471. Navegador.Enabled = False
  472. cboEmpresas.Enabled = False
  473. cboInstrumentosFinancieros.Enabled = False
  474. cboOrigenDeFondos.Enabled = False
  475. cboTipoOperacion.SelectedValue = "C"
  476. cboOrigenDeFondos.SelectedValue = "REPOVENTA"
  477. cboEmpresas.SelectedValue = NombreEmpresa
  478. cboInstrumentosFinancieros.SelectedValue = NombreInstrumento
  479. End If
  480. End Sub
  481. Sub Nuevo()
  482. Modo = "NM"
  483. Operaciones.TipoOperacion = "N"
  484. grbInversión.Visible = False
  485. Refrescar()
  486. PreNuevoModificar()
  487. ModoPropuesta()
  488. LimpiarControles()
  489. NuevaPropuesta()
  490. End Sub
  491. Private Sub UsuarioPrivilegio(ByVal TipoTransaccion As String, sender As Object)
  492. Dim UsuarioPri As Boolean = sender.checked
  493. If (TipoTransaccion = "A" Or TipoTransaccion = "B") And UsuarioPri Then
  494. Dim codigo As String = txtCodigoInversion.Text
  495. Dim Comprobar As New DAOGeneral
  496. Dim Estado As String = Comprobar.EstadoAutorizacionPro(codigo)
  497. Dim Existe As Boolean = ExisteInstrumentoReal("INV0")
  498. If Existe Then
  499. grbInversión.Visible = False
  500. MsgBox("La Inversion ya existe")
  501. sender.checked = False
  502. Else
  503. If Estado = "A" Then
  504. grbInversión.Visible = True
  505. Else
  506. grbInversión.Visible = False
  507. sender.checked = False
  508. End If
  509. End If
  510. Else
  511. sender.checked = False
  512. grbInversión.Visible = False
  513. End If
  514. End Sub
  515. Private Sub CargarEstadosDocumento()
  516. Dim vTipoTransaccion As String = TipoTransaccion
  517. TipoTransaccion = "X"
  518. Me.cboEstadoDocumento.DataSource = oDAOPropuestasDeInversion.ListaEstadoDocumento.Tables("EstadosDocumento")
  519. Me.cboEstadoDocumento.DisplayMember = "Descripcion"
  520. Me.cboEstadoDocumento.ValueMember = "Codigo"
  521. Col_EstDocumento = AgregarCheckbox(cboEstadoDocumento, flpEstadoDocumento)
  522. Me.cboEstadoDocumento.SelectedIndex = -1
  523. TipoTransaccion = vTipoTransaccion
  524. End Sub
  525. Private Sub CargarEstadosAutorizacion()
  526. Dim vTipoTransaccion As String = TipoTransaccion
  527. TipoTransaccion = "X"
  528. Me.cboAutorizacion.DataSource = oDAOGeneral.ListaEstadoAutorizacion
  529. Me.cboAutorizacion.DisplayMember = "Descripcion"
  530. Me.cboAutorizacion.ValueMember = "Codigo"
  531. Col_Aut = AgregarCheckbox(cboAutorizacion, flpAutorizacion)
  532. Me.cboAutorizacion.SelectedIndex = -1
  533. TipoTransaccion = vTipoTransaccion
  534. End Sub
  535. Private Sub CargarEmpresas()
  536. Dim vTipoTransaccion As String = TipoTransaccion
  537. TipoTransaccion = "X"
  538. Me.cboEmpresas.DataSource = oDAOGeneral.ListaEmpresas
  539. Me.cboEmpresas.DisplayMember = "Descripcion"
  540. Me.cboEmpresas.ValueMember = "Codigo"
  541. Col_Empresas = AgregarCheckbox(cboEmpresas, flpEmpresas)
  542. Me.cboEmpresas.SelectedIndex = -1
  543. TipoTransaccion = vTipoTransaccion
  544. End Sub
  545. Private Sub CargarInstrumentosFinancieros()
  546. Dim vTipoTransaccion As String = TipoTransaccion
  547. TipoTransaccion = "X"
  548. Me.cboInstrumentosFinancieros.DataSource = oDAOGeneral.ListaInstrumentos("Propuesta")
  549. Me.cboInstrumentosFinancieros.DisplayMember = "Descripcion"
  550. Me.cboInstrumentosFinancieros.ValueMember = "Codigo"
  551. AgregarCheckbox(cboInstrumentosFinancieros, flpInstrumentos)
  552. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  553. TipoTransaccion = vTipoTransaccion
  554. End Sub
  555. Private Sub CargarEmisores()
  556. Dim vTipoTransaccion As String = TipoTransaccion
  557. TipoTransaccion = "X"
  558. Me.cboEmisores.DataSource = oDAOGeneral.ListaEmisores
  559. Me.cboEmisores.DisplayMember = "Descripcion"
  560. Me.cboEmisores.ValueMember = "Codigo"
  561. Col_Emisor = AgregarCheckbox(cboEmisores, flpEmisor)
  562. Me.cboEmisores.SelectedIndex = -1
  563. TipoTransaccion = vTipoTransaccion
  564. End Sub
  565. Private Sub CargarCalificacionDeRiesgo()
  566. Dim vTipoTransaccion As String = TipoTransaccion
  567. TipoTransaccion = "X"
  568. Me.cboCalificacionDeRiesgo.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo
  569. Me.cboCalificacionDeRiesgo.DisplayMember = "Descripcion"
  570. Me.cboCalificacionDeRiesgo.ValueMember = "Codigo"
  571. Col_CalRiesgo = AgregarCheckbox(cboCalificacionDeRiesgo, flpCalificacionRiesgo)
  572. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  573. TipoTransaccion = vTipoTransaccion
  574. End Sub
  575. Private Sub CargarCalificadoraDeRiesgo()
  576. Dim vTipoTransaccion As String = TipoTransaccion
  577. TipoTransaccion = "X"
  578. Me.cboCalificadoraDeRiesgo.DataSource = oDAOGeneral.ListaEmpresasCalificadoras
  579. Me.cboCalificadoraDeRiesgo.DisplayMember = "Descripcion"
  580. Me.cboCalificadoraDeRiesgo.ValueMember = "Codigo"
  581. Col_CalERiesgo = AgregarCheckbox(cboCalificadoraDeRiesgo, flpCalificadoraRiesgo)
  582. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  583. TipoTransaccion = vTipoTransaccion
  584. End Sub
  585. Private Sub CargarOrigenDeFondos()
  586. Dim vTipoTransaccion As String = TipoTransaccion
  587. TipoTransaccion = "X"
  588. Me.cboOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos
  589. Me.cboOrigenDeFondos.DisplayMember = "Descripcion"
  590. Me.cboOrigenDeFondos.ValueMember = "Codigo"
  591. Col_OriFond = AgregarCheckbox(cboOrigenDeFondos, flpOrigenFondos)
  592. Me.cboOrigenDeFondos.SelectedIndex = -1
  593. TipoTransaccion = vTipoTransaccion
  594. End Sub
  595. Private Sub CargarPlazos()
  596. Dim vTipoTransaccion As String = TipoTransaccion
  597. TipoTransaccion = "X"
  598. Me.cboPlazosFactor.DataSource = oDAOGeneral.ListaPlazosFactor
  599. Me.cboPlazosFactor.DisplayMember = "Descripcion"
  600. Me.cboPlazosFactor.ValueMember = "Codigo"
  601. Col_Plazo = AgregarCheckbox(cboPlazosFactor, flpPlazo)
  602. Me.cboPlazosFactor.SelectedIndex = -1
  603. TipoTransaccion = vTipoTransaccion
  604. End Sub
  605. Private Sub CargarTipoOperacion()
  606. Dim vTipoTransaccion As String = TipoTransaccion
  607. TipoTransaccion = "X"
  608. Me.cboTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion
  609. Me.cboTipoOperacion.DisplayMember = "Descripcion"
  610. Me.cboTipoOperacion.ValueMember = "Codigo"
  611. Col_TipOperacion = AgregarCheckbox(cboTipoOperacion, flpTipoOperacion)
  612. Me.cboTipoOperacion.SelectedIndex = -1
  613. TipoTransaccion = vTipoTransaccion
  614. End Sub
  615. Private Sub CargarPaises()
  616. Dim vTipoTransaccion As String = TipoTransaccion
  617. TipoTransaccion = "X"
  618. Me.cboPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion
  619. Me.cboPaises.DisplayMember = "Descripcion"
  620. Me.cboPaises.ValueMember = "Codigo"
  621. Col_Pais = AgregarCheckbox(cboPaises, flpPais)
  622. Me.cboPaises.SelectedIndex = -1
  623. TipoTransaccion = vTipoTransaccion
  624. End Sub
  625. Private Sub CargarTiposMercado()
  626. Dim vTipoTransaccion As String = TipoTransaccion
  627. TipoTransaccion = "X"
  628. Me.cboTipoMercado.DataSource = oDAOGeneral.ListaTiposMercado
  629. Me.cboTipoMercado.DisplayMember = "Descripcion"
  630. Me.cboTipoMercado.ValueMember = "Codigo"
  631. Col_TipMercado = AgregarCheckbox(cboTipoMercado, flpTipoMercado)
  632. Me.cboTipoMercado.SelectedIndex = -1
  633. TipoTransaccion = vTipoTransaccion
  634. End Sub
  635. Private Sub NuevaPropuesta()
  636. If oPropuestaInversionCE Is Nothing Then
  637. oPropuestaInversionCE = New CEPropuestaInversion
  638. End If
  639. LimpiarControles()
  640. Me.cboEstadoDocumento.SelectedValue = "A"
  641. Me.cboAutorizacion.SelectedValue = "P"
  642. Me.cboTipoOperacion.SelectedValue = "C"
  643. Me.cboOrigenDeFondos.SelectedValue = "D"
  644. Me.btnAccion.Text = "Guardar"
  645. Me.txtCodigoInversion.ReadOnly = True
  646. End Sub
  647. Private Function GuardarPropuesta()
  648. Dim ValidacionCorrecta As Boolean = ValoresValidos()
  649. Dim Guardado As Boolean = False
  650. Dim Estado As String = "Correcto"
  651. If ValidacionCorrecta Then
  652. If TieneDetalleInstrumento Then
  653. ResultadoMsgBox = DialogResult.Yes
  654. Else
  655. ResultadoMsgBox = MessageBox.Show("No se ha ingresado detalles del Instrumento." & vbCrLf & "Desea continuar sin detalles?", "Sin Detalles", MessageBoxButtons.YesNo)
  656. End If
  657. If ValidacionCorrecta Then
  658. If ResultadoMsgBox = DialogResult.Yes Then
  659. If EstadoReporto = "PRIMARIO" Then
  660. Guardado = oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, TipoProcesoCMVTA, CodigoInversionCMVTA)
  661. ElseIf EstadoReporto = "SECUNDARIO" Then
  662. Guardado = oDAOPropuestasDeInversion.NuevaPropuesta(oPropuestaInversionCE, CodigoAsociado, EstadoReporto, CodigoReporto, IdFlujo, IdECT)
  663. Else
  664. Estado = "Error"
  665. End If
  666. Else
  667. Estado = "Omitir"
  668. End If
  669. End If
  670. Else
  671. Estado = "ValidacionIncorrecta"
  672. End If
  673. Return Estado
  674. End Function
  675. Private Sub ActualizarPropuesta(ByVal parametro As String)
  676. Dim retorno As Integer
  677. RefrescarValoresControles()
  678. retorno = oDAOPropuestasDeInversion.Actualizar(oPropuestaInversionCE, parametro, EstadoReporto)
  679. If retorno = 0 Then
  680. MsgBox("Registro Actualizado", MsgBoxStyle.Information)
  681. CargarPropuesta(IdPIN)
  682. End If
  683. End Sub
  684. Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresas.SelectedIndexChanged
  685. ControlEmpresa()
  686. End Sub
  687. Private Sub txtAsunto_TextChanged(sender As Object, e As EventArgs) Handles txtAsunto.TextChanged
  688. End Sub
  689. Private Sub txtAsunto_LostFocus(sender As Object, e As EventArgs) Handles txtAsunto.LostFocus
  690. ControlAsunto()
  691. End Sub
  692. Private Sub cboInstrumentosFinancieros_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboInstrumentosFinancieros.SelectedIndexChanged
  693. ControlInstrumento()
  694. TieneDetalleInstrumento = False
  695. End Sub
  696. Private Sub txtMontoInversion_TextChanged(sender As Object, e As EventArgs)
  697. End Sub
  698. Private Sub txtMontoInversion_LostFocus(sender As Object, e As EventArgs)
  699. End Sub
  700. Private Sub txtPrecio_TextChanged(sender As Object, e As EventArgs)
  701. End Sub
  702. Private Sub txtPrecio_LostFocus(sender As Object, e As EventArgs)
  703. End Sub
  704. Private Sub txtRendimiento_TextChanged(sender As Object, e As EventArgs)
  705. End Sub
  706. Private Sub txtRendimiento_LostFocus(sender As Object, e As EventArgs)
  707. End Sub
  708. Private Sub cboPlazos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPlazosFactor.SelectedIndexChanged
  709. ControlPlazoFactor()
  710. ControlPlazoFact()
  711. End Sub
  712. Private Sub txtPlazoNumero_TextChanged(sender As Object, e As EventArgs)
  713. End Sub
  714. Private Sub txtPlazoNumero_LostFocus(sender As Object, e As EventArgs)
  715. End Sub
  716. Private Sub txtIngresos_TextChanged(sender As Object, e As EventArgs)
  717. End Sub
  718. Private Sub cboOrigenDeFodos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOrigenDeFondos.SelectedIndexChanged
  719. ControlOrigenDeFondos()
  720. ControlOFon()
  721. End Sub
  722. Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmisores.SelectedIndexChanged
  723. ControlEmisores()
  724. End Sub
  725. Private Sub cboCalificacionDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificacionDeRiesgo.SelectedIndexChanged
  726. ControlCalificacionesDeRiesgo()
  727. End Sub
  728. Private Sub cboCalificadoraDeRiesgo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificadoraDeRiesgo.SelectedIndexChanged
  729. ControlCalificadoraDeRiesgo()
  730. End Sub
  731. Private Sub txtJustificacion_TextChanged(sender As Object, e As EventArgs) Handles txtJustificacion.TextChanged
  732. End Sub
  733. Private Sub txtJustificacion_LostFocus(sender As Object, e As EventArgs) Handles txtJustificacion.LostFocus
  734. ControlJustificacion()
  735. End Sub
  736. Private Sub txtComentarios_TextChanged(sender As Object, e As EventArgs) Handles txtComentarios.TextChanged
  737. End Sub
  738. Private Sub txtComentarios_LostFocus(sender As Object, e As EventArgs) Handles txtComentarios.LostFocus
  739. ControlComentarios()
  740. End Sub
  741. Private Sub cboEstadoDocumento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoDocumento.SelectedIndexChanged
  742. ControlEstadoDocumento()
  743. End Sub
  744. Private Sub dtpFechaDocumento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaDocumento.ValueChanged
  745. ControlFechaDocumento()
  746. End Sub
  747. Private Sub txtIngresos_LostFocus(sender As Object, e As EventArgs)
  748. End Sub
  749. Private Sub PrepararBusqueda()
  750. TipoTransaccion = "B"
  751. oPropuestaInversionCE = Nothing
  752. oPropuestaInversionCE = New CEPropuestaInversion
  753. LimpiarControles()
  754. End Sub
  755. Private Sub CargarPropuesta(Id As Integer)
  756. oPropuestaInversionCE = Nothing
  757. oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id)
  758. IdPIN = Id
  759. Dim vCodigoEmpresa As String = oPropuestaInversionCE.CodigoEmpresa.ToString
  760. If vCodigoEmpresa.Length = 0 Then
  761. Me.cboEmpresas.SelectedIndex = -1
  762. Else
  763. Me.cboEmpresas.SelectedValue = vCodigoEmpresa
  764. End If
  765. Me.txtAsunto.Text = oPropuestaInversionCE.Asunto.ToString
  766. Dim vCodigoInstrumentoFinanciero As String = oPropuestaInversionCE.CodigoInstrumentoFinanciero.ToString
  767. If vCodigoInstrumentoFinanciero.Length = 0 Then
  768. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  769. Else
  770. Me.cboInstrumentosFinancieros.SelectedValue = vCodigoInstrumentoFinanciero.ToString
  771. End If
  772. Dim vPlazoFactor As String = oPropuestaInversionCE.PlazoFactor.ToString
  773. If vPlazoFactor.Length = 0 Then
  774. Me.cboPlazosFactor.SelectedIndex = -1
  775. Else
  776. Me.cboPlazosFactor.SelectedValue = vPlazoFactor.ToString
  777. End If
  778. Dim vOrigenDeFondos As String = oPropuestaInversionCE.OrigenDeFondos.ToString
  779. If vOrigenDeFondos.Length = 0 Then
  780. Me.cboOrigenDeFondos.SelectedIndex = -1
  781. Else
  782. Me.cboOrigenDeFondos.SelectedValue = vOrigenDeFondos.ToString
  783. End If
  784. Dim vCodigoEmisor As String = oPropuestaInversionCE.CodigoEmisor.ToString
  785. If vCodigoEmisor = 0 Then
  786. Me.cboEmisores.SelectedIndex = -1
  787. Else
  788. Me.cboEmisores.SelectedValue = vCodigoEmisor.ToString
  789. End If
  790. Dim vCodigoCalificacionDeRiesgo As String = oPropuestaInversionCE.CodigoCalificacionDeRiesgo.ToString
  791. If vCodigoCalificacionDeRiesgo.Length = 0 Then
  792. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  793. Else
  794. Me.cboCalificacionDeRiesgo.SelectedValue = vCodigoCalificacionDeRiesgo.ToString
  795. End If
  796. Dim vCodigoEmpresaCalificadora As String = oPropuestaInversionCE.CodigoEmpresaCalificadora.ToString
  797. If vCodigoEmpresaCalificadora.Length = 0 Then
  798. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  799. Else
  800. Me.cboCalificadoraDeRiesgo.SelectedValue = vCodigoEmpresaCalificadora.ToString
  801. End If
  802. Me.txtJustificacion.Text = oPropuestaInversionCE.Justificacion.ToString
  803. Me.txtComentarios.Text = oPropuestaInversionCE.Comentarios.ToString
  804. Me.txtCodigoInversion.Text = oPropuestaInversionCE.CodigoInversion.ToString
  805. Me.txtCodigoInversion.ReadOnly = True
  806. Dim vEstadoDocumento As String = oPropuestaInversionCE.EstadoDocumento.ToString
  807. If vEstadoDocumento.Length = 0 Then
  808. Me.cboEstadoDocumento.SelectedIndex = -1
  809. Else
  810. Me.cboEstadoDocumento.SelectedValue = vEstadoDocumento.ToString
  811. End If
  812. Dim vFechaDocumento As Date = Date.Today.Date
  813. If Not Date.TryParse(oPropuestaInversionCE.FechaDocumento.ToString, vFechaDocumento.ToString) Then
  814. vFechaDocumento = Date.Today.Date
  815. End If
  816. Me.dtpFechaDocumento.Value = vFechaDocumento.ToString
  817. Dim vTipoOperacion As String = oPropuestaInversionCE.TipoOperacion.ToString
  818. If String.IsNullOrEmpty(vTipoOperacion) Then
  819. Me.cboTipoOperacion.SelectedIndex = -1
  820. Else
  821. Me.cboTipoOperacion.SelectedValue = vTipoOperacion.ToString
  822. End If
  823. Dim vEstadoAut As String = oPropuestaInversionCE.EstadoAutorizacion.ToString
  824. If vEstadoAut.Length = 0 Then
  825. Me.cboAutorizacion.SelectedIndex = 0
  826. Else
  827. Me.cboAutorizacion.SelectedValue = vEstadoAut.ToString
  828. End If
  829. Dim vTipoMercado As String = oPropuestaInversionCE.TipoMercado.ToString
  830. If String.IsNullOrEmpty(vTipoMercado) Then
  831. cboTipoMercado.SelectedIndex = -1
  832. Else
  833. Me.cboTipoMercado.SelectedValue = vTipoMercado.ToString
  834. End If
  835. Dim vPais As String = oPropuestaInversionCE.Pais.ToString
  836. If String.IsNullOrEmpty(vPais) Then
  837. cboPaises.SelectedIndex = -1
  838. Else
  839. cboPaises.SelectedValue = vPais
  840. End If
  841. Dim vTipoRenta As String = oPropuestaInversionCE.TipoRenta.ToString
  842. If String.IsNullOrEmpty(vTipoRenta) Then
  843. cboRenta.SelectedIndex = -1
  844. Else
  845. cboRenta.SelectedValue = vTipoRenta
  846. End If
  847. Dim vTipoTasa As String = oPropuestaInversionCE.TipoTasa.ToString
  848. If String.IsNullOrEmpty(vTipoTasa) Then
  849. cboTasa.SelectedIndex = -1
  850. Else
  851. cboTasa.SelectedValue = vTipoTasa
  852. End If
  853. Dim vPeriodicidad As String = oPropuestaInversionCE.Periodicidad.ToString
  854. If String.IsNullOrEmpty(vPeriodicidad) Then
  855. cboPeriodicidad.SelectedIndex = -1
  856. Else
  857. cboPeriodicidad.SelectedValue = vPeriodicidad
  858. End If
  859. Dim vNombre As String = oPropuestaInversionCE.NombreManual.ToString
  860. txtNombre.Text = vNombre
  861. TipoTransaccion = "C"
  862. IdPIN = Id
  863. IdIF = vCodigoInstrumentoFinanciero
  864. Me.btnAccion.Text = "Aceptar"
  865. End Sub
  866. 'NAVEGACION
  867. '***FIN NAVEGACION
  868. Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
  869. If TipoTransaccion = "N" Then
  870. Dim CrearInstrumento As String = String.Empty
  871. If Not TrasladarDatos Is Nothing Then
  872. If TrasladarDatos.AgregarCMVTA Then
  873. CrearInstrumento = "Correcto"
  874. Else
  875. CrearInstrumento = GuardarPropuesta()
  876. End If
  877. Else
  878. CrearInstrumento = GuardarPropuesta()
  879. End If
  880. If CrearInstrumento = "Correcto" Then
  881. GuardarFamilia(txtCodigoInversion.Text)
  882. txtCodigoInversion.ReadOnly = True
  883. Refrescar()
  884. LimpiarControles()
  885. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  886. If BindingNavigatorPositionItem.Enabled Then
  887. BindingNavigatorPositionItem.Enabled = False
  888. End If
  889. Nuevo()
  890. ElseIf CrearInstrumento = "Omitir" Then
  891. MsgBox("No se creo los detalles del instrumento")
  892. If BindingNavigatorPositionItem.Enabled Then
  893. BindingNavigatorPositionItem.Enabled = False
  894. End If
  895. ElseIf CrearInstrumento = "Error" Then
  896. MsgBox("Error al crear instrumento")
  897. If BindingNavigatorPositionItem.Enabled Then
  898. BindingNavigatorPositionItem.Enabled = False
  899. End If
  900. End If
  901. ElseIf TipoTransaccion = "A" Then
  902. Dim posicion = PIN0BindingSource4.Position
  903. ActualizarPropuesta(txtCodigoInversion.Text)
  904. Refrescar()
  905. If Not LlamadaDesdeBusqueda Then
  906. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  907. PIN0BindingSource4.Position = posicion
  908. End If
  909. ControlCambio()
  910. End If
  911. End Sub
  912. Sub GuardarFamilia(ByVal Instrumento As String)
  913. If Not TrasladarDatos Is Nothing Then
  914. If TrasladarDatos.AgregarCMVTA Then
  915. Dim ValidacionCorrecta As Boolean = ValoresValidos()
  916. If ValidacionCorrecta Then
  917. Dim CodigoCompra As String = txtCodigoInversionCM.Text
  918. Dim CodigoVenta As String = txtCodigoInversion.Text
  919. Dim NombreTabla As String = String.Empty
  920. Dim Coleccion As New Collection
  921. If Instrumento.IndexOf("OPC") > -1 Then
  922. NombreTabla = "OPC0"
  923. Coleccion = Variables.ColeccionFUTU
  924. ElseIf Instrumento.IndexOf("FUTU") > -1 Then
  925. NombreTabla = "FUT0"
  926. Coleccion = Variables.ColeccionFUTU
  927. ElseIf Instrumento.IndexOf("ACC") > -1 Then
  928. NombreTabla = "ACC0"
  929. Coleccion = Variables.ColeccionACC
  930. ElseIf Instrumento.IndexOf("CINV") > -1 Then
  931. NombreTabla = "CIN0"
  932. Coleccion = Variables.ColeccionCINV
  933. ElseIf Instrumento.IndexOf("BONO") > -1 Then
  934. NombreTabla = "BON0"
  935. Coleccion = Variables.ColeccionCINV
  936. ElseIf Instrumento.IndexOf("EURB") > -1 Then
  937. NombreTabla = "EURB0"
  938. Coleccion = Variables.ColeccionCINV
  939. ElseIf Instrumento.IndexOf("TIT") > -1 Then
  940. NombreTabla = "TIT"
  941. Coleccion = Variables.ColeccionCINV
  942. Else
  943. MsgBox("Error al crear Titulo")
  944. NombreTabla = "Error"
  945. End If
  946. If Not Coleccion Is Nothing Then
  947. If Coleccion.Count > 0 Then
  948. oDAOGeneral.GenerarCMVTA(CodigoCompra, CodigoVenta, NombreTabla, Coleccion, oPropuestaInversionCE)
  949. Else
  950. MsgBox("Error al crear Titulo")
  951. End If
  952. Else
  953. MsgBox("Error al crear Titulo")
  954. End If
  955. Else
  956. MsgBox("Error al crear Titulo")
  957. End If
  958. End If
  959. Else
  960. If Instrumento.IndexOf("LETE") > -1 Then
  961. Dim oDAOLetes As New LETESDAO
  962. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  963. If ColeccionLETE.Count > 0 Then
  964. oDAOLetes.NuevoIngreso(ColeccionLETE, "LETE")
  965. ColeccionLETE.Clear()
  966. End If
  967. End If
  968. If Instrumento.IndexOf("PBUR") > -1 Then
  969. Dim oDAOLetes As New LETESDAO
  970. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  971. If ColeccionLETE.Count > 0 Then
  972. oDAOLetes.NuevoIngreso(ColeccionLETE, "PBUR")
  973. ColeccionLETE.Clear()
  974. End If
  975. End If
  976. If Instrumento.IndexOf("VCN") > -1 Then
  977. Dim oDAOLetes As New LETESDAO
  978. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  979. Dim EmpaquetarTablaBaseDatos As New Dictionary(Of Integer, Collection)
  980. EmpaquetarTablaBaseDatos = Variables.EmpaquetarTablaBaseDatos
  981. If ColeccionLETE.Count > 0 And EmpaquetarTablaBaseDatos.Count > 0 Then
  982. oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN", EmpaquetarTablaBaseDatos)
  983. ColeccionLETE.Clear()
  984. EmpaquetarTablaBaseDatos.Clear()
  985. End If
  986. End If
  987. If Instrumento.IndexOf("CETE") > -1 Then
  988. Dim oDAOLetes As New LETESDAO
  989. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  990. If ColeccionLETE.Count > 0 Then
  991. oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE")
  992. ColeccionLETE.Clear()
  993. End If
  994. End If
  995. If Instrumento.IndexOf("ACC") > -1 Then
  996. Dim oDAOACC As New AccionesDAO
  997. Dim ColeccionACC As Collection = Variables.ColeccionACC
  998. If ColeccionACC.Count > 0 Then
  999. oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC)
  1000. ColeccionACC.Clear()
  1001. FormAcciones.Dispose()
  1002. End If
  1003. End If
  1004. If Instrumento.IndexOf("CINV") > -1 Then
  1005. Dim oDAOCINV As New CertificadosDeInversionDAO
  1006. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1007. If ColeccionCINV.Count > 0 Then
  1008. oDAOCINV.Nuevo(ColeccionCINV, "CINV")
  1009. ColeccionCINV.Clear()
  1010. End If
  1011. End If
  1012. If Instrumento.IndexOf("BONO") > -1 Then
  1013. Dim oDAOCINV As New CertificadosDeInversionDAO
  1014. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1015. If ColeccionCINV.Count > 0 Then
  1016. oDAOCINV.Nuevo(ColeccionCINV, "BONO")
  1017. ColeccionCINV.Clear()
  1018. End If
  1019. End If
  1020. If Instrumento.IndexOf("EURB0") > -1 Then
  1021. Dim oDAOCINV As New CertificadosDeInversionDAO
  1022. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1023. If ColeccionCINV.Count > 0 Then
  1024. oDAOCINV.Nuevo(ColeccionCINV, "EURB")
  1025. ColeccionCINV.Clear()
  1026. End If
  1027. End If
  1028. If Instrumento.IndexOf("TIT") > -1 Then
  1029. Dim oDAOCINV As New CertificadosDeInversionDAO
  1030. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1031. If ColeccionCINV.Count > 0 Then
  1032. oDAOCINV.Nuevo(ColeccionCINV, "TIT")
  1033. ColeccionCINV.Clear()
  1034. End If
  1035. End If
  1036. If Instrumento.IndexOf("DAP") > -1 Then
  1037. Dim oDAODAP As New DepositosAPlazoDAO
  1038. Dim ColeccionDAP As Collection = Variables.ColeccionDAP
  1039. Dim diccionario = Variables.ColeccionDAPDi
  1040. If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then
  1041. oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo)
  1042. ColeccionDAP.Clear()
  1043. diccionario = Nothing
  1044. End If
  1045. End If
  1046. If Instrumento.IndexOf("NEST") > -1 Then
  1047. Dim oDAONEST As New DAONotaEstructurada
  1048. Dim ColeccionDAP As Collection = Variables.ColeccionNEST
  1049. Dim diccionario = Variables.ColeccionNESTDi
  1050. If ColeccionNEST.Count > 0 And Not diccionario Is Nothing Then
  1051. oDAONEST.NuevoDato(ColeccionNEST, diccionario, Variables.Codigo)
  1052. ColeccionNEST.Clear()
  1053. diccionario = Nothing
  1054. End If
  1055. End If
  1056. If Instrumento.IndexOf("FINV") > -1 Then
  1057. Dim oDAOFINV As New FondoInversionDAO
  1058. Dim ColeccionFINV As Collection = Variables.ColeccionFINV
  1059. Dim diccionario = Variables.ColeccionFINVDi
  1060. If ColeccionFINV.Count > 0 And Not diccionario Is Nothing Then
  1061. oDAOFINV.ProcesoDatos(ColeccionFINV, Variables.Codigo, diccionario, "Nuevo")
  1062. ColeccionFINV.Clear()
  1063. diccionario = Nothing
  1064. End If
  1065. End If
  1066. If Instrumento.IndexOf("FUTU") > -1 Then
  1067. Dim oDAOFUTU As New FuturosDAO
  1068. Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU
  1069. If ColeccionFUTU.Count > 0 Then
  1070. oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU)
  1071. ColeccionFUTU.Clear()
  1072. End If
  1073. End If
  1074. If Instrumento.IndexOf("OPC") > -1 Then
  1075. Dim oDAOOPC As New FuturosDAO
  1076. Dim ColeccionOPC As Collection = Variables.ColeccionFUTU
  1077. If ColeccionOPC.Count > 0 Then
  1078. oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC)
  1079. ColeccionOPC.Clear()
  1080. End If
  1081. End If
  1082. If Instrumento.IndexOf("PEMP") > -1 Then
  1083. Dim oDAOPEMP As New PrestamoEmpresarialDAO
  1084. Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP
  1085. Dim diccionario = Variables.ColeccionPEMPDi
  1086. If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then
  1087. oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo")
  1088. ColeccionPEMP.Clear()
  1089. diccionario = Nothing
  1090. End If
  1091. End If
  1092. If Instrumento.IndexOf("PPER") > -1 Then
  1093. Dim oDAOPPER As New PrestamoPersonalDAO
  1094. Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR
  1095. Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE
  1096. Dim diccionario = Variables.ColeccionPPERAMORTDi
  1097. If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then
  1098. oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo")
  1099. ColeccionPPERDEUDOR.Clear()
  1100. ColeccionPPERDETALLE.Clear()
  1101. diccionario = Nothing
  1102. End If
  1103. End If
  1104. If Instrumento.IndexOf("REPOVENTA") > -1 Then
  1105. Dim oDAOREPO As New ReportosDAO
  1106. Dim diccionario = Variables.ColeccionREPO
  1107. If Not diccionario Is Nothing Then
  1108. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA")
  1109. diccionario = Nothing
  1110. End If
  1111. ElseIf Instrumento.IndexOf("REPO") > -1 And Not Instrumento.IndexOf("REPOVENTA") > -1 Then
  1112. Dim oDAOREPO As New ReportosDAO
  1113. Dim diccionario = Variables.ColeccionREPO
  1114. If Not diccionario Is Nothing Then
  1115. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0")
  1116. diccionario = Nothing
  1117. End If
  1118. End If
  1119. End If
  1120. End Sub
  1121. Function GuardarColecciones()
  1122. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1123. DiccionarioColecciones.Add("Empresa", Col_Empresas)
  1124. DiccionarioColecciones.Add("Emisor", Col_Emisor)
  1125. DiccionarioColecciones.Add("EstDocumento", Col_EstDocumento)
  1126. DiccionarioColecciones.Add("Instrumento", Col_Instrumento)
  1127. DiccionarioColecciones.Add("CalRiesgo", Col_CalRiesgo)
  1128. DiccionarioColecciones.Add("TipOperacion", Col_TipOperacion)
  1129. DiccionarioColecciones.Add("OriFond", Col_OriFond)
  1130. DiccionarioColecciones.Add("CalERiesgo", Col_CalERiesgo)
  1131. DiccionarioColecciones.Add("Aut", Col_Aut)
  1132. DiccionarioColecciones.Add("Plazo", Col_Plazo)
  1133. DiccionarioColecciones.Add("Pais", Col_Pais)
  1134. DiccionarioColecciones.Add("TipMercado", Col_TipMercado)
  1135. Return DiccionarioColecciones
  1136. End Function
  1137. Private Sub LanzarBusqueda()
  1138. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1139. DiccionarioColecciones = GuardarColecciones()
  1140. frmBuscarDeLista.dgvBuscarDeLista.DataSource = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado")
  1141. If frmBuscarDeLista.ShowDialog = DialogResult.OK Then
  1142. If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then
  1143. CargarPropuesta(frmBuscarDeLista.CodigoPrincipal)
  1144. End If
  1145. End If
  1146. End Sub
  1147. Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs)
  1148. End Sub
  1149. Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs)
  1150. End Sub
  1151. Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
  1152. End Sub
  1153. Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs)
  1154. End Sub
  1155. Private Sub navNuevoRegistro_Click(sender As Object, e As EventArgs)
  1156. NuevaPropuesta()
  1157. End Sub
  1158. Private Sub navEliminarRegistro_Click(sender As Object, e As EventArgs)
  1159. End Sub
  1160. Private Sub navBuscar_Click(sender As Object, e As EventArgs)
  1161. PrepararBusqueda()
  1162. End Sub
  1163. Private Sub cboEmpresas_LostFocus(sender As Object, e As EventArgs) Handles cboEmpresas.LostFocus
  1164. End Sub
  1165. Sub GenerarCodigoDeInversion()
  1166. Dim vEmpresa As String
  1167. Dim vCodigoIF As String
  1168. Dim oCodigo As String
  1169. vEmpresa = oPropuestaInversionCE.CodigoEmpresa
  1170. vCodigoIF = oPropuestaInversionCE.CodigoInstrumentoFinanciero
  1171. oCodigo = SeriesDAO.SiguienteCodigoInversion(vEmpresa, vCodigoIF)
  1172. Me.txtCodigoInversion.Text = oCodigo
  1173. End Sub
  1174. Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged
  1175. LimpiarVariablesTraspaso()
  1176. ControlCodigoInversion()
  1177. ControlCambio()
  1178. Variables.CodigoComparativo = String.Empty
  1179. End Sub
  1180. Sub ControlCambio()
  1181. Dim EstadoAut As String = cboAutorizacion.SelectedValue
  1182. Dim Codigo As String = txtCodigoInversion.Text
  1183. If Not String.IsNullOrEmpty(Codigo) Or TipoTransaccion = "N" Then
  1184. If TipoTransaccion = "N" Then
  1185. pnlCambiarRev.Visible = False
  1186. pnlCambiarRec.Visible = False
  1187. pnlCambiarApro.Visible = False
  1188. Else
  1189. If Not TipoTransaccion = "A" Then
  1190. If EstadoAut = "P" Then
  1191. pnlCambiarRev.Visible = True
  1192. pnlCambiarRec.Visible = True
  1193. pnlCambiarApro.Visible = False
  1194. ElseIf EstadoAut = "V" Then
  1195. pnlCambiarRev.Visible = False
  1196. pnlCambiarRec.Visible = True
  1197. pnlCambiarApro.Visible = True
  1198. ElseIf EstadoAut = "A" Or EstadoAut = "R" Then
  1199. pnlCambiarRev.Visible = False
  1200. pnlCambiarRec.Visible = False
  1201. pnlCambiarApro.Visible = False
  1202. TipoTransaccion = "B"
  1203. End If
  1204. End If
  1205. End If
  1206. End If
  1207. EstadoControladoresNAV()
  1208. End Sub
  1209. Private Sub ControlEmpresa()
  1210. If TipoTransaccion = "N" Then
  1211. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  1212. GenerarCodigoDeInversion()
  1213. End If
  1214. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1215. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  1216. End If
  1217. End Sub
  1218. Private Sub ControlAsunto()
  1219. oPropuestaInversionCE.Asunto = Me.txtAsunto.Text
  1220. End Sub
  1221. Private Sub ControlInstrumento()
  1222. If TipoTransaccion = "N" Then
  1223. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  1224. GenerarCodigoDeInversion()
  1225. End If
  1226. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1227. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  1228. End If
  1229. End Sub
  1230. Private Sub ControlPlazoFactor()
  1231. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1232. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  1233. End If
  1234. End Sub
  1235. Private Sub ControlOrigenDeFondos()
  1236. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1237. oPropuestaInversionCE.OrigenDeFondos = Me.cboOrigenDeFondos.SelectedValue
  1238. End If
  1239. End Sub
  1240. Private Sub ControlEmisores()
  1241. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1242. oPropuestaInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue
  1243. End If
  1244. End Sub
  1245. Private Sub ControlCalificacionesDeRiesgo()
  1246. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1247. oPropuestaInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificacionDeRiesgo.SelectedValue
  1248. End If
  1249. End Sub
  1250. Private Sub ControlCalificadoraDeRiesgo()
  1251. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1252. oPropuestaInversionCE.CodigoEmpresaCalificadora = Me.cboCalificadoraDeRiesgo.SelectedValue
  1253. End If
  1254. End Sub
  1255. Private Sub ControlTipoMercado()
  1256. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1257. If Me.cboTipoMercado.SelectedIndex = -1 Then
  1258. oPropuestaInversionCE.TipoMercado = ""
  1259. Else
  1260. oPropuestaInversionCE.TipoMercado = Me.cboTipoMercado.SelectedValue
  1261. End If
  1262. End If
  1263. End Sub
  1264. Private Sub ControlPais()
  1265. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1266. If Me.cboPaises.SelectedIndex = -1 Then
  1267. oPropuestaInversionCE.Pais = ""
  1268. Else
  1269. oPropuestaInversionCE.Pais = Me.cboPaises.SelectedValue
  1270. End If
  1271. End If
  1272. End Sub
  1273. Private Sub ControlPlazoFact()
  1274. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1275. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  1276. End If
  1277. End Sub
  1278. Private Sub ControlJustificacion()
  1279. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1280. oPropuestaInversionCE.Justificacion = Me.txtJustificacion.Text
  1281. End If
  1282. End Sub
  1283. Private Sub ControlOFon()
  1284. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1285. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1286. oPropuestaInversionCE.OrigenDeFondos = ""
  1287. Else
  1288. oPropuestaInversionCE.OrigenDeFondos = cboOrigenDeFondos.SelectedValue
  1289. End If
  1290. End If
  1291. End Sub
  1292. Private Sub ControlTipOper()
  1293. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1294. If cboTipoOperacion.SelectedIndex = -1 Then
  1295. oPropuestaInversionCE.TipoOperacion = ""
  1296. Else
  1297. oPropuestaInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue
  1298. End If
  1299. End If
  1300. End Sub
  1301. Private Sub ControlComentarios()
  1302. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1303. oPropuestaInversionCE.Comentarios = Me.txtComentarios.Text
  1304. End If
  1305. End Sub
  1306. Private Sub ControlCodigoInversion()
  1307. If TipoTransaccion = "N" Or TipoTransaccion = "B" Then
  1308. oPropuestaInversionCE.CodigoInversion = txtCodigoInversion.Text
  1309. End If
  1310. End Sub
  1311. Private Sub ControlEstadoDocumento()
  1312. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1313. oPropuestaInversionCE.EstadoDocumento = Me.cboEstadoDocumento.SelectedValue
  1314. End If
  1315. End Sub
  1316. Private Sub ControlEstadoAutorizacion()
  1317. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1318. oPropuestaInversionCE.EstadoAutorizacion = Me.cboAutorizacion.SelectedValue
  1319. End If
  1320. End Sub
  1321. Private Sub ControlFechaDocumento()
  1322. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1323. oPropuestaInversionCE.FechaDocumento = Me.dtpFechaDocumento.Value.Date
  1324. End If
  1325. End Sub
  1326. Private Sub ControlTipoOperacion()
  1327. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1328. oPropuestaInversionCE.TipoOperacion = Me.cboTipoOperacion.SelectedValue
  1329. End If
  1330. End Sub
  1331. Private Sub ControlNombre()
  1332. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1333. oPropuestaInversionCE.NombreManual = txtNombre.Text
  1334. End If
  1335. End Sub
  1336. Private Sub ControlTipoRenta()
  1337. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1338. If Not TypeOf Me.cboRenta.SelectedValue Is DataRowView Then
  1339. oPropuestaInversionCE.TipoRenta = Me.cboRenta.SelectedValue
  1340. End If
  1341. End If
  1342. End Sub
  1343. Private Sub ControlTasa()
  1344. If Not TypeOf Me.cboTasa.SelectedValue Is DataRowView Then
  1345. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1346. oPropuestaInversionCE.TipoTasa = Me.cboTasa.SelectedValue
  1347. End If
  1348. End If
  1349. End Sub
  1350. Private Sub ControlPeriodicidad()
  1351. If Not TypeOf Me.cboPeriodicidad.SelectedValue Is DataRowView Then
  1352. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1353. oPropuestaInversionCE.Periodicidad = Me.cboPeriodicidad.SelectedValue
  1354. End If
  1355. End If
  1356. End Sub
  1357. Private Sub LimpiarControles()
  1358. Dim vCero As Double = 0
  1359. Dim vCerotxt As String = vCero.ToString(Configuraciones.CodigoTXTMontos)
  1360. Me.cboEmpresas.SelectedIndex = -1
  1361. Me.txtAsunto.Text = String.Empty
  1362. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  1363. Me.cboPlazosFactor.SelectedIndex = -1
  1364. Me.cboOrigenDeFondos.SelectedIndex = 0
  1365. Me.cboEmisores.SelectedIndex = -1
  1366. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  1367. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  1368. Me.txtJustificacion.Text = String.Empty
  1369. Me.txtComentarios.Text = String.Empty
  1370. Me.txtCodigoInversion.Text = String.Empty
  1371. Me.txtCodigoInversion.ReadOnly = True
  1372. Me.cboEstadoDocumento.SelectedValue = "A"
  1373. Me.cboAutorizacion.SelectedValue = "P"
  1374. Me.dtpFechaDocumento.Value = Date.Now.Date
  1375. Me.cboTipoOperacion.SelectedValue = "C"
  1376. Me.cboTipoMercado.SelectedIndex = -1
  1377. Me.cboPaises.SelectedIndex = -1
  1378. End Sub
  1379. Private Sub RefrescarValoresControles()
  1380. ControlEmpresa()
  1381. ControlAsunto()
  1382. ControlInstrumento()
  1383. ControlPlazoFactor()
  1384. ControlOrigenDeFondos()
  1385. ControlEmisores()
  1386. ControlCalificacionesDeRiesgo()
  1387. ControlCalificadoraDeRiesgo()
  1388. ControlJustificacion()
  1389. ControlComentarios()
  1390. ControlCodigoInversion()
  1391. ControlEstadoDocumento()
  1392. ControlEstadoAutorizacion()
  1393. ControlFechaDocumento()
  1394. ControlTipoOperacion()
  1395. ControlTipoMercado()
  1396. ControlPais()
  1397. ControlPlazoFact()
  1398. ControlOFon()
  1399. ControlTipOper()
  1400. ControlNombre()
  1401. ControlTipoRenta()
  1402. ControlTasa()
  1403. ControlPeriodicidad()
  1404. End Sub
  1405. Private Function ValoresValidos() As Boolean
  1406. Dim DatosValidos As Boolean = True
  1407. If String.IsNullOrEmpty(txtNombre.Text.ToString) Then
  1408. MsgBox("Ingrese el nombre del titulo")
  1409. DatosValidos = False
  1410. Return DatosValidos
  1411. End If
  1412. If cboEmpresas.SelectedIndex = -1 Then
  1413. MsgBox("Seleccione una Empresa")
  1414. DatosValidos = False
  1415. Return DatosValidos
  1416. End If
  1417. If cboInstrumentosFinancieros.SelectedIndex = -1 Then
  1418. MsgBox("Seleccione un Instrumento")
  1419. DatosValidos = False
  1420. Return DatosValidos
  1421. End If
  1422. If cboTipoMercado.SelectedIndex = -1 Then
  1423. MsgBox("Seleccione un Tipo de Mercado")
  1424. DatosValidos = False
  1425. Return DatosValidos
  1426. End If
  1427. If cboPaises.SelectedIndex = -1 Then
  1428. MsgBox("Seleccione un Pais")
  1429. DatosValidos = False
  1430. Return DatosValidos
  1431. End If
  1432. If cboEstadoDocumento.SelectedIndex = -1 Then
  1433. MsgBox("Error con los campos del titulo")
  1434. DatosValidos = False
  1435. Return DatosValidos
  1436. End If
  1437. If cboTipoOperacion.SelectedIndex = -1 Then
  1438. MsgBox("Error con los campos del titulo")
  1439. DatosValidos = False
  1440. Return DatosValidos
  1441. End If
  1442. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1443. MsgBox("Error con los campos del titulo")
  1444. DatosValidos = False
  1445. Return DatosValidos
  1446. End If
  1447. If cboAutorizacion.SelectedIndex = -1 Then
  1448. MsgBox("Error con los campos del titulo")
  1449. DatosValidos = False
  1450. Return DatosValidos
  1451. End If
  1452. Return DatosValidos
  1453. End Function
  1454. Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged
  1455. ControlTipoOperacion()
  1456. ControlTipOper()
  1457. ActualizarEstado(sender)
  1458. End Sub
  1459. Sub ActualizarEstado(sender As Object)
  1460. Dim TOp As String = String.Empty
  1461. If Not TypeOf sender.selectedvalue Is DataRowView Then
  1462. If Not sender.selectedvalue Is Nothing Then
  1463. TOp = sender.selectedvalue
  1464. FormFuturos = New frmFuturos(TOp)
  1465. FormAcciones = New frmAcciones(TOp)
  1466. FormCINV = New frmCertificadosDeInversion(TOp)
  1467. End If
  1468. End If
  1469. End Sub
  1470. Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
  1471. Dim ProTipoTransaccionCompraVenta As String = cboTipoOperacion.SelectedValue.ToString
  1472. Dim ProNueva As String = TipoTransaccion
  1473. Dim CodigoExiste As String = txtCodigoInversion.Text.ToString
  1474. Dim CodigoInstrumentoExiste As String = Operaciones.ConvertirCadena(cboInstrumentosFinancieros.SelectedValue)
  1475. ''################################################################
  1476. Variables.TipoOperacionCMVTA = cboTipoOperacion.SelectedValue
  1477. Variables.InvocadorProInv = "frmPIN"
  1478. ''################################################################
  1479. ''################################################################
  1480. Variables.Periodicidad = cboPeriodicidad.SelectedValue
  1481. ''################################################################
  1482. ''################################################################
  1483. Dim TipOperacion As String = oPropuestaInversionCE.TipoOperacion
  1484. ''################################################################
  1485. TieneDetalleInstrumento = True
  1486. ''################################################################
  1487. Dim NuevaPosInstrumento As Boolean = False
  1488. ''################################################################
  1489. Variables.Codigo = txtCodigoInversion.Text.ToString
  1490. If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
  1491. Variables.CodigoComparativo = Variables.Codigo
  1492. NuevaPosInstrumento = True
  1493. Else
  1494. If Not Variables.CodigoComparativo = Variables.Codigo Then
  1495. NuevaPosInstrumento = True
  1496. End If
  1497. End If
  1498. ''################################################################
  1499. Variables.InvPro = "P"
  1500. ''################################################################
  1501. Dim CodigoInstrumento As String = String.Empty
  1502. ''################################################################
  1503. CodigoInstrumento = txtCodigoInversion.Text.ToString
  1504. ''################################################################
  1505. ''################################################################
  1506. ''################################################################
  1507. If CodigoInstrumento.IndexOf("FINV") > -1 Then
  1508. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFINV")
  1509. Dim ExistInstrumento As Boolean = ExisteInstrumento("FINV")
  1510. Try
  1511. If ExistInstrumento Then
  1512. FormFINV.Dispose()
  1513. FormFINV = New frmFOIN
  1514. FormFINV.ShowDialog()
  1515. Else
  1516. If NuevaPosInstrumento Then
  1517. FormFINV.Dispose()
  1518. FormFINV = New frmFOIN
  1519. FormFINV.ShowDialog()
  1520. Else
  1521. FormFINV.ShowDialog()
  1522. End If
  1523. End If
  1524. Catch ex As Exception
  1525. FormFINV = New frmFOIN
  1526. FormFINV.ShowDialog()
  1527. End Try
  1528. End If
  1529. ''################################################################
  1530. ''################################################################
  1531. ''################################################################
  1532. ''################################################################
  1533. If (CodigoInstrumento.IndexOf("FUTU") > -1 Or CodigoInstrumento.IndexOf("OPC") > -1) Then
  1534. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFuturos")
  1535. Dim ExistInstrumento As Boolean
  1536. If (CodigoInstrumento.IndexOf("FUTU") > -1) Then
  1537. ExistInstrumento = ExisteInstrumento("FUT0")
  1538. Else
  1539. ExistInstrumento = ExisteInstrumento("OPC0")
  1540. End If
  1541. Try
  1542. If ExistInstrumento Then
  1543. CantFormAbierto = False
  1544. FormFuturos.Dispose()
  1545. FormFuturos = New frmFuturos(TipOperacion)
  1546. FormFuturos.ShowDialog()
  1547. Else
  1548. If NuevaPosInstrumento Then
  1549. CantFormAbierto = False
  1550. FormFuturos.Dispose()
  1551. FormFuturos = New frmFuturos(TipOperacion)
  1552. FormFuturos.ShowDialog()
  1553. Else
  1554. CantFormAbierto = True
  1555. FormFuturos.ShowDialog()
  1556. End If
  1557. End If
  1558. Catch ex As Exception
  1559. CantFormAbierto = False
  1560. FormFuturos = New frmFuturos(TipOperacion)
  1561. FormFuturos.ShowDialog()
  1562. End Try
  1563. End If
  1564. ''################################################################
  1565. ''################################################################
  1566. ''################################################################
  1567. ''################################################################
  1568. If CodigoInstrumento.IndexOf("REPO") > -1 Or CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  1569. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaReporto")
  1570. Dim ExistInstrumento As Boolean
  1571. If CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  1572. ExistInstrumento = ExisteInstrumento("REP0VENTA")
  1573. Else
  1574. ExistInstrumento = ExisteInstrumento("REP0")
  1575. End If
  1576. Try
  1577. If ExistInstrumento Then
  1578. FormRepo.Dispose()
  1579. FormRepo = New frmReporto
  1580. FormRepo.ShowDialog()
  1581. Else
  1582. If NuevaPosInstrumento Then
  1583. FormRepo.Dispose()
  1584. FormRepo = New frmReporto
  1585. FormRepo.ShowDialog()
  1586. Else
  1587. FormRepo.ShowDialog()
  1588. End If
  1589. End If
  1590. Catch ex As Exception
  1591. FormRepo = New frmReporto
  1592. FormRepo.ShowDialog()
  1593. End Try
  1594. End If
  1595. ''################################################################
  1596. ''################################################################
  1597. ''################################################################
  1598. ''################################################################
  1599. If CodigoInstrumento.IndexOf("PPER") > -1 Then
  1600. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaPrestamoPersonal")
  1601. Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0")
  1602. Try
  1603. If ExistInstrumento Then
  1604. FormPrestamoPersonal.Dispose()
  1605. FormPrestamoPersonal = New frmPrestamoPersonal
  1606. FormPrestamoPersonal.ShowDialog()
  1607. Else
  1608. If NuevaPosInstrumento Then
  1609. FormPrestamoPersonal.Dispose()
  1610. FormPrestamoPersonal = New frmPrestamoPersonal
  1611. FormPrestamoPersonal.ShowDialog()
  1612. Else
  1613. FormPrestamoPersonal.ShowDialog()
  1614. End If
  1615. End If
  1616. Catch ex As Exception
  1617. FormPrestamoPersonal = New frmPrestamoPersonal
  1618. FormPrestamoPersonal.ShowDialog()
  1619. End Try
  1620. End If
  1621. ''################################################################
  1622. ''################################################################
  1623. ''################################################################
  1624. ''################################################################
  1625. If CodigoInstrumento.IndexOf("PEMP") > -1 Then
  1626. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaEmpresas")
  1627. Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0")
  1628. Try
  1629. If ExistInstrumento Then
  1630. FormPrestamoEmpresarial.Dispose()
  1631. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1632. FormPrestamoEmpresarial.ShowDialog()
  1633. Else
  1634. If NuevaPosInstrumento Then
  1635. FormPrestamoEmpresarial.Dispose()
  1636. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1637. FormPrestamoEmpresarial.ShowDialog()
  1638. Else
  1639. FormPrestamoEmpresarial.ShowDialog()
  1640. End If
  1641. End If
  1642. Catch ex As Exception
  1643. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1644. FormPrestamoEmpresarial.ShowDialog()
  1645. End Try
  1646. End If
  1647. ''################################################################
  1648. ''################################################################
  1649. ''################################################################
  1650. ''################################################################
  1651. Dim Acciones As Integer = 0
  1652. If CodigoInstrumento.IndexOf("ACC") > -1 Then
  1653. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaAcciones")
  1654. Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0")
  1655. Try
  1656. If ExistInstrumento Then
  1657. CantFormAbierto = False
  1658. FormAcciones.Dispose()
  1659. FormAcciones = New frmAcciones(TipOperacion)
  1660. FormAcciones.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1661. FormAcciones.ShowDialog()
  1662. Else
  1663. If NuevaPosInstrumento Then
  1664. CantFormAbierto = False
  1665. FormAcciones.Dispose()
  1666. FormAcciones = New frmAcciones(TipOperacion)
  1667. FormAcciones.ShowDialog()
  1668. Else
  1669. CantFormAbierto = True
  1670. FormAcciones.ShowDialog()
  1671. End If
  1672. End If
  1673. Catch ex As Exception
  1674. CantFormAbierto = False
  1675. FormAcciones = New frmAcciones(TipOperacion)
  1676. FormAcciones.ShowDialog()
  1677. End Try
  1678. End If
  1679. ''################################################################
  1680. ''################################################################
  1681. ''################################################################
  1682. ''################################################################
  1683. If CodigoInstrumento.IndexOf("LETE") > -1 Or CodigoInstrumento.IndexOf("PBUR") > -1 Or CodigoInstrumento.IndexOf("VCN") > -1 Or CodigoInstrumento.IndexOf("CETE") > -1 Then
  1684. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaLetes")
  1685. Dim ExistInstrumento As Boolean
  1686. If CodigoInstrumento.IndexOf("LETE") > -1 Then
  1687. ExistInstrumento = ExisteInstrumento("LET0")
  1688. ElseIf CodigoInstrumento.IndexOf("PBUR") > -1 Then
  1689. ExistInstrumento = ExisteInstrumento("PBUR")
  1690. ElseIf CodigoInstrumento.IndexOf("VCN") > -1 Then
  1691. ExistInstrumento = ExisteInstrumento("VCN")
  1692. Else
  1693. ExistInstrumento = ExisteInstrumento("CET0")
  1694. End If
  1695. Try
  1696. If ExistInstrumento Then
  1697. FormLete.Dispose()
  1698. FormLete = New frmLetes
  1699. FormLete.ShowDialog()
  1700. Else
  1701. If NuevaPosInstrumento Then
  1702. FormLete.Dispose()
  1703. FormLete = New frmLetes
  1704. FormLete.ShowDialog()
  1705. Else
  1706. FormLete.ShowDialog()
  1707. End If
  1708. End If
  1709. Catch ex As Exception
  1710. FormLete = New frmLetes
  1711. FormLete.ShowDialog()
  1712. End Try
  1713. End If
  1714. ''################################################################
  1715. ''################################################################
  1716. ''################################################################
  1717. ''################################################################
  1718. If CodigoInstrumento.IndexOf("BONO") > -1 Or CodigoInstrumento.IndexOf("CINV") > -1 Or CodigoInstrumento.IndexOf("TIT") > -1 Or CodigoInstrumento.IndexOf("EURB") > -1 Then
  1719. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaCINV")
  1720. Dim ExistInstrumento As Boolean
  1721. If CodigoInstrumento.IndexOf("BONO") > -1 Then
  1722. ExistInstrumento = ExisteInstrumento("BON0")
  1723. ElseIf CodigoInstrumento.IndexOf("CINV") > -1 Then
  1724. ExistInstrumento = ExisteInstrumento("CIN0")
  1725. ElseIf CodigoInstrumento.IndexOf("TIT") > -1 Then
  1726. ExistInstrumento = ExisteInstrumento("TIT")
  1727. Else
  1728. ExistInstrumento = ExisteInstrumento("EURB0")
  1729. End If
  1730. Try
  1731. If ExistInstrumento Then
  1732. CantFormAbierto = False
  1733. FormCINV.Dispose()
  1734. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1735. FormCINV.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1736. FormCINV.ShowDialog()
  1737. Else
  1738. If NuevaPosInstrumento Then
  1739. CantFormAbierto = False
  1740. FormCINV.Dispose()
  1741. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1742. FormCINV.ShowDialog()
  1743. Else
  1744. CantFormAbierto = True
  1745. FormCINV.ShowDialog()
  1746. End If
  1747. End If
  1748. Catch ex As Exception
  1749. CantFormAbierto = False
  1750. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1751. FormCINV.ShowDialog()
  1752. End Try
  1753. End If
  1754. ''################################################################
  1755. ''################################################################
  1756. ''################################################################
  1757. ''################################################################
  1758. If CodigoInstrumento.IndexOf("DAP") > -1 Then
  1759. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP")
  1760. Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0")
  1761. Try
  1762. If ExistInstrumento Then
  1763. FormDAP.Dispose()
  1764. FormDAP = New frmDepositosAPlazo
  1765. FormDAP.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1766. FormDAP.ShowDialog()
  1767. Else
  1768. If NuevaPosInstrumento Then
  1769. FormDAP.Dispose()
  1770. FormDAP = New frmDepositosAPlazo
  1771. FormDAP.ShowDialog()
  1772. Else
  1773. FormDAP.ShowDialog()
  1774. End If
  1775. End If
  1776. Catch ex As Exception
  1777. FormDAP = New frmDepositosAPlazo
  1778. FormDAP.ShowDialog()
  1779. End Try
  1780. End If
  1781. ''################################################################
  1782. ''################################################################
  1783. ''################################################################
  1784. ''################################################################
  1785. If CodigoInstrumento.IndexOf("NEST") > -1 Then
  1786. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP")
  1787. Dim ExistInstrumento As Boolean = ExisteInstrumento("NEST0")
  1788. Try
  1789. If ExistInstrumento Then
  1790. FormNEST.Dispose()
  1791. FormNEST = New frmNotaEstructurada
  1792. FormNEST.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1793. FormNEST.ShowDialog()
  1794. Else
  1795. If NuevaPosInstrumento Then
  1796. FormNEST.Dispose()
  1797. FormNEST = New frmNotaEstructurada
  1798. FormNEST.ShowDialog()
  1799. Else
  1800. FormNEST.ShowDialog()
  1801. End If
  1802. End If
  1803. Catch ex As Exception
  1804. FormNEST = New frmNotaEstructurada
  1805. FormNEST.ShowDialog()
  1806. End Try
  1807. End If
  1808. ''################################################################
  1809. ''################################################################
  1810. End Sub
  1811. Function ExisteInstrumento(ByVal Tabla As String)
  1812. Dim General As New DAOGeneral
  1813. Variables.Codigo = txtCodigoInversion.Text.ToString
  1814. Dim Codigo As String = Variables.Codigo
  1815. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1816. Return Existe
  1817. End Function
  1818. Function ExisteInstrumentoReal(ByVal Tabla As String)
  1819. Dim General As New DAOGeneral
  1820. Dim Codigo As String = txtCodigoInversion.Text
  1821. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1822. Return Existe
  1823. End Function
  1824. Private Sub navNuevo_Click(sender As Object, e As EventArgs)
  1825. NuevaPropuesta()
  1826. End Sub
  1827. Private Sub DeshabilitarControles()
  1828. cboEmpresas.Enabled = False
  1829. txtAsunto.ReadOnly = True
  1830. cboInstrumentosFinancieros.Enabled = False
  1831. cboPlazosFactor.Enabled = False
  1832. cboOrigenDeFondos.Enabled = False
  1833. cboEmisores.Enabled = False
  1834. cboCalificacionDeRiesgo.Enabled = False
  1835. cboCalificadoraDeRiesgo.Enabled = False
  1836. txtJustificacion.ReadOnly = True
  1837. txtComentarios.ReadOnly = True
  1838. cboTipoOperacion.Enabled = False
  1839. cboEstadoDocumento.Enabled = False
  1840. cboAutorizacion.Enabled = False
  1841. dtpFechaDocumento.Enabled = False
  1842. cboTipoMercado.Enabled = False
  1843. cboPaises.Enabled = False
  1844. txtCodigoInversion.ReadOnly = True
  1845. cboRenta.Enabled = False
  1846. cboTasa.Enabled = False
  1847. cboPeriodicidad.Enabled = False
  1848. End Sub
  1849. Private Sub HabilitarControles()
  1850. cboEmpresas.Enabled = True
  1851. txtAsunto.ReadOnly = False
  1852. cboInstrumentosFinancieros.Enabled = True
  1853. cboPlazosFactor.Enabled = True
  1854. cboOrigenDeFondos.Enabled = True
  1855. cboEmisores.Enabled = True
  1856. cboCalificacionDeRiesgo.Enabled = True
  1857. cboCalificadoraDeRiesgo.Enabled = True
  1858. txtJustificacion.ReadOnly = False
  1859. txtComentarios.ReadOnly = False
  1860. cboTipoOperacion.Enabled = False
  1861. cboAutorizacion.Enabled = False
  1862. dtpFechaDocumento.Enabled = True
  1863. cboTipoMercado.Enabled = True
  1864. cboPaises.Enabled = True
  1865. cboEstadoDocumento.Enabled = False
  1866. cboRenta.Enabled = True
  1867. cboTasa.Enabled = True
  1868. cboPeriodicidad.Enabled = True
  1869. End Sub
  1870. Private Sub PrepararModificacion()
  1871. If oPropuestaInversionCE.EstadoDocumento = "A" Then
  1872. HabilitarControles()
  1873. TipoTransaccion = "A"
  1874. RefrescarControles()
  1875. Me.btnAccion.Text = "Actualizar"
  1876. End If
  1877. End Sub
  1878. Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAutorizacion.SelectedIndexChanged
  1879. ControlEstadoAutorizacion()
  1880. End Sub
  1881. Private Sub btnActivar_Click(sender As Object, e As EventArgs) Handles btnActivar.Click
  1882. If cboTipoOperacion.SelectedValue = "C" Then
  1883. Dim Id = oDAOPropuestasDeInversion.IdRegistro(txtCodigoInversion.Text)
  1884. oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id)
  1885. ConvertirEnInversion(Id)
  1886. End If
  1887. End Sub
  1888. Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs)
  1889. ControlPais()
  1890. End Sub
  1891. Private Sub cboTipoMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoMercado.SelectedIndexChanged
  1892. ControlTipoMercado()
  1893. End Sub
  1894. Private Sub ConvertirEnInversion(Id As Integer)
  1895. If Not oPropuestaInversionCE Is Nothing Then
  1896. Dim vConversion As Integer
  1897. Dim vIdPropuesta As Integer
  1898. If (oPropuestaInversionCE.IdDeDocumento = 0) Then
  1899. vIdPropuesta = Id
  1900. Else
  1901. vIdPropuesta = oPropuestaInversionCE.IdDeDocumento
  1902. End If
  1903. vConversion = oDAOPropuestasDeInversion.ConvertirEnInversion(vIdPropuesta, EstadoReporto)
  1904. If vConversion = 1 Then
  1905. MsgBox("El proceso de activación se ha efectuado correctamente")
  1906. CargarPropuesta(vIdPropuesta)
  1907. grbInversión.Visible = False
  1908. TipoTransaccion = "B"
  1909. chkUsuario.Checked = False
  1910. Else
  1911. MsgBox("Error")
  1912. End If
  1913. End If
  1914. End Sub
  1915. Private Sub RefrescarControles()
  1916. If TipoTransaccion = "C" Then
  1917. DeshabilitarControles()
  1918. End If
  1919. If TipoTransaccion = "B" Then
  1920. HabilitarControles()
  1921. End If
  1922. If TipoTransaccion = "A" Then
  1923. HabilitarControles()
  1924. cboEstadoDocumento.Enabled = False
  1925. End If
  1926. End Sub
  1927. Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
  1928. Me.Close()
  1929. End Sub
  1930. Private Sub CargarPeriodicidades()
  1931. If (String.IsNullOrEmpty(cboPeriodicidad.SelectedValue)) Then
  1932. Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
  1933. Me.cboPeriodicidad.DisplayMember = "Descripcion"
  1934. Me.cboPeriodicidad.ValueMember = "Codigo"
  1935. Me.cboPeriodicidad.SelectedIndex = -1
  1936. End If
  1937. End Sub
  1938. Private Sub CargarTipoRenta()
  1939. Me.cboRenta.DataSource = oDAOGeneral.ListaTipoRenta
  1940. Me.cboRenta.DisplayMember = "Descripcion"
  1941. Me.cboRenta.ValueMember = "Codigo"
  1942. Me.cboRenta.SelectedIndex = -1
  1943. End Sub
  1944. Private Sub CargarTipoTasa()
  1945. Me.cboTasa.DataSource = oDAOGeneral.ListaTipoTasa
  1946. Me.cboTasa.DisplayMember = "Descripcion"
  1947. Me.cboTasa.ValueMember = "Codigo"
  1948. Me.cboTasa.SelectedIndex = -1
  1949. End Sub
  1950. Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
  1951. ControlPeriodicidad()
  1952. End Sub
  1953. Private Sub cboTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTasa.SelectedIndexChanged
  1954. ControlTasa()
  1955. End Sub
  1956. Private Sub navEliminar_Click(sender As Object, e As EventArgs)
  1957. If (Borrar() = 0) Then
  1958. LimpiarControles()
  1959. End If
  1960. Refrescar()
  1961. PrepararBusqueda()
  1962. End Sub
  1963. Public Sub Refrescar()
  1964. Me.Refresh()
  1965. End Sub
  1966. Public Function Borrar()
  1967. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  1968. If (mensaje = vbOK) Then
  1969. Dim eliminar As New InversionDAO
  1970. Dim valor = eliminar.EliminarPropuesta(txtCodigoInversion.Text)
  1971. If (valor = 1) Then
  1972. MsgBox("Error al Eliminar")
  1973. Return valor
  1974. Else
  1975. MsgBox("Registro Eliminado")
  1976. Return valor
  1977. End If
  1978. End If
  1979. End Function
  1980. Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs)
  1981. End Sub
  1982. Private Sub navSiguienteRegistro_Click_1(sender As Object, e As EventArgs)
  1983. DeshabilitarControles()
  1984. TipoTransaccion = "B"
  1985. If Not BindingNavigatorPositionItem.Enabled Then
  1986. PIN0BindingSource4.ResumeBinding()
  1987. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  1988. End If
  1989. End Sub
  1990. Private Sub navNuevo_Click_1(sender As Object, e As EventArgs) Handles navNuevo.Click
  1991. ActivarSuspen = True
  1992. Modo = "NM"
  1993. TipoTransaccion = "N"
  1994. grbInversión.Visible = False
  1995. NuevaPropuesta()
  1996. PIN0BindingSource4.SuspendBinding()
  1997. Refrescar()
  1998. PreNuevoModificar()
  1999. ModoPropuesta()
  2000. LimpiarControles()
  2001. HabilitarControles()
  2002. TipoTransaccion = "N"
  2003. cboEmpresas.Enabled = True
  2004. cboInstrumentosFinancieros.Enabled = True
  2005. End Sub
  2006. Private Sub DeshabilitarBotonesBusqueda()
  2007. cboPlazosFactor.Enabled = False
  2008. cboOrigenDeFondos.Enabled = False
  2009. cboCalificacionDeRiesgo.Enabled =
  2010. cboCalificadoraDeRiesgo.Enabled = False
  2011. txtJustificacion.ReadOnly = True
  2012. txtComentarios.ReadOnly = True
  2013. cboTipoOperacion.Enabled = False
  2014. cboAutorizacion.Enabled = False
  2015. dtpFechaDocumento.Enabled = False
  2016. cboTipoMercado.Enabled = False
  2017. cboPaises.Enabled = False
  2018. End Sub
  2019. Sub HabilitarAut()
  2020. cboAutorizacion.Enabled = True
  2021. End Sub
  2022. Sub CambiarEstadoAut(ByVal Estado As String)
  2023. If Estado = "P" Then
  2024. cboAutorizacion.SelectedValue = "P"
  2025. ElseIf Estado = "I" Then
  2026. cboAutorizacion.SelectedValue = "I"
  2027. ElseIf Estado = "V" Then
  2028. cboAutorizacion.SelectedValue = "V"
  2029. ElseIf Estado = "A" Then
  2030. cboAutorizacion.SelectedValue = "A"
  2031. ElseIf Estado = "R" Then
  2032. cboAutorizacion.SelectedValue = "R"
  2033. End If
  2034. cboAutorizacion.BackColor = Color.White
  2035. End Sub
  2036. Private Sub navBuscar_Click_1(sender As Object, e As EventArgs) Handles navBuscar.Click
  2037. Modo = "B"
  2038. ModoPropuesta()
  2039. End Sub
  2040. Sub HabilitarBusqueda()
  2041. HabilitarControles()
  2042. grbInversión.Visible = False
  2043. PreBusqueda()
  2044. TipoTransaccion = "B"
  2045. End Sub
  2046. Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
  2047. Dim posicion = PIN0BindingSource4.Position
  2048. ActivarSuspen = True
  2049. Modo = "NM"
  2050. btnAccion.Text = "Actualizar"
  2051. HabilitarControles()
  2052. TipoTransaccion = "A"
  2053. Operaciones.TipoOperacion = "A"
  2054. PrepararModificacion()
  2055. Refrescar()
  2056. TipoTransaccion = "A"
  2057. PreNuevoModificar()
  2058. HabilitarAut()
  2059. ModoPropuesta()
  2060. If Not LlamadaDesdeBusqueda Then
  2061. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2062. PIN0BindingSource4.Position = posicion
  2063. End If
  2064. cboEmpresas.Enabled = False
  2065. cboInstrumentosFinancieros.Enabled = False
  2066. End Sub
  2067. Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click
  2068. End Sub
  2069. Private Sub chkUsuario_CheckedChanged(sender As Object, e As EventArgs) Handles chkUsuario.CheckedChanged
  2070. Dim Codigo As String = txtCodigoInversion.Text.ToString
  2071. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  2072. If ExisteInstrumento Then
  2073. UsuarioPrivilegio(TipoTransaccion, sender)
  2074. Else
  2075. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de la inversión es 0")
  2076. If chkUsuario.Checked Then
  2077. chkUsuario.Checked = False
  2078. End If
  2079. End If
  2080. End Sub
  2081. Private Sub BindingNavigatorCountItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorCountItem.Click
  2082. End Sub
  2083. Friend WithEvents vBindingSource As BindingSource
  2084. Private Sub navEliminar_Click_1(sender As Object, e As EventArgs) Handles navEliminar.Click
  2085. Dim posicion As Integer = PIN0BindingSource4.Position
  2086. If (BorrarPropuesta() = 0) Then
  2087. LimpiarControles()
  2088. End If
  2089. PIN0BindingSource4.SuspendBinding()
  2090. Refrescar()
  2091. HabilitarControles()
  2092. DeshabilitarBotonesBusqueda()
  2093. PrepararBusqueda()
  2094. Variables.CodigoComparativo = "NULL"
  2095. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2096. If Not posicion = 0 Then
  2097. posicion -= 1
  2098. End If
  2099. PIN0BindingSource4.Position = posicion
  2100. End Sub
  2101. Public Function BorrarPropuesta()
  2102. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  2103. If (mensaje = vbOK) Then
  2104. Dim eliminar As New InversionDAO
  2105. Dim EliminarCascada As Boolean = ExisteInstrumento("INV0")
  2106. Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "PIN0", EliminarCascada)
  2107. If (valor = 1) Then
  2108. MsgBox("Error al Eliminar")
  2109. Return valor
  2110. Else
  2111. MsgBox("Registro Eliminado")
  2112. Return valor
  2113. End If
  2114. Else
  2115. Return 1
  2116. End If
  2117. End Function
  2118. Private Sub Navegador_RefreshItems_1(sender As Object, e As EventArgs) Handles Navegador.RefreshItems
  2119. End Sub
  2120. Private Sub PIN0BindingSource_CurrentChanged(sender As Object, e As EventArgs)
  2121. End Sub
  2122. Private Sub navRegistroAnterior_Click_1(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
  2123. DeshabilitarControles()
  2124. TipoTransaccion = "B"
  2125. If Not BindingNavigatorPositionItem.Enabled Then
  2126. PIN0BindingSource4.ResumeBinding()
  2127. End If
  2128. End Sub
  2129. Private Sub navPrimerRegistro_Click_1(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
  2130. DeshabilitarControles()
  2131. TipoTransaccion = "B"
  2132. If Not BindingNavigatorPositionItem.Enabled Then
  2133. PIN0BindingSource4.ResumeBinding()
  2134. End If
  2135. End Sub
  2136. Private Sub navUltimoRegistro_Click_1(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
  2137. DeshabilitarControles()
  2138. TipoTransaccion = "B"
  2139. If Not BindingNavigatorPositionItem.Enabled Then
  2140. PIN0BindingSource4.ResumeBinding()
  2141. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2142. End If
  2143. End Sub
  2144. Private Sub PreBusqueda()
  2145. Me.cboEmpresas.BackColor = Configuraciones.ColorFondoPredefinido()
  2146. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2147. Me.cboInstrumentosFinancieros.BackColor = Configuraciones.ColorFondoPredefinido()
  2148. Me.cboEmisores.BackColor = Configuraciones.ColorFondoPredefinido()
  2149. Me.cboCalificacionDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido()
  2150. Me.cboCalificadoraDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido()
  2151. Me.cboPaises.BackColor = Configuraciones.ColorFondoPredefinido()
  2152. Me.cboTipoMercado.BackColor = Configuraciones.ColorFondoPredefinido()
  2153. Me.txtNombre.BackColor = Configuraciones.ColorFondoPredefinido()
  2154. Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoPredefinido()
  2155. Me.cboPlazosFactor.BackColor = Configuraciones.ColorFondoPredefinido()
  2156. Me.cboRenta.BackColor = Configuraciones.ColorFondoPredefinido()
  2157. Me.cboTasa.BackColor = Configuraciones.ColorFondoPredefinido()
  2158. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2159. Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoPredefinido()
  2160. cboOrigenDeFondos.BackColor = Configuraciones.ColorFondoPredefinido()
  2161. cboTipoOperacion.BackColor = Configuraciones.ColorFondoPredefinido()
  2162. cboAutorizacion.BackColor = Configuraciones.ColorFondoPredefinido()
  2163. txtAsunto.BackColor = Configuraciones.ColorFondoPredefinido()
  2164. dtpFechaDocumento.Enabled = False
  2165. TipoTransaccion = "B"
  2166. oPropuestaInversionCE = Nothing
  2167. oPropuestaInversionCE = New CEPropuestaInversion
  2168. LimpiarControles()
  2169. End Sub
  2170. Private Sub PreNuevoModificar()
  2171. Me.cboEmpresas.BackColor = Color.White
  2172. Me.txtCodigoInversion.BackColor = Color.White
  2173. Me.cboInstrumentosFinancieros.BackColor = Color.White
  2174. Me.cboEmisores.BackColor = Color.White
  2175. Me.cboCalificacionDeRiesgo.BackColor = Color.White
  2176. Me.cboCalificadoraDeRiesgo.BackColor = Color.White
  2177. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2178. Me.cboPaises.BackColor = Color.White
  2179. Me.cboTipoMercado.BackColor = Color.White
  2180. Me.txtNombre.BackColor = Color.White
  2181. Me.cboPeriodicidad.BackColor = Color.White
  2182. Me.cboPlazosFactor.BackColor = Color.White
  2183. Me.cboRenta.BackColor = Color.White
  2184. Me.cboTasa.BackColor = Color.White
  2185. Me.cboEstadoDocumento.BackColor = Color.White()
  2186. cboOrigenDeFondos.BackColor = Color.White
  2187. cboTipoOperacion.BackColor = Color.White
  2188. cboAutorizacion.BackColor = Color.White
  2189. txtAsunto.BackColor = Color.White
  2190. End Sub
  2191. Private Sub txtMontoInversion_Leave(sender As Object, e As EventArgs)
  2192. End Sub
  2193. Private Sub txtPrecio_Leave(sender As Object, e As EventArgs)
  2194. End Sub
  2195. Private Sub txtRendimiento_Leave(sender As Object, e As EventArgs)
  2196. End Sub
  2197. Private Sub txtPlazoNumero_Leave(sender As Object, e As EventArgs)
  2198. End Sub
  2199. Private Sub txtIngresos_Leave(sender As Object, e As EventArgs)
  2200. End Sub
  2201. Private Sub txtRendimiento_TextChanged_1(sender As Object, e As EventArgs)
  2202. End Sub
  2203. Private Sub txtRendimiento_Leave_1(sender As Object, e As EventArgs)
  2204. End Sub
  2205. Private Sub Navegador_EndDrag(sender As Object, e As EventArgs) Handles Navegador.EndDrag
  2206. End Sub
  2207. Private Sub lblEmpresa_Click(sender As Object)
  2208. End Sub
  2209. Sub Acercar(sender As Object)
  2210. If TypeOf sender Is Panel Then
  2211. If Not sender.BackColor.Name = Color.White.Name Then
  2212. sender.BackColor = Color.Turquoise
  2213. End If
  2214. Else
  2215. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2216. sender.BackColor = Color.Turquoise
  2217. End If
  2218. End If
  2219. End Sub
  2220. Sub Alejar(sender As Object)
  2221. If TypeOf sender Is Panel Then
  2222. If Not sender.BackColor.Name = Color.White.Name Then
  2223. sender.BackColor = Color.WhiteSmoke
  2224. End If
  2225. Else
  2226. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2227. sender.BackColor = Color.WhiteSmoke
  2228. End If
  2229. End If
  2230. End Sub
  2231. Sub MenuSeleccionado(sender As Object)
  2232. pnlContenedor.Visible = True
  2233. For Each Items In pnlMenu.Controls
  2234. If TypeOf Items Is Panel Then
  2235. Items.BackColor = Color.WhiteSmoke
  2236. For Each Item In Items.controls
  2237. Item.BackColor = Color.WhiteSmoke
  2238. Next
  2239. End If
  2240. Next
  2241. If TypeOf sender Is Panel Then
  2242. sender.BackColor = Color.White
  2243. For Each Item In sender.controls
  2244. Item.BackColor = Color.White
  2245. Next
  2246. End If
  2247. If TypeOf sender Is Label Then
  2248. sender.BackColor = Color.White
  2249. sender.parent.BackColor = Color.White
  2250. End If
  2251. End Sub
  2252. Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs)
  2253. EventHijoAcercar(sender)
  2254. End Sub
  2255. Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs)
  2256. EventHijoAlejar(sender)
  2257. End Sub
  2258. Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs)
  2259. EventPadreAcercar(sender)
  2260. End Sub
  2261. Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs)
  2262. EventPadreAlejar(sender)
  2263. End Sub
  2264. Sub EventPadreAcercar(ByVal sender As Object)
  2265. Acercar(sender)
  2266. For Each label In sender.Controls
  2267. Acercar(label)
  2268. Next
  2269. End Sub
  2270. Sub EventPadreAlejar(ByVal sender As Object)
  2271. Alejar(sender)
  2272. For Each label In sender.Controls
  2273. Alejar(label)
  2274. Next
  2275. End Sub
  2276. Sub EventHijoAcercar(ByVal sender As Object)
  2277. Acercar(sender)
  2278. Acercar(sender.parent)
  2279. End Sub
  2280. Sub EventHijoAlejar(ByVal sender As Object)
  2281. Alejar(sender)
  2282. Alejar(sender.parent)
  2283. End Sub
  2284. Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs)
  2285. EventHijoAcercar(sender)
  2286. End Sub
  2287. Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs)
  2288. EventHijoAlejar(sender)
  2289. End Sub
  2290. Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs)
  2291. EventPadreAcercar(sender)
  2292. End Sub
  2293. Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs)
  2294. EventPadreAlejar(sender)
  2295. End Sub
  2296. Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs)
  2297. EventPadreAcercar(sender)
  2298. End Sub
  2299. Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs)
  2300. EventPadreAlejar(sender)
  2301. End Sub
  2302. Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs)
  2303. EventHijoAcercar(sender)
  2304. End Sub
  2305. Private Sub lblPais_MouseHover(sender As Object, e As EventArgs)
  2306. EventHijoAcercar(sender)
  2307. End Sub
  2308. Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs)
  2309. EventHijoAcercar(sender)
  2310. End Sub
  2311. Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs)
  2312. EventHijoAcercar(sender)
  2313. End Sub
  2314. Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs)
  2315. EventHijoAcercar(sender)
  2316. End Sub
  2317. Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs)
  2318. EventHijoAcercar(sender)
  2319. End Sub
  2320. Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs)
  2321. EventHijoAlejar(sender)
  2322. End Sub
  2323. Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs)
  2324. EventHijoAlejar(sender)
  2325. End Sub
  2326. Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs)
  2327. EventHijoAlejar(sender)
  2328. End Sub
  2329. Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs)
  2330. EventHijoAlejar(sender)
  2331. End Sub
  2332. Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs)
  2333. EventHijoAlejar(sender)
  2334. End Sub
  2335. Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs)
  2336. EventHijoAlejar(sender)
  2337. End Sub
  2338. Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs)
  2339. EventPadreAcercar(sender)
  2340. End Sub
  2341. Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs)
  2342. EventPadreAcercar(sender)
  2343. End Sub
  2344. Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs)
  2345. EventPadreAcercar(sender)
  2346. End Sub
  2347. Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs)
  2348. EventPadreAcercar(sender)
  2349. End Sub
  2350. Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs)
  2351. EventPadreAcercar(sender)
  2352. End Sub
  2353. Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs)
  2354. EventPadreAcercar(sender)
  2355. End Sub
  2356. Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs)
  2357. EventPadreAlejar(sender)
  2358. End Sub
  2359. Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs)
  2360. EventPadreAlejar(sender)
  2361. End Sub
  2362. Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs)
  2363. EventPadreAlejar(sender)
  2364. End Sub
  2365. Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs)
  2366. EventPadreAlejar(sender)
  2367. End Sub
  2368. Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs)
  2369. EventPadreAlejar(sender)
  2370. End Sub
  2371. Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs)
  2372. EventPadreAlejar(sender)
  2373. End Sub
  2374. Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs)
  2375. EventHijoAcercar(sender)
  2376. End Sub
  2377. Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs)
  2378. EventHijoAlejar(sender)
  2379. End Sub
  2380. Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter
  2381. End Sub
  2382. Private Sub lblInstrumento_Click(sender As Object, e As EventArgs)
  2383. End Sub
  2384. Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs)
  2385. EventHijoAcercar(sender)
  2386. End Sub
  2387. Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs)
  2388. EventHijoAcercar(sender)
  2389. End Sub
  2390. Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs)
  2391. EventHijoAlejar(sender)
  2392. End Sub
  2393. Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs)
  2394. EventHijoAlejar(sender)
  2395. End Sub
  2396. Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs)
  2397. EventPadreAcercar(sender)
  2398. End Sub
  2399. Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs)
  2400. EventPadreAcercar(sender)
  2401. End Sub
  2402. Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs)
  2403. EventPadreAlejar(sender)
  2404. End Sub
  2405. Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs)
  2406. EventPadreAlejar(sender)
  2407. End Sub
  2408. Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs)
  2409. EventHijoAcercar(sender)
  2410. End Sub
  2411. Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs)
  2412. EventHijoAlejar(sender)
  2413. End Sub
  2414. Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs)
  2415. EventPadreAcercar(sender)
  2416. End Sub
  2417. Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs)
  2418. EventPadreAlejar(sender)
  2419. End Sub
  2420. Private Sub lblEmpresa_Click(sender As Object, e As EventArgs)
  2421. End Sub
  2422. Sub ProcesoVisibilidad(sender As Object)
  2423. For Each Items In pnlContenedor.Controls
  2424. If TypeOf Items Is GroupBox Then
  2425. Items.visible = False
  2426. End If
  2427. Next
  2428. sender.visible = True
  2429. End Sub
  2430. Sub ConfiguracionInicial()
  2431. For Each Items In pnlContenedor.Controls
  2432. If TypeOf Items Is GroupBox Then
  2433. Dim W_Tamgrp As Double = Items.Parent.Width - 10
  2434. Dim W_Tamflp As Double = W_Tamgrp - 10
  2435. Dim H_Tamgrp As Double = Items.Parent.Height - 30
  2436. Dim H_Tamflp As Double = H_Tamgrp - 30
  2437. Items.Width = W_Tamgrp
  2438. Items.Height = H_Tamgrp
  2439. Items.Location = New Point(2, 20)
  2440. For Each flItem In Items.Controls
  2441. If TypeOf flItem Is FlowLayoutPanel Then
  2442. flItem.Width = W_Tamflp
  2443. flItem.Height = H_Tamflp - 10
  2444. End If
  2445. Next
  2446. For Each item In Items.Controls
  2447. If TypeOf item Is CheckBox Then
  2448. Dim W_Tamchk As Double = item.Width + 5
  2449. item.Width = W_Tamchk
  2450. End If
  2451. Next
  2452. End If
  2453. Next
  2454. End Sub
  2455. Private Sub pnlEmpresa_Paint(sender As Object, e As PaintEventArgs)
  2456. End Sub
  2457. Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs)
  2458. End Sub
  2459. Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs)
  2460. End Sub
  2461. Private Sub pnlOrigenFondos_Paint(sender As Object, e As PaintEventArgs)
  2462. End Sub
  2463. Private Sub lblPlazo_Click(sender As Object, e As EventArgs)
  2464. End Sub
  2465. Private Sub pnlPlazo_Paint(sender As Object, e As PaintEventArgs)
  2466. End Sub
  2467. Private Sub lblEmisor_Click(sender As Object, e As EventArgs)
  2468. End Sub
  2469. Private Sub pnlEmisor_Paint(sender As Object, e As PaintEventArgs)
  2470. End Sub
  2471. Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs)
  2472. End Sub
  2473. Private Sub pnlCalificacionRiesgo_Paint(sender As Object, e As PaintEventArgs)
  2474. End Sub
  2475. Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs)
  2476. ProcesoVisibilidad(grpEmpresas)
  2477. End Sub
  2478. Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs)
  2479. ProcesoVisibilidad(grpInstrumentos)
  2480. End Sub
  2481. Private Sub lblCalificadora_Click(sender As Object, e As EventArgs)
  2482. End Sub
  2483. Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs)
  2484. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2485. End Sub
  2486. Private Sub lblPais_Click(sender As Object, e As EventArgs)
  2487. End Sub
  2488. Private Sub pnlPais_Click(sender As Object, e As EventArgs)
  2489. ProcesoVisibilidad(grpPais)
  2490. End Sub
  2491. Private Sub lblEstado_Click(sender As Object, e As EventArgs)
  2492. End Sub
  2493. Private Sub pnlEstado_Click(sender As Object, e As EventArgs)
  2494. ProcesoVisibilidad(grpEstadoDocumento)
  2495. End Sub
  2496. Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs)
  2497. End Sub
  2498. Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs)
  2499. ProcesoVisibilidad(grpAutorizacion)
  2500. End Sub
  2501. Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs)
  2502. End Sub
  2503. Private Sub pnlTipOper_Click(sender As Object, e As EventArgs)
  2504. ProcesoVisibilidad(grpTipoOperacion)
  2505. End Sub
  2506. Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs)
  2507. End Sub
  2508. Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs)
  2509. ProcesoVisibilidad(grpTipoMercado)
  2510. End Sub
  2511. Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs)
  2512. ProcesoVisibilidad(grpOrigenFondos)
  2513. End Sub
  2514. Private Sub pnlPlazo_Click(sender As Object, e As EventArgs)
  2515. ProcesoVisibilidad(grpPlazo)
  2516. End Sub
  2517. Private Sub pnlEmisor_Click(sender As Object, e As EventArgs)
  2518. ProcesoVisibilidad(grpEmisor)
  2519. End Sub
  2520. Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs)
  2521. ProcesoVisibilidad(grpCalificacionRiesgo)
  2522. End Sub
  2523. Private Sub Button1_Click(sender As Object, e As EventArgs)
  2524. End Sub
  2525. Private Sub TbComentarios_Click(sender As Object, e As EventArgs)
  2526. End Sub
  2527. Private Sub pnlContenedor_Paint(sender As Object, e As PaintEventArgs) Handles pnlContenedor.Paint
  2528. End Sub
  2529. Private Sub mnuFilEmpresas_Click(sender As Object, e As EventArgs)
  2530. ProcesoVisibilidad(grpEmpresas)
  2531. End Sub
  2532. Private Sub mnuInstrumentos_Click(sender As Object, e As EventArgs)
  2533. CambiarPosicionPrincipal(sender)
  2534. End Sub
  2535. Private Sub mnuFilInstrumentos_Click(sender As Object, e As EventArgs)
  2536. End Sub
  2537. Private Sub mnuFilOrigenFondos_Click(sender As Object, e As EventArgs)
  2538. End Sub
  2539. Private Sub mnuOrigenFondos_Click(sender As Object, e As EventArgs)
  2540. CambiarPosicionPrincipal(sender)
  2541. End Sub
  2542. Private Sub mnuPlazo_Click(sender As Object, e As EventArgs)
  2543. CambiarPosicionPrincipal(sender)
  2544. End Sub
  2545. Private Sub mnuFilPlazo_Click(sender As Object, e As EventArgs)
  2546. End Sub
  2547. Private Sub mnuEmisor_Click(sender As Object, e As EventArgs)
  2548. CambiarPosicionPrincipal(sender)
  2549. End Sub
  2550. Private Sub mnuFilEmisor_Click(sender As Object, e As EventArgs)
  2551. End Sub
  2552. Private Sub mnuFilCalRiesgo_Click(sender As Object, e As EventArgs)
  2553. End Sub
  2554. Private Sub mnuFilCalificadora_Click(sender As Object, e As EventArgs)
  2555. End Sub
  2556. Private Sub mnuFilPais_Click(sender As Object, e As EventArgs)
  2557. End Sub
  2558. Private Sub mnuFilEstado_Click(sender As Object, e As EventArgs)
  2559. End Sub
  2560. Private Sub mnuFilAut_Click(sender As Object, e As EventArgs)
  2561. End Sub
  2562. Private Sub mnuFilTipOper_Click(sender As Object, e As EventArgs)
  2563. End Sub
  2564. Private Sub mnuFilTipMercado_Click(sender As Object, e As EventArgs)
  2565. End Sub
  2566. Private Sub mnuVerEmpresas_Click(sender As Object, e As EventArgs)
  2567. LanzarBusqueda()
  2568. End Sub
  2569. Private Sub mnuVerInstrumentos_Click(sender As Object, e As EventArgs)
  2570. LanzarBusqueda()
  2571. End Sub
  2572. Private Sub mnuVerOrigenFondos_Click(sender As Object, e As EventArgs)
  2573. LanzarBusqueda()
  2574. End Sub
  2575. Sub CambiarPosicionPrincipal(sender As Object)
  2576. Dim PosicionY = sender.Location.Y
  2577. Dim PosicionX = pnlContenedor.Location.X
  2578. pnlContenedor.Location = New Point(PosicionX, PosicionY)
  2579. End Sub
  2580. Private Sub mnuEmpresas_Click(sender As Object, e As EventArgs)
  2581. CambiarPosicionPrincipal(sender)
  2582. End Sub
  2583. Private Sub mnuCalRiesgo_Click(sender As Object, e As EventArgs)
  2584. CambiarPosicionPrincipal(sender)
  2585. End Sub
  2586. Private Sub mnuCalificadora_Click(sender As Object, e As EventArgs)
  2587. CambiarPosicionPrincipal(sender)
  2588. End Sub
  2589. Private Sub mnuPais_Click(sender As Object, e As EventArgs)
  2590. CambiarPosicionPrincipal(sender)
  2591. End Sub
  2592. Private Sub mnuEstado_Click(sender As Object, e As EventArgs)
  2593. CambiarPosicionPrincipal(sender)
  2594. End Sub
  2595. Private Sub mnuAut_Click(sender As Object, e As EventArgs)
  2596. CambiarPosicionPrincipal(sender)
  2597. End Sub
  2598. Private Sub mnuTipOper_Click(sender As Object, e As EventArgs)
  2599. CambiarPosicionPrincipal(sender)
  2600. End Sub
  2601. Private Sub mnuTipMercado_Click(sender As Object, e As EventArgs)
  2602. CambiarPosicionPrincipal(sender)
  2603. End Sub
  2604. Private Sub lblEmpresa_Click_1(sender As Object, e As EventArgs) Handles lblEmpresa.Click
  2605. ProcesoVisibilidad(grpEmpresas)
  2606. MenuSeleccionado(sender)
  2607. CambiarPosicionPrincipal(sender.parent)
  2608. End Sub
  2609. Private Sub pnlEmpresa_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlEmpresa.Paint
  2610. End Sub
  2611. Private Sub lblEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover
  2612. EventHijoAcercar(sender)
  2613. End Sub
  2614. Private Sub lblInstrumento_Click_1(sender As Object, e As EventArgs) Handles lblInstrumento.Click
  2615. ProcesoVisibilidad(grpInstrumentos)
  2616. MenuSeleccionado(sender)
  2617. CambiarPosicionPrincipal(sender.parent)
  2618. End Sub
  2619. Private Sub lblInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover
  2620. EventHijoAcercar(sender)
  2621. End Sub
  2622. Private Sub lblOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover
  2623. EventHijoAcercar(sender)
  2624. End Sub
  2625. Private Sub lblPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover
  2626. EventHijoAcercar(sender)
  2627. End Sub
  2628. Private Sub lblEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover
  2629. EventHijoAcercar(sender)
  2630. End Sub
  2631. Private Sub lblCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover
  2632. EventHijoAcercar(sender)
  2633. End Sub
  2634. Private Sub lblCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover
  2635. EventHijoAcercar(sender)
  2636. End Sub
  2637. Private Sub lblPais_MouseHover_1(sender As Object, e As EventArgs) Handles lblPais.MouseHover
  2638. EventHijoAcercar(sender)
  2639. End Sub
  2640. Private Sub lblEstado_MouseHover_1(sender As Object, e As EventArgs) Handles lblEstado.MouseHover
  2641. EventHijoAcercar(sender)
  2642. End Sub
  2643. Private Sub lblAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseHover
  2644. EventHijoAcercar(sender)
  2645. End Sub
  2646. Private Sub lblTipoOperacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover
  2647. EventHijoAcercar(sender)
  2648. End Sub
  2649. Private Sub lblTipoMercado_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover
  2650. EventHijoAcercar(sender)
  2651. End Sub
  2652. Private Sub lblEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave
  2653. EventHijoAlejar(sender)
  2654. End Sub
  2655. Private Sub lblInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave
  2656. EventHijoAlejar(sender)
  2657. End Sub
  2658. Private Sub lblOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave
  2659. EventHijoAlejar(sender)
  2660. End Sub
  2661. Private Sub lblPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave
  2662. EventHijoAlejar(sender)
  2663. End Sub
  2664. Private Sub lblEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave
  2665. EventHijoAlejar(sender)
  2666. End Sub
  2667. Private Sub lblCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave
  2668. EventHijoAlejar(sender)
  2669. End Sub
  2670. Private Sub lblCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave
  2671. EventHijoAlejar(sender)
  2672. End Sub
  2673. Private Sub lblPais_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPais.MouseLeave
  2674. EventHijoAlejar(sender)
  2675. End Sub
  2676. Private Sub lblEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave
  2677. EventHijoAlejar(sender)
  2678. End Sub
  2679. Private Sub lblAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseLeave
  2680. EventHijoAlejar(sender)
  2681. End Sub
  2682. Private Sub lblTipoOperacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave
  2683. EventHijoAlejar(sender)
  2684. End Sub
  2685. Private Sub lblTipoMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave
  2686. EventHijoAlejar(sender)
  2687. End Sub
  2688. Private Sub pnlEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover
  2689. EventPadreAcercar(sender)
  2690. End Sub
  2691. Private Sub pnlInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover
  2692. EventPadreAcercar(sender)
  2693. End Sub
  2694. Private Sub pnlOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover
  2695. EventPadreAcercar(sender)
  2696. End Sub
  2697. Private Sub pnlPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover
  2698. EventPadreAcercar(sender)
  2699. End Sub
  2700. Private Sub pnlEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover
  2701. EventPadreAcercar(sender)
  2702. End Sub
  2703. Private Sub pnlCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover
  2704. EventPadreAcercar(sender)
  2705. End Sub
  2706. Private Sub pnlCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover
  2707. EventPadreAcercar(sender)
  2708. End Sub
  2709. Private Sub pnlPais_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPais.MouseHover
  2710. EventPadreAcercar(sender)
  2711. End Sub
  2712. Private Sub pnlEstado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover
  2713. EventPadreAcercar(sender)
  2714. End Sub
  2715. Private Sub pnlAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseHover
  2716. EventPadreAcercar(sender)
  2717. End Sub
  2718. Private Sub pnlTipOper_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover
  2719. EventPadreAcercar(sender)
  2720. End Sub
  2721. Private Sub pnlTipMercado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover
  2722. EventPadreAcercar(sender)
  2723. End Sub
  2724. Private Sub pnlEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave
  2725. EventPadreAlejar(sender)
  2726. End Sub
  2727. Private Sub pnlInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave
  2728. EventPadreAlejar(sender)
  2729. End Sub
  2730. Private Sub pnlOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave
  2731. EventPadreAlejar(sender)
  2732. End Sub
  2733. Private Sub pnlPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave
  2734. EventPadreAlejar(sender)
  2735. End Sub
  2736. Private Sub pnlEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave
  2737. EventPadreAlejar(sender)
  2738. End Sub
  2739. Private Sub pnlCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave
  2740. EventPadreAlejar(sender)
  2741. End Sub
  2742. Private Sub pnlCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave
  2743. EventPadreAlejar(sender)
  2744. End Sub
  2745. Private Sub pnlPais_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave
  2746. EventPadreAlejar(sender)
  2747. End Sub
  2748. Private Sub pnlEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave
  2749. EventPadreAlejar(sender)
  2750. End Sub
  2751. Private Sub pnlAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseLeave
  2752. EventPadreAlejar(sender)
  2753. End Sub
  2754. Private Sub pnlTipOper_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave
  2755. EventPadreAlejar(sender)
  2756. End Sub
  2757. Private Sub pnlTipMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave
  2758. EventPadreAlejar(sender)
  2759. End Sub
  2760. Private Sub pnlEmpresa_Click_1(sender As Object, e As EventArgs) Handles pnlEmpresa.Click
  2761. ProcesoVisibilidad(grpEmpresas)
  2762. MenuSeleccionado(sender)
  2763. CambiarPosicionPrincipal(sender)
  2764. End Sub
  2765. Private Sub pnlInstrumento_Click_1(sender As Object, e As EventArgs) Handles pnlInstrumento.Click
  2766. ProcesoVisibilidad(grpInstrumentos)
  2767. MenuSeleccionado(sender)
  2768. CambiarPosicionPrincipal(sender)
  2769. End Sub
  2770. Private Sub lblOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click
  2771. ProcesoVisibilidad(grpOrigenFondos)
  2772. MenuSeleccionado(sender)
  2773. CambiarPosicionPrincipal(sender.parent)
  2774. End Sub
  2775. Private Sub pnlOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click
  2776. ProcesoVisibilidad(grpOrigenFondos)
  2777. MenuSeleccionado(sender)
  2778. CambiarPosicionPrincipal(sender)
  2779. End Sub
  2780. Private Sub lblPlazo_Click_1(sender As Object, e As EventArgs) Handles lblPlazo.Click
  2781. ProcesoVisibilidad(grpPlazo)
  2782. MenuSeleccionado(sender)
  2783. CambiarPosicionPrincipal(sender.parent)
  2784. End Sub
  2785. Private Sub pnlPlazo_Click_1(sender As Object, e As EventArgs) Handles pnlPlazo.Click
  2786. ProcesoVisibilidad(grpPlazo)
  2787. MenuSeleccionado(sender)
  2788. CambiarPosicionPrincipal(sender)
  2789. End Sub
  2790. Private Sub lblEmisor_Click_1(sender As Object, e As EventArgs) Handles lblEmisor.Click
  2791. ProcesoVisibilidad(grpEmisor)
  2792. MenuSeleccionado(sender)
  2793. CambiarPosicionPrincipal(sender.parent)
  2794. End Sub
  2795. Private Sub pnlEmisor_Click_1(sender As Object, e As EventArgs) Handles pnlEmisor.Click
  2796. ProcesoVisibilidad(grpEmisor)
  2797. MenuSeleccionado(sender)
  2798. CambiarPosicionPrincipal(sender)
  2799. End Sub
  2800. Private Sub lblCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click
  2801. ProcesoVisibilidad(grpCalificacionRiesgo)
  2802. MenuSeleccionado(sender)
  2803. CambiarPosicionPrincipal(sender.parent)
  2804. End Sub
  2805. Private Sub pnlCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click
  2806. ProcesoVisibilidad(grpCalificacionRiesgo)
  2807. MenuSeleccionado(sender)
  2808. CambiarPosicionPrincipal(sender)
  2809. End Sub
  2810. Private Sub lblCalificadora_Click_1(sender As Object, e As EventArgs) Handles lblCalificadora.Click
  2811. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2812. MenuSeleccionado(sender)
  2813. CambiarPosicionPrincipal(sender.parent)
  2814. End Sub
  2815. Private Sub pnlCalificadora_Click_1(sender As Object, e As EventArgs) Handles pnlCalificadora.Click
  2816. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2817. MenuSeleccionado(sender)
  2818. CambiarPosicionPrincipal(sender)
  2819. End Sub
  2820. Private Sub lblPais_Click_1(sender As Object, e As EventArgs) Handles lblPais.Click
  2821. ProcesoVisibilidad(grpPais)
  2822. MenuSeleccionado(sender)
  2823. CambiarPosicionPrincipal(sender.parent)
  2824. End Sub
  2825. Private Sub pnlPais_Click_1(sender As Object, e As EventArgs) Handles pnlPais.Click
  2826. ProcesoVisibilidad(grpPais)
  2827. MenuSeleccionado(sender)
  2828. CambiarPosicionPrincipal(sender)
  2829. End Sub
  2830. Private Sub lblEstado_Click_1(sender As Object, e As EventArgs) Handles lblEstado.Click
  2831. ProcesoVisibilidad(grpEstadoDocumento)
  2832. MenuSeleccionado(sender)
  2833. CambiarPosicionPrincipal(sender.parent)
  2834. End Sub
  2835. Private Sub pnlEstado_Click_1(sender As Object, e As EventArgs) Handles pnlEstado.Click
  2836. ProcesoVisibilidad(grpEstadoDocumento)
  2837. MenuSeleccionado(sender)
  2838. CambiarPosicionPrincipal(sender)
  2839. End Sub
  2840. Private Sub lblAutorizacion_Click_1(sender As Object, e As EventArgs) Handles lblAutorizacion.Click
  2841. ProcesoVisibilidad(grpAutorizacion)
  2842. MenuSeleccionado(sender)
  2843. CambiarPosicionPrincipal(sender.parent)
  2844. End Sub
  2845. Private Sub pnlAutorizacion_Click_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.Click
  2846. ProcesoVisibilidad(grpAutorizacion)
  2847. MenuSeleccionado(sender)
  2848. CambiarPosicionPrincipal(sender)
  2849. End Sub
  2850. Private Sub lblTipoOperacion_Click_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click
  2851. ProcesoVisibilidad(grpTipoOperacion)
  2852. MenuSeleccionado(sender)
  2853. CambiarPosicionPrincipal(sender.parent)
  2854. End Sub
  2855. Private Sub pnlTipOper_Click_1(sender As Object, e As EventArgs) Handles pnlTipOper.Click
  2856. ProcesoVisibilidad(grpTipoOperacion)
  2857. MenuSeleccionado(sender)
  2858. CambiarPosicionPrincipal(sender)
  2859. End Sub
  2860. Private Sub lblTipoMercado_Click_1(sender As Object, e As EventArgs) Handles lblTipoMercado.Click
  2861. ProcesoVisibilidad(grpTipoMercado)
  2862. MenuSeleccionado(sender)
  2863. CambiarPosicionPrincipal(sender.parent)
  2864. End Sub
  2865. Private Sub pnlTipMercado_Click_1(sender As Object, e As EventArgs) Handles pnlTipMercado.Click
  2866. ProcesoVisibilidad(grpTipoMercado)
  2867. MenuSeleccionado(sender)
  2868. CambiarPosicionPrincipal(sender)
  2869. End Sub
  2870. Private Sub pnlOrigenFondos_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlOrigenFondos.Paint
  2871. End Sub
  2872. Private Sub pnlTipMercado_Paint(sender As Object, e As PaintEventArgs) Handles pnlTipMercado.Paint
  2873. End Sub
  2874. Sub CargarTabla()
  2875. frmBuscar = New frmBuscarDeLista(1)
  2876. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  2877. DiccionarioColecciones = GuardarColecciones()
  2878. Dim Data As New DataTable
  2879. Data = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado")
  2880. GenerarFormato(Data)
  2881. For Each Item In pnlCargaDatos.Controls
  2882. If TypeOf Item Is Form Then
  2883. Item.dispose
  2884. End If
  2885. Next
  2886. frmBuscar.dgvBuscarDeLista.DataSource = Data
  2887. frmBuscar.Dock = DockStyle.Fill
  2888. frmBuscar.TopLevel = False
  2889. frmBuscar.Parent = pnlCargaDatos
  2890. frmBuscar.Show()
  2891. End Sub
  2892. Sub GenerarFormato(ByRef Data As DataTable)
  2893. For Each Row As DataRow In Data.Rows
  2894. Dim CodigoPropuesta As String = String.Empty
  2895. Dim Estado As String = String.Empty
  2896. Dim Asunto As String = String.Empty
  2897. Dim Empresa As String = String.Empty
  2898. Dim InstrumentoFinanciero As String = String.Empty
  2899. Dim Emisor As String = String.Empty
  2900. Dim CalificacionRiesgo As String = String.Empty
  2901. Dim EmpresaCalificadora As String = String.Empty
  2902. Dim OrigenFondos As String = String.Empty
  2903. Dim Comentarios As String = String.Empty
  2904. Dim Justificaciones As String = String.Empty
  2905. Dim TipoOperacion As String = String.Empty
  2906. Dim Base As String = String.Empty
  2907. Dim Monto As String = String.Empty
  2908. Dim Precio As String = String.Empty
  2909. Dim Rendimiento As String = String.Empty
  2910. Dim CantidadPlazo As String = String.Empty
  2911. Dim TipoPlazo As String = String.Empty
  2912. Dim Ingresos As String = String.Empty
  2913. Dim FechaCreación As String = String.Empty
  2914. Dim EstadoAutorización As String = String.Empty
  2915. Dim TipoMercado As String = String.Empty
  2916. Dim Pais As String = String.Empty
  2917. CodigoPropuesta = Row("Código de Propuesta").ToString
  2918. Estado = Row("Estado").ToString
  2919. Asunto = Row("Asunto").ToString
  2920. Empresa = Row("Empresa").ToString
  2921. InstrumentoFinanciero = Row("Instrumento Financiero").ToString
  2922. Emisor = Row("Emisor").ToString
  2923. CalificacionRiesgo = Row("Calificación de Riesgo").ToString
  2924. EmpresaCalificadora = Row("Empresa Calificadora").ToString
  2925. OrigenFondos = Row("Origen de Fondos").ToString
  2926. Comentarios = Row("Comentarios").ToString
  2927. Justificaciones = Row("Justificaciones").ToString
  2928. TipoOperacion = Row("Tipo de Operacion").ToString
  2929. Base = Row("Base de Calculo").ToString
  2930. Monto = Row("Monto de Inversion").ToString
  2931. Precio = Row("Precio").ToString
  2932. Rendimiento = Row("Rendimiento").ToString
  2933. CantidadPlazo = Row("Cantidad en Plazo").ToString
  2934. TipoPlazo = Row("Tipo de Plazo").ToString
  2935. Ingresos = Row("Ingresos").ToString
  2936. FechaCreación = Row("Fecha de Creación").ToString
  2937. EstadoAutorización = Row("Estado de Autorización").ToString
  2938. TipoMercado = Row("Tipo de Mercado").ToString
  2939. Pais = Row("Pais").ToString
  2940. If String.IsNullOrEmpty(CodigoPropuesta) Then
  2941. CodigoPropuesta = " ---- ---- ---- ---- ----"
  2942. End If
  2943. If String.IsNullOrEmpty(Estado) Then
  2944. Estado = " ---- ---- ---- ---- ----"
  2945. End If
  2946. If String.IsNullOrEmpty(Asunto) Then
  2947. Asunto = " ---- ---- ---- ---- ----"
  2948. End If
  2949. If String.IsNullOrEmpty(Empresa) Then
  2950. Empresa = " ---- ---- ---- ---- ----"
  2951. End If
  2952. If String.IsNullOrEmpty(InstrumentoFinanciero) Then
  2953. InstrumentoFinanciero = " ---- ---- ---- ---- ----"
  2954. End If
  2955. If String.IsNullOrEmpty(Emisor) Then
  2956. Emisor = " ---- ---- ---- ---- ----"
  2957. End If
  2958. If String.IsNullOrEmpty(CalificacionRiesgo) Then
  2959. CalificacionRiesgo = " ---- ---- ---- ---- ----"
  2960. End If
  2961. If String.IsNullOrEmpty(EmpresaCalificadora) Then
  2962. EmpresaCalificadora = " ---- ---- ---- ---- ----"
  2963. End If
  2964. If String.IsNullOrEmpty(OrigenFondos) Then
  2965. OrigenFondos = " ---- ---- ---- ---- ----"
  2966. End If
  2967. If String.IsNullOrEmpty(Comentarios) Then
  2968. Comentarios = " ---- ---- ---- ---- ----"
  2969. End If
  2970. If String.IsNullOrEmpty(Justificaciones) Then
  2971. Justificaciones = " ---- ---- ---- ---- ----"
  2972. End If
  2973. If String.IsNullOrEmpty(TipoOperacion) Then
  2974. TipoOperacion = " ---- ---- ---- ---- ----"
  2975. End If
  2976. If String.IsNullOrEmpty(Base) Then
  2977. Base = " ---- ---- ---- ---- ----"
  2978. End If
  2979. If String.IsNullOrEmpty(Monto) Then
  2980. Monto = " ---- ---- ---- ---- ----"
  2981. End If
  2982. If String.IsNullOrEmpty(Precio) Then
  2983. Precio = " ---- ---- ---- ---- ----"
  2984. End If
  2985. If String.IsNullOrEmpty(Rendimiento) Then
  2986. Rendimiento = " ---- ---- ---- ---- ----"
  2987. End If
  2988. If String.IsNullOrEmpty(CantidadPlazo) Then
  2989. CantidadPlazo = " ---- ---- ---- ---- ----"
  2990. End If
  2991. If String.IsNullOrEmpty(TipoPlazo) Then
  2992. TipoPlazo = " ---- ---- ---- ---- ----"
  2993. End If
  2994. If String.IsNullOrEmpty(Ingresos) Then
  2995. Ingresos = " ---- ---- ---- ---- ----"
  2996. End If
  2997. If String.IsNullOrEmpty(FechaCreación) Then
  2998. FechaCreación = " ---- ---- ---- ---- ----"
  2999. End If
  3000. If String.IsNullOrEmpty(EstadoAutorización) Then
  3001. EstadoAutorización = " ---- ---- ---- ---- ----"
  3002. End If
  3003. If String.IsNullOrEmpty(TipoMercado) Then
  3004. TipoMercado = " ---- ---- ---- ---- ----"
  3005. End If
  3006. If String.IsNullOrEmpty(Pais) Then
  3007. Pais = " ---- ---- ---- ---- ----"
  3008. End If
  3009. Row("Código de Propuesta") = CodigoPropuesta
  3010. Row("Estado") = Estado
  3011. Row("Asunto") = Asunto
  3012. Row("Empresa") = Empresa
  3013. Row("Instrumento Financiero") = InstrumentoFinanciero
  3014. Row("Emisor") = Emisor
  3015. Row("Calificación de Riesgo") = CalificacionRiesgo
  3016. Row("Empresa Calificadora") = EmpresaCalificadora
  3017. Row("Origen de Fondos") = OrigenFondos
  3018. Row("Comentarios") = Comentarios
  3019. Row("Justificaciones") = Justificaciones
  3020. Row("Tipo de Operacion") = TipoOperacion
  3021. Row("Base de Calculo") = Base
  3022. Row("Monto de Inversion") = Monto
  3023. Row("Precio") = Precio
  3024. Row("Rendimiento") = Rendimiento
  3025. Row("Cantidad en Plazo") = CantidadPlazo
  3026. Row("Tipo de Plazo") = TipoPlazo
  3027. Row("Ingresos") = Ingresos
  3028. Row("Fecha de Creación") = FechaCreación
  3029. Row("Estado de Autorización") = EstadoAutorización
  3030. Row("Tipo de Mercado") = TipoMercado
  3031. Row("Pais") = Pais
  3032. Next
  3033. End Sub
  3034. Private Sub pnlPie_Paint(sender As Object, e As PaintEventArgs) Handles pnlPie.Paint
  3035. End Sub
  3036. Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles btnAceptar.Click
  3037. eventoCargar()
  3038. End Sub
  3039. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
  3040. eventoCancelar()
  3041. End Sub
  3042. Private Sub txtBuscar_TextChanged(sender As Object, e As EventArgs) Handles txtBuscar.TextChanged
  3043. 'Filtrar(sender)
  3044. Filtrar(sender)
  3045. End Sub
  3046. Sub Filtrar(sender As Object)
  3047. Dim TextoIngresado As String = sender.text.ToString.ToLower
  3048. Dim CajaActiva As New GroupBox
  3049. Dim CajaInterna As New FlowLayoutPanel
  3050. For Each Item In pnlContenedor.Controls
  3051. If TypeOf Item Is GroupBox Then
  3052. If Item.visible Then
  3053. CajaActiva = Item
  3054. Exit For
  3055. End If
  3056. End If
  3057. Next
  3058. For Each Item In CajaActiva.Controls
  3059. If TypeOf Item Is FlowLayoutPanel Then
  3060. CajaInterna = Item
  3061. Exit For
  3062. End If
  3063. Next
  3064. For Each Item In CajaInterna.Controls
  3065. If TypeOf Item Is CheckBox Then
  3066. If Item.text.ToString.ToLower.Contains(TextoIngresado) Then
  3067. If Not Item.visible Then
  3068. Item.visible = True
  3069. End If
  3070. Else
  3071. If Item.visible Then
  3072. Item.visible = False
  3073. End If
  3074. End If
  3075. End If
  3076. Next
  3077. End Sub
  3078. Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
  3079. End Sub
  3080. Sub ModoPropuesta()
  3081. Dim TbNM = TbIngresarModificar
  3082. Dim VTbBuscar = TbBuscar
  3083. If Modo = "NM" Or (TipoTransaccion = "B" And Modo = "NM") Then
  3084. If Not VTbBuscar.Parent Is Nothing Then
  3085. TbBuscar.Parent = Nothing
  3086. End If
  3087. If (TbNM.Parent Is Nothing) Then
  3088. TbNM.Parent = TabCampos
  3089. End If
  3090. ElseIf Modo = "B" Then
  3091. If Not TbNM.Parent Is Nothing Then
  3092. TbNM.Parent = Nothing
  3093. End If
  3094. If (VTbBuscar.Parent Is Nothing) Then
  3095. VTbBuscar.Parent = TabCampos
  3096. End If
  3097. End If
  3098. End Sub
  3099. Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles navRecorrer.Click
  3100. DeshabilitarControles()
  3101. PreBusqueda()
  3102. Modo = "NM"
  3103. ModoPropuesta()
  3104. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  3105. PIN0BindingSource4.ResumeBinding()
  3106. btnAccion.Text = "Aceptar"
  3107. End Sub
  3108. Public Sub CargarDatosContenedor()
  3109. If MsgBox("Desea ver esta Propuesta de Inversión", MsgBoxStyle.OkCancel) = DialogResult.OK Then
  3110. Dim Id As Integer = frmBuscar.dgvBuscarDeLista.CurrentRow.Cells("Id").Value
  3111. If Not Id = Nothing Then
  3112. Modo = "NM"
  3113. TipoTransaccion = "B"
  3114. ModoPropuesta()
  3115. DeshabilitarControles()
  3116. PreBusqueda()
  3117. CargarPropuesta(Id)
  3118. LlamadaDesdeBusqueda = True
  3119. End If
  3120. End If
  3121. End Sub
  3122. Private Sub txtMontoInversion_KeyPress(sender As Object, e As KeyPressEventArgs)
  3123. ValidarEntradaPrecionada(sender, e)
  3124. End Sub
  3125. Sub ValidarEntradaPrecionada(sender As Object, e As KeyPressEventArgs)
  3126. If String.IsNullOrEmpty(sender.Text) Then
  3127. If e.KeyChar = "." Then
  3128. sender.Text = "0"
  3129. Exit Sub
  3130. End If
  3131. End If
  3132. If (Not sender.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  3133. Operaciones.ValidarEntrada(sender, e, True)
  3134. Else
  3135. Operaciones.ValidarEntrada(sender, e, False)
  3136. End If
  3137. End Sub
  3138. Sub ValidarEntradaLevantar(ByRef sender As Object)
  3139. If sender.Text = "." Then
  3140. sender.Text = ".0"
  3141. End If
  3142. End Sub
  3143. Private Sub txtMontoInversion_KeyUp(sender As Object, e As KeyEventArgs)
  3144. ValidarEntradaLevantar(sender)
  3145. End Sub
  3146. Private Sub txtIngresos_KeyPress(sender As Object, e As KeyPressEventArgs)
  3147. ValidarEntradaPrecionada(sender, e)
  3148. End Sub
  3149. Private Sub txtIngresos_KeyUp(sender As Object, e As KeyEventArgs)
  3150. ValidarEntradaLevantar(sender)
  3151. End Sub
  3152. Private Sub txtPrecio_KeyPress(sender As Object, e As KeyPressEventArgs)
  3153. ValidarEntradaPrecionada(sender, e)
  3154. End Sub
  3155. Private Sub txtPrecio_KeyUp(sender As Object, e As KeyEventArgs)
  3156. ValidarEntradaLevantar(sender)
  3157. End Sub
  3158. Private Sub txtRendimiento_KeyPress(sender As Object, e As KeyPressEventArgs)
  3159. ValidarEntradaPrecionada(sender, e)
  3160. End Sub
  3161. Private Sub txtRendimiento_KeyUp(sender As Object, e As KeyEventArgs)
  3162. ValidarEntradaLevantar(sender)
  3163. End Sub
  3164. Private Sub txtPlazoNumero_KeyPress(sender As Object, e As KeyPressEventArgs)
  3165. ValidarEntradaPrecionada(sender, e)
  3166. End Sub
  3167. Private Sub txtPlazoNumero_KeyUp(sender As Object, e As KeyEventArgs)
  3168. ValidarEntradaLevantar(sender)
  3169. End Sub
  3170. Private Sub btnRequisicionDePago_Click(sender As Object, e As EventArgs)
  3171. End Sub
  3172. Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles navVistaPrevia.Click
  3173. Impresion(True)
  3174. End Sub
  3175. Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles navImprimir.Click
  3176. Impresion(False)
  3177. End Sub
  3178. Private Sub Impresion(ByVal pVistaPreliminar As Boolean)
  3179. Dim General As New DAOGeneral
  3180. Dim Codigo As String = txtCodigoInversion.Text
  3181. Dim Id = General.IdPropuesta(Codigo)
  3182. IdPIN = Id
  3183. If Not IdPIN = Nothing Then
  3184. Dim oImprimir As New frmImprimir("PrintPropuestaDeInversion.rpt", IdPIN, True)
  3185. oImprimir.NombreRPT = "PrintPropuestaDeInversion.rpt"
  3186. oImprimir.IdDocumento = IdPIN
  3187. If pVistaPreliminar = True Then
  3188. oImprimir.ShowDialog()
  3189. Else
  3190. oImprimir.VistaPrevia = False
  3191. oImprimir.CargarRPT()
  3192. End If
  3193. End If
  3194. End Sub
  3195. Private Sub txtNombre_TextChanged(sender As Object, e As EventArgs) Handles txtNombre.TextChanged
  3196. ControlNombre()
  3197. End Sub
  3198. Private Sub cboRenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboRenta.SelectedIndexChanged
  3199. ControlTipoRenta()
  3200. End Sub
  3201. Private Sub cboPaises_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged
  3202. ControlPais()
  3203. End Sub
  3204. Private Sub grbInversión_Enter(sender As Object, e As EventArgs) Handles grbInversión.Enter
  3205. End Sub
  3206. Private Sub btnCambiarEstado_Click(sender As Object, e As EventArgs) Handles btnCambiarRev.Click
  3207. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3208. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3209. If ExisteInstrumento Then
  3210. ModificarEstado("V")
  3211. Else
  3212. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3213. End If
  3214. End Sub
  3215. Sub ModificarEstado(Estado As String)
  3216. Dim Codigo = txtCodigoInversion.Text
  3217. If Not String.IsNullOrEmpty(Codigo) Then
  3218. Dim posicion = PIN0BindingSource4.Position
  3219. ActivarSuspen = True
  3220. Modo = "NM"
  3221. btnAccion.Text = "Actualizar"
  3222. PrepararModificacion()
  3223. ModoPropuesta()
  3224. DeshabilitarControles()
  3225. CambiarEstadoAut(Estado)
  3226. TipoTransaccion = "A"
  3227. ControlCambio()
  3228. End If
  3229. End Sub
  3230. Private Sub btnCambiarInter_Click(sender As Object, e As EventArgs)
  3231. ModificarEstado("I")
  3232. End Sub
  3233. Private Sub btnCambiarApro_Click(sender As Object, e As EventArgs) Handles btnCambiarApro.Click
  3234. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3235. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3236. If ExisteInstrumento Then
  3237. ModificarEstado("A")
  3238. Else
  3239. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3240. End If
  3241. End Sub
  3242. Private Sub btnCambiarRec_Click(sender As Object, e As EventArgs) Handles btnCambiarRec.Click
  3243. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3244. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3245. If ExisteInstrumento Then
  3246. ModificarEstado("R")
  3247. Else
  3248. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3249. End If
  3250. End Sub
  3251. Sub EstadoControladoresNAV()
  3252. Dim Estado As String = String.Empty
  3253. If cboAutorizacion.SelectedValue = "P" Then
  3254. Estado = "P"
  3255. ElseIf cboAutorizacion.SelectedValue = "V" Then
  3256. Estado = "V"
  3257. ElseIf cboAutorizacion.SelectedValue = "A" Then
  3258. Estado = "A"
  3259. ElseIf cboAutorizacion.SelectedValue = "R" Then
  3260. Estado = "R"
  3261. End If
  3262. If Estado = "P" Or Estado = "A" Or Estado = "R" Then
  3263. navNuevo.Enabled = True
  3264. navModificar.Enabled = False
  3265. navEliminar.Enabled = False
  3266. navBuscar.Enabled = True
  3267. navRecorrer.Enabled = True
  3268. navVistaPrevia.Enabled = True
  3269. navImprimir.Enabled = True
  3270. ElseIf Estado = "V" Then
  3271. navNuevo.Enabled = True
  3272. navModificar.Enabled = True
  3273. navEliminar.Enabled = False
  3274. navBuscar.Enabled = True
  3275. navRecorrer.Enabled = True
  3276. navVistaPrevia.Enabled = True
  3277. navImprimir.Enabled = True
  3278. End If
  3279. End Sub
  3280. Private Sub txtCodigoCompra_TextChanged(sender As Object, e As EventArgs)
  3281. End Sub
  3282. Private Sub pnlCambiarRev_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarRev.Paint
  3283. End Sub
  3284. Private Sub pnlCambiarApro_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarApro.Paint
  3285. End Sub
  3286. Private Sub TabCampos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged
  3287. CargarTabla()
  3288. End Sub
  3289. Sub LimpiarVariablesTraspaso()
  3290. Variables.RetMonto = 0
  3291. Variables.RetPrecio = 0
  3292. Variables.RetRendimiento = 0
  3293. Variables.RetIngresosEsp = 0
  3294. Variables.RetUnidadesAcciones = 0
  3295. Variables.RetUnidadesContratosFuturos = 0
  3296. Variables.RetCantidadContratosFuturos = 0
  3297. Variables.RetCuotaParticipacionFINV = 0
  3298. Variables.RetValorParticipacionFINV = 0
  3299. Variables.TipoTransaccionCompraVenta = "NA"
  3300. Variables.RetCodigoInversionExiste = False
  3301. End Sub
  3302. End Class