frmPIN.vb 154 KB

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