frmPIN.vb 166 KB

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