frmPIN.vb 167 KB

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