frmPIN.vb 167 KB

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