frmPIN.vb 155 KB

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