| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742 |
- Public Class frmINV
- Dim oDAOGeneral As New DAOGeneral
- Dim oInversionCE As New InversionesCE
- Dim oInversionDAO As New InversionDAO
- Dim controladores As New Controldores
- Dim frmAcciones As frmAcciones
- Dim FormAcciones As frmAcciones
- Dim FormFuturos As frmFuturos
- Dim FormPrestamoEmpresarial As frmPrestamoEmpresariales
- Dim FormPrestamoPersonal As frmPrestamoPersonal
- Dim FormRepo As frmReporto
- Dim FormLete As frmLetes
- Dim FormCINV As frmCertificadosDeInversion
- Dim FormDAP As frmDepositosAPlazo
- Dim IsReporto As Boolean = False
- Dim FormNEST As frmNotaEstructurada
- Dim FormFOIN As frmFOIN
- Dim frmBuscar As New frmBuscarDeLista(2)
- Dim Operaciones As New Operaciones
- Private TipoOperacion As String = String.Empty
- Dim oInstrumentoFinanciero As Object
- Dim Modo As String = "NM"
- Dim Col_Empresas As New Collection
- Dim Col_Emisor As New Collection
- Dim Col_EstDocumento As New Collection
- Dim Col_Instrumento As New Collection
- Dim Col_CalRiesgo As New Collection
- Dim Col_TipOperacion As New Collection
- Dim Col_OriFond As New Collection
- Dim Col_CalERiesgo As New Collection
- Dim Col_EstadoProceso As New Collection
- Dim Col_Plazo As New Collection
- Dim Col_Pais As New Collection
- Dim Col_TipMercado As New Collection
- Dim ConDatos As Integer = 0
- Public EnviadoContaduria As Boolean = False
- Public DocumentoAnexado As Boolean = False
- Private TipoOperacionRepo As String = String.Empty
- Private GenerarReportoVenta As Boolean = False
- Private DicDatos As New Dictionary(Of String, Object)
- Private MontoReportoVenta As Double = 0
- Private CodigoAsociacion As String = String.Empty
- Private HabilitarAsociacion As Boolean = False
- Private EstadoReporto As String = String.Empty
- Private ColUnionTablas As New Collection
- Sub New()
- ' Esta llamada es exigida por el diseñador.
- InitializeComponent()
- ' Agregue cualquier inicialización después de la llamada a InitializeComponent().
- Variables.TrasladarCMVTA = Nothing
- End Sub
- Sub New(ByRef DicDatos As Dictionary(Of String, Object))
- Me.New
- Me.DicDatos = DicDatos
- GenerarReportoVenta = True
- Variables.TrasladarCMVTA = Nothing
- navNuevo.Enabled = True
- End Sub
- Sub ConfigurarReportoVenta()
- HabilitarAsociacion = True
- Dim CodigoAsociacion As String = String.Empty
- Dim Empresa As String = String.Empty
- Dim Monto As Double = 0
- If DicDatos.ContainsKey("CodigoAsociacion") Then
- CodigoAsociacion = DicDatos.Item("CodigoAsociacion").ToString
- End If
- If DicDatos.ContainsKey("Empresa") Then
- Empresa = DicDatos.Item("Empresa").ToString
- End If
- If DicDatos.ContainsKey("MontoUsado") Then
- Monto = Operaciones.ConvertirDecimal(DicDatos.Item("MontoUsado").ToString)
- End If
- If DicDatos.ContainsKey("ColUnionTablas") Then
- ColUnionTablas = DicDatos.Item("ColUnionTablas")
- End If
- MontoReportoVenta = Monto
- Me.CodigoAsociacion = CodigoAsociacion
- If GenerarReportoVenta Then
- Navegador.Enabled = False
- Modo = "NM"
- btnAccion.Text = "Guardar"
- ModoInversion()
- PrepararNuevo()
- cboEmpresas.Enabled = False
- cboEstadoDocumento.Enabled = False
- cboTipoOperacion.Enabled = False
- cboOrigenDeFondos.Enabled = False
- cboInstrumentos.Enabled = False
- cboEstadoProceso.Enabled = False
- cboEmpresas.SelectedValue = Empresa
- cboEstadoDocumento.SelectedValue = "A"
- cboTipoOperacion.SelectedValue = "C"
- cboOrigenDeFondos.SelectedValue = "D"
- cboInstrumentos.SelectedValue = "REPOVENTA"
- cboEstadoProceso.SelectedValue = "R"
- End If
- End Sub
- Private Sub frmInversiones_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'TODO: esta línea de código carga datos en la tabla 'InversionesDEVDataSet5.PIN0' Puede moverla o quitarla según sea necesario.
- frmProgreso.PgbProgreso.Value = 1
- Call CargarEstadosInversion()
- frmProgreso.PgbProgreso.Value = 5
- Call CargarEmpresas()
- frmProgreso.PgbProgreso.Value = 10
- Call CargarInstrumentosFinancieros()
- frmProgreso.PgbProgreso.Value = 15
- Call CargarEmisores()
- frmProgreso.PgbProgreso.Value = 20
- Call CargarCalificacionDeRiesgo()
- frmProgreso.PgbProgreso.Value = 22
- Call CargarCalificadoraDeRiesgo()
- frmProgreso.PgbProgreso.Value = 25
- Call CargarPaises()
- frmProgreso.PgbProgreso.Value = 30
- Call CargarTiposMercado()
- frmProgreso.PgbProgreso.Value = 35
- Call CargarTipoRenta()
- frmProgreso.PgbProgreso.Value = 40
- Call CargarTipoTasa()
- frmProgreso.PgbProgreso.Value = 45
- Call CargarPlazos()
- frmProgreso.PgbProgreso.Value = 50
- Call CargarPeriodicidades()
- frmProgreso.PgbProgreso.Value = 55
- Call CargarOrigenFondo()
- frmProgreso.PgbProgreso.Value = 60
- Call CargarEstadoProceso()
- frmProgreso.PgbProgreso.Value = 65
- Call CargarTipoOperacion()
- frmProgreso.PgbProgreso.Value = 70
- PrepararBusqueda()
- frmProgreso.PgbProgreso.Value = 75
- CargarNavegador()
- frmProgreso.PgbProgreso.Value = 80
- frmProgreso.PgbProgreso.Value = 85
- ConfiguracionInicial()
- frmProgreso.PgbProgreso.Value = 87
- frmProgreso.PgbProgreso.Value = 90
- ModoInversion()
- frmProgreso.PgbProgreso.Value = 92
- TipoOperacion = "B"
- DeshabilitarControles()
- ColoresBloqueados()
- frmProgreso.PgbProgreso.Value = 94
- Me.btnAccion.Text = "Aceptar"
- EstadoBoton()
- frmProgreso.PgbProgreso.Value = 96
- Modificar()
- frmProgreso.PgbProgreso.Value = 100
- frmProgreso.Visible = False
- ConfigurarReportoVenta()
- btnRequisicionDePago.Visible = False
- End Sub
- Sub CodigoCompra()
- Dim CodigoCompra As String = String.Empty
- If Not String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
- CodigoCompra = txtCodigoCompra.Text.ToString
- End If
- If Not String.IsNullOrEmpty(CodigoCompra) Then
- lblCodigoCompra.Visible = True
- txtCodigoCompra.Visible = True
- txtCodigoCompra.Text = CodigoCompra
- Else
- lblCodigoCompra.Visible = False
- txtCodigoCompra.Visible = False
- End If
- End Sub
- Private Function CamposRequeridos() As Integer
- If String.IsNullOrEmpty(txtNombreManual.Text.ToString) Then
- MsgBox("Ingrese el nombre del titulo")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboEmpresas.SelectedValue)) Then
- MsgBox("Seleccione una Empresa")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboInstrumentos.SelectedValue)) Then
- MsgBox("Seleccione un Instrumento")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboTiposMercado.SelectedValue)) Then
- MsgBox("Seleccione un Tipo de Mercado")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboPaises.SelectedValue)) Then
- MsgBox("Seleccione un Pais")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboEstadoDocumento.SelectedValue)) Then
- MsgBox("Error con los campos del titulo")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboTipoOperacion.SelectedValue)) Then
- MsgBox("Error con los campos del titulo")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboOrigenDeFondos.SelectedValue)) Then
- MsgBox("Error con los campos del titulo")
- Return 1
- End If
- If (String.IsNullOrEmpty(Me.cboEstadoProceso.SelectedValue)) Then
- MsgBox("Error con los campos del titulo")
- Return 1
- End If
- Dim ExisteReportoVenta As Boolean = ReportoVenta()
- If ExisteReportoVenta Then
- Return 0
- Else
- MsgBox("Agregue un registro en el detalle")
- Return 1
- End If
- Return 0
- End Function
- Private Sub CargarNavegador()
- vBindingSource.DataSource = oInversionDAO.ListaCodigosInversion
- Navegador.BindingSource = vBindingSource
- End Sub
- Private Sub CargarTipoOperacion()
- Me.cboTipoOperacion.DataSource = oDAOGeneral.ListaTipoOperacion
- Me.cboTipoOperacion.DisplayMember = "Descripcion"
- Me.cboTipoOperacion.ValueMember = "Codigo"
- Col_TipOperacion = AgregarCheckbox(cboTipoOperacion, flpTipoOperacion)
- Me.cboTipoOperacion.SelectedIndex = -1
- End Sub
- Private Sub CargarOrigenFondo()
- Me.cboOrigenDeFondos.DataSource = oDAOGeneral.ListaOrigenDeFondos
- Me.cboOrigenDeFondos.DisplayMember = "Descripcion"
- Me.cboOrigenDeFondos.ValueMember = "Codigo"
- Col_OriFond = AgregarCheckbox(cboOrigenDeFondos, flpOrigenFondos)
- Me.cboOrigenDeFondos.SelectedIndex = 0
- End Sub
- Private Sub CargarEstadoProceso()
- Me.cboEstadoProceso.DataSource = oDAOGeneral.ListaEstadoProceso
- Me.cboEstadoProceso.DisplayMember = "Descripcion"
- Me.cboEstadoProceso.ValueMember = "Codigo"
- Col_EstadoProceso = AgregarCheckbox(cboEstadoProceso, flpEstadoProceso)
- Me.cboEstadoProceso.SelectedIndex = -1
- End Sub
- Private Sub CargarPeriodicidades()
- Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
- Me.cboPeriodicidad.DisplayMember = "Descripcion"
- Me.cboPeriodicidad.ValueMember = "Codigo"
- Me.cboPeriodicidad.SelectedIndex = -1
- End Sub
- Private Sub CargarPlazos()
- Me.cboPlazoFactor.DataSource = oDAOGeneral.ListaPlazosFactor
- Me.cboPlazoFactor.DisplayMember = "Descripcion"
- Me.cboPlazoFactor.ValueMember = "Codigo"
- Col_Plazo = AgregarCheckbox(cboPlazoFactor, flpPlazo)
- Me.cboPlazoFactor.SelectedIndex = -1
- End Sub
- Private Sub CargarTipoRenta()
- Me.cboTipoRenta.DataSource = oDAOGeneral.ListaTipoRenta
- Me.cboTipoRenta.DisplayMember = "Descripcion"
- Me.cboTipoRenta.ValueMember = "Codigo"
- Me.cboTipoRenta.SelectedIndex = -1
- End Sub
- Private Sub CargarTipoTasa()
- Me.cboTipoTasa.DataSource = oDAOGeneral.ListaTipoTasa
- Me.cboTipoTasa.DisplayMember = "Descripcion"
- Me.cboTipoTasa.ValueMember = "Codigo"
- Me.cboTipoTasa.SelectedIndex = -1
- End Sub
- Private Sub CargarEstadosInversion()
- Me.cboEstadoDocumento.DataSource = oDAOGeneral.ListaEstadoInversion
- Me.cboEstadoDocumento.DisplayMember = "Descripcion"
- Me.cboEstadoDocumento.ValueMember = "Codigo"
- Col_EstDocumento = AgregarCheckbox(cboEstadoDocumento, flpEstadoDocumento)
- Me.cboEstadoDocumento.SelectedIndex = -1
- End Sub
- Private Sub CargarEmpresas()
- Me.cboEmpresas.DataSource = oDAOGeneral.ListaEmpresas
- Me.cboEmpresas.DisplayMember = "Descripcion"
- Me.cboEmpresas.ValueMember = "Codigo"
- Col_Empresas = AgregarCheckbox(cboEmpresas, flpEmpresas)
- Me.cboEmpresas.SelectedIndex = -1
- End Sub
- Private Sub CargarInstrumentosFinancieros()
- Me.cboInstrumentos.DataSource = oDAOGeneral.ListaInstrumentos("Inversion")
- Me.cboInstrumentos.DisplayMember = "Descripcion"
- Me.cboInstrumentos.ValueMember = "Codigo"
- Col_Instrumento = AgregarCheckbox(cboInstrumentos, flpInstrumentos)
- Me.cboInstrumentos.SelectedIndex = -1
- End Sub
- Private Sub CargarEmisores()
- Me.cboEmisores.DataSource = oDAOGeneral.ListaEmisores
- Me.cboEmisores.DisplayMember = "Descripcion"
- Me.cboEmisores.ValueMember = "Codigo"
- Col_Emisor = AgregarCheckbox(cboEmisores, flpEmisor)
- Me.cboEmisores.SelectedIndex = -1
- End Sub
- Private Sub CargarCalificacionDeRiesgo()
- Me.cboCalificaciones.DataSource = oDAOGeneral.ListaCalificacionesDeRiesgo
- Me.cboCalificaciones.DisplayMember = "Descripcion"
- Me.cboCalificaciones.ValueMember = "Codigo"
- Col_CalRiesgo = AgregarCheckbox(cboCalificaciones, flpCalificacionRiesgo)
- Me.cboCalificaciones.SelectedIndex = -1
- End Sub
- Private Sub CargarCalificadoraDeRiesgo()
- Me.cboCalificadoras.DataSource = oDAOGeneral.ListaEmpresasCalificadoras
- Me.cboCalificadoras.DisplayMember = "Descripcion"
- Me.cboCalificadoras.ValueMember = "Codigo"
- Col_CalERiesgo = AgregarCheckbox(cboCalificadoras, flpCalificadoraRiesgo)
- Me.cboCalificadoras.SelectedIndex = -1
- End Sub
- Private Sub CargarPaises()
- Me.cboPaises.DataSource = oDAOGeneral.ListaPaisesRelevanteInversion
- Me.cboPaises.DisplayMember = "Descripcion"
- Me.cboPaises.ValueMember = "Codigo"
- Col_Pais = AgregarCheckbox(cboPaises, flpPais)
- Me.cboPaises.SelectedIndex = -1
- End Sub
- Private Sub CargarTiposMercado()
- Me.cboTiposMercado.DataSource = oDAOGeneral.ListaTiposMercado
- Me.cboTiposMercado.DisplayMember = "Descripcion"
- Me.cboTiposMercado.ValueMember = "Codigo"
- Col_TipMercado = AgregarCheckbox(cboTiposMercado, flpTipoMercado)
- Me.cboTiposMercado.SelectedIndex = -1
- End Sub
- Private Sub navBuscar_Click(sender As Object, e As EventArgs) Handles navBuscar.Click
- Modo = "B"
- ModoInversion()
- End Sub
- Private Sub PrepararBusqueda()
- HabilitarControles()
- LimpiarControles()
- oInversionCE = Nothing
- oInversionCE = New InversionesCE
- DeshabilitarControles()
- ColoresBloqueados()
- dtpFechaDocumento.Enabled = False
- TipoOperacion = "B"
- Me.btnAccion.Text = "Buscar"
- End Sub
- Private Sub HabilitarControles()
- cboEmpresas.Enabled = True
- cboInstrumentos.Enabled = True
- cboEmisores.Enabled = True
- cboCalificaciones.Enabled = True
- cboCalificadoras.Enabled = True
- cboPaises.Enabled = True
- cboTiposMercado.Enabled = True
- txtCodigoInversion.ReadOnly = False
- cboEstadoDocumento.Enabled = True
- dtpFechaDocumento.Enabled = True
- txtNombreManual.ReadOnly = False
- txtCodigoManual.ReadOnly = False
- cboPlazoFactor.Enabled = True
- cboPeriodicidad.Enabled = True
- cboTipoOperacion.Enabled = True
- cboOrigenDeFondos.Enabled = True
- cboTipoRenta.Enabled = True
- cboTipoTasa.Enabled = True
- txtPlazoNum.ReadOnly = False
- cboTipoOperacion.BackColor = Color.White
- cboOrigenDeFondos.BackColor = Color.White
- cboTipoRenta.BackColor = Color.White
- cboTipoTasa.BackColor = Color.White
- cboEmpresas.BackColor = Color.White
- cboInstrumentos.BackColor = Color.White
- cboEmisores.BackColor = Color.White
- cboCalificaciones.BackColor = Color.White
- cboCalificadoras.BackColor = Color.White
- cboTipoOperacion.BackColor = Color.White
- cboOrigenDeFondos.BackColor = Color.White
- cboEstadoProceso.BackColor = Color.White
- Me.cboPaises.BackColor = Color.White
- Me.cboTiposMercado.BackColor = Color.White
- Me.txtNombreManual.BackColor = Color.White
- Me.cboPeriodicidad.BackColor = Color.White
- Me.txtPlazoNum.BackColor = Color.White
- Me.cboPlazoFactor.BackColor = Color.White
- Me.cboTipoRenta.BackColor = Color.White
- Me.cboTipoTasa.BackColor = Color.White
- Me.txtCodigoInversion.BackColor = Color.White
- Me.txtCodigoManual.BackColor = Color.White
- Me.cboEstadoDocumento.BackColor = Color.White
- End Sub
- Private Sub DeshabilitarControles()
- cboEmpresas.Enabled = False
- cboInstrumentos.Enabled = False
- cboEmisores.Enabled = False
- cboCalificaciones.Enabled = False
- cboCalificadoras.Enabled = False
- cboPaises.Enabled = False
- cboTiposMercado.Enabled = False
- txtCodigoInversion.ReadOnly = True
- cboEstadoDocumento.Enabled = False
- txtNombreManual.ReadOnly = True
- txtCodigoManual.ReadOnly = True
- cboTipoOperacion.Enabled = False
- cboOrigenDeFondos.Enabled = False
- cboTipoRenta.Enabled = False
- cboTipoTasa.Enabled = False
- cboPeriodicidad.Enabled = False
- cboPlazoFactor.Enabled = False
- txtPlazoNum.ReadOnly = True
- End Sub
- Private Sub cboEmpresas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmpresas.SelectedIndexChanged
- ControlEmpresas()
- End Sub
- Private Sub ControlEmpresas()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.CodigoEmpresa = cboEmpresas.SelectedValue
- End If
- If TipoOperacion = "N" Then
- ActualizarCodigoNuevo()
- End If
- End Sub
- Private Sub ControlCodigoIFManual()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.CodigoManual = txtCodigoManual.Text
- End If
- End Sub
- Private Sub Buscar()
- If frmBuscarDeLista.ShowDialog = DialogResult.OK Then
- If Not frmBuscarDeLista.CodigoPrincipal = Nothing Then
- CargarRegistro(frmBuscarDeLista.CodigoPrincipal)
- End If
- End If
- End Sub
- Public Sub CargarRegistro(ByVal IdRegistro As Integer)
- TipoOperacion = "C"
- Dim Id As Integer = 0
- If ConDatos > 0 Then
- Id = ConDatos
- Else
- Id = IdRegistro
- End If
- oInversionCE = oInversionDAO.CargarRegistro(Id)
- Dim a = vBindingSource.Find("DocId", Id)
- vBindingSource.Position = vBindingSource.Find("DocId", Id)
- ConDatos = 0
- RefrescarValoresDeControles()
- RefrescarEstadoControles()
- ColoresBloqueados()
- Me.btnAccion.Text = "Aceptar"
- End Sub
- Sub ColoresBloqueados()
- Me.cboEmpresas.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboInstrumentos.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboEmisores.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboCalificaciones.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboCalificadoras.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtCodigoManual.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboPaises.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboTiposMercado.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtNombreManual.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboPeriodicidad.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtPlazoNum.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboPlazoFactor.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboTipoRenta.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboTipoTasa.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtCodigoInversion.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.txtCodigoManual.BackColor = Configuraciones.ColorFondoPredefinido()
- Me.cboEstadoDocumento.BackColor = Configuraciones.ColorFondoPredefinido()
- End Sub
- Function ReportoVenta()
- If GenerarReportoVenta Then
- Try
- If Not Variables.ColeccionREPO.count Is Nothing Then
- If Variables.ColeccionREPO.count = 0 Then
- Return False
- Else
- Return True
- End If
- Return False
- Else
- Return False
- End If
- Catch ex As Exception
- Return False
- End Try
- End If
- Return True
- End Function
- Private Sub Guardar()
- oInversionCE.CodigoIversion = txtCodigoInversion.Text
- oInversionCE.EstadoReporto = EstadoReporto
- Dim retorno As Integer
- If TipoOperacion = "N" Then
- If GenerarReportoVenta Then
- Dim diccionario = Variables.ColeccionREPO
- If Not diccionario Is Nothing Then
- If String.IsNullOrEmpty(EstadoReporto) Then
- retorno = 0
- Else
- retorno = oInversionDAO.NuevoConReportoVenta(oInversionCE, diccionario, txtCodigoInversion.Text, CodigoAsociacion, EstadoReporto, ColUnionTablas)
- End If
- diccionario = Nothing
- End If
- Else
- If String.IsNullOrEmpty(EstadoReporto) Then
- retorno = 0
- Else
- retorno = oInversionDAO.Nuevo(oInversionCE)
- End If
- End If
- End If
- If TipoOperacion = "M" Then
- retorno = oInversionDAO.Modificar(oInversionCE)
- If retorno >= 1 Then
- EstadoBoton()
- End If
- End If
- If retorno >= 1 Then
- oInversionCE.IdDeDocumento = vBindingSource.Current("DocId")
- CargarRegistro(oInversionCE.IdDeDocumento)
- MsgBox("Operación Completada.")
- End If
- End Sub
- Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
- ControlEstadoProceso()
- If TipoOperacion = "B" Then
- Buscar()
- End If
- If TipoOperacion = "N" Or TipoOperacion = "M" Then
- If (CamposRequeridos() = 0) Then
- If (Not String.IsNullOrEmpty(txtPlazoNum.Text)) Then
- Variables.Plazo = txtPlazoNum.Text
- End If
- If (Not String.IsNullOrEmpty(cboPlazoFactor.SelectedValue)) Then
- Variables.PlazoFact = cboPlazoFactor.SelectedValue
- End If
- ControlFechaDocumento()
- Guardar()
- If Not GenerarReportoVenta Then
- Dim Codigo As String = txtCodigoInversion.Text
- GuardarFamilia(Codigo)
- End If
- CargarNavegador()
- Refrescar()
- End If
- End If
- Modificar()
- End Sub
- Sub GuardarFamilia(ByVal Instrumento As String)
- If Instrumento.IndexOf("LETE") > -1 Then
- Dim oDAOLetes As New LETESDAO
- Dim ColeccionLETE As Collection = Variables.ColeccionLETE
- If ColeccionLETE.Count > 0 Then
- oDAOLetes.NuevoIngreso(ColeccionLETE, "LETE")
- ColeccionLETE.Clear()
- End If
- End If
- If Instrumento.IndexOf("PBUR") > -1 Then
- Dim oDAOLetes As New LETESDAO
- Dim ColeccionLETE As Collection = Variables.ColeccionLETE
- If ColeccionLETE.Count > 0 Then
- oDAOLetes.NuevoIngreso(ColeccionLETE, "PBUR")
- ColeccionLETE.Clear()
- End If
- End If
- If Instrumento.IndexOf("VCN") > -1 Then
- Dim oDAOLetes As New LETESDAO
- Dim ColeccionLETE As Collection = Variables.ColeccionLETE
- If ColeccionLETE.Count > 0 Then
- oDAOLetes.NuevoIngreso(ColeccionLETE, "VCN")
- ColeccionLETE.Clear()
- End If
- End If
- If Instrumento.IndexOf("CETE") > -1 Then
- Dim oDAOLetes As New LETESDAO
- Dim ColeccionLETE As Collection = Variables.ColeccionLETE
- If ColeccionLETE.Count > 0 Then
- oDAOLetes.NuevoIngreso(ColeccionLETE, "CETE")
- ColeccionLETE.Clear()
- End If
- End If
- If Instrumento.IndexOf("ACC") > -1 Then
- Dim oDAOACC As New AccionesDAO
- Dim ColeccionACC As Collection = Variables.ColeccionACC
- If ColeccionACC.Count > 0 Then
- oDAOACC.NuevaAccion(Variables.Codigo, ColeccionACC)
- ColeccionACC.Clear()
- FormAcciones.Dispose()
- End If
- End If
- If Instrumento.IndexOf("CINV") > -1 Then
- Dim oDAOCINV As New CertificadosDeInversionDAO
- Dim ColeccionCINV As Collection = Variables.ColeccionCINV
- If ColeccionCINV.Count > 0 Then
- oDAOCINV.Nuevo(ColeccionCINV, "CINV")
- ColeccionCINV.Clear()
- End If
- End If
- If Instrumento.IndexOf("BONO") > -1 Then
- Dim oDAOCINV As New CertificadosDeInversionDAO
- Dim ColeccionCINV As Collection = Variables.ColeccionCINV
- If ColeccionCINV.Count > 0 Then
- oDAOCINV.Nuevo(ColeccionCINV, "BONO")
- ColeccionCINV.Clear()
- End If
- End If
- If Instrumento.IndexOf("EURB0") > -1 Then
- Dim oDAOCINV As New CertificadosDeInversionDAO
- Dim ColeccionCINV As Collection = Variables.ColeccionCINV
- If ColeccionCINV.Count > 0 Then
- oDAOCINV.Nuevo(ColeccionCINV, "EURB")
- ColeccionCINV.Clear()
- End If
- End If
- If Instrumento.IndexOf("TIT") > -1 Then
- Dim oDAOCINV As New CertificadosDeInversionDAO
- Dim ColeccionCINV As Collection = Variables.ColeccionCINV
- If ColeccionCINV.Count > 0 Then
- oDAOCINV.Nuevo(ColeccionCINV, "TIT")
- ColeccionCINV.Clear()
- End If
- End If
- If Instrumento.IndexOf("DAP") > -1 Then
- Dim oDAODAP As New DepositosAPlazoDAO
- Dim ColeccionDAP As Collection = Variables.ColeccionDAP
- Dim diccionario = Variables.ColeccionDAPDi
- If ColeccionDAP.Count > 0 And Not diccionario Is Nothing Then
- oDAODAP.NuevoDato(ColeccionDAP, diccionario, Variables.Codigo)
- ColeccionDAP.Clear()
- diccionario = Nothing
- End If
- End If
- If Instrumento.IndexOf("NEST") > -1 Then
- Dim oDAONEST As New DAONotaEstructurada
- Dim ColeccionNEST As Collection = Variables.ColeccionNEST
- Dim diccionario = Variables.ColeccionNESTDi
- If ColeccionNEST.Count > 0 And Not diccionario Is Nothing Then
- oDAONEST.NuevoDato(ColeccionNEST, diccionario, Variables.Codigo)
- ColeccionNEST.Clear()
- diccionario = Nothing
- End If
- End If
- If Instrumento.IndexOf("FUTU") > -1 Then
- Dim oDAOFUTU As New FuturosDAO
- Dim ColeccionFUTU As Collection = Variables.ColeccionFUTU
- If ColeccionFUTU.Count > 0 Then
- oDAOFUTU.Nuevo(Variables.Codigo, ColeccionFUTU)
- ColeccionFUTU.Clear()
- End If
- End If
- If Instrumento.IndexOf("OPC") > -1 Then
- Dim oDAOOPC As New FuturosDAO
- Dim ColeccionOPC As Collection = Variables.ColeccionFUTU
- If ColeccionOPC.Count > 0 Then
- oDAOOPC.NuevoOpciones(Variables.Codigo, ColeccionOPC)
- ColeccionOPC.Clear()
- End If
- End If
- If Instrumento.IndexOf("PEMP") > -1 Then
- Dim oDAOPEMP As New PrestamoEmpresarialDAO
- Dim ColeccionPEMP As Collection = Variables.ColeccionPEMP
- Dim diccionario = Variables.ColeccionPEMPDi
- If ColeccionPEMP.Count > 0 And Not diccionario Is Nothing Then
- oDAOPEMP.ProcesoDatos(ColeccionPEMP, Variables.Codigo, diccionario, "Nuevo")
- ColeccionPEMP.Clear()
- diccionario = Nothing
- End If
- End If
- If Instrumento.IndexOf("PPER") > -1 Then
- Dim oDAOPPER As New PrestamoPersonalDAO
- Dim ColeccionPPERDEUDOR As Collection = Variables.ColeccionPPERDEUDOR
- Dim ColeccionPPERDETALLE As Collection = Variables.ColeccionPPERDETALLE
- Dim diccionario = Variables.ColeccionPPERAMORTDi
- If ColeccionPPERDEUDOR.Count > 0 And ColeccionPPERDETALLE.Count > 0 And Not diccionario Is Nothing Then
- oDAOPPER.ProcesoDatos(ColeccionPPERDEUDOR, ColeccionPPERDETALLE, Variables.Codigo, diccionario, "Nuevo", "Nuevo")
- ColeccionPPERDEUDOR.Clear()
- ColeccionPPERDETALLE.Clear()
- diccionario = Nothing
- End If
- End If
- If Instrumento.IndexOf("REPOVENTA") > -1 Then
- Dim oDAOREPO As New ReportosDAO
- Dim diccionario = Variables.ColeccionREPO
- If Not diccionario Is Nothing Then
- oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0VENTA")
- diccionario = Nothing
- End If
- ElseIf Instrumento.IndexOf("REPO") > -1 And Not Instrumento.IndexOf("REPOVENTA") > -1 Then
- Dim oDAOREPO As New ReportosDAO
- Dim diccionario = Variables.ColeccionREPO
- If Not diccionario Is Nothing Then
- oDAOREPO.ProcesoDatos(diccionario, Variables.Codigo, "REP0")
- diccionario = Nothing
- End If
- End If
- If Instrumento.IndexOf("FINV") > -1 Then
- Dim oDAOFOIN As New FondoInversionDAO
- Dim ColeccionFOIN As Collection = Variables.ColeccionFINV
- Dim diccionario = Variables.ColeccionFINVDi
- If ColeccionFINV.Count > 0 And Not diccionario Is Nothing Then
- oDAOFOIN.ProcesoDatos(ColeccionFINV, Variables.Codigo, diccionario, "Nuevo")
- ColeccionFOIN.Clear()
- diccionario = Nothing
- End If
- End If
- End Sub
- Private Sub RefrescarValoresDeControles()
- If Not oInversionCE Is Nothing Then
- Dim vCodCompra As String = oInversionCE.CodigoCompra.ToString
- If vCodCompra.Length = 0 Then
- txtCodigoCompra.Text = String.Empty
- Else
- txtCodigoCompra.Text = vCodCompra
- End If
- Dim vEmpresa As String = oInversionCE.CodigoEmpresa
- If vEmpresa.Length = 0 Then
- cboEmpresas.SelectedIndex = -1
- Else
- cboEmpresas.SelectedValue = vEmpresa
- End If
- Dim vInstrumento As String = oInversionCE.CodigoInstrumentoFinanciero
- If vInstrumento.Length = 0 Then
- cboInstrumentos.SelectedIndex = -1
- Else
- cboInstrumentos.SelectedValue = vInstrumento
- End If
- Dim vEmisor As String = oInversionCE.CodigoEmisor
- If vEmisor.Length = 0 Then
- cboEmisores.SelectedIndex = -1
- Else
- cboEmisores.SelectedValue = vEmisor
- End If
- Dim vCalificacionDeRiesgo As String = oInversionCE.CodigoCalificacionDeRiesgo
- If vCalificacionDeRiesgo.Length = 0 Then
- cboCalificaciones.SelectedIndex = -1
- Else
- cboCalificaciones.SelectedValue = vCalificacionDeRiesgo
- End If
- Dim vCalificadora As String = oInversionCE.CodigoEmpresaCalificadora
- If vCalificadora.Length = 0 Then
- cboCalificadoras.SelectedIndex = -1
- Else
- cboCalificadoras.SelectedValue = vCalificadora
- End If
- Dim vPais As String = oInversionCE.Pais
- If vPais.Length = 0 Then
- cboPaises.SelectedIndex = -1
- Else
- cboPaises.SelectedValue = vPais
- End If
- Dim vTipoMercado As String = oInversionCE.TipoMercado
- If vTipoMercado.Length = 0 Then
- cboTiposMercado.SelectedIndex = -1
- Else
- cboTiposMercado.SelectedValue = vTipoMercado
- End If
- Dim vCodigoInversion As String = oInversionCE.CodigoIversion
- If vCodigoInversion.Length = 0 Then
- txtCodigoInversion.Text = String.Empty
- Else
- txtCodigoInversion.Text = vCodigoInversion
- End If
- Dim vEstadoDoc As String = oInversionCE.EstadoDocumento
- If vEstadoDoc.Length = 0 Then
- cboEstadoDocumento.SelectedIndex = -1
- Else
- cboEstadoDocumento.SelectedValue = vEstadoDoc
- End If
- Dim vNombreManualIF As String = oInversionCE.NombreManual
- txtNombreManual.Text = vNombreManualIF
- Dim vCodigoManual As String = oInversionCE.CodigoManual
- txtCodigoManual.Text = vCodigoManual
- Dim vPeriodicidad As String = oInversionCE.Periodicidad.ToString
- If vPeriodicidad.Length = 0 Then
- cboPeriodicidad.SelectedIndex = -1
- Else
- cboPeriodicidad.SelectedValue = vPeriodicidad
- End If
- Dim vPlazoNum As String = oInversionCE.PlazoNumero.ToString
- Me.txtPlazoNum.Text = vPlazoNum
- Dim vPlazoFactor As String = oInversionCE.PlazoFactor.ToString
- If vPlazoFactor.Length = 0 Then
- cboPlazoFactor.SelectedIndex = -1
- Else
- cboPlazoFactor.SelectedValue = vPlazoFactor
- End If
- Dim vTipoRenta As String = oInversionCE.TipoRenta
- If vTipoRenta.Length = 0 Then
- cboTipoRenta.SelectedIndex = -1
- Else
- cboTipoRenta.SelectedValue = vTipoRenta
- End If
- Dim vTipoTasa As String = oInversionCE.TipoTasa
- If vTipoTasa.Length = 0 Then
- cboTipoTasa.SelectedIndex = -1
- Else
- cboTipoTasa.SelectedValue = vTipoTasa
- End If
- Dim vComentarios As String = oInversionCE.Comentarios.ToString
- Me.txtNotas.Text = vComentarios
- Dim vTipoOper As String = oInversionCE.TipoOperacion.ToString
- If vTipoOper.Length = 0 Then
- cboTipoOperacion.SelectedIndex = -1
- Else
- cboTipoOperacion.SelectedValue = vTipoOper
- End If
- Dim vEstadoProceso As String = oInversionCE.EstadoProceso.ToString
- If vEstadoProceso.Length = 0 Then
- cboEstadoProceso.SelectedIndex = -1
- Else
- cboEstadoProceso.SelectedValue = vEstadoProceso
- End If
- Dim vOFondo As String = oInversionCE.OFondo.ToString
- If vOFondo.Length = 0 Then
- cboOrigenDeFondos.SelectedIndex = -1
- Else
- cboOrigenDeFondos.SelectedValue = vOFondo
- End If
- Dim vFecha As String = oInversionCE.FechaDocumento.ToString
- If vFecha.Length = 0 Then
- dtpFechaDocumento.Value = Date.Today.Date
- Else
- dtpFechaDocumento.Value = vFecha
- End If
- End If
- End Sub
- Private Sub RefrescarEstadoControles()
- If TipoOperacion = "C" Then
- DeshabilitarControles()
- End If
- If TipoOperacion = "B" Then
- HabilitarControles()
- End If
- End Sub
- Private Sub LimpiarControles()
- Me.cboEmpresas.SelectedIndex = -1
- Me.cboInstrumentos.SelectedIndex = -1
- Me.cboEmisores.SelectedIndex = -1
- Me.cboCalificaciones.SelectedIndex = -1
- Me.cboCalificadoras.SelectedIndex = -1
- Me.cboPaises.SelectedIndex = -1
- Me.cboTiposMercado.SelectedIndex = -1
- Me.txtCodigoInversion.Text = String.Empty
- Me.cboEstadoDocumento.SelectedIndex = -1
- Me.txtNombreManual.Text = String.Empty
- Me.cboPeriodicidad.SelectedIndex = -1
- Me.txtPlazoNum.Text = String.Empty
- Me.cboPlazoFactor.SelectedIndex = -1
- Me.cboTipoRenta.SelectedIndex = -1
- Me.cboTipoTasa.SelectedIndex = -1
- Me.txtCodigoManual.Text = String.Empty
- Me.txtNotas.Text = String.Empty
- End Sub
- Sub SetPeriodicidad()
- Dim Periodicidad As String = String.Empty
- Dim General As New DAOGeneral
- Dim Codigo As String = Variables.Codigo
- Periodicidad = General.Periodicidad(Codigo, "INV0")
- If Not String.IsNullOrEmpty(Periodicidad) Then
- cboPeriodicidad.SelectedValue = Periodicidad
- End If
- End Sub
- Private Sub btnDetalleIF_Click(sender As Object, e As EventArgs) Handles btnDetalleIF.Click
- Variables.InvocadorProInv = "frmINV"
- Variables.TipoOperacionCMVTA = cboTipoOperacion.SelectedValue
- ''#########################################################################
- If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
- Variables.Codigo = txtCodigoInversion.Text.ToString
- Else
- Variables.Codigo = txtCodigoCompra.Text.ToString
- End If
- ''#########################################################################
- Dim NuevaPosInstrumento As Boolean = False
- ''#########################################################################
- If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
- Variables.CodigoComparativo = Variables.Codigo
- Else
- If Not Variables.CodigoComparativo = Variables.Codigo Then
- NuevaPosInstrumento = True
- End If
- End If
- ''#########################################################################
- If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
- CodigoInstrumento = txtCodigoInversion.Text.ToString
- Else
- CodigoInstrumento = txtCodigoCompra.Text.ToString
- End If
- ''#########################################################################
- Variables.InvPro = "I"
- SetPeriodicidad()
- ''#########################################################################
- Dim TipOperacion As String = oInversionCE.TipoOperacion
- ''#########################################################################
- If String.IsNullOrEmpty(Variables.CodigoComparativo) Then
- Variables.CodigoComparativo = Variables.Codigo
- Else
- If Not Variables.CodigoComparativo = Variables.Codigo Then
- NuevaPosInstrumento = True
- End If
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("FINV") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("FINV")
- Try
- If ExistInstrumento Then
- FormFOIN.Dispose()
- FormFOIN = New frmFOIN
- FormFOIN.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormFOIN.Dispose()
- FormFOIN = New frmFOIN
- FormFOIN.ShowDialog()
- Else
- FormFOIN.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormFOIN = New frmFOIN
- FormFOIN.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("FUTU") > -1 Or CodigoInstrumento.IndexOf("OPC") > -1 Then
- Dim ExistInstrumento As Boolean
- If CodigoInstrumento.IndexOf("FUTU") > -1 Then
- ExistInstrumento = ExisteInstrumento("FUT0")
- Else
- ExistInstrumento = ExisteInstrumento("OPC0")
- End If
- Try
- If ExistInstrumento Then
- FormFuturos.Dispose()
- FormFuturos = New frmFuturos(TipOperacion)
- FormFuturos.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormFuturos.Dispose()
- FormFuturos = New frmFuturos(TipOperacion)
- FormFuturos.ShowDialog()
- Else
- FormFuturos = New frmFuturos(TipOperacion)
- FormFuturos.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormFuturos = New frmFuturos(TipOperacion)
- FormFuturos.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("REPO") > -1 Or CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
- Dim ExistInstrumento As Boolean
- If CodigoInstrumento.IndexOf("REPOVENTA") > -1 Then
- ExistInstrumento = ExisteInstrumento("REP0VENTA")
- Else
- ExistInstrumento = ExisteInstrumento("REP0")
- End If
- Try
- If ExistInstrumento Then
- FormRepo.Dispose()
- FormRepo = New frmReporto
- If GenerarReportoVenta Then
- FormRepo.txtMonto.Text = MontoReportoVenta
- End If
- FormRepo.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormRepo.Dispose()
- FormRepo = New frmReporto
- If GenerarReportoVenta Then
- FormRepo.txtMonto.Text = MontoReportoVenta
- End If
- FormRepo.ShowDialog()
- Else
- If GenerarReportoVenta Then
- FormRepo.txtMonto.Text = MontoReportoVenta
- End If
- FormRepo.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormRepo = New frmReporto
- If GenerarReportoVenta Then
- FormRepo.txtMonto.Text = MontoReportoVenta
- End If
- FormRepo.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("PPER") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("PPER0")
- Try
- If ExistInstrumento Then
- FormPrestamoPersonal.Dispose()
- FormPrestamoPersonal = New frmPrestamoPersonal
- FormPrestamoPersonal.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormPrestamoPersonal.Dispose()
- FormPrestamoPersonal = New frmPrestamoPersonal
- FormPrestamoPersonal.ShowDialog()
- Else
- FormPrestamoPersonal.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormPrestamoPersonal = New frmPrestamoPersonal
- FormPrestamoPersonal.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("PEMP") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("PEMP0")
- Try
- If ExistInstrumento Then
- FormPrestamoEmpresarial.Dispose()
- FormPrestamoEmpresarial = New frmPrestamoEmpresariales
- FormPrestamoEmpresarial.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormPrestamoEmpresarial.Dispose()
- FormPrestamoEmpresarial = New frmPrestamoEmpresariales
- FormPrestamoEmpresarial.ShowDialog()
- Else
- FormPrestamoEmpresarial.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormPrestamoEmpresarial = New frmPrestamoEmpresariales
- FormPrestamoEmpresarial.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- Dim Acciones As Integer = 0
- If CodigoInstrumento.IndexOf("ACC") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("ACC0")
- Try
- If ExistInstrumento Then
- FormAcciones.Dispose()
- FormAcciones = New frmAcciones(TipOperacion)
- FormAcciones.CargarRegistro(oInversionCE.CodigoIversion)
- FormAcciones.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormAcciones.Dispose()
- FormAcciones = New frmAcciones(TipOperacion)
- FormAcciones.ShowDialog()
- Else
- FormAcciones.Dispose()
- FormAcciones = New frmAcciones(TipOperacion)
- FormAcciones.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormAcciones = New frmAcciones(TipOperacion)
- FormAcciones.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("LETE") > -1 Or CodigoInstrumento.IndexOf("PBUR") > -1 Or CodigoInstrumento.IndexOf("VCN") > -1 Or CodigoInstrumento.IndexOf("CETE") > -1 Then
- Dim ExistInstrumento As Boolean
- If CodigoInstrumento.IndexOf("LETE") > -1 Then
- ExistInstrumento = ExisteInstrumento("LET0")
- ElseIf CodigoInstrumento.IndexOf("PBUR") > -1 Then
- ExistInstrumento = ExisteInstrumento("PBUR")
- ElseIf CodigoInstrumento.IndexOf("VCN") > -1 Then
- ExistInstrumento = ExisteInstrumento("VCN")
- Else
- ExistInstrumento = ExisteInstrumento("CET0")
- End If
- Try
- If ExistInstrumento Then
- FormLete.Dispose()
- FormLete = New frmLetes
- FormLete.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormLete.Dispose()
- FormLete = New frmLetes
- FormLete.ShowDialog()
- Else
- FormLete.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormLete = New frmLetes
- FormLete.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("BONO") > -1 Or CodigoInstrumento.IndexOf("CINV") > -1 Or CodigoInstrumento.IndexOf("TIT") > -1 Or CodigoInstrumento.IndexOf("EURB") > -1 Then
- Dim ExistInstrumento As Boolean
- If CodigoInstrumento.IndexOf("BONO") > -1 Then
- ExistInstrumento = ExisteInstrumento("BON0")
- ElseIf CodigoInstrumento.IndexOf("CINV") > -1 Then
- ExistInstrumento = ExisteInstrumento("CIN0")
- ElseIf CodigoInstrumento.IndexOf("TIT") > -1 Then
- ExistInstrumento = ExisteInstrumento("TIT")
- Else
- ExistInstrumento = ExisteInstrumento("EURB0")
- End If
- Try
- If ExistInstrumento Then
- FormCINV.Dispose()
- FormCINV = New frmCertificadosDeInversion(TipOperacion)
- FormCINV.CargarRegistro(oInversionCE.CodigoIversion)
- FormCINV.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormCINV.Dispose()
- FormCINV = New frmCertificadosDeInversion(TipOperacion)
- FormCINV.ShowDialog()
- Else
- FormCINV.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormCINV = New frmCertificadosDeInversion(TipOperacion)
- FormCINV.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("DAP") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("DAP0")
- Try
- If ExistInstrumento Then
- FormDAP.Dispose()
- FormDAP = New frmDepositosAPlazo
- FormDAP.CargarRegistro(oInversionCE.CodigoIversion)
- FormDAP.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormDAP.Dispose()
- FormDAP = New frmDepositosAPlazo
- FormDAP.ShowDialog()
- Else
- FormDAP.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormDAP = New frmDepositosAPlazo
- FormDAP.ShowDialog()
- End Try
- End If
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- If CodigoInstrumento.IndexOf("NEST") > -1 Then
- Dim ExistInstrumento As Boolean = ExisteInstrumento("NEST0")
- Try
- If ExistInstrumento Then
- FormNEST.Dispose()
- FormNEST = New frmNotaEstructurada
- FormNEST.CargarRegistro(oInversionCE.CodigoIversion)
- FormNEST.ShowDialog()
- Else
- If NuevaPosInstrumento Then
- Variables.CodigoComparativo = String.Empty
- FormNEST.Dispose()
- FormNEST = New frmNotaEstructurada
- FormNEST.ShowDialog()
- Else
- FormNEST.ShowDialog()
- End If
- End If
- Catch ex As Exception
- FormNEST = New frmNotaEstructurada
- FormNEST.ShowDialog()
- End Try
- End If
- End Sub
- ''#########################################################################
- ''#########################################################################
- ''#########################################################################
- Function ExisteInstrumento(ByVal Tabla As String)
- Dim General As New DAOGeneral
- If String.IsNullOrEmpty(txtCodigoCompra.Text.ToString) Then
- Variables.Codigo = txtCodigoInversion.Text.ToString
- Else
- Variables.Codigo = txtCodigoCompra.Text.ToString
- End If
- Dim Codigo As String = Variables.Codigo
- Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
- Return Existe
- End Function
- ''#########################################################################
- Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
- Modificar()
- End Sub
- Sub Modificar()
- Dim General As New DAOGeneral
- Dim Codigo As String = txtCodigoInversion.Text
- Dim Valor As String = General.EstadoInversion(Codigo)
- If Valor = "C" Then
- Modo = "NM"
- ModoInversion()
- PrepararEdicion()
- End If
- End Sub
- Private Sub PrepararEdicion()
- TipoOperacion = "M"
- HabilitarControles()
- btnAccion.Text = "Modificar"
- End Sub
- Private Sub txtCodigoManual_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoManual.TextChanged
- ControlCodigoIFManual()
- End Sub
- Private Sub txtCodigoManual_LostFocus(sender As Object, e As EventArgs) Handles txtCodigoManual.LostFocus
- ControlCodigoIFManual()
- End Sub
- Private Sub vBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles vBindingSource.CurrentChanged
- If Me.TipoOperacion = "C" Then
- CargarRegistro(vBindingSource.Current("DocId").ToString)
- End If
- End Sub
- Private Sub navSiguienteRegistro_Click(sender As Object, e As EventArgs)
- If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
- Try
- CargarRegistro(vBindingSource.Current("DocId").ToString)
- Catch ex As Exception
- End Try
- ElseIf Me.TipoOperacion = "C" Then
- vBindingSource.MoveNext()
- End If
- EstadoBoton()
- End Sub
- Private Sub navRegistroAnterior_Click(sender As Object, e As EventArgs) Handles navRegistroAnterior.Click
- If Me.TipoOperacion = "B" Or Me.TipoOperacion = "M" Then
- Try
- CargarRegistro(vBindingSource.Current("DocId").ToString)
- Catch ex As Exception
- End Try
- ElseIf Me.TipoOperacion = "C" Then
- vBindingSource.MovePrevious()
- End If
- EstadoBoton()
- End Sub
- Private Sub navPrimerRegistro_Click(sender As Object, e As EventArgs) Handles navPrimerRegistro.Click
- If Me.TipoOperacion = "B" Then
- Me.TipoOperacion = "C"
- vBindingSource.MoveFirst()
- Try
- CargarRegistro(vBindingSource.Current("DocId").ToString)
- Catch ex As Exception
- End Try
- ElseIf Me.TipoOperacion = "C" Then
- vBindingSource.MoveFirst()
- End If
- EstadoBoton()
- End Sub
- Private Sub navUltimoRegistro_Click(sender As Object, e As EventArgs) Handles navUltimoRegistro.Click
- If Me.TipoOperacion = "B" Then
- Me.TipoOperacion = "C"
- vBindingSource.MoveLast()
- Try
- CargarRegistro(vBindingSource.Current("DocId").ToString)
- Catch ex As Exception
- End Try
- ElseIf Me.TipoOperacion = "C" Then
- vBindingSource.MoveLast()
- End If
- EstadoBoton()
- End Sub
- Private Sub cboEmisores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEmisores.SelectedIndexChanged
- ControlEmisores()
- End Sub
- Private Sub ControlEmisores()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.CodigoEmisor = Me.cboEmisores.SelectedValue
- End If
- End Sub
- Private Sub Navegador_RefreshItems(sender As Object, e As EventArgs) Handles Navegador.RefreshItems
- End Sub
- Private Sub cboInstrumentos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboInstrumentos.SelectedIndexChanged
- ControlInstrumentos()
- controladores.TInstrumento = cboInstrumentos.SelectedIndex
- End Sub
- Private Sub ControlInstrumentos()
- If Not String.IsNullOrEmpty(TipoOperacion) Then
- If (Not String.IsNullOrEmpty(Me.cboInstrumentos.SelectedValue)) Then
- oInversionCE.CodigoInstrumentoFinanciero = Me.cboInstrumentos.SelectedValue
- End If
- End If
- If TipoOperacion = "N" Then
- ActualizarCodigoNuevo()
- End If
- End Sub
- Private Sub cboCalificaciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificaciones.SelectedIndexChanged
- ControlCalificaciones()
- End Sub
- Private Sub ControlCalificaciones()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.CodigoCalificacionDeRiesgo = Me.cboCalificaciones.SelectedValue
- End If
- End Sub
- Private Sub cboCalificadoras_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCalificadoras.SelectedIndexChanged
- ControlCalificadoras()
- End Sub
- Private Sub ControlCalificadoras()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.CodigoEmpresaCalificadora = cboCalificadoras.SelectedValue
- End If
- End Sub
- Private Sub cboPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPaises.SelectedIndexChanged
- ControlPaises()
- End Sub
- Private Sub ControlPaises()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.Pais = cboPaises.SelectedValue
- End If
- End Sub
- Private Sub cboTiposMercado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTiposMercado.SelectedIndexChanged
- ControlTiposMercado()
- End Sub
- Private Sub ControlTiposMercado()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.TipoMercado = cboTiposMercado.SelectedValue
- End If
- End Sub
- Private Sub txtNombreManual_TextChanged(sender As Object, e As EventArgs) Handles txtNombreManual.TextChanged
- End Sub
- Private Sub txtNombreManual_LostFocus(sender As Object, e As EventArgs) Handles txtNombreManual.LostFocus
- ControlNombreManual()
- End Sub
- Private Sub ControlNombreManual()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.NombreManual = txtNombreManual.Text
- End If
- End Sub
- Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
- ControlPeriodicidad()
- Variables.Periodicidad = cboPeriodicidad.SelectedValue
- End Sub
- Private Sub ControlPeriodicidad()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.Periodicidad = cboPeriodicidad.SelectedValue
- End If
- End Sub
- Private Sub txtPlazoNum_TextChanged(sender As Object, e As EventArgs) Handles txtPlazoNum.TextChanged
- End Sub
- Private Sub txtPlazoNum_LostFocus(sender As Object, e As EventArgs) Handles txtPlazoNum.LostFocus
- ControlPlazoNum()
- End Sub
- Private Sub ControlPlazoNum()
- Dim valor As Integer
- Integer.TryParse(txtPlazoNum.Text, valor)
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.PlazoNumero = valor
- End If
- End Sub
- Private Sub cboPlazoFactor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPlazoFactor.SelectedIndexChanged
- ControlPlazoFactor()
- End Sub
- Private Sub ControlPlazoFactor()
- If (cboPlazoFactor.SelectedValue <> Nothing) Then
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.PlazoFactor = cboPlazoFactor.SelectedValue
- End If
- End If
- End Sub
- Private Sub cboTipoRenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoRenta.SelectedIndexChanged
- ControlTipoRenta()
- End Sub
- Private Sub ControlTipoRenta()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- If (cboTipoRenta.SelectedValue <> Nothing) Then
- oInversionCE.TipoRenta = cboTipoRenta.SelectedValue
- End If
- End If
- End Sub
- Private Sub cboTipoTasa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoTasa.SelectedIndexChanged
- ControlTipoTasa()
- End Sub
- Private Sub ControlTipoTasa()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- oInversionCE.TipoTasa = cboTipoTasa.SelectedValue
- End If
- End Sub
- Private Sub txtCodigoInversion_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoInversion.TextChanged
- CodigoCompra()
- End Sub
- Private Sub txtCodigoInversion_LostFocus(sender As Object, e As EventArgs) Handles txtCodigoInversion.LostFocus
- If Me.TipoOperacion = "B" Then
- ControlCodigoInversion()
- End If
- End Sub
- Private Sub ControlCodigoInversion()
- oInversionCE.CodigoIversion = txtCodigoInversion.Text
- End Sub
- Private Sub cboEstadoDocumento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoDocumento.SelectedIndexChanged
- ControlEstadoDocumento()
- End Sub
- Private Sub ControlEstadoDocumento()
- If Not (TypeOf cboEstadoDocumento.SelectedValue Is DataRowView) Then
- If Not oInversionCE Is Nothing Then
- oInversionCE.EstadoDocumento = cboEstadoDocumento.SelectedValue
- End If
- End If
- End Sub
- Private Sub txtNotas_TextChanged(sender As Object, e As EventArgs) Handles txtNotas.TextChanged
- End Sub
- Private Sub txtNotas_LostFocus(sender As Object, e As EventArgs) Handles txtNotas.LostFocus
- ControlNotas()
- End Sub
- Private Sub ControlNotas()
- If TipoOperacion = "N" Or TipoOperacion = "M" Then
- oInversionCE.Comentarios = Me.txtNotas.Text
- End If
- End Sub
- Private Sub ControlEstadoProceso()
- If TipoOperacion = "N" Or TipoOperacion = "M" Then
- oInversionCE.EstadoProceso = cboEstadoProceso.SelectedValue
- End If
- End Sub
- Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
- Modo = "NM"
- btnAccion.Text = "Guardar"
- ModoInversion()
- PrepararNuevo()
- End Sub
- Private Sub PrepararNuevo()
- LimpiarControles()
- HabilitarControles()
- oInversionCE = Nothing
- oInversionCE = New InversionesCE
- Me.cboEmpresas.BackColor = Color.White
- Me.txtCodigoInversion.BackColor = Color.White
- Me.cboInstrumentos.BackColor = Color.White
- Me.cboEmisores.BackColor = Color.White
- Me.cboCalificaciones.BackColor = Color.White
- Me.cboCalificadoras.BackColor = Color.White
- Me.txtCodigoManual.BackColor = Color.White
- Me.txtCodigoInversion.Enabled = False
- Me.cboEstadoDocumento.SelectedValue = "A"
- Me.cboEstadoDocumento.Enabled = False
- Me.cboTipoOperacion.SelectedValue = "C"
- Me.cboTipoOperacion.Enabled = False
- Me.cboEstadoProceso.SelectedValue = "R"
- Me.cboEstadoProceso.Enabled = False
- Me.cboOrigenDeFondos.SelectedValue = "D"
- Me.cboOrigenDeFondos.Enabled = False
- TipoOperacion = "N"
- End Sub
- Private Sub ActualizarCodigoNuevo()
- Dim vCodigo As String
- vCodigo = SeriesDAO.SiguienteCodigoInversion(oInversionCE.CodigoEmpresa, oInversionCE.CodigoInstrumentoFinanciero)
- If TipoOperacion = "N" Then
- Me.txtCodigoInversion.Text = vCodigo
- End If
- If oInversionCE.CodigoInstrumentoFinanciero = "REPOVENTA" Then
- EstadoReporto = "REPORTO"
- Else
- EstadoReporto = "PRIMARIO"
- End If
- End Sub
- Private Sub dtpFechaDocumento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaDocumento.ValueChanged
- ControlFechaDocumento()
- End Sub
- Private Sub ControlFechaDocumento()
- If TipoOperacion = "N" Or TipoOperacion = "M" Then
- oInversionCE.FechaDocumento = dtpFechaDocumento.Value.Date
- End If
- End Sub
- Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles btnReporte.Click
- End Sub
- Private Sub BoquearBotones()
- Me.cboEmpresas.Enabled = False
- Me.cboInstrumentos.Enabled = False
- Me.cboEmisores.Enabled = False
- Me.cboCalificaciones.Enabled = False
- Me.cboCalificadoras.Enabled = False
- Me.cboPaises.Enabled = False
- Me.cboTiposMercado.Enabled = False
- Me.txtNombreManual.ReadOnly = True
- Me.cboPeriodicidad.Enabled = False
- Me.txtPlazoNum.ReadOnly = True
- Me.cboPlazoFactor.Enabled = False
- Me.cboTipoRenta.Enabled = False
- Me.cboTipoTasa.Enabled = False
- Me.txtCodigoInversion.ReadOnly = True
- Me.dtpFechaDocumento.Enabled = False
- Me.txtCodigoManual.ReadOnly = True
- Me.cboEstadoDocumento.Enabled = False
- End Sub
- Private Sub HabilitarBotones()
- Me.cboEmpresas.Enabled = False
- Me.cboInstrumentos.Enabled = False
- Me.cboEmisores.Enabled = False
- Me.cboCalificaciones.Enabled = False
- Me.cboCalificadoras.Enabled = False
- Me.cboPaises.Enabled = False
- Me.cboTiposMercado.Enabled = False
- Me.txtNombreManual.ReadOnly = True
- Me.cboPeriodicidad.Enabled = False
- Me.txtPlazoNum.ReadOnly = True
- Me.cboPlazoFactor.Enabled = False
- Me.cboTipoRenta.Enabled = False
- Me.cboTipoTasa.Enabled = False
- Me.txtCodigoInversion.ReadOnly = True
- Me.dtpFechaDocumento.Enabled = False
- Me.txtCodigoManual.ReadOnly = True
- Me.cboEstadoDocumento.Enabled = False
- End Sub
- Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
- Me.Close()
- End Sub
- Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
- If (Borrar() = 0) Then
- LimpiarControles()
- End If
- CargarNavegador()
- Refrescar()
- btnAccion.Text = "Buscar"
- PrepararBusqueda()
- Variables.CodigoComparativo = "NULL"
- End Sub
- Public Sub Refrescar()
- Me.Refresh()
- End Sub
- Public Function Borrar()
- Dim mensaje = MsgBox("¿Deseas Eliminar este registro?", vbOKCancel, "Eliminar")
- If (mensaje = vbOK) Then
- Dim EliminarCascada As Boolean = ExisteInstrumento("PIN0")
- Dim eliminar As New InversionDAO
- Dim valor = eliminar.Eliminar(txtCodigoInversion.Text, "INV0", EliminarCascada)
- If (valor = 1) Then
- MsgBox("Error al Eliminar")
- Return valor
- Else
- MsgBox("Registro Eliminado")
- Return valor
- End If
- Else
- Return 1
- End If
- End Function
- Private Sub BindingNavigatorPositionItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorPositionItem.Click
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs)
- frmReporto.Show()
- End Sub
- Private Sub Button1_Click_1(sender As Object, e As EventArgs)
- frmPrestamoPersonal.ShowDialog()
- End Sub
- Private Sub Button1_Click_2(sender As Object, e As EventArgs)
- JSON.Show()
- End Sub
- Sub ConfiguracionInicial()
- For Each Items In pnlContenedor.Controls
- If TypeOf Items Is GroupBox Then
- Dim W_Tamgrp As Double = Items.Parent.Width - 10
- Dim W_Tamflp As Double = W_Tamgrp - 10
- Dim H_Tamgrp As Double = Items.Parent.Height - 30
- Dim H_Tamflp As Double = H_Tamgrp - 30
- Items.Width = W_Tamgrp
- Items.Height = H_Tamgrp
- Items.Location = New Point(2, 20)
- For Each flItem In Items.Controls
- If TypeOf flItem Is FlowLayoutPanel Then
- flItem.Width = W_Tamflp
- flItem.Height = H_Tamflp - 10
- End If
- Next
- For Each item In Items.Controls
- If TypeOf item Is CheckBox Then
- Dim W_Tamchk As Double = item.Width + 5
- item.Width = W_Tamchk
- End If
- Next
- End If
- Next
- End Sub
- Sub CargarTabla()
- frmBuscar = New frmBuscarDeLista(2)
- Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
- DiccionarioColecciones = GuardarColecciones()
- Dim Data As New DataTable
- Data = oInversionDAO.Buscar(DiccionarioColecciones).Tables("Resultado")
- GenerarFormato(Data)
- For Each Item In pnlCargaDatos.Controls
- If TypeOf Item Is Form Then
- Item.dispose
- End If
- Next
- frmBuscar.dgvBuscarDeLista.DataSource = Data
- frmBuscar.Dock = DockStyle.Fill
- frmBuscar.TopLevel = False
- frmBuscar.Parent = pnlCargaDatos
- frmBuscar.Show()
- End Sub
- Sub GenerarFormato(ByRef Data As DataTable)
- For Each Row As DataRow In Data.Rows
- Dim CodigoPropuesta As String = String.Empty
- Dim Estado As String = String.Empty
- Dim Asunto As String = String.Empty
- Dim Empresa As String = String.Empty
- Dim InstrumentoFinanciero As String = String.Empty
- Dim Emisor As String = String.Empty
- Dim CalificacionRiesgo As String = String.Empty
- Dim EmpresaCalificadora As String = String.Empty
- Dim OrigenFondos As String = String.Empty
- Dim Comentarios As String = String.Empty
- Dim Justificaciones As String = String.Empty
- Dim TipoOperacion As String = String.Empty
- Dim Base As String = String.Empty
- Dim Monto As String = String.Empty
- Dim Precio As String = String.Empty
- Dim Rendimiento As String = String.Empty
- Dim CantidadPlazo As String = String.Empty
- Dim TipoPlazo As String = String.Empty
- Dim Ingresos As String = String.Empty
- Dim FechaCreación As String = String.Empty
- Dim EstadoAutorización As String = String.Empty
- Dim TipoMercado As String = String.Empty
- Dim Pais As String = String.Empty
- CodigoPropuesta = Row("Código de Propuesta").ToString
- Estado = Row("Estado").ToString
- Asunto = Row("Asunto").ToString
- Empresa = Row("Empresa").ToString
- InstrumentoFinanciero = Row("Instrumento Financiero").ToString
- Emisor = Row("Emisor").ToString
- CalificacionRiesgo = Row("Calificación de Riesgo").ToString
- EmpresaCalificadora = Row("Empresa Calificadora").ToString
- OrigenFondos = Row("Origen de Fondos").ToString
- Comentarios = Row("Comentarios").ToString
- Justificaciones = Row("Justificaciones").ToString
- TipoOperacion = Row("Tipo de Operacion").ToString
- Base = Row("Base de Calculo").ToString
- Monto = Row("Monto de Inversion").ToString
- Precio = Row("Precio").ToString
- Rendimiento = Row("Rendimiento").ToString
- CantidadPlazo = Row("Cantidad en Plazo").ToString
- TipoPlazo = Row("Tipo de Plazo").ToString
- Ingresos = Row("Ingresos").ToString
- FechaCreación = Row("Fecha de Creación").ToString
- EstadoAutorización = Row("Estado de Autorización").ToString
- TipoMercado = Row("Tipo de Mercado").ToString
- Pais = Row("Pais").ToString
- If String.IsNullOrEmpty(CodigoPropuesta) Then
- CodigoPropuesta = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Estado) Then
- Estado = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Asunto) Then
- Asunto = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Empresa) Then
- Empresa = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(InstrumentoFinanciero) Then
- InstrumentoFinanciero = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Emisor) Then
- Emisor = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(CalificacionRiesgo) Then
- CalificacionRiesgo = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(EmpresaCalificadora) Then
- EmpresaCalificadora = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(OrigenFondos) Then
- OrigenFondos = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Comentarios) Then
- Comentarios = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Justificaciones) Then
- Justificaciones = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(TipoOperacion) Then
- TipoOperacion = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Base) Then
- Base = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Monto) Then
- Monto = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Precio) Then
- Precio = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Rendimiento) Then
- Rendimiento = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(CantidadPlazo) Then
- CantidadPlazo = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(TipoPlazo) Then
- TipoPlazo = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Ingresos) Then
- Ingresos = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(FechaCreación) Then
- FechaCreación = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(EstadoAutorización) Then
- EstadoAutorización = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(TipoMercado) Then
- TipoMercado = " ---- ---- ---- ---- ----"
- End If
- If String.IsNullOrEmpty(Pais) Then
- Pais = " ---- ---- ---- ---- ----"
- End If
- Row("Código de Propuesta") = CodigoPropuesta
- Row("Estado") = Estado
- Row("Asunto") = Asunto
- Row("Empresa") = Empresa
- Row("Instrumento Financiero") = InstrumentoFinanciero
- Row("Emisor") = Emisor
- Row("Calificación de Riesgo") = CalificacionRiesgo
- Row("Empresa Calificadora") = EmpresaCalificadora
- Row("Origen de Fondos") = OrigenFondos
- Row("Comentarios") = Comentarios
- Row("Justificaciones") = Justificaciones
- Row("Tipo de Operacion") = TipoOperacion
- Row("Base de Calculo") = Base
- Row("Monto de Inversion") = Monto
- Row("Precio") = Precio
- Row("Rendimiento") = Rendimiento
- Row("Cantidad en Plazo") = CantidadPlazo
- Row("Tipo de Plazo") = TipoPlazo
- Row("Ingresos") = Ingresos
- Row("Fecha de Creación") = FechaCreación
- Row("Estado de Autorización") = EstadoAutorización
- Row("Tipo de Mercado") = TipoMercado
- Row("Pais") = Pais
- Next
- End Sub
- Function GuardarColecciones()
- Dim DiccionarioColecciones As New Dictionary(Of String, Collection)
- DiccionarioColecciones.Add("Empresa", Col_Empresas)
- DiccionarioColecciones.Add("Emisor", Col_Emisor)
- DiccionarioColecciones.Add("EstDocumento", Col_EstDocumento)
- DiccionarioColecciones.Add("Instrumento", Col_Instrumento)
- DiccionarioColecciones.Add("CalRiesgo", Col_CalRiesgo)
- DiccionarioColecciones.Add("TipOperacion", Col_TipOperacion)
- DiccionarioColecciones.Add("OriFond", Col_OriFond)
- DiccionarioColecciones.Add("CalERiesgo", Col_CalERiesgo)
- DiccionarioColecciones.Add("Aut", Col_EstadoProceso)
- DiccionarioColecciones.Add("Plazo", Col_Plazo)
- DiccionarioColecciones.Add("Pais", Col_Pais)
- DiccionarioColecciones.Add("TipMercado", Col_TipMercado)
- Return DiccionarioColecciones
- End Function
- Sub ActualizarColecciones(sender As Object)
- Dim Flpnombre As String = sender.parent.name
- If TypeOf sender.parent Is FlowLayoutPanel Then
- Dim FlpObjeto As New FlowLayoutPanel
- FlpObjeto = sender.parent
- If Flpnombre = "flpEmpresas" Then
- Col_Empresas.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_Empresas.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpEmisor" Then
- Col_Emisor.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_Emisor.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpEstadoDocumento" Then
- Col_EstDocumento.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_EstDocumento.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpInstrumentos" Then
- Col_Instrumento.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_Instrumento.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpCalificacionRiesgo" Then
- Col_CalRiesgo.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_CalRiesgo.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpTipoOperacion" Then
- Col_TipOperacion.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_TipOperacion.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpOrigenFondos" Then
- Col_OriFond.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_OriFond.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpCalificadoraRiesgo" Then
- Col_CalERiesgo.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_CalERiesgo.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpAutorizacion" Then
- Col_EstadoProceso.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_EstadoProceso.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpPlazo" Then
- Col_Plazo.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_Plazo.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpPais" Then
- Col_Pais.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_Pais.Add(Nombre.name)
- End If
- End If
- Next
- ElseIf Flpnombre = "flpTipoMercado" Then
- Col_TipMercado.Clear()
- For Each Nombre In FlpObjeto.Controls
- If TypeOf Nombre Is CheckBox Then
- If Nombre.checked Then
- Col_TipMercado.Add(Nombre.name)
- End If
- End If
- Next
- End If
- End If
- End Sub
- Function AgregarCheckbox(ByRef P_cboObjeto As ComboBox, ByRef P_flpObjeto As FlowLayoutPanel)
- Dim Datos As New Dictionary(Of String, String)
- Dim Col_Generica As New Collection
- Dim i As Integer = 0
- While i < P_cboObjeto.Items.Count
- P_cboObjeto.SelectedIndex = i
- Dim Valor As String = P_cboObjeto.SelectedValue
- Dim Texto As String = P_cboObjeto.Text
- If Not Valor Is Nothing Then
- If Not String.IsNullOrEmpty(Valor.ToString) Or Not String.IsNullOrEmpty(Texto.ToString) Then
- Datos.Add(Valor, Texto)
- End If
- End If
- i += 1
- End While
- Dim Existe As Boolean = False
- For Each item As CheckBox In P_flpObjeto.Controls
- If item.Text.ToString = "Todos" Then
- Existe = True
- End If
- Next
- Dim O_ChequeTodos As New CheckBox
- O_ChequeTodos.Name = "Todos" + P_flpObjeto.Name.ToString
- O_ChequeTodos.Checked = True
- O_ChequeTodos.Width = 250
- O_ChequeTodos.BackColor = ColorTranslator.FromHtml("#EAEAE8")
- O_ChequeTodos.Text = "Todos"
- O_ChequeTodos.Height = 20
- O_ChequeTodos.Margin = New Padding(25, 5, 25, 5)
- If Not Existe Then
- P_flpObjeto.Controls.Add(O_ChequeTodos)
- AddHandler O_ChequeTodos.Click, AddressOf evento
- AddHandler O_ChequeTodos.CheckedChanged, AddressOf Colorevento
- End If
- Col_Generica.Add(O_ChequeTodos.Name)
- For Each RecorrerDatos In Datos
- Col_Generica.Add(RecorrerDatos.Key)
- Dim O_Check As New CheckBox
- Existe = False
- Dim Nombre = RecorrerDatos.Value
- For Each item As CheckBox In P_flpObjeto.Controls
- If item.Text.ToString = Nombre.ToString Then
- Existe = True
- End If
- Next
- If Not Existe Then
- O_Check.Name = RecorrerDatos.Key
- O_Check.Checked = True
- O_Check.Width = 250
- O_Check.BackColor = ColorTranslator.FromHtml("#EAEAE8")
- O_Check.Text = Nombre
- O_Check.Height = 20
- O_Check.Margin = New Padding(25, 5, 25, 5)
- P_flpObjeto.Controls.Add(O_Check)
- AddHandler O_Check.Click, AddressOf evento
- AddHandler O_Check.CheckedChanged, AddressOf Colorevento
- End If
- Next
- Return Col_Generica
- End Function
- Sub eventoCargar()
- For Each Item In pnlMenu.Controls
- If TypeOf Item Is Panel Then
- If Item.backcolor = Color.White Then
- For Each Items In Item.controls
- Items.backcolor = Color.WhiteSmoke
- Next
- Item.backcolor = Color.WhiteSmoke
- End If
- End If
- Next
- pnlContenedor.Visible = False
- CargarTabla()
- End Sub
- Sub eventoCancelar()
- For Each Item In pnlMenu.Controls
- If TypeOf Item Is Panel Then
- If Item.backcolor = Color.White Then
- For Each Items In Item.controls
- Items.backcolor = Color.WhiteSmoke
- Next
- Item.backcolor = Color.WhiteSmoke
- End If
- End If
- Next
- pnlContenedor.Visible = False
- End Sub
- Sub evento(sender As Object, e As EventArgs)
- Dim P_flpObjeto As New FlowLayoutPanel
- P_flpObjeto = sender.parent
- If sender.Name.ToString.IndexOf("Todos") > -1 Then
- CambioCheckTodos(P_flpObjeto, sender)
- Else
- TodosCheck(P_flpObjeto, sender, e)
- End If
- End Sub
- Sub Colorevento(sender As Object, e As EventArgs)
- If (sender.checked) Then
- sender.BackColor = ColorTranslator.FromHtml("#EAEAE8")
- Else
- sender.BackColor = ColorTranslator.FromHtml("Transparent")
- End If
- ActualizarColecciones(sender)
- End Sub
- Sub CambioCheckTodos(ByRef P_flpObjeto As FlowLayoutPanel, ByVal sender As Object)
- Dim ContadorPrimario As Integer = P_flpObjeto.Controls.Count - 1
- Dim PrimerCheck As Boolean = True
- For Each xCheckBox In P_flpObjeto.Controls
- If TypeOf xCheckBox Is CheckBox Then
- Dim yCheckBox As New CheckBox
- yCheckBox = xCheckBox
- If xCheckBox.TabIndex = 0 Then
- If Not yCheckBox.Checked Then
- PrimerCheck = False
- End If
- End If
- End If
- Next
- If PrimerCheck Then
- For Each xCheckBox In P_flpObjeto.Controls
- If TypeOf xCheckBox Is CheckBox Then
- Dim yCheckBox As New CheckBox
- yCheckBox = xCheckBox
- yCheckBox.Checked = True
- End If
- Next
- ElseIf Not PrimerCheck Then
- For Each xCheckBox In P_flpObjeto.Controls
- If TypeOf xCheckBox Is CheckBox Then
- Dim yCheckBox As New CheckBox
- yCheckBox = xCheckBox
- yCheckBox.Checked = False
- End If
- Next
- End If
- End Sub
- Sub TodosCheck(ByRef P_flpObjeto As FlowLayoutPanel, sender As Object, e As EventArgs)
- Dim ChequeTodos As Boolean = True
- If Not sender.Name.ToString.IndexOf("Todos") > -1 Then
- For Each xCheckBox In P_flpObjeto.Controls
- If Not xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
- If Not xCheckBox.checked Then
- ChequeTodos = False
- End If
- End If
- Next
- End If
- For Each xCheckBox In P_flpObjeto.Controls
- If xCheckBox.Name.ToString.IndexOf("Todos") > -1 Then
- xCheckBox.checked = ChequeTodos
- End If
- Next
- End Sub
- Private Sub lblEmpresa_Click(sender As Object, e As EventArgs) Handles lblEmpresa.Click
- ProcesoVisibilidad(grpEmpresas)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Sub ProcesoVisibilidad(sender As Object)
- For Each Items In pnlContenedor.Controls
- If TypeOf Items Is GroupBox Then
- Items.visible = False
- End If
- Next
- sender.visible = True
- End Sub
- Sub MenuSeleccionado(sender As Object)
- pnlContenedor.Visible = True
- For Each Items In pnlMenu.Controls
- If TypeOf Items Is Panel Then
- Items.BackColor = Color.WhiteSmoke
- For Each Item In Items.controls
- Item.BackColor = Color.WhiteSmoke
- Next
- End If
- Next
- If TypeOf sender Is Panel Then
- sender.BackColor = Color.White
- For Each Item In sender.controls
- Item.BackColor = Color.White
- Next
- End If
- If TypeOf sender Is Label Then
- sender.BackColor = Color.White
- sender.parent.BackColor = Color.White
- End If
- End Sub
- Sub CambiarPosicionPrincipal(sender As Object)
- Dim PosicionY = sender.Location.Y
- Dim PosicionX = pnlContenedor.Location.X
- pnlContenedor.Location = New Point(PosicionX, PosicionY)
- End Sub
- Private Sub pnlEmpresa_Click(sender As Object, e As EventArgs) Handles pnlEmpresa.Click
- ProcesoVisibilidad(grpEmpresas)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblInstrumento_Click(sender As Object, e As EventArgs) Handles lblInstrumento.Click
- ProcesoVisibilidad(grpInstrumentos)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlInstrumento_Paint(sender As Object, e As PaintEventArgs) Handles pnlInstrumento.Paint
- End Sub
- Private Sub pnlInstrumento_Click(sender As Object, e As EventArgs) Handles pnlInstrumento.Click
- ProcesoVisibilidad(grpInstrumentos)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblOrigenFondos_Click(sender As Object, e As EventArgs) Handles lblOrigenFondos.Click
- ProcesoVisibilidad(grpOrigenFondos)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlOrigenFondos_Click(sender As Object, e As EventArgs) Handles pnlOrigenFondos.Click
- ProcesoVisibilidad(grpOrigenFondos)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblPlazo_Click(sender As Object, e As EventArgs) Handles lblPlazo.Click
- ProcesoVisibilidad(grpPlazo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlPlazo_Click(sender As Object, e As EventArgs) Handles pnlPlazo.Click
- ProcesoVisibilidad(grpPlazo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblEmisor_Click(sender As Object, e As EventArgs) Handles lblEmisor.Click
- ProcesoVisibilidad(grpEmisor)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlEmisor_Click(sender As Object, e As EventArgs) Handles pnlEmisor.Click
- ProcesoVisibilidad(grpEmisor)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.Click
- ProcesoVisibilidad(grpCalificacionRiesgo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlCalificacionRiesgo_Click(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.Click
- ProcesoVisibilidad(grpCalificacionRiesgo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblCalificadora_Click(sender As Object, e As EventArgs) Handles lblCalificadora.Click
- ProcesoVisibilidad(grpCalificadoraRiesgo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlCalificadora_Click(sender As Object, e As EventArgs) Handles pnlCalificadora.Click
- ProcesoVisibilidad(grpCalificadoraRiesgo)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblPais_Click(sender As Object, e As EventArgs) Handles lblPais.Click
- ProcesoVisibilidad(grpPais)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlPais_Click(sender As Object, e As EventArgs) Handles pnlPais.Click
- ProcesoVisibilidad(grpPais)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblEstado_Click(sender As Object, e As EventArgs) Handles lblEstado.Click
- ProcesoVisibilidad(grpEstadoDocumento)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlEstado_Click(sender As Object, e As EventArgs) Handles pnlEstado.Click
- ProcesoVisibilidad(grpEstadoDocumento)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblAutorizacion_Click(sender As Object, e As EventArgs) Handles lblEstadoProceso.Click
- ProcesoVisibilidad(grpEstadoProceso)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlAutorizacion_Click(sender As Object, e As EventArgs) Handles pnlEstadoProceso.Click
- ProcesoVisibilidad(grpEstadoProceso)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblTipoOperacion_Click(sender As Object, e As EventArgs) Handles lblTipoOperacion.Click
- ProcesoVisibilidad(grpTipoOperacion)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlTipOper_Click(sender As Object, e As EventArgs) Handles pnlTipOper.Click
- ProcesoVisibilidad(grpTipoOperacion)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblTipoMercado_Click(sender As Object, e As EventArgs) Handles lblTipoMercado.Click
- ProcesoVisibilidad(grpTipoMercado)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender.parent)
- End Sub
- Private Sub pnlTipMercado_Click(sender As Object, e As EventArgs) Handles pnlTipMercado.Click
- ProcesoVisibilidad(grpTipoMercado)
- MenuSeleccionado(sender)
- CambiarPosicionPrincipal(sender)
- End Sub
- Private Sub lblEmpresa_MouseHover(sender As Object, e As EventArgs) Handles lblEmpresa.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Sub EventPadreAcercar(ByVal sender As Object)
- Acercar(sender)
- For Each label In sender.Controls
- Acercar(label)
- Next
- End Sub
- Sub EventPadreAlejar(ByVal sender As Object)
- Alejar(sender)
- For Each label In sender.Controls
- Alejar(label)
- Next
- End Sub
- Sub EventHijoAcercar(ByVal sender As Object)
- Acercar(sender)
- Acercar(sender.parent)
- End Sub
- Sub EventHijoAlejar(ByVal sender As Object)
- Alejar(sender)
- Alejar(sender.parent)
- End Sub
- Sub Acercar(sender As Object)
- If TypeOf sender Is Panel Then
- If Not sender.BackColor.Name = Color.White.Name Then
- sender.BackColor = Color.Turquoise
- End If
- Else
- If Not sender.parent.BackColor.Name = Color.White.Name Then
- sender.BackColor = Color.Turquoise
- End If
- End If
- End Sub
- Sub Alejar(sender As Object)
- If TypeOf sender Is Panel Then
- If Not sender.BackColor.Name = Color.White.Name Then
- sender.BackColor = Color.WhiteSmoke
- End If
- Else
- If Not sender.parent.BackColor.Name = Color.White.Name Then
- sender.BackColor = Color.WhiteSmoke
- End If
- End If
- End Sub
- Private Sub lblInstrumento_MouseHover(sender As Object, e As EventArgs) Handles lblInstrumento.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblPlazo_MouseHover(sender As Object, e As EventArgs) Handles lblPlazo.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblEmisor_MouseHover(sender As Object, e As EventArgs) Handles lblEmisor.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblCalificadora_MouseHover(sender As Object, e As EventArgs) Handles lblCalificadora.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblPais_MouseHover(sender As Object, e As EventArgs) Handles lblPais.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblEstado_MouseHover(sender As Object, e As EventArgs) Handles lblEstado.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles lblEstadoProceso.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblTipoOperacion_MouseHover(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub lblTipoMercado_MouseHover(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseHover
- EventHijoAcercar(sender)
- End Sub
- Private Sub pnlEmpresa_MouseHover(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlInstrumento_MouseHover(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlOrigenFondos_MouseHover(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlPlazo_MouseHover(sender As Object, e As EventArgs) Handles pnlPlazo.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlEmisor_MouseHover(sender As Object, e As EventArgs) Handles pnlEmisor.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlCalificacionRiesgo_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlCalificadora_MouseHover(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlPais_MouseHover(sender As Object, e As EventArgs) Handles pnlPais.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlEstado_MouseHover(sender As Object, e As EventArgs) Handles pnlEstado.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlAutorizacion_MouseHover(sender As Object, e As EventArgs) Handles pnlEstadoProceso.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlTipOper_MouseHover(sender As Object, e As EventArgs) Handles pnlTipOper.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub pnlTipMercado_MouseHover(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseHover
- EventPadreAcercar(sender)
- End Sub
- Private Sub lblEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles lblEmpresa.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles lblInstrumento.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblPais_MouseLeave(sender As Object, e As EventArgs) Handles lblPais.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles lblOrigenFondos.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblPlazo_MouseLeave(sender As Object, e As EventArgs) Handles lblPlazo.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblEmisor_MouseLeave(sender As Object, e As EventArgs) Handles lblEmisor.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificacionRiesgo.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles lblCalificadora.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblEstado_MouseLeave(sender As Object, e As EventArgs) Handles lblEstado.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles lblEstadoProceso.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblTipoOperacion_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoOperacion.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub lblTipoMercado_MouseLeave(sender As Object, e As EventArgs) Handles lblTipoMercado.MouseLeave
- EventHijoAlejar(sender)
- End Sub
- Private Sub pnlEmpresa_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmpresa.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlInstrumento_MouseLeave(sender As Object, e As EventArgs) Handles pnlInstrumento.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlOrigenFondos_MouseLeave(sender As Object, e As EventArgs) Handles pnlOrigenFondos.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlPlazo_MouseLeave(sender As Object, e As EventArgs) Handles pnlPlazo.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlEmisor_MouseLeave(sender As Object, e As EventArgs) Handles pnlEmisor.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlCalificacionRiesgo_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificacionRiesgo.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlCalificadora_MouseLeave(sender As Object, e As EventArgs) Handles pnlCalificadora.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlPais_MouseLeave(sender As Object, e As EventArgs) Handles pnlPais.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlEstado_MouseLeave(sender As Object, e As EventArgs) Handles pnlEstado.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlAutorizacion_MouseLeave(sender As Object, e As EventArgs) Handles pnlEstadoProceso.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlTipOper_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipOper.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub pnlTipMercado_MouseLeave(sender As Object, e As EventArgs) Handles pnlTipMercado.MouseLeave
- EventPadreAlejar(sender)
- End Sub
- Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
- eventoCargar()
- End Sub
- Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
- eventoCancelar()
- End Sub
- Private Sub txtBuscar_TextChanged(sender As Object, e As EventArgs) Handles txtBuscar.TextChanged
- Filtrar(sender)
- End Sub
- Sub Filtrar(sender As Object)
- Dim TextoIngresado As String = sender.text.ToString.ToLower
- Dim CajaActiva As New GroupBox
- Dim CajaInterna As New FlowLayoutPanel
- For Each Item In pnlContenedor.Controls
- If TypeOf Item Is GroupBox Then
- If Item.visible Then
- CajaActiva = Item
- Exit For
- End If
- End If
- Next
- For Each Item In CajaActiva.Controls
- If TypeOf Item Is FlowLayoutPanel Then
- CajaInterna = Item
- Exit For
- End If
- Next
- For Each Item In CajaInterna.Controls
- If TypeOf Item Is CheckBox Then
- If Item.text.ToString.ToLower.Contains(TextoIngresado) Then
- If Not Item.visible Then
- Item.visible = True
- End If
- Else
- If Item.visible Then
- Item.visible = False
- End If
- End If
- End If
- Next
- End Sub
- Private Sub pnlCargaDatos_Paint(sender As Object, e As PaintEventArgs) Handles pnlCargaDatos.Paint
- End Sub
- Public Sub CargarDatosContenedor()
- If MsgBox("Desea ver esta Inversión", MsgBoxStyle.OkCancel) = DialogResult.OK Then
- Dim Id As Integer = frmBuscar.dgvBuscarDeLista.CurrentRow.Cells("Id").Value
- If Not Id = Nothing Then
- ConDatos = Id
- TipoOperacion = "B"
- Modo = "NM"
- ModoInversion()
- CargarRegistro(Id)
- TipoOperacion = "B"
- Modo = "NM"
- EstadoBoton()
- End If
- End If
- End Sub
- Sub ModoInversion()
- Dim TbNM = TbIngresarModificar
- Dim VTbBuscar = TbBuscar
- If Modo = "NM" Or (TipoOperacion = "B" And Modo = "NM") Then
- If Not VTbBuscar.Parent Is Nothing Then
- TbBuscar.Parent = Nothing
- End If
- If (TbNM.Parent Is Nothing) Then
- TbNM.Parent = TabCampos
- End If
- ElseIf Modo = "B" Then
- If Not TbNM.Parent Is Nothing Then
- TbNM.Parent = Nothing
- End If
- If (VTbBuscar.Parent Is Nothing) Then
- VTbBuscar.Parent = TabCampos
- End If
- End If
- End Sub
- Private Sub ToolStripButton1_Click_1(sender As Object, e As EventArgs) Handles navRecorrer.Click
- Modo = "NM"
- btnAccion.Text = "Buscar"
- ModoInversion()
- PrepararBusqueda()
- End Sub
- Sub ValidarEntradaPrecionada(sender As Object, e As KeyPressEventArgs)
- If String.IsNullOrEmpty(sender.Text) Then
- If e.KeyChar = "." Then
- sender.Text = "0"
- Exit Sub
- End If
- End If
- If (Not sender.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
- Operaciones.ValidarEntrada(sender, e, True)
- Else
- Operaciones.ValidarEntrada(sender, e, False)
- End If
- End Sub
- Sub ValidarEntradaLevantar(ByRef sender As Object)
- If sender.Text = "." Then
- sender.Text = ".0"
- End If
- End Sub
- Private Sub txtPlazoNum_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPlazoNum.KeyPress
- ValidarEntradaPrecionada(sender, e)
- End Sub
- Private Sub txtPlazoNum_KeyUp(sender As Object, e As KeyEventArgs) Handles txtPlazoNum.KeyUp
- ValidarEntradaLevantar(sender)
- End Sub
- Private Sub btnRequisicionDePago_Click(sender As Object, e As EventArgs) Handles btnRequisicionDePago.Click
- Dim CodigoInversion As String = txtCodigoInversion.Text
- Dim Empresa As String = cboEmpresas.SelectedValue
- Dim oRequisicionDePago As New frmReqPago(CodigoInversion, Empresa, "Individual")
- oRequisicionDePago.ShowDialog()
- End Sub
- Private Sub cboAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboEstadoProceso.SelectedIndexChanged
- End Sub
- Private Sub Button1_Click_3(sender As Object, e As EventArgs) Handles Button1.Click
- If MsgBox("Esta Seguro de Cambiar el Estado a Corrección?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
- cboEstadoProceso.SelectedValue = "C"
- End If
- TipoOperacion = "M"
- btnAccion.Text = "Actualizar"
- End Sub
- Private Sub btnAprobado_Click(sender As Object, e As EventArgs) Handles btnAprobado.Click
- If MsgBox("Esta Seguro de Cambiar el Estado ha Aprobado?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
- cboEstadoProceso.SelectedValue = "A"
- End If
- TipoOperacion = "M"
- btnAccion.Text = "Actualizar"
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- If MsgBox("Esta Seguro de Cambiar el Estado para Anexar?", MsgBoxStyle.OkCancel) = MsgBoxStyle.OkCancel Then
- cboEstadoProceso.SelectedValue = "F"
- End If
- TipoOperacion = "M"
- btnAccion.Text = "Actualizar"
- End Sub
- Public Sub EstadoBoton()
- Dim EstadoActual = cboEstadoProceso.SelectedValue
- Dim CodigoInversion As String = txtCodigoInversion.Text
- If EstadoActual = "R" Then
- pnlCorregir.Visible = True
- pnlAprobar.Visible = True
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = False
- lblMensajeReq.Text = String.Empty
- ElseIf EstadoActual = "A" Then
- If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) Then
- lblMensajeReq.Text = String.Empty
- ModificacionTiempo("P", CodigoInversion, "Se ha actualizado.")
- Else
- pnlCorregir.Visible = False
- pnlAprobar.Visible = False
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = True
- lblMensajeReq.Text = "Pendiente"
- End If
- ElseIf EstadoActual = "C" Then
- pnlCorregir.Visible = False
- pnlAprobar.Visible = True
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = False
- lblMensajeReq.Text = String.Empty
- ElseIf EstadoActual = "I" Then
- If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) And DocumentoAnexado Then
- ModificacionTiempo("F", CodigoInversion, "Ha finalizado el proceso de la inversión, la inverión se encuentra activa completamente.")
- Else
- pnlCorregir.Visible = False
- pnlAprobar.Visible = False
- pnlAnexar.Visible = True
- btnRequisicionDePago.Visible = True
- lblMensajeReq.Text = String.Empty
- End If
- ElseIf EstadoActual = "P" Then
- If RequisicionDePagoDAO.ExisteRequisicion(CodigoInversion) And EnviadoContaduria Then
- ModificacionTiempo("I", CodigoInversion, "Se ha enviado a contaduría.")
- Else
- pnlCorregir.Visible = False
- pnlAprobar.Visible = False
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = True
- lblMensajeReq.Text = "Pendiente envio Contaduria"
- End If
- ElseIf EstadoActual = "F" Then
- pnlCorregir.Visible = False
- pnlAprobar.Visible = False
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = True
- lblMensajeReq.Text = String.Empty
- End If
- RefrescarValoresDeControles()
- EstadoControladoresNAV()
- End Sub
- Sub ModificacionTiempo(ByVal Estado As String, ByVal CodigoInversion As String, ByVal Mensaje As String)
- pnlCorregir.Visible = False
- pnlAprobar.Visible = False
- pnlAnexar.Visible = False
- btnRequisicionDePago.Visible = False
- oInversionCE.EstadoProceso = Estado
- RefrescarValoresDeControles()
- Dim retorno As Integer = 0
- retorno = oInversionDAO.Modificar(oInversionCE)
- If retorno = 1 Then
- If Not Estado = "P" Then
- CargarRegistro(oInversionCE.IdDeDocumento)
- End If
- MsgBox(Mensaje)
- End If
- GuardarFamilia(CodigoInversion)
- CargarNavegador()
- Refrescar()
- EstadoBoton()
- Exit Sub
- End Sub
- Sub EstadoControladoresNAV()
- Dim Estado As String = String.Empty
- If cboEstadoProceso.SelectedValue = "R" Then
- Estado = "R"
- ElseIf cboEstadoProceso.SelectedValue = "C" Then
- Estado = "C"
- ElseIf cboEstadoProceso.SelectedValue = "A" Then
- Estado = "A"
- ElseIf cboEstadoProceso.SelectedValue = "P" Then
- Estado = "P"
- ElseIf cboEstadoProceso.SelectedValue = "I" Then
- Estado = "I"
- ElseIf cboEstadoProceso.SelectedValue = "F" Then
- Estado = "F"
- End If
- If Estado = "R" Or Estado = "A" Or Estado = "P" Or Estado = "I" Or Estado = "F" Then
- navNuevo.Enabled = False
- navModificar.Enabled = False
- navEliminar.Enabled = False
- navBuscar.Enabled = True
- navRecorrer.Enabled = True
- ElseIf Estado = "C" Then
- navNuevo.Enabled = False
- navModificar.Enabled = True
- navEliminar.Enabled = False
- navBuscar.Enabled = True
- navRecorrer.Enabled = True
- End If
- End Sub
- Private Sub cboOrigenDeFondos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOrigenDeFondos.SelectedIndexChanged
- ControlOFondo()
- End Sub
- Private Sub cboTipoOperacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboTipoOperacion.SelectedIndexChanged
- ControlTipoOperacion()
- End Sub
- Private Sub ControlTipoOperacion()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- If Not TypeOf cboTipoOperacion.SelectedValue Is DataRowView Then
- oInversionCE.TipoOperacion = cboTipoOperacion.SelectedValue
- End If
- End If
- End Sub
- Private Sub ControlOFondo()
- If TipoOperacion = "N" Or TipoOperacion = "B" Or TipoOperacion = "M" Then
- If Not TypeOf cboOrigenDeFondos.SelectedValue Is DataRowView Then
- oInversionCE.OFondo = cboOrigenDeFondos.SelectedValue
- End If
- End If
- End Sub
- Private Sub btnReportoVenta_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub TableLayoutPanel2_Paint(sender As Object, e As PaintEventArgs)
- End Sub
- Private Sub txtCodigoCompra_TextChanged(sender As Object, e As EventArgs) Handles txtCodigoCompra.TextChanged
- End Sub
- Private Sub TabCampos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabCampos.SelectedIndexChanged
- CargarTabla()
- End Sub
- Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
- End Sub
- Private Sub Panel5_Paint(sender As Object, e As PaintEventArgs)
- End Sub
- Private Sub Panel6_Paint(sender As Object, e As PaintEventArgs)
- End Sub
- Private Sub TbIngresarModificar_Click(sender As Object, e As EventArgs) Handles TbIngresarModificar.Click
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub btnVerAdjunto_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub btnAdjuntar_Click(sender As Object, e As EventArgs)
- End Sub
- End Class
|