frmPIN.vb 145 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794
  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. If ColeccionLETE.Count > 0 Then
  980. oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN")
  981. ColeccionLETE.Clear()
  982. End If
  983. End If
  984. If Instrumento.IndexOf("CETE") > -1 Then
  985. Dim oDAOLetes As New LETESDAO
  986. Dim ColeccionLETE As Collection = Variables.ColeccionLETE
  987. If ColeccionLETE.Count > 0 Then
  988. oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE")
  989. ColeccionLETE.Clear()
  990. End If
  991. End If
  992. If Instrumento.IndexOf("ACC") > -1 Then
  993. Dim oDAOACC As New AccionesDAO
  994. Dim ColeccionACC As Collection = Variables.ColeccionACC
  995. If ColeccionACC.Count > 0 Then
  996. oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC)
  997. ColeccionACC.Clear()
  998. FormAcciones.Dispose()
  999. End If
  1000. End If
  1001. If Instrumento.IndexOf("CINV") > -1 Then
  1002. Dim oDAOCINV As New CertificadosDeInversionDAO
  1003. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1004. If ColeccionCINV.Count > 0 Then
  1005. oDAOCINV.Nuevo(ColeccionCINV, "CINV")
  1006. ColeccionCINV.Clear()
  1007. End If
  1008. End If
  1009. If Instrumento.IndexOf("BONO") > -1 Then
  1010. Dim oDAOCINV As New CertificadosDeInversionDAO
  1011. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1012. If ColeccionCINV.Count > 0 Then
  1013. oDAOCINV.Nuevo(ColeccionCINV, "BONO")
  1014. ColeccionCINV.Clear()
  1015. End If
  1016. End If
  1017. If Instrumento.IndexOf("EURB0") > -1 Then
  1018. Dim oDAOCINV As New CertificadosDeInversionDAO
  1019. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1020. If ColeccionCINV.Count > 0 Then
  1021. oDAOCINV.Nuevo(ColeccionCINV, "EURB")
  1022. ColeccionCINV.Clear()
  1023. End If
  1024. End If
  1025. If Instrumento.IndexOf("TIT") > -1 Then
  1026. Dim oDAOCINV As New CertificadosDeInversionDAO
  1027. Dim ColeccionCINV As Collection = Variables.ColeccionCINV
  1028. If ColeccionCINV.Count > 0 Then
  1029. oDAOCINV.Nuevo(ColeccionCINV, "TIT")
  1030. ColeccionCINV.Clear()
  1031. End If
  1032. End If
  1033. If Instrumento.IndexOf("DAP") > -1 Then
  1034. Dim oDAODAP As New DepositosAPlazoDAO
  1035. Dim ColeccionDAP As Collection = Variables.ColeccionDAP
  1036. Dim diccionario = Variables.ColeccionDAPDi
  1037. If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then
  1038. oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo)
  1039. ColeccionDAP.Clear()
  1040. diccionario = Nothing
  1041. End If
  1042. End If
  1043. If Instrumento.IndexOf("NEST") > -1 Then
  1044. Dim oDAONEST As New DAONotaEstructurada
  1045. Dim ColeccionDAP As Collection = Variables.ColeccionNEST
  1046. Dim diccionario = Variables.ColeccionNESTDi
  1047. If ColeccionNEST.Count > 0 And Not diccionario Is Nothing Then
  1048. oDAONEST.NuevoDato(ColeccionNEST, diccionario, Variables.Codigo)
  1049. ColeccionNEST.Clear()
  1050. diccionario = Nothing
  1051. End If
  1052. End If
  1053. If Instrumento.IndexOf("FINV") > -1 Then
  1054. Dim oDAOFINV As New FondoInversionDAO
  1055. Dim ColeccionFINV As Collection = Variables.ColeccionFINV
  1056. Dim diccionario = Variables.ColeccionFINVDi
  1057. If ColeccionFINV.Count > 0 And Not diccionario Is Nothing Then
  1058. oDAOFINV.ProcesoDatos(ColeccionFINV, Variables.Codigo, diccionario, "Nuevo")
  1059. ColeccionFINV.Clear()
  1060. diccionario = Nothing
  1061. End If
  1062. End If
  1063. If Instrumento.IndexOf("FUTU") > -1 Then
  1064. Dim oDAOFUTU As New FuturosDAO
  1065. Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU
  1066. If ColeccionFUTU.Count > 0 Then
  1067. oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU)
  1068. ColeccionFUTU.Clear()
  1069. End If
  1070. End If
  1071. If Instrumento.IndexOf("OPC") > -1 Then
  1072. Dim oDAOOPC As New FuturosDAO
  1073. Dim ColeccionOPC As Collection = Variables.ColeccionFUTU
  1074. If ColeccionOPC.Count > 0 Then
  1075. oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC)
  1076. ColeccionOPC.Clear()
  1077. End If
  1078. End If
  1079. If Instrumento.IndexOf("PEMP") > -1 Then
  1080. Dim oDAOPEMP As New PrestamoEmpresarialDAO
  1081. Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP
  1082. Dim diccionario = Variables.ColeccionPEMPDi
  1083. If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then
  1084. oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo")
  1085. ColeccionPEMP.Clear()
  1086. diccionario = Nothing
  1087. End If
  1088. End If
  1089. If Instrumento.IndexOf("PPER") > -1 Then
  1090. Dim oDAOPPER As New PrestamoPersonalDAO
  1091. Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR
  1092. Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE
  1093. Dim diccionario = Variables.ColeccionPPERAMORTDi
  1094. If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then
  1095. oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo")
  1096. ColeccionPPERDEUDOR.Clear()
  1097. ColeccionPPERDETALLE.Clear()
  1098. diccionario = Nothing
  1099. End If
  1100. End If
  1101. If Instrumento.IndexOf("REPOVENTA") > -1 Then
  1102. Dim oDAOREPO As New ReportosDAO
  1103. Dim diccionario = Variables.ColeccionREPO
  1104. If Not diccionario Is Nothing Then
  1105. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA")
  1106. diccionario = Nothing
  1107. End If
  1108. ElseIf Instrumento.IndexOf("REPO") > -1 And Not Instrumento.IndexOf("REPOVENTA") > -1 Then
  1109. Dim oDAOREPO As New ReportosDAO
  1110. Dim diccionario = Variables.ColeccionREPO
  1111. If Not diccionario Is Nothing Then
  1112. oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0")
  1113. diccionario = Nothing
  1114. End If
  1115. End If
  1116. End If
  1117. End Sub
  1118. Function GuardarColecciones()
  1119. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1120. DiccionarioColecciones.Add("Empresa", Col_Empresas)
  1121. DiccionarioColecciones.Add("Emisor", Col_Emisor)
  1122. DiccionarioColecciones.Add("EstDocumento", Col_EstDocumento)
  1123. DiccionarioColecciones.Add("Instrumento", Col_Instrumento)
  1124. DiccionarioColecciones.Add("CalRiesgo", Col_CalRiesgo)
  1125. DiccionarioColecciones.Add("TipOperacion", Col_TipOperacion)
  1126. DiccionarioColecciones.Add("OriFond", Col_OriFond)
  1127. DiccionarioColecciones.Add("CalERiesgo", Col_CalERiesgo)
  1128. DiccionarioColecciones.Add("Aut", Col_Aut)
  1129. DiccionarioColecciones.Add("Plazo", Col_Plazo)
  1130. DiccionarioColecciones.Add("Pais", Col_Pais)
  1131. DiccionarioColecciones.Add("TipMercado", Col_TipMercado)
  1132. Return DiccionarioColecciones
  1133. End Function
  1134. Private Sub LanzarBusqueda()
  1135. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  1136. DiccionarioColecciones = GuardarColecciones()
  1137. frmBuscarDeLista.dgvBuscarDeLista.DataSource = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado")
  1138. If frmBuscarDeLista.ShowDialog = DialogResult.OK Then
  1139. If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then
  1140. CargarPropuesta(frmBuscarDeLista.CodigoPrincipal)
  1141. End If
  1142. End If
  1143. End Sub
  1144. Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs)
  1145. End Sub
  1146. Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs)
  1147. End Sub
  1148. Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
  1149. End Sub
  1150. Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs)
  1151. End Sub
  1152. Private Sub navNuevoRegistro_Click(sender As Object, e As EventArgs)
  1153. NuevaPropuesta()
  1154. End Sub
  1155. Private Sub navEliminarRegistro_Click(sender As Object, e As EventArgs)
  1156. End Sub
  1157. Private Sub navBuscar_Click(sender As Object, e As EventArgs)
  1158. PrepararBusqueda()
  1159. End Sub
  1160. Private Sub cboEmpresas_LostFocus(sender As Object, e As EventArgs) Handles cboEmpresas.LostFocus
  1161. End Sub
  1162. Sub GenerarCodigoDeInversion()
  1163. Dim vEmpresa As String
  1164. Dim vCodigoIF As String
  1165. Dim oCodigo As String
  1166. vEmpresa = oPropuestaInversionCE.CodigoEmpresa
  1167. vCodigoIF = oPropuestaInversionCE.CodigoInstrumentoFinanciero
  1168. oCodigo = SeriesDAO.SiguienteCodigoInversion(vEmpresa, vCodigoIF)
  1169. Me.txtCodigoInversion.Text = oCodigo
  1170. End Sub
  1171. Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged
  1172. LimpiarVariablesTraspaso()
  1173. ControlCodigoInversion()
  1174. ControlCambio()
  1175. Variables.CodigoComparativo = String.Empty
  1176. End Sub
  1177. Sub ControlCambio()
  1178. Dim EstadoAut As String = cboAutorizacion.SelectedValue
  1179. Dim Codigo As String = txtCodigoInversion.Text
  1180. If Not String.IsNullOrEmpty(Codigo) Or TipoTransaccion = "N" Then
  1181. If TipoTransaccion = "N" Then
  1182. pnlCambiarRev.Visible = False
  1183. pnlCambiarRec.Visible = False
  1184. pnlCambiarApro.Visible = False
  1185. Else
  1186. If Not TipoTransaccion = "A" Then
  1187. If EstadoAut = "P" Then
  1188. pnlCambiarRev.Visible = True
  1189. pnlCambiarRec.Visible = True
  1190. pnlCambiarApro.Visible = False
  1191. ElseIf EstadoAut = "V" Then
  1192. pnlCambiarRev.Visible = False
  1193. pnlCambiarRec.Visible = True
  1194. pnlCambiarApro.Visible = True
  1195. ElseIf EstadoAut = "A" Or EstadoAut = "R" Then
  1196. pnlCambiarRev.Visible = False
  1197. pnlCambiarRec.Visible = False
  1198. pnlCambiarApro.Visible = False
  1199. TipoTransaccion = "B"
  1200. End If
  1201. End If
  1202. End If
  1203. End If
  1204. EstadoControladoresNAV()
  1205. End Sub
  1206. Private Sub ControlEmpresa()
  1207. If TipoTransaccion = "N" Then
  1208. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  1209. GenerarCodigoDeInversion()
  1210. End If
  1211. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1212. oPropuestaInversionCE.CodigoEmpresa = Me.cboEmpresas.SelectedValue
  1213. End If
  1214. End Sub
  1215. Private Sub ControlAsunto()
  1216. oPropuestaInversionCE.Asunto = Me.txtAsunto.Text
  1217. End Sub
  1218. Private Sub ControlInstrumento()
  1219. If TipoTransaccion = "N" Then
  1220. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  1221. GenerarCodigoDeInversion()
  1222. End If
  1223. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1224. oPropuestaInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentosFinancieros.SelectedValue
  1225. End If
  1226. End Sub
  1227. Private Sub ControlPlazoFactor()
  1228. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1229. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  1230. End If
  1231. End Sub
  1232. Private Sub ControlOrigenDeFondos()
  1233. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1234. oPropuestaInversionCE.OrigenDeFondos = Me.cboOrigenDeFondos.SelectedValue
  1235. End If
  1236. End Sub
  1237. Private Sub ControlEmisores()
  1238. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1239. oPropuestaInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue
  1240. End If
  1241. End Sub
  1242. Private Sub ControlCalificacionesDeRiesgo()
  1243. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1244. oPropuestaInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificacionDeRiesgo.SelectedValue
  1245. End If
  1246. End Sub
  1247. Private Sub ControlCalificadoraDeRiesgo()
  1248. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1249. oPropuestaInversionCE.CodigoEmpresaCalificadora = Me.cboCalificadoraDeRiesgo.SelectedValue
  1250. End If
  1251. End Sub
  1252. Private Sub ControlTipoMercado()
  1253. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1254. If Me.cboTipoMercado.SelectedIndex = -1 Then
  1255. oPropuestaInversionCE.TipoMercado = ""
  1256. Else
  1257. oPropuestaInversionCE.TipoMercado = Me.cboTipoMercado.SelectedValue
  1258. End If
  1259. End If
  1260. End Sub
  1261. Private Sub ControlPais()
  1262. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1263. If Me.cboPaises.SelectedIndex = -1 Then
  1264. oPropuestaInversionCE.Pais = ""
  1265. Else
  1266. oPropuestaInversionCE.Pais = Me.cboPaises.SelectedValue
  1267. End If
  1268. End If
  1269. End Sub
  1270. Private Sub ControlPlazoFact()
  1271. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1272. oPropuestaInversionCE.PlazoFactor = Me.cboPlazosFactor.SelectedValue
  1273. End If
  1274. End Sub
  1275. Private Sub ControlJustificacion()
  1276. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1277. oPropuestaInversionCE.Justificacion = Me.txtJustificacion.Text
  1278. End If
  1279. End Sub
  1280. Private Sub ControlOFon()
  1281. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1282. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1283. oPropuestaInversionCE.OrigenDeFondos = ""
  1284. Else
  1285. oPropuestaInversionCE.OrigenDeFondos = cboOrigenDeFondos.SelectedValue
  1286. End If
  1287. End If
  1288. End Sub
  1289. Private Sub ControlTipOper()
  1290. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1291. If cboTipoOperacion.SelectedIndex = -1 Then
  1292. oPropuestaInversionCE.TipoOperacion = ""
  1293. Else
  1294. oPropuestaInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue
  1295. End If
  1296. End If
  1297. End Sub
  1298. Private Sub ControlComentarios()
  1299. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1300. oPropuestaInversionCE.Comentarios = Me.txtComentarios.Text
  1301. End If
  1302. End Sub
  1303. Private Sub ControlCodigoInversion()
  1304. If TipoTransaccion = "N" Or TipoTransaccion = "B" Then
  1305. oPropuestaInversionCE.CodigoInversion = txtCodigoInversion.Text
  1306. End If
  1307. End Sub
  1308. Private Sub ControlEstadoDocumento()
  1309. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1310. oPropuestaInversionCE.EstadoDocumento = Me.cboEstadoDocumento.SelectedValue
  1311. End If
  1312. End Sub
  1313. Private Sub ControlEstadoAutorizacion()
  1314. If TipoTransaccion = "N" Or TipoTransaccion = "B" Or TipoTransaccion = "A" Then
  1315. oPropuestaInversionCE.EstadoAutorizacion = Me.cboAutorizacion.SelectedValue
  1316. End If
  1317. End Sub
  1318. Private Sub ControlFechaDocumento()
  1319. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1320. oPropuestaInversionCE.FechaDocumento = Me.dtpFechaDocumento.Value.Date
  1321. End If
  1322. End Sub
  1323. Private Sub ControlTipoOperacion()
  1324. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1325. oPropuestaInversionCE.TipoOperacion = Me.cboTipoOperacion.SelectedValue
  1326. End If
  1327. End Sub
  1328. Private Sub ControlNombre()
  1329. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1330. oPropuestaInversionCE.NombreManual = txtNombre.Text
  1331. End If
  1332. End Sub
  1333. Private Sub ControlTipoRenta()
  1334. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1335. If Not TypeOf Me.cboRenta.SelectedValue Is DataRowView Then
  1336. oPropuestaInversionCE.TipoRenta = Me.cboRenta.SelectedValue
  1337. End If
  1338. End If
  1339. End Sub
  1340. Private Sub ControlTasa()
  1341. If Not TypeOf Me.cboTasa.SelectedValue Is DataRowView Then
  1342. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1343. oPropuestaInversionCE.TipoTasa = Me.cboTasa.SelectedValue
  1344. End If
  1345. End If
  1346. End Sub
  1347. Private Sub ControlPeriodicidad()
  1348. If Not TypeOf Me.cboPeriodicidad.SelectedValue Is DataRowView Then
  1349. If TipoTransaccion = "N" Or TipoTransaccion = "A" Then
  1350. oPropuestaInversionCE.Periodicidad = Me.cboPeriodicidad.SelectedValue
  1351. End If
  1352. End If
  1353. End Sub
  1354. Private Sub LimpiarControles()
  1355. Dim vCero As Double = 0
  1356. Dim vCerotxt As String = vCero.ToString(Configuraciones.CodigoTXTMontos)
  1357. Me.cboEmpresas.SelectedIndex = -1
  1358. Me.txtAsunto.Text = String.Empty
  1359. Me.cboInstrumentosFinancieros.SelectedIndex = -1
  1360. Me.cboPlazosFactor.SelectedIndex = -1
  1361. Me.cboOrigenDeFondos.SelectedIndex = 0
  1362. Me.cboEmisores.SelectedIndex = -1
  1363. Me.cboCalificacionDeRiesgo.SelectedIndex = -1
  1364. Me.cboCalificadoraDeRiesgo.SelectedIndex = -1
  1365. Me.txtJustificacion.Text = String.Empty
  1366. Me.txtComentarios.Text = String.Empty
  1367. Me.txtCodigoInversion.Text = String.Empty
  1368. Me.txtCodigoInversion.ReadOnly = True
  1369. Me.cboEstadoDocumento.SelectedValue = "A"
  1370. Me.cboAutorizacion.SelectedValue = "P"
  1371. Me.dtpFechaDocumento.Value = Date.Now.Date
  1372. Me.cboTipoOperacion.SelectedValue = "C"
  1373. Me.cboTipoMercado.SelectedIndex = -1
  1374. Me.cboPaises.SelectedIndex = -1
  1375. End Sub
  1376. Private Sub RefrescarValoresControles()
  1377. ControlEmpresa()
  1378. ControlAsunto()
  1379. ControlInstrumento()
  1380. ControlPlazoFactor()
  1381. ControlOrigenDeFondos()
  1382. ControlEmisores()
  1383. ControlCalificacionesDeRiesgo()
  1384. ControlCalificadoraDeRiesgo()
  1385. ControlJustificacion()
  1386. ControlComentarios()
  1387. ControlCodigoInversion()
  1388. ControlEstadoDocumento()
  1389. ControlEstadoAutorizacion()
  1390. ControlFechaDocumento()
  1391. ControlTipoOperacion()
  1392. ControlTipoMercado()
  1393. ControlPais()
  1394. ControlPlazoFact()
  1395. ControlOFon()
  1396. ControlTipOper()
  1397. ControlNombre()
  1398. ControlTipoRenta()
  1399. ControlTasa()
  1400. ControlPeriodicidad()
  1401. End Sub
  1402. Private Function ValoresValidos() As Boolean
  1403. Dim DatosValidos As Boolean = True
  1404. If String.IsNullOrEmpty(txtNombre.Text.ToString) Then
  1405. MsgBox("Ingrese el nombre del titulo")
  1406. DatosValidos = False
  1407. Return DatosValidos
  1408. End If
  1409. If cboEmpresas.SelectedIndex = -1 Then
  1410. MsgBox("Seleccione una Empresa")
  1411. DatosValidos = False
  1412. Return DatosValidos
  1413. End If
  1414. If cboInstrumentosFinancieros.SelectedIndex = -1 Then
  1415. MsgBox("Seleccione un Instrumento")
  1416. DatosValidos = False
  1417. Return DatosValidos
  1418. End If
  1419. If cboTipoMercado.SelectedIndex = -1 Then
  1420. MsgBox("Seleccione un Tipo de Mercado")
  1421. DatosValidos = False
  1422. Return DatosValidos
  1423. End If
  1424. If cboPaises.SelectedIndex = -1 Then
  1425. MsgBox("Seleccione un Pais")
  1426. DatosValidos = False
  1427. Return DatosValidos
  1428. End If
  1429. If cboEstadoDocumento.SelectedIndex = -1 Then
  1430. MsgBox("Error con los campos del titulo")
  1431. DatosValidos = False
  1432. Return DatosValidos
  1433. End If
  1434. If cboTipoOperacion.SelectedIndex = -1 Then
  1435. MsgBox("Error con los campos del titulo")
  1436. DatosValidos = False
  1437. Return DatosValidos
  1438. End If
  1439. If cboOrigenDeFondos.SelectedIndex = -1 Then
  1440. MsgBox("Error con los campos del titulo")
  1441. DatosValidos = False
  1442. Return DatosValidos
  1443. End If
  1444. If cboAutorizacion.SelectedIndex = -1 Then
  1445. MsgBox("Error con los campos del titulo")
  1446. DatosValidos = False
  1447. Return DatosValidos
  1448. End If
  1449. Return DatosValidos
  1450. End Function
  1451. Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged
  1452. ControlTipoOperacion()
  1453. ControlTipOper()
  1454. ActualizarEstado(sender)
  1455. End Sub
  1456. Sub ActualizarEstado(sender As Object)
  1457. Dim TOp As String = String.Empty
  1458. If Not TypeOf sender.selectedvalue Is DataRowView Then
  1459. If Not sender.selectedvalue Is Nothing Then
  1460. TOp = sender.selectedvalue
  1461. FormFuturos = New frmFuturos(TOp)
  1462. FormAcciones = New frmAcciones(TOp)
  1463. FormCINV = New frmCertificadosDeInversion(TOp)
  1464. End If
  1465. End If
  1466. End Sub
  1467. Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
  1468. Dim ProTipoTransaccionCompraVenta As String = cboTipoOperacion.SelectedValue.ToString
  1469. Dim ProNueva As String = TipoTransaccion
  1470. Dim CodigoExiste As String = txtCodigoInversion.Text.ToString
  1471. Dim CodigoInstrumentoExiste As String = Operaciones.ConvertirCadena(cboInstrumentosFinancieros.SelectedValue)
  1472. ''################################################################
  1473. Variables.TipoOperacionCMVTA = cboTipoOperacion.SelectedValue
  1474. Variables.InvocadorProInv = "frmPIN"
  1475. ''################################################################
  1476. ''################################################################
  1477. Variables.Periodicidad = cboPeriodicidad.SelectedValue
  1478. ''################################################################
  1479. ''################################################################
  1480. Dim TipOperacion As String = oPropuestaInversionCE.TipoOperacion
  1481. ''################################################################
  1482. TieneDetalleInstrumento = True
  1483. ''################################################################
  1484. Dim NuevaPosInstrumento As Boolean = False
  1485. ''################################################################
  1486. Variables.Codigo = txtCodigoInversion.Text.ToString
  1487. If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
  1488. Variables.CodigoComparativo = Variables.Codigo
  1489. NuevaPosInstrumento = True
  1490. Else
  1491. If Not Variables.CodigoComparativo = Variables.Codigo Then
  1492. NuevaPosInstrumento = True
  1493. End If
  1494. End If
  1495. ''################################################################
  1496. Variables.InvPro = "P"
  1497. ''################################################################
  1498. Dim CodigoInstrumento As String = String.Empty
  1499. ''################################################################
  1500. CodigoInstrumento = txtCodigoInversion.Text.ToString
  1501. ''################################################################
  1502. ''################################################################
  1503. ''################################################################
  1504. If CodigoInstrumento.IndexOf("FINV") > -1 Then
  1505. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFINV")
  1506. Dim ExistInstrumento As Boolean = ExisteInstrumento("FINV")
  1507. Try
  1508. If ExistInstrumento Then
  1509. FormFINV.Dispose()
  1510. FormFINV = New frmFOIN
  1511. FormFINV.ShowDialog()
  1512. Else
  1513. If NuevaPosInstrumento Then
  1514. FormFINV.Dispose()
  1515. FormFINV = New frmFOIN
  1516. FormFINV.ShowDialog()
  1517. Else
  1518. FormFINV.ShowDialog()
  1519. End If
  1520. End If
  1521. Catch ex As Exception
  1522. FormFINV = New frmFOIN
  1523. FormFINV.ShowDialog()
  1524. End Try
  1525. End If
  1526. ''################################################################
  1527. ''################################################################
  1528. ''################################################################
  1529. ''################################################################
  1530. If (CodigoInstrumento.IndexOf("FUTU") > -1 Or CodigoInstrumento.IndexOf("OPC") > -1) Then
  1531. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaFuturos")
  1532. Dim ExistInstrumento As Boolean
  1533. If (CodigoInstrumento.IndexOf("FUTU") > -1) Then
  1534. ExistInstrumento = ExisteInstrumento("FUT0")
  1535. Else
  1536. ExistInstrumento = ExisteInstrumento("OPC0")
  1537. End If
  1538. Try
  1539. If ExistInstrumento Then
  1540. CantFormAbierto = False
  1541. FormFuturos.Dispose()
  1542. FormFuturos = New frmFuturos(TipOperacion)
  1543. FormFuturos.ShowDialog()
  1544. Else
  1545. If NuevaPosInstrumento Then
  1546. CantFormAbierto = False
  1547. FormFuturos.Dispose()
  1548. FormFuturos = New frmFuturos(TipOperacion)
  1549. FormFuturos.ShowDialog()
  1550. Else
  1551. CantFormAbierto = True
  1552. FormFuturos.ShowDialog()
  1553. End If
  1554. End If
  1555. Catch ex As Exception
  1556. CantFormAbierto = False
  1557. FormFuturos = New frmFuturos(TipOperacion)
  1558. FormFuturos.ShowDialog()
  1559. End Try
  1560. End If
  1561. ''################################################################
  1562. ''################################################################
  1563. ''################################################################
  1564. ''################################################################
  1565. If CodigoInstrumento.IndexOf("REPO") > -1 Or CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  1566. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaReporto")
  1567. Dim ExistInstrumento As Boolean
  1568. If CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
  1569. ExistInstrumento = ExisteInstrumento("REP0VENTA")
  1570. Else
  1571. ExistInstrumento = ExisteInstrumento("REP0")
  1572. End If
  1573. Try
  1574. If ExistInstrumento Then
  1575. FormRepo.Dispose()
  1576. FormRepo = New frmReporto
  1577. FormRepo.ShowDialog()
  1578. Else
  1579. If NuevaPosInstrumento Then
  1580. FormRepo.Dispose()
  1581. FormRepo = New frmReporto
  1582. FormRepo.ShowDialog()
  1583. Else
  1584. FormRepo.ShowDialog()
  1585. End If
  1586. End If
  1587. Catch ex As Exception
  1588. FormRepo = New frmReporto
  1589. FormRepo.ShowDialog()
  1590. End Try
  1591. End If
  1592. ''################################################################
  1593. ''################################################################
  1594. ''################################################################
  1595. ''################################################################
  1596. If CodigoInstrumento.IndexOf("PPER") > -1 Then
  1597. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaPrestamoPersonal")
  1598. Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0")
  1599. Try
  1600. If ExistInstrumento Then
  1601. FormPrestamoPersonal.Dispose()
  1602. FormPrestamoPersonal = New frmPrestamoPersonal
  1603. FormPrestamoPersonal.ShowDialog()
  1604. Else
  1605. If NuevaPosInstrumento Then
  1606. FormPrestamoPersonal.Dispose()
  1607. FormPrestamoPersonal = New frmPrestamoPersonal
  1608. FormPrestamoPersonal.ShowDialog()
  1609. Else
  1610. FormPrestamoPersonal.ShowDialog()
  1611. End If
  1612. End If
  1613. Catch ex As Exception
  1614. FormPrestamoPersonal = New frmPrestamoPersonal
  1615. FormPrestamoPersonal.ShowDialog()
  1616. End Try
  1617. End If
  1618. ''################################################################
  1619. ''################################################################
  1620. ''################################################################
  1621. ''################################################################
  1622. If CodigoInstrumento.IndexOf("PEMP") > -1 Then
  1623. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaEmpresas")
  1624. Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0")
  1625. Try
  1626. If ExistInstrumento Then
  1627. FormPrestamoEmpresarial.Dispose()
  1628. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1629. FormPrestamoEmpresarial.ShowDialog()
  1630. Else
  1631. If NuevaPosInstrumento Then
  1632. FormPrestamoEmpresarial.Dispose()
  1633. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1634. FormPrestamoEmpresarial.ShowDialog()
  1635. Else
  1636. FormPrestamoEmpresarial.ShowDialog()
  1637. End If
  1638. End If
  1639. Catch ex As Exception
  1640. FormPrestamoEmpresarial = New frmPrestamoEmpresariales
  1641. FormPrestamoEmpresarial.ShowDialog()
  1642. End Try
  1643. End If
  1644. ''################################################################
  1645. ''################################################################
  1646. ''################################################################
  1647. ''################################################################
  1648. Dim Acciones As Integer = 0
  1649. If CodigoInstrumento.IndexOf("ACC") > -1 Then
  1650. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaAcciones")
  1651. Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0")
  1652. Try
  1653. If ExistInstrumento Then
  1654. CantFormAbierto = False
  1655. FormAcciones.Dispose()
  1656. FormAcciones = New frmAcciones(TipOperacion)
  1657. FormAcciones.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1658. FormAcciones.ShowDialog()
  1659. Else
  1660. If NuevaPosInstrumento Then
  1661. CantFormAbierto = False
  1662. FormAcciones.Dispose()
  1663. FormAcciones = New frmAcciones(TipOperacion)
  1664. FormAcciones.ShowDialog()
  1665. Else
  1666. CantFormAbierto = True
  1667. FormAcciones.ShowDialog()
  1668. End If
  1669. End If
  1670. Catch ex As Exception
  1671. CantFormAbierto = False
  1672. FormAcciones = New frmAcciones(TipOperacion)
  1673. FormAcciones.ShowDialog()
  1674. End Try
  1675. End If
  1676. ''################################################################
  1677. ''################################################################
  1678. ''################################################################
  1679. ''################################################################
  1680. If CodigoInstrumento.IndexOf("LETE") > -1 Or CodigoInstrumento.IndexOf("PBUR") > -1 Or CodigoInstrumento.IndexOf("VCN") > -1 Or CodigoInstrumento.IndexOf("CETE") > -1 Then
  1681. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaLetes")
  1682. Dim ExistInstrumento As Boolean
  1683. If CodigoInstrumento.IndexOf("LETE") > -1 Then
  1684. ExistInstrumento = ExisteInstrumento("LET0")
  1685. ElseIf CodigoInstrumento.IndexOf("PBUR") > -1 Then
  1686. ExistInstrumento = ExisteInstrumento("PBUR")
  1687. ElseIf CodigoInstrumento.IndexOf("VCN") > -1 Then
  1688. ExistInstrumento = ExisteInstrumento("VCN")
  1689. Else
  1690. ExistInstrumento = ExisteInstrumento("CET0")
  1691. End If
  1692. Try
  1693. If ExistInstrumento Then
  1694. FormLete.Dispose()
  1695. FormLete = New frmLetes
  1696. FormLete.ShowDialog()
  1697. Else
  1698. If NuevaPosInstrumento Then
  1699. FormLete.Dispose()
  1700. FormLete = New frmLetes
  1701. FormLete.ShowDialog()
  1702. Else
  1703. FormLete.ShowDialog()
  1704. End If
  1705. End If
  1706. Catch ex As Exception
  1707. FormLete = New frmLetes
  1708. FormLete.ShowDialog()
  1709. End Try
  1710. End If
  1711. ''################################################################
  1712. ''################################################################
  1713. ''################################################################
  1714. ''################################################################
  1715. If CodigoInstrumento.IndexOf("BONO") > -1 Or CodigoInstrumento.IndexOf("CINV") > -1 Or CodigoInstrumento.IndexOf("TIT") > -1 Or CodigoInstrumento.IndexOf("EURB") > -1 Then
  1716. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaCINV")
  1717. Dim ExistInstrumento As Boolean
  1718. If CodigoInstrumento.IndexOf("BONO") > -1 Then
  1719. ExistInstrumento = ExisteInstrumento("BON0")
  1720. ElseIf CodigoInstrumento.IndexOf("CINV") > -1 Then
  1721. ExistInstrumento = ExisteInstrumento("CIN0")
  1722. ElseIf CodigoInstrumento.IndexOf("TIT") > -1 Then
  1723. ExistInstrumento = ExisteInstrumento("TIT")
  1724. Else
  1725. ExistInstrumento = ExisteInstrumento("EURB0")
  1726. End If
  1727. Try
  1728. If ExistInstrumento Then
  1729. CantFormAbierto = False
  1730. FormCINV.Dispose()
  1731. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1732. FormCINV.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1733. FormCINV.ShowDialog()
  1734. Else
  1735. If NuevaPosInstrumento Then
  1736. CantFormAbierto = False
  1737. FormCINV.Dispose()
  1738. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1739. FormCINV.ShowDialog()
  1740. Else
  1741. CantFormAbierto = True
  1742. FormCINV.ShowDialog()
  1743. End If
  1744. End If
  1745. Catch ex As Exception
  1746. CantFormAbierto = False
  1747. FormCINV = New frmCertificadosDeInversion(TipOperacion)
  1748. FormCINV.ShowDialog()
  1749. End Try
  1750. End If
  1751. ''################################################################
  1752. ''################################################################
  1753. ''################################################################
  1754. ''################################################################
  1755. If CodigoInstrumento.IndexOf("DAP") > -1 Then
  1756. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP")
  1757. Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0")
  1758. Try
  1759. If ExistInstrumento Then
  1760. FormDAP.Dispose()
  1761. FormDAP = New frmDepositosAPlazo
  1762. FormDAP.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1763. FormDAP.ShowDialog()
  1764. Else
  1765. If NuevaPosInstrumento Then
  1766. FormDAP.Dispose()
  1767. FormDAP = New frmDepositosAPlazo
  1768. FormDAP.ShowDialog()
  1769. Else
  1770. FormDAP.ShowDialog()
  1771. End If
  1772. End If
  1773. Catch ex As Exception
  1774. FormDAP = New frmDepositosAPlazo
  1775. FormDAP.ShowDialog()
  1776. End Try
  1777. End If
  1778. ''################################################################
  1779. ''################################################################
  1780. ''################################################################
  1781. ''################################################################
  1782. If CodigoInstrumento.IndexOf("NEST") > -1 Then
  1783. Operaciones.TraspasarDatos(CodigoExiste, CodigoInstrumentoExiste, ProNueva, ProTipoTransaccionCompraVenta, "FamiliaDAP")
  1784. Dim ExistInstrumento As Boolean = ExisteInstrumento("NEST0")
  1785. Try
  1786. If ExistInstrumento Then
  1787. FormNEST.Dispose()
  1788. FormNEST = New frmNotaEstructurada
  1789. FormNEST.CargarRegistro(oPropuestaInversionCE.CodigoInversion)
  1790. FormNEST.ShowDialog()
  1791. Else
  1792. If NuevaPosInstrumento Then
  1793. FormNEST.Dispose()
  1794. FormNEST = New frmNotaEstructurada
  1795. FormNEST.ShowDialog()
  1796. Else
  1797. FormNEST.ShowDialog()
  1798. End If
  1799. End If
  1800. Catch ex As Exception
  1801. FormNEST = New frmNotaEstructurada
  1802. FormNEST.ShowDialog()
  1803. End Try
  1804. End If
  1805. ''################################################################
  1806. ''################################################################
  1807. End Sub
  1808. Function ExisteInstrumento(ByVal Tabla As String)
  1809. Dim General As New DAOGeneral
  1810. Variables.Codigo = txtCodigoInversion.Text.ToString
  1811. Dim Codigo As String = Variables.Codigo
  1812. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1813. Return Existe
  1814. End Function
  1815. Function ExisteInstrumentoReal(ByVal Tabla As String)
  1816. Dim General As New DAOGeneral
  1817. Dim Codigo As String = txtCodigoInversion.Text
  1818. Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
  1819. Return Existe
  1820. End Function
  1821. Private Sub navNuevo_Click(sender As Object, e As EventArgs)
  1822. NuevaPropuesta()
  1823. End Sub
  1824. Private Sub DeshabilitarControles()
  1825. cboEmpresas.Enabled = False
  1826. txtAsunto.ReadOnly = True
  1827. cboInstrumentosFinancieros.Enabled = False
  1828. cboPlazosFactor.Enabled = False
  1829. cboOrigenDeFondos.Enabled = False
  1830. cboEmisores.Enabled = False
  1831. cboCalificacionDeRiesgo.Enabled = False
  1832. cboCalificadoraDeRiesgo.Enabled = False
  1833. txtJustificacion.ReadOnly = True
  1834. txtComentarios.ReadOnly = True
  1835. cboTipoOperacion.Enabled = False
  1836. cboEstadoDocumento.Enabled = False
  1837. cboAutorizacion.Enabled = False
  1838. dtpFechaDocumento.Enabled = False
  1839. cboTipoMercado.Enabled = False
  1840. cboPaises.Enabled = False
  1841. txtCodigoInversion.ReadOnly = True
  1842. cboRenta.Enabled = False
  1843. cboTasa.Enabled = False
  1844. cboPeriodicidad.Enabled = False
  1845. End Sub
  1846. Private Sub HabilitarControles()
  1847. cboEmpresas.Enabled = True
  1848. txtAsunto.ReadOnly = False
  1849. cboInstrumentosFinancieros.Enabled = True
  1850. cboPlazosFactor.Enabled = True
  1851. cboOrigenDeFondos.Enabled = False
  1852. cboEmisores.Enabled = True
  1853. cboCalificacionDeRiesgo.Enabled = True
  1854. cboCalificadoraDeRiesgo.Enabled = True
  1855. txtJustificacion.ReadOnly = False
  1856. txtComentarios.ReadOnly = False
  1857. cboTipoOperacion.Enabled = False
  1858. cboAutorizacion.Enabled = False
  1859. dtpFechaDocumento.Enabled = True
  1860. cboTipoMercado.Enabled = True
  1861. cboPaises.Enabled = True
  1862. cboEstadoDocumento.Enabled = False
  1863. cboRenta.Enabled = True
  1864. cboTasa.Enabled = True
  1865. cboPeriodicidad.Enabled = True
  1866. End Sub
  1867. Private Sub PrepararModificacion()
  1868. If oPropuestaInversionCE.EstadoDocumento = "A" Then
  1869. HabilitarControles()
  1870. TipoTransaccion = "A"
  1871. RefrescarControles()
  1872. Me.btnAccion.Text = "Actualizar"
  1873. End If
  1874. End Sub
  1875. Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAutorizacion.SelectedIndexChanged
  1876. ControlEstadoAutorizacion()
  1877. End Sub
  1878. Private Sub btnActivar_Click(sender As Object, e As EventArgs) Handles btnActivar.Click
  1879. If cboTipoOperacion.SelectedValue = "C" Then
  1880. Dim Id = oDAOPropuestasDeInversion.IdRegistro(txtCodigoInversion.Text)
  1881. oPropuestaInversionCE = oDAOPropuestasDeInversion.CargarPropuesta(Id)
  1882. ConvertirEnInversion(Id)
  1883. End If
  1884. End Sub
  1885. Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs)
  1886. ControlPais()
  1887. End Sub
  1888. Private Sub cboTipoMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoMercado.SelectedIndexChanged
  1889. ControlTipoMercado()
  1890. End Sub
  1891. Private Sub ConvertirEnInversion(Id As Integer)
  1892. If Not oPropuestaInversionCE Is Nothing Then
  1893. Dim vConversion As Integer
  1894. Dim vIdPropuesta As Integer
  1895. If (oPropuestaInversionCE.IdDeDocumento = 0) Then
  1896. vIdPropuesta = Id
  1897. Else
  1898. vIdPropuesta = oPropuestaInversionCE.IdDeDocumento
  1899. End If
  1900. vConversion = oDAOPropuestasDeInversion.ConvertirEnInversion(vIdPropuesta, EstadoReporto)
  1901. If vConversion = 1 Then
  1902. MsgBox("El proceso de activación se ha efectuado correctamente")
  1903. CargarPropuesta(vIdPropuesta)
  1904. grbInversión.Visible = False
  1905. TipoTransaccion = "B"
  1906. chkUsuario.Checked = False
  1907. Else
  1908. MsgBox("Error")
  1909. End If
  1910. End If
  1911. End Sub
  1912. Private Sub RefrescarControles()
  1913. If TipoTransaccion = "C" Then
  1914. DeshabilitarControles()
  1915. End If
  1916. If TipoTransaccion = "B" Then
  1917. HabilitarControles()
  1918. End If
  1919. If TipoTransaccion = "A" Then
  1920. HabilitarControles()
  1921. cboEstadoDocumento.Enabled = False
  1922. End If
  1923. End Sub
  1924. Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
  1925. Me.Close()
  1926. End Sub
  1927. Private Sub CargarPeriodicidades()
  1928. If (String.IsNullOrEmpty(cboPeriodicidad.SelectedValue)) Then
  1929. Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
  1930. Me.cboPeriodicidad.DisplayMember = "Descripcion"
  1931. Me.cboPeriodicidad.ValueMember = "Codigo"
  1932. Me.cboPeriodicidad.SelectedIndex = -1
  1933. End If
  1934. End Sub
  1935. Private Sub CargarTipoRenta()
  1936. Me.cboRenta.DataSource = oDAOGeneral.ListaTipoRenta
  1937. Me.cboRenta.DisplayMember = "Descripcion"
  1938. Me.cboRenta.ValueMember = "Codigo"
  1939. Me.cboRenta.SelectedIndex = -1
  1940. End Sub
  1941. Private Sub CargarTipoTasa()
  1942. Me.cboTasa.DataSource = oDAOGeneral.ListaTipoTasa
  1943. Me.cboTasa.DisplayMember = "Descripcion"
  1944. Me.cboTasa.ValueMember = "Codigo"
  1945. Me.cboTasa.SelectedIndex = -1
  1946. End Sub
  1947. Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
  1948. ControlPeriodicidad()
  1949. End Sub
  1950. Private Sub cboTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTasa.SelectedIndexChanged
  1951. ControlTasa()
  1952. End Sub
  1953. Private Sub navEliminar_Click(sender As Object, e As EventArgs)
  1954. If (Borrar() = 0) Then
  1955. LimpiarControles()
  1956. End If
  1957. Refrescar()
  1958. PrepararBusqueda()
  1959. End Sub
  1960. Public Sub Refrescar()
  1961. Me.Refresh()
  1962. End Sub
  1963. Public Function Borrar()
  1964. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  1965. If (mensaje = vbOK) Then
  1966. Dim eliminar As New InversionDAO
  1967. Dim valor = eliminar.EliminarPropuesta(txtCodigoInversion.Text)
  1968. If (valor = 1) Then
  1969. MsgBox("Error al Eliminar")
  1970. Return valor
  1971. Else
  1972. MsgBox("Registro Eliminado")
  1973. Return valor
  1974. End If
  1975. End If
  1976. End Function
  1977. Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs)
  1978. End Sub
  1979. Private Sub navSiguienteRegistro_Click_1(sender As Object, e As EventArgs)
  1980. DeshabilitarControles()
  1981. TipoTransaccion = "B"
  1982. If Not BindingNavigatorPositionItem.Enabled Then
  1983. PIN0BindingSource4.ResumeBinding()
  1984. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  1985. End If
  1986. End Sub
  1987. Private Sub navNuevo_Click_1(sender As Object, e As EventArgs) Handles navNuevo.Click
  1988. ActivarSuspen = True
  1989. Modo = "NM"
  1990. TipoTransaccion = "N"
  1991. grbInversión.Visible = False
  1992. NuevaPropuesta()
  1993. PIN0BindingSource4.SuspendBinding()
  1994. Refrescar()
  1995. PreNuevoModificar()
  1996. ModoPropuesta()
  1997. LimpiarControles()
  1998. HabilitarControles()
  1999. TipoTransaccion = "N"
  2000. cboEmpresas.Enabled = True
  2001. cboInstrumentosFinancieros.Enabled = True
  2002. End Sub
  2003. Private Sub DeshabilitarBotonesBusqueda()
  2004. cboPlazosFactor.Enabled = False
  2005. cboOrigenDeFondos.Enabled = False
  2006. cboCalificacionDeRiesgo.Enabled =
  2007. cboCalificadoraDeRiesgo.Enabled = False
  2008. txtJustificacion.ReadOnly = True
  2009. txtComentarios.ReadOnly = True
  2010. cboTipoOperacion.Enabled = False
  2011. cboAutorizacion.Enabled = False
  2012. dtpFechaDocumento.Enabled = False
  2013. cboTipoMercado.Enabled = False
  2014. cboPaises.Enabled = False
  2015. End Sub
  2016. Sub HabilitarAut()
  2017. cboAutorizacion.Enabled = True
  2018. End Sub
  2019. Sub CambiarEstadoAut(ByVal Estado As String)
  2020. If Estado = "P" Then
  2021. cboAutorizacion.SelectedValue = "P"
  2022. ElseIf Estado = "I" Then
  2023. cboAutorizacion.SelectedValue = "I"
  2024. ElseIf Estado = "V" Then
  2025. cboAutorizacion.SelectedValue = "V"
  2026. ElseIf Estado = "A" Then
  2027. cboAutorizacion.SelectedValue = "A"
  2028. ElseIf Estado = "R" Then
  2029. cboAutorizacion.SelectedValue = "R"
  2030. End If
  2031. cboAutorizacion.BackColor = Color.White
  2032. End Sub
  2033. Private Sub navBuscar_Click_1(sender As Object, e As EventArgs) Handles navBuscar.Click
  2034. Modo = "B"
  2035. ModoPropuesta()
  2036. End Sub
  2037. Sub HabilitarBusqueda()
  2038. HabilitarControles()
  2039. grbInversión.Visible = False
  2040. PreBusqueda()
  2041. TipoTransaccion = "B"
  2042. End Sub
  2043. Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
  2044. Dim posicion = PIN0BindingSource4.Position
  2045. ActivarSuspen = True
  2046. Modo = "NM"
  2047. btnAccion.Text = "Actualizar"
  2048. HabilitarControles()
  2049. TipoTransaccion = "A"
  2050. Operaciones.TipoOperacion = "A"
  2051. PrepararModificacion()
  2052. Refrescar()
  2053. TipoTransaccion = "A"
  2054. PreNuevoModificar()
  2055. HabilitarAut()
  2056. ModoPropuesta()
  2057. If Not LlamadaDesdeBusqueda Then
  2058. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2059. PIN0BindingSource4.Position = posicion
  2060. End If
  2061. cboEmpresas.Enabled = False
  2062. cboInstrumentosFinancieros.Enabled = False
  2063. End Sub
  2064. Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click
  2065. End Sub
  2066. Private Sub chkUsuario_CheckedChanged(sender As Object, e As EventArgs) Handles chkUsuario.CheckedChanged
  2067. Dim Codigo As String = txtCodigoInversion.Text.ToString
  2068. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  2069. If ExisteInstrumento Then
  2070. UsuarioPrivilegio(TipoTransaccion, sender)
  2071. Else
  2072. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de la inversión es 0")
  2073. If chkUsuario.Checked Then
  2074. chkUsuario.Checked = False
  2075. End If
  2076. End If
  2077. End Sub
  2078. Private Sub BindingNavigatorCountItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorCountItem.Click
  2079. End Sub
  2080. Friend WithEvents vBindingSource As BindingSource
  2081. Private Sub navEliminar_Click_1(sender As Object, e As EventArgs) Handles navEliminar.Click
  2082. Dim posicion As Integer = PIN0BindingSource4.Position
  2083. If (BorrarPropuesta() = 0) Then
  2084. LimpiarControles()
  2085. End If
  2086. PIN0BindingSource4.SuspendBinding()
  2087. Refrescar()
  2088. HabilitarControles()
  2089. DeshabilitarBotonesBusqueda()
  2090. PrepararBusqueda()
  2091. Variables.CodigoComparativo = "NULL"
  2092. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2093. If Not posicion = 0 Then
  2094. posicion -= 1
  2095. End If
  2096. PIN0BindingSource4.Position = posicion
  2097. End Sub
  2098. Public Function BorrarPropuesta()
  2099. Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
  2100. If (mensaje = vbOK) Then
  2101. Dim eliminar As New InversionDAO
  2102. Dim EliminarCascada As Boolean = ExisteInstrumento("INV0")
  2103. Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "PIN0", EliminarCascada)
  2104. If (valor = 1) Then
  2105. MsgBox("Error al Eliminar")
  2106. Return valor
  2107. Else
  2108. MsgBox("Registro Eliminado")
  2109. Return valor
  2110. End If
  2111. Else
  2112. Return 1
  2113. End If
  2114. End Function
  2115. Private Sub Navegador_RefreshItems_1(sender As Object, e As EventArgs) Handles Navegador.RefreshItems
  2116. End Sub
  2117. Private Sub PIN0BindingSource_CurrentChanged(sender As Object, e As EventArgs)
  2118. End Sub
  2119. Private Sub navRegistroAnterior_Click_1(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
  2120. DeshabilitarControles()
  2121. TipoTransaccion = "B"
  2122. If Not BindingNavigatorPositionItem.Enabled Then
  2123. PIN0BindingSource4.ResumeBinding()
  2124. End If
  2125. End Sub
  2126. Private Sub navPrimerRegistro_Click_1(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
  2127. DeshabilitarControles()
  2128. TipoTransaccion = "B"
  2129. If Not BindingNavigatorPositionItem.Enabled Then
  2130. PIN0BindingSource4.ResumeBinding()
  2131. End If
  2132. End Sub
  2133. Private Sub navUltimoRegistro_Click_1(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
  2134. DeshabilitarControles()
  2135. TipoTransaccion = "B"
  2136. If Not BindingNavigatorPositionItem.Enabled Then
  2137. PIN0BindingSource4.ResumeBinding()
  2138. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  2139. End If
  2140. End Sub
  2141. Private Sub PreBusqueda()
  2142. Me.cboEmpresas.BackColor = Configuraciones.ColorFondoPredefinido()
  2143. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2144. Me.cboInstrumentosFinancieros.BackColor = Configuraciones.ColorFondoPredefinido()
  2145. Me.cboEmisores.BackColor = Configuraciones.ColorFondoPredefinido()
  2146. Me.cboCalificacionDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido()
  2147. Me.cboCalificadoraDeRiesgo.BackColor = Configuraciones.ColorFondoPredefinido()
  2148. Me.cboPaises.BackColor = Configuraciones.ColorFondoPredefinido()
  2149. Me.cboTipoMercado.BackColor = Configuraciones.ColorFondoPredefinido()
  2150. Me.txtNombre.BackColor = Configuraciones.ColorFondoPredefinido()
  2151. Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoPredefinido()
  2152. Me.cboPlazosFactor.BackColor = Configuraciones.ColorFondoPredefinido()
  2153. Me.cboRenta.BackColor = Configuraciones.ColorFondoPredefinido()
  2154. Me.cboTasa.BackColor = Configuraciones.ColorFondoPredefinido()
  2155. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2156. Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoPredefinido()
  2157. cboOrigenDeFondos.BackColor = Configuraciones.ColorFondoPredefinido()
  2158. cboTipoOperacion.BackColor = Configuraciones.ColorFondoPredefinido()
  2159. cboAutorizacion.BackColor = Configuraciones.ColorFondoPredefinido()
  2160. txtAsunto.BackColor = Configuraciones.ColorFondoPredefinido()
  2161. dtpFechaDocumento.Enabled = False
  2162. TipoTransaccion = "B"
  2163. oPropuestaInversionCE = Nothing
  2164. oPropuestaInversionCE = New CEPropuestaInversion
  2165. LimpiarControles()
  2166. End Sub
  2167. Private Sub PreNuevoModificar()
  2168. Me.cboEmpresas.BackColor = Color.White
  2169. Me.txtCodigoInversion.BackColor = Color.White
  2170. Me.cboInstrumentosFinancieros.BackColor = Color.White
  2171. Me.cboEmisores.BackColor = Color.White
  2172. Me.cboCalificacionDeRiesgo.BackColor = Color.White
  2173. Me.cboCalificadoraDeRiesgo.BackColor = Color.White
  2174. Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
  2175. Me.cboPaises.BackColor = Color.White
  2176. Me.cboTipoMercado.BackColor = Color.White
  2177. Me.txtNombre.BackColor = Color.White
  2178. Me.cboPeriodicidad.BackColor = Color.White
  2179. Me.cboPlazosFactor.BackColor = Color.White
  2180. Me.cboRenta.BackColor = Color.White
  2181. Me.cboTasa.BackColor = Color.White
  2182. Me.cboEstadoDocumento.BackColor = Color.White()
  2183. cboOrigenDeFondos.BackColor = Color.White
  2184. cboTipoOperacion.BackColor = Color.White
  2185. cboAutorizacion.BackColor = Color.White
  2186. txtAsunto.BackColor = Color.White
  2187. End Sub
  2188. Private Sub txtMontoInversion_Leave(sender As Object, e As EventArgs)
  2189. End Sub
  2190. Private Sub txtPrecio_Leave(sender As Object, e As EventArgs)
  2191. End Sub
  2192. Private Sub txtRendimiento_Leave(sender As Object, e As EventArgs)
  2193. End Sub
  2194. Private Sub txtPlazoNumero_Leave(sender As Object, e As EventArgs)
  2195. End Sub
  2196. Private Sub txtIngresos_Leave(sender As Object, e As EventArgs)
  2197. End Sub
  2198. Private Sub txtRendimiento_TextChanged_1(sender As Object, e As EventArgs)
  2199. End Sub
  2200. Private Sub txtRendimiento_Leave_1(sender As Object, e As EventArgs)
  2201. End Sub
  2202. Private Sub Navegador_EndDrag(sender As Object, e As EventArgs) Handles Navegador.EndDrag
  2203. End Sub
  2204. Private Sub lblEmpresa_Click(sender As Object)
  2205. End Sub
  2206. Sub Acercar(sender As Object)
  2207. If TypeOf sender Is Panel Then
  2208. If Not sender.BackColor.Name = Color.White.Name Then
  2209. sender.BackColor = Color.Turquoise
  2210. End If
  2211. Else
  2212. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2213. sender.BackColor = Color.Turquoise
  2214. End If
  2215. End If
  2216. End Sub
  2217. Sub Alejar(sender As Object)
  2218. If TypeOf sender Is Panel Then
  2219. If Not sender.BackColor.Name = Color.White.Name Then
  2220. sender.BackColor = Color.WhiteSmoke
  2221. End If
  2222. Else
  2223. If Not sender.parent.BackColor.Name = Color.White.Name Then
  2224. sender.BackColor = Color.WhiteSmoke
  2225. End If
  2226. End If
  2227. End Sub
  2228. Sub MenuSeleccionado(sender As Object)
  2229. pnlContenedor.Visible = True
  2230. For Each Items In pnlMenu.Controls
  2231. If TypeOf Items Is Panel Then
  2232. Items.BackColor = Color.WhiteSmoke
  2233. For Each Item In Items.controls
  2234. Item.BackColor = Color.WhiteSmoke
  2235. Next
  2236. End If
  2237. Next
  2238. If TypeOf sender Is Panel Then
  2239. sender.BackColor = Color.White
  2240. For Each Item In sender.controls
  2241. Item.BackColor = Color.White
  2242. Next
  2243. End If
  2244. If TypeOf sender Is Label Then
  2245. sender.BackColor = Color.White
  2246. sender.parent.BackColor = Color.White
  2247. End If
  2248. End Sub
  2249. Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs)
  2250. EventHijoAcercar(sender)
  2251. End Sub
  2252. Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs)
  2253. EventHijoAlejar(sender)
  2254. End Sub
  2255. Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs)
  2256. EventPadreAcercar(sender)
  2257. End Sub
  2258. Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs)
  2259. EventPadreAlejar(sender)
  2260. End Sub
  2261. Sub EventPadreAcercar(ByVal sender As Object)
  2262. Acercar(sender)
  2263. For Each label In sender.Controls
  2264. Acercar(label)
  2265. Next
  2266. End Sub
  2267. Sub EventPadreAlejar(ByVal sender As Object)
  2268. Alejar(sender)
  2269. For Each label In sender.Controls
  2270. Alejar(label)
  2271. Next
  2272. End Sub
  2273. Sub EventHijoAcercar(ByVal sender As Object)
  2274. Acercar(sender)
  2275. Acercar(sender.parent)
  2276. End Sub
  2277. Sub EventHijoAlejar(ByVal sender As Object)
  2278. Alejar(sender)
  2279. Alejar(sender.parent)
  2280. End Sub
  2281. Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs)
  2282. EventHijoAcercar(sender)
  2283. End Sub
  2284. Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs)
  2285. EventHijoAlejar(sender)
  2286. End Sub
  2287. Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs)
  2288. EventPadreAcercar(sender)
  2289. End Sub
  2290. Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs)
  2291. EventPadreAlejar(sender)
  2292. End Sub
  2293. Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs)
  2294. EventPadreAcercar(sender)
  2295. End Sub
  2296. Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs)
  2297. EventPadreAlejar(sender)
  2298. End Sub
  2299. Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs)
  2300. EventHijoAcercar(sender)
  2301. End Sub
  2302. Private Sub lblPais_MouseHover(sender As Object, e As EventArgs)
  2303. EventHijoAcercar(sender)
  2304. End Sub
  2305. Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs)
  2306. EventHijoAcercar(sender)
  2307. End Sub
  2308. Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs)
  2309. EventHijoAcercar(sender)
  2310. End Sub
  2311. Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs)
  2312. EventHijoAcercar(sender)
  2313. End Sub
  2314. Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs)
  2315. EventHijoAcercar(sender)
  2316. End Sub
  2317. Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs)
  2318. EventHijoAlejar(sender)
  2319. End Sub
  2320. Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs)
  2321. EventHijoAlejar(sender)
  2322. End Sub
  2323. Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs)
  2324. EventHijoAlejar(sender)
  2325. End Sub
  2326. Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs)
  2327. EventHijoAlejar(sender)
  2328. End Sub
  2329. Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs)
  2330. EventHijoAlejar(sender)
  2331. End Sub
  2332. Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs)
  2333. EventHijoAlejar(sender)
  2334. End Sub
  2335. Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs)
  2336. EventPadreAcercar(sender)
  2337. End Sub
  2338. Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs)
  2339. EventPadreAcercar(sender)
  2340. End Sub
  2341. Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs)
  2342. EventPadreAcercar(sender)
  2343. End Sub
  2344. Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs)
  2345. EventPadreAcercar(sender)
  2346. End Sub
  2347. Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs)
  2348. EventPadreAcercar(sender)
  2349. End Sub
  2350. Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs)
  2351. EventPadreAcercar(sender)
  2352. End Sub
  2353. Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs)
  2354. EventPadreAlejar(sender)
  2355. End Sub
  2356. Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs)
  2357. EventPadreAlejar(sender)
  2358. End Sub
  2359. Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs)
  2360. EventPadreAlejar(sender)
  2361. End Sub
  2362. Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs)
  2363. EventPadreAlejar(sender)
  2364. End Sub
  2365. Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs)
  2366. EventPadreAlejar(sender)
  2367. End Sub
  2368. Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs)
  2369. EventPadreAlejar(sender)
  2370. End Sub
  2371. Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs)
  2372. EventHijoAcercar(sender)
  2373. End Sub
  2374. Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs)
  2375. EventHijoAlejar(sender)
  2376. End Sub
  2377. Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles GroupBox1.Enter
  2378. End Sub
  2379. Private Sub lblInstrumento_Click(sender As Object, e As EventArgs)
  2380. End Sub
  2381. Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs)
  2382. EventHijoAcercar(sender)
  2383. End Sub
  2384. Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs)
  2385. EventHijoAcercar(sender)
  2386. End Sub
  2387. Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs)
  2388. EventHijoAlejar(sender)
  2389. End Sub
  2390. Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs)
  2391. EventHijoAlejar(sender)
  2392. End Sub
  2393. Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs)
  2394. EventPadreAcercar(sender)
  2395. End Sub
  2396. Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs)
  2397. EventPadreAcercar(sender)
  2398. End Sub
  2399. Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs)
  2400. EventPadreAlejar(sender)
  2401. End Sub
  2402. Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs)
  2403. EventPadreAlejar(sender)
  2404. End Sub
  2405. Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs)
  2406. EventHijoAcercar(sender)
  2407. End Sub
  2408. Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs)
  2409. EventHijoAlejar(sender)
  2410. End Sub
  2411. Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs)
  2412. EventPadreAcercar(sender)
  2413. End Sub
  2414. Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs)
  2415. EventPadreAlejar(sender)
  2416. End Sub
  2417. Private Sub lblEmpresa_Click(sender As Object, e As EventArgs)
  2418. End Sub
  2419. Sub ProcesoVisibilidad(sender As Object)
  2420. For Each Items In pnlContenedor.Controls
  2421. If TypeOf Items Is GroupBox Then
  2422. Items.visible = False
  2423. End If
  2424. Next
  2425. sender.visible = True
  2426. End Sub
  2427. Sub ConfiguracionInicial()
  2428. For Each Items In pnlContenedor.Controls
  2429. If TypeOf Items Is GroupBox Then
  2430. Dim W_Tamgrp As Double = Items.Parent.Width - 10
  2431. Dim W_Tamflp As Double = W_Tamgrp - 10
  2432. Dim H_Tamgrp As Double = Items.Parent.Height - 30
  2433. Dim H_Tamflp As Double = H_Tamgrp - 30
  2434. Items.Width = W_Tamgrp
  2435. Items.Height = H_Tamgrp
  2436. Items.Location = New Point(2, 20)
  2437. For Each flItem In Items.Controls
  2438. If TypeOf flItem Is FlowLayoutPanel Then
  2439. flItem.Width = W_Tamflp
  2440. flItem.Height = H_Tamflp - 10
  2441. End If
  2442. Next
  2443. For Each item In Items.Controls
  2444. If TypeOf item Is CheckBox Then
  2445. Dim W_Tamchk As Double = item.Width + 5
  2446. item.Width = W_Tamchk
  2447. End If
  2448. Next
  2449. End If
  2450. Next
  2451. End Sub
  2452. Private Sub pnlEmpresa_Paint(sender As Object, e As PaintEventArgs)
  2453. End Sub
  2454. Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs)
  2455. End Sub
  2456. Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs)
  2457. End Sub
  2458. Private Sub pnlOrigenFondos_Paint(sender As Object, e As PaintEventArgs)
  2459. End Sub
  2460. Private Sub lblPlazo_Click(sender As Object, e As EventArgs)
  2461. End Sub
  2462. Private Sub pnlPlazo_Paint(sender As Object, e As PaintEventArgs)
  2463. End Sub
  2464. Private Sub lblEmisor_Click(sender As Object, e As EventArgs)
  2465. End Sub
  2466. Private Sub pnlEmisor_Paint(sender As Object, e As PaintEventArgs)
  2467. End Sub
  2468. Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs)
  2469. End Sub
  2470. Private Sub pnlCalificacionRiesgo_Paint(sender As Object, e As PaintEventArgs)
  2471. End Sub
  2472. Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs)
  2473. ProcesoVisibilidad(grpEmpresas)
  2474. End Sub
  2475. Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs)
  2476. ProcesoVisibilidad(grpInstrumentos)
  2477. End Sub
  2478. Private Sub lblCalificadora_Click(sender As Object, e As EventArgs)
  2479. End Sub
  2480. Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs)
  2481. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2482. End Sub
  2483. Private Sub lblPais_Click(sender As Object, e As EventArgs)
  2484. End Sub
  2485. Private Sub pnlPais_Click(sender As Object, e As EventArgs)
  2486. ProcesoVisibilidad(grpPais)
  2487. End Sub
  2488. Private Sub lblEstado_Click(sender As Object, e As EventArgs)
  2489. End Sub
  2490. Private Sub pnlEstado_Click(sender As Object, e As EventArgs)
  2491. ProcesoVisibilidad(grpEstadoDocumento)
  2492. End Sub
  2493. Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs)
  2494. End Sub
  2495. Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs)
  2496. ProcesoVisibilidad(grpAutorizacion)
  2497. End Sub
  2498. Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs)
  2499. End Sub
  2500. Private Sub pnlTipOper_Click(sender As Object, e As EventArgs)
  2501. ProcesoVisibilidad(grpTipoOperacion)
  2502. End Sub
  2503. Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs)
  2504. End Sub
  2505. Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs)
  2506. ProcesoVisibilidad(grpTipoMercado)
  2507. End Sub
  2508. Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs)
  2509. ProcesoVisibilidad(grpOrigenFondos)
  2510. End Sub
  2511. Private Sub pnlPlazo_Click(sender As Object, e As EventArgs)
  2512. ProcesoVisibilidad(grpPlazo)
  2513. End Sub
  2514. Private Sub pnlEmisor_Click(sender As Object, e As EventArgs)
  2515. ProcesoVisibilidad(grpEmisor)
  2516. End Sub
  2517. Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs)
  2518. ProcesoVisibilidad(grpCalificacionRiesgo)
  2519. End Sub
  2520. Private Sub Button1_Click(sender As Object, e As EventArgs)
  2521. End Sub
  2522. Private Sub TbComentarios_Click(sender As Object, e As EventArgs)
  2523. End Sub
  2524. Private Sub pnlContenedor_Paint(sender As Object, e As PaintEventArgs) Handles pnlContenedor.Paint
  2525. End Sub
  2526. Private Sub mnuFilEmpresas_Click(sender As Object, e As EventArgs)
  2527. ProcesoVisibilidad(grpEmpresas)
  2528. End Sub
  2529. Private Sub mnuInstrumentos_Click(sender As Object, e As EventArgs)
  2530. CambiarPosicionPrincipal(sender)
  2531. End Sub
  2532. Private Sub mnuFilInstrumentos_Click(sender As Object, e As EventArgs)
  2533. End Sub
  2534. Private Sub mnuFilOrigenFondos_Click(sender As Object, e As EventArgs)
  2535. End Sub
  2536. Private Sub mnuOrigenFondos_Click(sender As Object, e As EventArgs)
  2537. CambiarPosicionPrincipal(sender)
  2538. End Sub
  2539. Private Sub mnuPlazo_Click(sender As Object, e As EventArgs)
  2540. CambiarPosicionPrincipal(sender)
  2541. End Sub
  2542. Private Sub mnuFilPlazo_Click(sender As Object, e As EventArgs)
  2543. End Sub
  2544. Private Sub mnuEmisor_Click(sender As Object, e As EventArgs)
  2545. CambiarPosicionPrincipal(sender)
  2546. End Sub
  2547. Private Sub mnuFilEmisor_Click(sender As Object, e As EventArgs)
  2548. End Sub
  2549. Private Sub mnuFilCalRiesgo_Click(sender As Object, e As EventArgs)
  2550. End Sub
  2551. Private Sub mnuFilCalificadora_Click(sender As Object, e As EventArgs)
  2552. End Sub
  2553. Private Sub mnuFilPais_Click(sender As Object, e As EventArgs)
  2554. End Sub
  2555. Private Sub mnuFilEstado_Click(sender As Object, e As EventArgs)
  2556. End Sub
  2557. Private Sub mnuFilAut_Click(sender As Object, e As EventArgs)
  2558. End Sub
  2559. Private Sub mnuFilTipOper_Click(sender As Object, e As EventArgs)
  2560. End Sub
  2561. Private Sub mnuFilTipMercado_Click(sender As Object, e As EventArgs)
  2562. End Sub
  2563. Private Sub mnuVerEmpresas_Click(sender As Object, e As EventArgs)
  2564. LanzarBusqueda()
  2565. End Sub
  2566. Private Sub mnuVerInstrumentos_Click(sender As Object, e As EventArgs)
  2567. LanzarBusqueda()
  2568. End Sub
  2569. Private Sub mnuVerOrigenFondos_Click(sender As Object, e As EventArgs)
  2570. LanzarBusqueda()
  2571. End Sub
  2572. Sub CambiarPosicionPrincipal(sender As Object)
  2573. Dim PosicionY = sender.Location.Y
  2574. Dim PosicionX = pnlContenedor.Location.X
  2575. pnlContenedor.Location = New Point(PosicionX, PosicionY)
  2576. End Sub
  2577. Private Sub mnuEmpresas_Click(sender As Object, e As EventArgs)
  2578. CambiarPosicionPrincipal(sender)
  2579. End Sub
  2580. Private Sub mnuCalRiesgo_Click(sender As Object, e As EventArgs)
  2581. CambiarPosicionPrincipal(sender)
  2582. End Sub
  2583. Private Sub mnuCalificadora_Click(sender As Object, e As EventArgs)
  2584. CambiarPosicionPrincipal(sender)
  2585. End Sub
  2586. Private Sub mnuPais_Click(sender As Object, e As EventArgs)
  2587. CambiarPosicionPrincipal(sender)
  2588. End Sub
  2589. Private Sub mnuEstado_Click(sender As Object, e As EventArgs)
  2590. CambiarPosicionPrincipal(sender)
  2591. End Sub
  2592. Private Sub mnuAut_Click(sender As Object, e As EventArgs)
  2593. CambiarPosicionPrincipal(sender)
  2594. End Sub
  2595. Private Sub mnuTipOper_Click(sender As Object, e As EventArgs)
  2596. CambiarPosicionPrincipal(sender)
  2597. End Sub
  2598. Private Sub mnuTipMercado_Click(sender As Object, e As EventArgs)
  2599. CambiarPosicionPrincipal(sender)
  2600. End Sub
  2601. Private Sub lblEmpresa_Click_1(sender As Object, e As EventArgs) Handles lblEmpresa.Click
  2602. ProcesoVisibilidad(grpEmpresas)
  2603. MenuSeleccionado(sender)
  2604. CambiarPosicionPrincipal(sender.parent)
  2605. End Sub
  2606. Private Sub pnlEmpresa_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlEmpresa.Paint
  2607. End Sub
  2608. Private Sub lblEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover
  2609. EventHijoAcercar(sender)
  2610. End Sub
  2611. Private Sub lblInstrumento_Click_1(sender As Object, e As EventArgs) Handles lblInstrumento.Click
  2612. ProcesoVisibilidad(grpInstrumentos)
  2613. MenuSeleccionado(sender)
  2614. CambiarPosicionPrincipal(sender.parent)
  2615. End Sub
  2616. Private Sub lblInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover
  2617. EventHijoAcercar(sender)
  2618. End Sub
  2619. Private Sub lblOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover
  2620. EventHijoAcercar(sender)
  2621. End Sub
  2622. Private Sub lblPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover
  2623. EventHijoAcercar(sender)
  2624. End Sub
  2625. Private Sub lblEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover
  2626. EventHijoAcercar(sender)
  2627. End Sub
  2628. Private Sub lblCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover
  2629. EventHijoAcercar(sender)
  2630. End Sub
  2631. Private Sub lblCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover
  2632. EventHijoAcercar(sender)
  2633. End Sub
  2634. Private Sub lblPais_MouseHover_1(sender As Object, e As EventArgs) Handles lblPais.MouseHover
  2635. EventHijoAcercar(sender)
  2636. End Sub
  2637. Private Sub lblEstado_MouseHover_1(sender As Object, e As EventArgs) Handles lblEstado.MouseHover
  2638. EventHijoAcercar(sender)
  2639. End Sub
  2640. Private Sub lblAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseHover
  2641. EventHijoAcercar(sender)
  2642. End Sub
  2643. Private Sub lblTipoOperacion_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover
  2644. EventHijoAcercar(sender)
  2645. End Sub
  2646. Private Sub lblTipoMercado_MouseHover_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover
  2647. EventHijoAcercar(sender)
  2648. End Sub
  2649. Private Sub lblEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave
  2650. EventHijoAlejar(sender)
  2651. End Sub
  2652. Private Sub lblInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave
  2653. EventHijoAlejar(sender)
  2654. End Sub
  2655. Private Sub lblOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave
  2656. EventHijoAlejar(sender)
  2657. End Sub
  2658. Private Sub lblPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave
  2659. EventHijoAlejar(sender)
  2660. End Sub
  2661. Private Sub lblEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave
  2662. EventHijoAlejar(sender)
  2663. End Sub
  2664. Private Sub lblCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave
  2665. EventHijoAlejar(sender)
  2666. End Sub
  2667. Private Sub lblCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave
  2668. EventHijoAlejar(sender)
  2669. End Sub
  2670. Private Sub lblPais_MouseLeave_1(sender As Object, e As EventArgs) Handles lblPais.MouseLeave
  2671. EventHijoAlejar(sender)
  2672. End Sub
  2673. Private Sub lblEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave
  2674. EventHijoAlejar(sender)
  2675. End Sub
  2676. Private Sub lblAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblAutorizacion.MouseLeave
  2677. EventHijoAlejar(sender)
  2678. End Sub
  2679. Private Sub lblTipoOperacion_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave
  2680. EventHijoAlejar(sender)
  2681. End Sub
  2682. Private Sub lblTipoMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave
  2683. EventHijoAlejar(sender)
  2684. End Sub
  2685. Private Sub pnlEmpresa_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover
  2686. EventPadreAcercar(sender)
  2687. End Sub
  2688. Private Sub pnlInstrumento_MouseHover_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover
  2689. EventPadreAcercar(sender)
  2690. End Sub
  2691. Private Sub pnlOrigenFondos_MouseHover_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover
  2692. EventPadreAcercar(sender)
  2693. End Sub
  2694. Private Sub pnlPlazo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover
  2695. EventPadreAcercar(sender)
  2696. End Sub
  2697. Private Sub pnlEmisor_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover
  2698. EventPadreAcercar(sender)
  2699. End Sub
  2700. Private Sub pnlCalificacionRiesgo_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover
  2701. EventPadreAcercar(sender)
  2702. End Sub
  2703. Private Sub pnlCalificadora_MouseHover_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover
  2704. EventPadreAcercar(sender)
  2705. End Sub
  2706. Private Sub pnlPais_MouseHover_1(sender As Object, e As EventArgs) Handles pnlPais.MouseHover
  2707. EventPadreAcercar(sender)
  2708. End Sub
  2709. Private Sub pnlEstado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover
  2710. EventPadreAcercar(sender)
  2711. End Sub
  2712. Private Sub pnlAutorizacion_MouseHover_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseHover
  2713. EventPadreAcercar(sender)
  2714. End Sub
  2715. Private Sub pnlTipOper_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover
  2716. EventPadreAcercar(sender)
  2717. End Sub
  2718. Private Sub pnlTipMercado_MouseHover_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover
  2719. EventPadreAcercar(sender)
  2720. End Sub
  2721. Private Sub pnlEmpresa_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave
  2722. EventPadreAlejar(sender)
  2723. End Sub
  2724. Private Sub pnlInstrumento_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave
  2725. EventPadreAlejar(sender)
  2726. End Sub
  2727. Private Sub pnlOrigenFondos_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave
  2728. EventPadreAlejar(sender)
  2729. End Sub
  2730. Private Sub pnlPlazo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave
  2731. EventPadreAlejar(sender)
  2732. End Sub
  2733. Private Sub pnlEmisor_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave
  2734. EventPadreAlejar(sender)
  2735. End Sub
  2736. Private Sub pnlCalificacionRiesgo_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave
  2737. EventPadreAlejar(sender)
  2738. End Sub
  2739. Private Sub pnlCalificadora_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave
  2740. EventPadreAlejar(sender)
  2741. End Sub
  2742. Private Sub pnlPais_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave
  2743. EventPadreAlejar(sender)
  2744. End Sub
  2745. Private Sub pnlEstado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave
  2746. EventPadreAlejar(sender)
  2747. End Sub
  2748. Private Sub pnlAutorizacion_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.MouseLeave
  2749. EventPadreAlejar(sender)
  2750. End Sub
  2751. Private Sub pnlTipOper_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave
  2752. EventPadreAlejar(sender)
  2753. End Sub
  2754. Private Sub pnlTipMercado_MouseLeave_1(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave
  2755. EventPadreAlejar(sender)
  2756. End Sub
  2757. Private Sub pnlEmpresa_Click_1(sender As Object, e As EventArgs) Handles pnlEmpresa.Click
  2758. ProcesoVisibilidad(grpEmpresas)
  2759. MenuSeleccionado(sender)
  2760. CambiarPosicionPrincipal(sender)
  2761. End Sub
  2762. Private Sub pnlInstrumento_Click_1(sender As Object, e As EventArgs) Handles pnlInstrumento.Click
  2763. ProcesoVisibilidad(grpInstrumentos)
  2764. MenuSeleccionado(sender)
  2765. CambiarPosicionPrincipal(sender)
  2766. End Sub
  2767. Private Sub lblOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click
  2768. ProcesoVisibilidad(grpOrigenFondos)
  2769. MenuSeleccionado(sender)
  2770. CambiarPosicionPrincipal(sender.parent)
  2771. End Sub
  2772. Private Sub pnlOrigenFondos_Click_1(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click
  2773. ProcesoVisibilidad(grpOrigenFondos)
  2774. MenuSeleccionado(sender)
  2775. CambiarPosicionPrincipal(sender)
  2776. End Sub
  2777. Private Sub lblPlazo_Click_1(sender As Object, e As EventArgs) Handles lblPlazo.Click
  2778. ProcesoVisibilidad(grpPlazo)
  2779. MenuSeleccionado(sender)
  2780. CambiarPosicionPrincipal(sender.parent)
  2781. End Sub
  2782. Private Sub pnlPlazo_Click_1(sender As Object, e As EventArgs) Handles pnlPlazo.Click
  2783. ProcesoVisibilidad(grpPlazo)
  2784. MenuSeleccionado(sender)
  2785. CambiarPosicionPrincipal(sender)
  2786. End Sub
  2787. Private Sub lblEmisor_Click_1(sender As Object, e As EventArgs) Handles lblEmisor.Click
  2788. ProcesoVisibilidad(grpEmisor)
  2789. MenuSeleccionado(sender)
  2790. CambiarPosicionPrincipal(sender.parent)
  2791. End Sub
  2792. Private Sub pnlEmisor_Click_1(sender As Object, e As EventArgs) Handles pnlEmisor.Click
  2793. ProcesoVisibilidad(grpEmisor)
  2794. MenuSeleccionado(sender)
  2795. CambiarPosicionPrincipal(sender)
  2796. End Sub
  2797. Private Sub lblCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click
  2798. ProcesoVisibilidad(grpCalificacionRiesgo)
  2799. MenuSeleccionado(sender)
  2800. CambiarPosicionPrincipal(sender.parent)
  2801. End Sub
  2802. Private Sub pnlCalificacionRiesgo_Click_1(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click
  2803. ProcesoVisibilidad(grpCalificacionRiesgo)
  2804. MenuSeleccionado(sender)
  2805. CambiarPosicionPrincipal(sender)
  2806. End Sub
  2807. Private Sub lblCalificadora_Click_1(sender As Object, e As EventArgs) Handles lblCalificadora.Click
  2808. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2809. MenuSeleccionado(sender)
  2810. CambiarPosicionPrincipal(sender.parent)
  2811. End Sub
  2812. Private Sub pnlCalificadora_Click_1(sender As Object, e As EventArgs) Handles pnlCalificadora.Click
  2813. ProcesoVisibilidad(grpCalificadoraRiesgo)
  2814. MenuSeleccionado(sender)
  2815. CambiarPosicionPrincipal(sender)
  2816. End Sub
  2817. Private Sub lblPais_Click_1(sender As Object, e As EventArgs) Handles lblPais.Click
  2818. ProcesoVisibilidad(grpPais)
  2819. MenuSeleccionado(sender)
  2820. CambiarPosicionPrincipal(sender.parent)
  2821. End Sub
  2822. Private Sub pnlPais_Click_1(sender As Object, e As EventArgs) Handles pnlPais.Click
  2823. ProcesoVisibilidad(grpPais)
  2824. MenuSeleccionado(sender)
  2825. CambiarPosicionPrincipal(sender)
  2826. End Sub
  2827. Private Sub lblEstado_Click_1(sender As Object, e As EventArgs) Handles lblEstado.Click
  2828. ProcesoVisibilidad(grpEstadoDocumento)
  2829. MenuSeleccionado(sender)
  2830. CambiarPosicionPrincipal(sender.parent)
  2831. End Sub
  2832. Private Sub pnlEstado_Click_1(sender As Object, e As EventArgs) Handles pnlEstado.Click
  2833. ProcesoVisibilidad(grpEstadoDocumento)
  2834. MenuSeleccionado(sender)
  2835. CambiarPosicionPrincipal(sender)
  2836. End Sub
  2837. Private Sub lblAutorizacion_Click_1(sender As Object, e As EventArgs) Handles lblAutorizacion.Click
  2838. ProcesoVisibilidad(grpAutorizacion)
  2839. MenuSeleccionado(sender)
  2840. CambiarPosicionPrincipal(sender.parent)
  2841. End Sub
  2842. Private Sub pnlAutorizacion_Click_1(sender As Object, e As EventArgs) Handles pnlAutorizacion.Click
  2843. ProcesoVisibilidad(grpAutorizacion)
  2844. MenuSeleccionado(sender)
  2845. CambiarPosicionPrincipal(sender)
  2846. End Sub
  2847. Private Sub lblTipoOperacion_Click_1(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click
  2848. ProcesoVisibilidad(grpTipoOperacion)
  2849. MenuSeleccionado(sender)
  2850. CambiarPosicionPrincipal(sender.parent)
  2851. End Sub
  2852. Private Sub pnlTipOper_Click_1(sender As Object, e As EventArgs) Handles pnlTipOper.Click
  2853. ProcesoVisibilidad(grpTipoOperacion)
  2854. MenuSeleccionado(sender)
  2855. CambiarPosicionPrincipal(sender)
  2856. End Sub
  2857. Private Sub lblTipoMercado_Click_1(sender As Object, e As EventArgs) Handles lblTipoMercado.Click
  2858. ProcesoVisibilidad(grpTipoMercado)
  2859. MenuSeleccionado(sender)
  2860. CambiarPosicionPrincipal(sender.parent)
  2861. End Sub
  2862. Private Sub pnlTipMercado_Click_1(sender As Object, e As EventArgs) Handles pnlTipMercado.Click
  2863. ProcesoVisibilidad(grpTipoMercado)
  2864. MenuSeleccionado(sender)
  2865. CambiarPosicionPrincipal(sender)
  2866. End Sub
  2867. Private Sub pnlOrigenFondos_Paint_1(sender As Object, e As PaintEventArgs) Handles pnlOrigenFondos.Paint
  2868. End Sub
  2869. Private Sub pnlTipMercado_Paint(sender As Object, e As PaintEventArgs) Handles pnlTipMercado.Paint
  2870. End Sub
  2871. Sub CargarTabla()
  2872. frmBuscar = New frmBuscarDeLista(1)
  2873. Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
  2874. DiccionarioColecciones = GuardarColecciones()
  2875. Dim Data As New DataTable
  2876. Data = oDAOPropuestasDeInversion.BuscarPropuestasCodigo(DiccionarioColecciones).Tables("Resultado")
  2877. GenerarFormato(Data)
  2878. For Each Item In pnlCargaDatos.Controls
  2879. If TypeOf Item Is Form Then
  2880. Item.dispose
  2881. End If
  2882. Next
  2883. frmBuscar.dgvBuscarDeLista.DataSource = Data
  2884. frmBuscar.Dock = DockStyle.Fill
  2885. frmBuscar.TopLevel = False
  2886. frmBuscar.Parent = pnlCargaDatos
  2887. frmBuscar.Show()
  2888. End Sub
  2889. Sub GenerarFormato(ByRef Data As DataTable)
  2890. For Each Row As DataRow In Data.Rows
  2891. Dim CodigoPropuesta As String = String.Empty
  2892. Dim Estado As String = String.Empty
  2893. Dim Asunto As String = String.Empty
  2894. Dim Empresa As String = String.Empty
  2895. Dim InstrumentoFinanciero As String = String.Empty
  2896. Dim Emisor As String = String.Empty
  2897. Dim CalificacionRiesgo As String = String.Empty
  2898. Dim EmpresaCalificadora As String = String.Empty
  2899. Dim OrigenFondos As String = String.Empty
  2900. Dim Comentarios As String = String.Empty
  2901. Dim Justificaciones As String = String.Empty
  2902. Dim TipoOperacion As String = String.Empty
  2903. Dim Base As String = String.Empty
  2904. Dim Monto As String = String.Empty
  2905. Dim Precio As String = String.Empty
  2906. Dim Rendimiento As String = String.Empty
  2907. Dim CantidadPlazo As String = String.Empty
  2908. Dim TipoPlazo As String = String.Empty
  2909. Dim Ingresos As String = String.Empty
  2910. Dim FechaCreación As String = String.Empty
  2911. Dim EstadoAutorización As String = String.Empty
  2912. Dim TipoMercado As String = String.Empty
  2913. Dim Pais As String = String.Empty
  2914. CodigoPropuesta = Row("Código de Propuesta").ToString
  2915. Estado = Row("Estado").ToString
  2916. Asunto = Row("Asunto").ToString
  2917. Empresa = Row("Empresa").ToString
  2918. InstrumentoFinanciero = Row("Instrumento Financiero").ToString
  2919. Emisor = Row("Emisor").ToString
  2920. CalificacionRiesgo = Row("Calificación de Riesgo").ToString
  2921. EmpresaCalificadora = Row("Empresa Calificadora").ToString
  2922. OrigenFondos = Row("Origen de Fondos").ToString
  2923. Comentarios = Row("Comentarios").ToString
  2924. Justificaciones = Row("Justificaciones").ToString
  2925. TipoOperacion = Row("Tipo de Operacion").ToString
  2926. Base = Row("Base de Calculo").ToString
  2927. Monto = Row("Monto de Inversion").ToString
  2928. Precio = Row("Precio").ToString
  2929. Rendimiento = Row("Rendimiento").ToString
  2930. CantidadPlazo = Row("Cantidad en Plazo").ToString
  2931. TipoPlazo = Row("Tipo de Plazo").ToString
  2932. Ingresos = Row("Ingresos").ToString
  2933. FechaCreación = Row("Fecha de Creación").ToString
  2934. EstadoAutorización = Row("Estado de Autorización").ToString
  2935. TipoMercado = Row("Tipo de Mercado").ToString
  2936. Pais = Row("Pais").ToString
  2937. If String.IsNullOrEmpty(CodigoPropuesta) Then
  2938. CodigoPropuesta = " ---- ---- ---- ---- ----"
  2939. End If
  2940. If String.IsNullOrEmpty(Estado) Then
  2941. Estado = " ---- ---- ---- ---- ----"
  2942. End If
  2943. If String.IsNullOrEmpty(Asunto) Then
  2944. Asunto = " ---- ---- ---- ---- ----"
  2945. End If
  2946. If String.IsNullOrEmpty(Empresa) Then
  2947. Empresa = " ---- ---- ---- ---- ----"
  2948. End If
  2949. If String.IsNullOrEmpty(InstrumentoFinanciero) Then
  2950. InstrumentoFinanciero = " ---- ---- ---- ---- ----"
  2951. End If
  2952. If String.IsNullOrEmpty(Emisor) Then
  2953. Emisor = " ---- ---- ---- ---- ----"
  2954. End If
  2955. If String.IsNullOrEmpty(CalificacionRiesgo) Then
  2956. CalificacionRiesgo = " ---- ---- ---- ---- ----"
  2957. End If
  2958. If String.IsNullOrEmpty(EmpresaCalificadora) Then
  2959. EmpresaCalificadora = " ---- ---- ---- ---- ----"
  2960. End If
  2961. If String.IsNullOrEmpty(OrigenFondos) Then
  2962. OrigenFondos = " ---- ---- ---- ---- ----"
  2963. End If
  2964. If String.IsNullOrEmpty(Comentarios) Then
  2965. Comentarios = " ---- ---- ---- ---- ----"
  2966. End If
  2967. If String.IsNullOrEmpty(Justificaciones) Then
  2968. Justificaciones = " ---- ---- ---- ---- ----"
  2969. End If
  2970. If String.IsNullOrEmpty(TipoOperacion) Then
  2971. TipoOperacion = " ---- ---- ---- ---- ----"
  2972. End If
  2973. If String.IsNullOrEmpty(Base) Then
  2974. Base = " ---- ---- ---- ---- ----"
  2975. End If
  2976. If String.IsNullOrEmpty(Monto) Then
  2977. Monto = " ---- ---- ---- ---- ----"
  2978. End If
  2979. If String.IsNullOrEmpty(Precio) Then
  2980. Precio = " ---- ---- ---- ---- ----"
  2981. End If
  2982. If String.IsNullOrEmpty(Rendimiento) Then
  2983. Rendimiento = " ---- ---- ---- ---- ----"
  2984. End If
  2985. If String.IsNullOrEmpty(CantidadPlazo) Then
  2986. CantidadPlazo = " ---- ---- ---- ---- ----"
  2987. End If
  2988. If String.IsNullOrEmpty(TipoPlazo) Then
  2989. TipoPlazo = " ---- ---- ---- ---- ----"
  2990. End If
  2991. If String.IsNullOrEmpty(Ingresos) Then
  2992. Ingresos = " ---- ---- ---- ---- ----"
  2993. End If
  2994. If String.IsNullOrEmpty(FechaCreación) Then
  2995. FechaCreación = " ---- ---- ---- ---- ----"
  2996. End If
  2997. If String.IsNullOrEmpty(EstadoAutorización) Then
  2998. EstadoAutorización = " ---- ---- ---- ---- ----"
  2999. End If
  3000. If String.IsNullOrEmpty(TipoMercado) Then
  3001. TipoMercado = " ---- ---- ---- ---- ----"
  3002. End If
  3003. If String.IsNullOrEmpty(Pais) Then
  3004. Pais = " ---- ---- ---- ---- ----"
  3005. End If
  3006. Row("Código de Propuesta") = CodigoPropuesta
  3007. Row("Estado") = Estado
  3008. Row("Asunto") = Asunto
  3009. Row("Empresa") = Empresa
  3010. Row("Instrumento Financiero") = InstrumentoFinanciero
  3011. Row("Emisor") = Emisor
  3012. Row("Calificación de Riesgo") = CalificacionRiesgo
  3013. Row("Empresa Calificadora") = EmpresaCalificadora
  3014. Row("Origen de Fondos") = OrigenFondos
  3015. Row("Comentarios") = Comentarios
  3016. Row("Justificaciones") = Justificaciones
  3017. Row("Tipo de Operacion") = TipoOperacion
  3018. Row("Base de Calculo") = Base
  3019. Row("Monto de Inversion") = Monto
  3020. Row("Precio") = Precio
  3021. Row("Rendimiento") = Rendimiento
  3022. Row("Cantidad en Plazo") = CantidadPlazo
  3023. Row("Tipo de Plazo") = TipoPlazo
  3024. Row("Ingresos") = Ingresos
  3025. Row("Fecha de Creación") = FechaCreación
  3026. Row("Estado de Autorización") = EstadoAutorización
  3027. Row("Tipo de Mercado") = TipoMercado
  3028. Row("Pais") = Pais
  3029. Next
  3030. End Sub
  3031. Private Sub pnlPie_Paint(sender As Object, e As PaintEventArgs) Handles pnlPie.Paint
  3032. End Sub
  3033. Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles btnAceptar.Click
  3034. eventoCargar()
  3035. End Sub
  3036. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
  3037. eventoCancelar()
  3038. End Sub
  3039. Private Sub txtBuscar_TextChanged(sender As Object, e As EventArgs) Handles txtBuscar.TextChanged
  3040. 'Filtrar(sender)
  3041. Filtrar(sender)
  3042. End Sub
  3043. Sub Filtrar(sender As Object)
  3044. Dim TextoIngresado As String = sender.text.ToString.ToLower
  3045. Dim CajaActiva As New GroupBox
  3046. Dim CajaInterna As New FlowLayoutPanel
  3047. For Each Item In pnlContenedor.Controls
  3048. If TypeOf Item Is GroupBox Then
  3049. If Item.visible Then
  3050. CajaActiva = Item
  3051. Exit For
  3052. End If
  3053. End If
  3054. Next
  3055. For Each Item In CajaActiva.Controls
  3056. If TypeOf Item Is FlowLayoutPanel Then
  3057. CajaInterna = Item
  3058. Exit For
  3059. End If
  3060. Next
  3061. For Each Item In CajaInterna.Controls
  3062. If TypeOf Item Is CheckBox Then
  3063. If Item.text.ToString.ToLower.Contains(TextoIngresado) Then
  3064. If Not Item.visible Then
  3065. Item.visible = True
  3066. End If
  3067. Else
  3068. If Item.visible Then
  3069. Item.visible = False
  3070. End If
  3071. End If
  3072. End If
  3073. Next
  3074. End Sub
  3075. Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
  3076. End Sub
  3077. Sub ModoPropuesta()
  3078. Dim TbNM = TbIngresarModificar
  3079. Dim VTbBuscar = TbBuscar
  3080. If Modo = "NM" Or (TipoTransaccion = "B" And Modo = "NM") Then
  3081. If Not VTbBuscar.Parent Is Nothing Then
  3082. TbBuscar.Parent = Nothing
  3083. End If
  3084. If (TbNM.Parent Is Nothing) Then
  3085. TbNM.Parent = TabCampos
  3086. End If
  3087. ElseIf Modo = "B" Then
  3088. If Not TbNM.Parent Is Nothing Then
  3089. TbNM.Parent = Nothing
  3090. End If
  3091. If (VTbBuscar.Parent Is Nothing) Then
  3092. VTbBuscar.Parent = TabCampos
  3093. End If
  3094. End If
  3095. End Sub
  3096. Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles navRecorrer.Click
  3097. DeshabilitarControles()
  3098. PreBusqueda()
  3099. Modo = "NM"
  3100. ModoPropuesta()
  3101. Me.PIN0TableAdapter3.Fill(Me.InversionesDEVDataSet5.PIN0)
  3102. PIN0BindingSource4.ResumeBinding()
  3103. btnAccion.Text = "Aceptar"
  3104. End Sub
  3105. Public Sub CargarDatosContenedor()
  3106. If MsgBox("Desea ver esta Propuesta de Inversión", MsgBoxStyle.OkCancel) = DialogResult.OK Then
  3107. Dim Id As Integer = frmBuscar.dgvBuscarDeLista.CurrentRow.Cells("Id").Value
  3108. If Not Id = Nothing Then
  3109. Modo = "NM"
  3110. TipoTransaccion = "B"
  3111. ModoPropuesta()
  3112. DeshabilitarControles()
  3113. PreBusqueda()
  3114. CargarPropuesta(Id)
  3115. LlamadaDesdeBusqueda = True
  3116. End If
  3117. End If
  3118. End Sub
  3119. Private Sub txtMontoInversion_KeyPress(sender As Object, e As KeyPressEventArgs)
  3120. ValidarEntradaPrecionada(sender, e)
  3121. End Sub
  3122. Sub ValidarEntradaPrecionada(sender As Object, e As KeyPressEventArgs)
  3123. If String.IsNullOrEmpty(sender.Text) Then
  3124. If e.KeyChar = "." Then
  3125. sender.Text = "0"
  3126. Exit Sub
  3127. End If
  3128. End If
  3129. If (Not sender.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  3130. Operaciones.ValidarEntrada(sender, e, True)
  3131. Else
  3132. Operaciones.ValidarEntrada(sender, e, False)
  3133. End If
  3134. End Sub
  3135. Sub ValidarEntradaLevantar(ByRef sender As Object)
  3136. If sender.Text = "." Then
  3137. sender.Text = ".0"
  3138. End If
  3139. End Sub
  3140. Private Sub txtMontoInversion_KeyUp(sender As Object, e As KeyEventArgs)
  3141. ValidarEntradaLevantar(sender)
  3142. End Sub
  3143. Private Sub txtIngresos_KeyPress(sender As Object, e As KeyPressEventArgs)
  3144. ValidarEntradaPrecionada(sender, e)
  3145. End Sub
  3146. Private Sub txtIngresos_KeyUp(sender As Object, e As KeyEventArgs)
  3147. ValidarEntradaLevantar(sender)
  3148. End Sub
  3149. Private Sub txtPrecio_KeyPress(sender As Object, e As KeyPressEventArgs)
  3150. ValidarEntradaPrecionada(sender, e)
  3151. End Sub
  3152. Private Sub txtPrecio_KeyUp(sender As Object, e As KeyEventArgs)
  3153. ValidarEntradaLevantar(sender)
  3154. End Sub
  3155. Private Sub txtRendimiento_KeyPress(sender As Object, e As KeyPressEventArgs)
  3156. ValidarEntradaPrecionada(sender, e)
  3157. End Sub
  3158. Private Sub txtRendimiento_KeyUp(sender As Object, e As KeyEventArgs)
  3159. ValidarEntradaLevantar(sender)
  3160. End Sub
  3161. Private Sub txtPlazoNumero_KeyPress(sender As Object, e As KeyPressEventArgs)
  3162. ValidarEntradaPrecionada(sender, e)
  3163. End Sub
  3164. Private Sub txtPlazoNumero_KeyUp(sender As Object, e As KeyEventArgs)
  3165. ValidarEntradaLevantar(sender)
  3166. End Sub
  3167. Private Sub btnRequisicionDePago_Click(sender As Object, e As EventArgs)
  3168. End Sub
  3169. Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles navVistaPrevia.Click
  3170. Impresion(True)
  3171. End Sub
  3172. Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles navImprimir.Click
  3173. Impresion(False)
  3174. End Sub
  3175. Private Sub Impresion(ByVal pVistaPreliminar As Boolean)
  3176. Dim General As New DAOGeneral
  3177. Dim Codigo As String = txtCodigoInversion.Text
  3178. Dim Id = General.IdPropuesta(Codigo)
  3179. IdPIN = Id
  3180. If Not IdPIN = Nothing Then
  3181. Dim oImprimir As New frmImprimir("PrintPropuestaDeInversion.rpt", IdPIN, True)
  3182. oImprimir.NombreRPT = "PrintPropuestaDeInversion.rpt"
  3183. oImprimir.IdDocumento = IdPIN
  3184. If pVistaPreliminar = True Then
  3185. oImprimir.ShowDialog()
  3186. Else
  3187. oImprimir.VistaPrevia = False
  3188. oImprimir.CargarRPT()
  3189. End If
  3190. End If
  3191. End Sub
  3192. Private Sub txtNombre_TextChanged(sender As Object, e As EventArgs) Handles txtNombre.TextChanged
  3193. ControlNombre()
  3194. End Sub
  3195. Private Sub cboRenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboRenta.SelectedIndexChanged
  3196. ControlTipoRenta()
  3197. End Sub
  3198. Private Sub cboPaises_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged
  3199. ControlPais()
  3200. End Sub
  3201. Private Sub grbInversión_Enter(sender As Object, e As EventArgs) Handles grbInversión.Enter
  3202. End Sub
  3203. Private Sub btnCambiarEstado_Click(sender As Object, e As EventArgs) Handles btnCambiarRev.Click
  3204. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3205. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3206. If ExisteInstrumento Then
  3207. ModificarEstado("V")
  3208. Else
  3209. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3210. End If
  3211. End Sub
  3212. Sub ModificarEstado(Estado As String)
  3213. Dim Codigo = txtCodigoInversion.Text
  3214. If Not String.IsNullOrEmpty(Codigo) Then
  3215. Dim posicion = PIN0BindingSource4.Position
  3216. ActivarSuspen = True
  3217. Modo = "NM"
  3218. btnAccion.Text = "Actualizar"
  3219. PrepararModificacion()
  3220. ModoPropuesta()
  3221. DeshabilitarControles()
  3222. CambiarEstadoAut(Estado)
  3223. TipoTransaccion = "A"
  3224. ControlCambio()
  3225. End If
  3226. End Sub
  3227. Private Sub btnCambiarInter_Click(sender As Object, e As EventArgs)
  3228. ModificarEstado("I")
  3229. End Sub
  3230. Private Sub btnCambiarApro_Click(sender As Object, e As EventArgs) Handles btnCambiarApro.Click
  3231. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3232. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3233. If ExisteInstrumento Then
  3234. ModificarEstado("A")
  3235. Else
  3236. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3237. End If
  3238. End Sub
  3239. Private Sub btnCambiarRec_Click(sender As Object, e As EventArgs) Handles btnCambiarRec.Click
  3240. Dim Codigo As String = txtCodigoInversion.Text.ToString
  3241. Dim ExisteInstrumento As Boolean = oDAOPropuestasDeInversion.ExisteInstrumento(Codigo)
  3242. If ExisteInstrumento Then
  3243. ModificarEstado("R")
  3244. Else
  3245. MsgBox("El detalle del instrumento no ha sido ingresado o el monto de inversión es 0")
  3246. End If
  3247. End Sub
  3248. Sub EstadoControladoresNAV()
  3249. Dim Estado As String = String.Empty
  3250. If cboAutorizacion.SelectedValue = "P" Then
  3251. Estado = "P"
  3252. ElseIf cboAutorizacion.SelectedValue = "V" Then
  3253. Estado = "V"
  3254. ElseIf cboAutorizacion.SelectedValue = "A" Then
  3255. Estado = "A"
  3256. ElseIf cboAutorizacion.SelectedValue = "R" Then
  3257. Estado = "R"
  3258. End If
  3259. If Estado = "P" Or Estado = "A" Or Estado = "R" Then
  3260. navNuevo.Enabled = True
  3261. navModificar.Enabled = False
  3262. navEliminar.Enabled = False
  3263. navBuscar.Enabled = True
  3264. navRecorrer.Enabled = True
  3265. navVistaPrevia.Enabled = True
  3266. navImprimir.Enabled = True
  3267. ElseIf Estado = "V" Then
  3268. navNuevo.Enabled = True
  3269. navModificar.Enabled = True
  3270. navEliminar.Enabled = False
  3271. navBuscar.Enabled = True
  3272. navRecorrer.Enabled = True
  3273. navVistaPrevia.Enabled = True
  3274. navImprimir.Enabled = True
  3275. End If
  3276. End Sub
  3277. Private Sub txtCodigoCompra_TextChanged(sender As Object, e As EventArgs)
  3278. End Sub
  3279. Private Sub pnlCambiarRev_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarRev.Paint
  3280. End Sub
  3281. Private Sub pnlCambiarApro_Paint(sender As Object, e As PaintEventArgs) Handles pnlCambiarApro.Paint
  3282. End Sub
  3283. Private Sub TabCampos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged
  3284. CargarTabla()
  3285. End Sub
  3286. Sub LimpiarVariablesTraspaso()
  3287. Variables.RetMonto = 0
  3288. Variables.RetPrecio = 0
  3289. Variables.RetRendimiento = 0
  3290. Variables.RetIngresosEsp = 0
  3291. Variables.RetUnidadesAcciones = 0
  3292. Variables.RetUnidadesContratosFuturos = 0
  3293. Variables.RetCantidadContratosFuturos = 0
  3294. Variables.RetCuotaParticipacionFINV = 0
  3295. Variables.RetValorParticipacionFINV = 0
  3296. Variables.TipoTransaccionCompraVenta = "NA"
  3297. Variables.RetCodigoInversionExiste = False
  3298. End Sub
  3299. End Class