| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403 |
- Public Class frmFOIN
- Dim oCEFOIN As FondosDeInversionCE = New FondosDeInversionCE
- Dim oDAOGeneral As New DAOGeneral
- Dim FOIN As New FondoInversionDAO
- Dim EstadoBoton As String
- Dim Operaciones As New Operaciones
- Dim IndexBase As Integer = 0
- Dim TipoTransaccion As String = String.Empty
- Private Sub frmFOIN_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- CargarBase()
- CargarPeriodicidad()
- AgregarCampos()
- CargarRegistroPrincipal()
- CargarFilas()
- Rellenar()
- Calculos()
- ExisteInversion()
- ValidarExistencia()
- CargarTransladoNuevo()
- End Sub
- Sub ValidarExistencia()
- Dim General As New DAOGeneral
- Dim Codigo As String = Variables.Codigo
- Dim Tabla As String = String.Empty
- Tabla = "FINV"
- Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
- If (Existe) Then
- navNuevo.Enabled = False
- navModificar.Enabled = True
- navEliminar.Enabled = True
- Else
- navNuevo.Enabled = True
- navModificar.Enabled = False
- navEliminar.Enabled = False
- 'LimpiarCampos()
- End If
- End Sub
- Function ExisteInversion()
- Dim Codigo As String = Variables.Codigo
- Dim TablaINV As String = "INV0"
- Dim TablaPINV As String = "PIN0"
- Dim General As New DAOGeneral
- Dim InvPro = Variables.InvPro
- If InvPro = "I" Then
- Dim INV0 As Boolean = General.ExisteTitulo(Codigo, TablaINV)
- If INV0 Then
- navNuevo.Visible = True
- Return True
- Else
- navNuevo.Visible = False
- Return False
- End If
- End If
- If InvPro = "P" Then
- Dim PINV0 As Boolean = General.ExisteTitulo(Codigo, TablaPINV)
- If PINV0 Then
- navNuevo.Visible = True
- Return True
- Else
- navNuevo.Visible = False
- Return False
- End If
- End If
- Return False
- End Function
- Sub CargarBase()
- If Me.cboAnioBase.Items.Count = 0 Or Me.cboAnioBase.Items.Count = 1 Then
- Me.cboAnioBase.DataSource = oDAOGeneral.ListaBase
- Me.cboAnioBase.DisplayMember = "Descripcion"
- Me.cboAnioBase.ValueMember = "Codigo"
- Me.cboAnioBase.SelectedIndex = 0
- End If
- End Sub
- Sub Rellenar()
- If (String.IsNullOrEmpty(txtValorNominal.Text.ToString)) Then
- txtValorNominal.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtCuotasDeParticipacion.Text.ToString)) Then
- txtCuotasDeParticipacion.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtValorDeParticipacion.Text.ToString)) Then
- txtValorDeParticipacion.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtPorcentajeComisionCasa.Text.ToString.Trim("%"))) Then
- txtPorcentajeComisionCasa.Text = "0.0%"
- End If
- If (String.IsNullOrEmpty(txtPorcentajeComisionBolsa.Text.ToString.Trim("%"))) Then
- txtPorcentajeComisionBolsa.Text = "0.0%"
- End If
- If (String.IsNullOrEmpty(txtComisionCasa.Text.ToString)) Then
- txtComisionCasa.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtComisionBolsa.Text.ToString)) Then
- txtComisionBolsa.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtValorTransado.Text.ToString)) Then
- txtValorTransado.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtDiasLiq.Text.ToString)) Then
- txtDiasLiq.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtRendimientoOfrecido.Text.ToString.Trim("%"))) Then
- txtRendimientoOfrecido.Text = "0.0%"
- End If
- If (String.IsNullOrEmpty(txtPlazo.Text.ToString)) Then
- txtPlazo.Text = "0.0"
- End If
- If (String.IsNullOrEmpty(txtDividendo.Text.ToString.Trim("%"))) Then
- txtDividendo.Text = "0.0%"
- End If
- End Sub
- Sub CalculoDGT()
- End Sub
- Function CalcularIngreso(ByVal Index As Integer, ByVal Dividendo As Double, ByVal CuotaParticipacion As Double)
- Dim Total
- If (Index = 0) Then
- Total = ((Dividendo * CuotaParticipacion) / 30) * 11
- Else
- Total = Dividendo * CuotaParticipacion
- End If
- Return Total
- End Function
- Function CalcularRendimieno(ByVal Ingreso As Double, ByVal ValorNominal As Double, ByVal Base As Integer, ByVal Dias As Integer)
- Dim Total = Ingreso / ValorNominal * Base / Dias
- Return Total
- End Function
- Sub CargarDatos()
- ''Declaracion de Variables'
- 'Dim Base As Integer = 0
- 'Dim DiaFijo As Integer = 0
- 'Dim Periodicidad As String = "M"
- 'Dim TipoCalculo As String = String.Empty
- ''Seleccion de Tipo de Calculo'
- 'If RadioButton1.Checked Then
- ' TipoCalculo = "FinMes"
- 'Else
- ' If RadioButton2.Checked Then
- ' TipoCalculo = "Mensual"
- ' End If
- 'End If
- 'If (IndexBase = 0 Or IndexBase = 2) Then
- ' Base = 360
- ' If TipoCalculo = "FinMes" Then
- ' DateTimePicker1.Value = Operaciones.FechaFinMes(DateTimePicker1.Value, Periodicidad, Base)
- ' ElseIf TipoCalculo = "Mensual" Then
- ' DateTimePicker1.Value = Operaciones.FechaMensual(DateTimePicker1.Value, Periodicidad, TipoCalculo, 0, DiaFijo, Base)
- ' End If
- 'ElseIf IndexBase = 1 Or IndexBase = 3 Then
- ' Base = 365
- ' If TipoCalculo = "FinMes" Then
- ' DateTimePicker1.Value = Operaciones.FechaFinMes(DateTimePicker1.Value, Periodicidad, Base)
- ' ElseIf TipoCalculo = "Mensual" Then
- ' DateTimePicker1.Value = Operaciones.FechaMensual(DateTimePicker1.Value, Periodicidad, TipoCalculo, 0, DiaFijo, Base)
- ' End If
- 'End If
- End Sub
- Function CalcularFecha(ByVal FechaInicial As Date, ByVal DiaFijo As Integer)
- 'Declaracion de Variables'
- Dim Base As Integer = 0
- Dim Periodicidad As String = cboPeriodicidad.SelectedValue
- Dim TipoCalculo As String = String.Empty
- Dim FechaFinal As Date = Date.Today.Date
- 'Seleccion de Tipo de Calculo'
- If RadioButton1.Checked Then
- TipoCalculo = "FinMes"
- Else
- If RadioButton2.Checked Then
- TipoCalculo = "Mensual"
- End If
- End If
- IndexBase = cboAnioBase.SelectedIndex
- If (IndexBase = 0 Or IndexBase = 2) Then
- Base = 360
- If TipoCalculo = "FinMes" Then
- FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, Base)
- ElseIf TipoCalculo = "Mensual" Then
- FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, TipoCalculo, 0, DiaFijo, Base)
- End If
- ElseIf IndexBase = 1 Or IndexBase = 3 Then
- Base = 365
- If TipoCalculo = "FinMes" Then
- FechaFinal = Operaciones.FechaFinMes(FechaInicial, Periodicidad, Base)
- ElseIf TipoCalculo = "Mensual" Then
- FechaFinal = Operaciones.FechaMensual(FechaInicial, Periodicidad, TipoCalculo, 0, DiaFijo, Base)
- End If
- End If
- Return FechaFinal
- End Function
- Sub AgregarFecha()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim IndexAnterior As Integer = Index - 1
- Dim FechaAnterior As String = String.Empty
- Dim FechaActual As String = String.Empty
- Dim FechaLiquidacion As Date = dtpFechaLiquidacion.Value
- Dim DiaFijo As Integer = FechaLiquidacion.Day
- If Index > 0 Then
- FechaAnterior = dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString
- If String.IsNullOrEmpty(FechaAnterior) Then
- MsgBox("Error de Formato en Fecha")
- Exit Sub
- Else
- FechaActual = CalcularFecha(CDate(FechaAnterior), DiaFijo)
- End If
- If String.IsNullOrEmpty(FechaActual) Then
- MsgBox("Error de Formato en Fecha")
- Exit Sub
- Else
- dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format(CDate(FechaActual), "dd/MM/yyyy").ToString
- End If
- Else
- FechaActual = CalcularFecha(CDate(FechaLiquidacion), DiaFijo)
- dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value = Format(CDate(FechaActual), "dd/MM/yyyy").ToString
- End If
- End Sub
- Sub AgregarDias()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim IndexAnterior As Integer = Index - 1
- Dim FechaAnterior As String = String.Empty
- Dim FechaActual As String = String.Empty
- Dim FechaLiquidacion As Date = Format(dtpFechaLiquidacion.Value, "dd/MM/yyyy")
- Dim BaseIndex As Integer = cboAnioBase.SelectedIndex
- Dim BaseCalculo As Integer = 0
- Dim Meses As Integer = 0
- Dim TipoCalculo As String = String.Empty
- Dim DiasFinales As Integer = 0
- Dim CantidadDiasNormal360 As Integer = 0
- Dim CantidadDias360 As Integer = 0
- Dim Periodicidad As String = cboPeriodicidad.SelectedValue
- If Periodicidad = "M" Then
- Meses = 1
- ElseIf Periodicidad = "T" Then
- Meses = 3
- ElseIf Periodicidad = "S" Then
- Meses = 6
- ElseIf Periodicidad = "A" Then
- Meses = 12
- End If
- CantidadDiasNormal360 = Meses * 30
- If BaseIndex = 0 Or BaseIndex = 2 Then
- BaseCalculo = 360
- ElseIf BaseIndex = 1 Or BaseIndex = 3 Then
- BaseCalculo = 365
- End If
- If RadioButton1.Checked Then
- TipoCalculo = "FinMes"
- Else
- If RadioButton2.Checked Then
- TipoCalculo = "Mensual"
- End If
- End If
- If Index > 0 Then
- FechaAnterior = dgvIngresos.Rows(IndexAnterior).Cells("Fecha de Corte").Value.ToString
- FechaActual = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString
- If Not String.IsNullOrEmpty(FechaAnterior) And Not String.IsNullOrEmpty(FechaActual) Then
- If BaseCalculo = 360 Then
- If TipoCalculo = "FinMes" Then
- DiasFinales = Operaciones.Base360(FechaAnterior, FechaActual)
- ElseIf TipoCalculo = "Mensual" Then
- DiasFinales = CantidadDiasNormal360
- End If
- ElseIf BaseCalculo = 365 Then
- DiasFinales = Operaciones.Base365(FechaAnterior, FechaActual)
- End If
- End If
- Else
- 'Primera Fecha'
- FechaActual = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value.ToString
- If Not String.IsNullOrEmpty(FechaLiquidacion) And Not String.IsNullOrEmpty(FechaActual) Then
- If BaseCalculo = 360 Then
- If TipoCalculo = "FinMes" Then
- DiasFinales = Operaciones.Base360(FechaLiquidacion, FechaActual)
- ElseIf TipoCalculo = "Mensual" Then
- DiasFinales = CantidadDiasNormal360
- End If
- ElseIf BaseCalculo = 365 Then
- DiasFinales = Operaciones.Base365(FechaLiquidacion, FechaActual)
- End If
- End If
- End If
- dgvIngresos.Rows(Index).Cells("Dias").Value = DiasFinales
- End Sub
- Sub AgregarDividendo()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim Dividendo As String = String.Empty
- Dim DividendoAgregar As String = String.Empty
- Dim DividendoTexto As String = txtDividendo.Text.ToString.Trim("%")
- Dim NuevaFila As Boolean = False
- If dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
- NuevaFila = True
- Else
- Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString
- End If
- If String.IsNullOrEmpty(Dividendo) Then
- If String.IsNullOrEmpty(DividendoTexto) Then
- DividendoAgregar = "0"
- Else
- DividendoAgregar = DividendoTexto
- End If
- dgvIngresos.Rows(Index).Cells("Dividendo").Value = (DividendoAgregar.ToString + "%")
- End If
- End Sub
- Sub AgregarIngreso()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim CuotasParticipacion As Double = 0
- Dim Dividendo As Double = 0
- Dim Dias As Integer = 0
- Dim Calculo As Double = 0
- If Index > 0 Then
- If Not String.IsNullOrEmpty(txtCuotasDeParticipacion.Text.ToString) Then
- CuotasParticipacion = txtCuotasDeParticipacion.Text
- End If
- If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
- Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
- End If
- End If
- Calculo = CuotasParticipacion * (Dividendo / 100)
- Else
- If Not String.IsNullOrEmpty(txtCuotasDeParticipacion.Text.ToString) Then
- CuotasParticipacion = txtCuotasDeParticipacion.Text
- End If
- If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
- Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
- End If
- End If
- If Not dgvIngresos.Rows(Index).Cells("Dias").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dias").Value.ToString) Then
- Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
- End If
- End If
- If Not Dias = 0 Then
- Dim FechaTemporal As Date = dtpFechaLiquidacion.Value.AddDays(1)
- If FechaTemporal.Month = dtpFechaLiquidacion.Value.Month Then
- Calculo = (((Dividendo / 100) * CuotasParticipacion) / Dias)
- Else
- Calculo = CuotasParticipacion * (Dividendo / 100)
- End If
- End If
- End If
- dgvIngresos.Rows(Index).Cells("Ingresos").Value = Calculo
- End Sub
- Sub AgregarRendimientos()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim ValorNominal As Double = 0
- Dim Dividendo As Double = 0
- Dim Dias As Integer = 0
- Dim Ingreso As Double = 0
- Dim Calculo As Double = 0
- Dim IndexBase As Integer = 0
- Dim BaseCalculo As Integer = 0
- If Not String.IsNullOrEmpty(txtValorNominal.Text.ToString) Then
- ValorNominal = txtValorNominal.Text
- End If
- If Not dgvIngresos.Rows(Index).Cells("Dividendo").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) Then
- Dividendo = dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")
- End If
- End If
- If Not dgvIngresos.Rows(Index).Cells("Ingresos").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Ingresos").Value.ToString) Then
- Ingreso = dgvIngresos.Rows(Index).Cells("Ingresos").Value
- End If
- End If
- If Not dgvIngresos.Rows(Index).Cells("Dias").Value Is Nothing Then
- If Not String.IsNullOrEmpty(dgvIngresos.Rows(Index).Cells("Dias").Value.ToString) Then
- Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
- End If
- End If
- IndexBase = cboAnioBase.SelectedIndex
- If IndexBase = 0 Or IndexBase = 2 Then
- BaseCalculo = 360
- ElseIf IndexBase = 1 Or IndexBase = 3 Then
- BaseCalculo = 365
- End If
- If Not Dias = 0 And Not ValorNominal = 0 And Not BaseCalculo = 0 Then
- Calculo = Ingreso / ValorNominal * BaseCalculo / Dias
- End If
- dgvIngresos.Rows(Index).Cells("Rendimiento Mensual").Value = (Calculo * 100).ToString + "%"
- End Sub
- Sub AgregarNumDiv()
- Dim Index As Integer = dgvIngresos.CurrentRow.Index
- Dim IndexAnterior As Integer = Index - 1
- Dim I_NumDivAnterior As Integer = 0
- Dim I_NumDivActual As Integer = 0
- Dim S_NumDivAnterior As String = String.Empty
- Dim S_NumDivActual As String = String.Empty
- S_NumDivActual = dgvIngresos.Rows(Index).Cells("NumDiv").Value
- I_NumDivActual = Operaciones.ConvertirEntero(S_NumDivActual)
- If Index > 0 Then
- S_NumDivAnterior = dgvIngresos.Rows(IndexAnterior).Cells("NumDiv").Value
- I_NumDivAnterior = Operaciones.ConvertirEntero(S_NumDivAnterior)
- If I_NumDivActual = 0 Then
- I_NumDivActual = I_NumDivAnterior + 1
- dgvIngresos.Rows(Index).Cells("NumDiv").Value = I_NumDivActual
- End If
- Else
- If I_NumDivActual = 0 Then
- I_NumDivActual = 1
- dgvIngresos.Rows(Index).Cells("NumDiv").Value = I_NumDivActual
- End If
- End If
- End Sub
- Sub AgregarCorrelativo()
- Dim Cantidad As Integer = dgvIngresos.Rows.Count - 2
- Dim Index As Integer = 0
- While Index <= Cantidad
- Dim Correlativo As Integer = Index + 1
- dgvIngresos.Rows(Index).Cells("correlativo").Value = Correlativo
- Index += 1
- End While
- End Sub
- Sub CalculosTabla()
- AgregarCorrelativo()
- AgregarFecha()
- AgregarDias()
- AgregarDividendo()
- AgregarIngreso()
- AgregarRendimientos()
- AgregarNumDiv()
- End Sub
- Sub CargarPeriodicidad()
- Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
- Me.cboPeriodicidad.DisplayMember = "Descripcion"
- Me.cboPeriodicidad.ValueMember = "Codigo"
- ' Me.cboPeriodicidad.SelectedIndex = -1
- End Sub
- Private Sub Calculos()
- Dim SCuotasDeParticipacion As String = String.Empty
- Dim SValorParticipacion As String = String.Empty
- Dim SValorNominal As String = String.Empty
- Dim SValorTransado As String = String.Empty
- Dim SDiasPlazo As String = String.Empty
- Dim SPorcentajeComisionCasa As String = String.Empty
- Dim SPorcentajeComisionBolsa As String = String.Empty
- Dim SComisionCasa As String = String.Empty
- Dim SComisionBolsa As String = String.Empty
- Dim SDiasLiquidos As String = String.Empty
- Dim ICuotasDeParticipacion As Double = 0
- Dim IValorParticipacion As Double = 0
- Dim IValorNominal As Double = 0
- Dim IValorTransado As Double = 0
- Dim FechaLiquidacion As Date = Date.Today.Date
- Dim FechaOperacion As Date = Date.Today.Date
- Dim FechaVencimiento As Date = Date.Today.Date
- Dim IDiasPlazo As Integer = 0
- Dim IPorcentajeComisionCasa As Double = 0
- Dim IPorcentajeComisionBolsa As Double = 0
- Dim IComisionCasa As Double = 0
- Dim IComisionBolsa As Double = 0
- Dim IDiasLiquidos As Integer = 0
- SDiasPlazo = txtPlazo.Text.ToString
- IDiasPlazo = Operaciones.ConvertirEntero(SDiasPlazo)
- SDiasLiquidos = txtDiasLiq.Text.ToString
- IDiasLiquidos = Operaciones.ConvertirEntero(SDiasLiquidos)
- SPorcentajeComisionCasa = txtPorcentajeComisionCasa.Text.ToString
- IPorcentajeComisionCasa = Operaciones.ConvertirDecimal(SPorcentajeComisionCasa) / 100
- SPorcentajeComisionBolsa = txtPorcentajeComisionBolsa.Text.ToString
- IPorcentajeComisionBolsa = Operaciones.ConvertirDecimal(SPorcentajeComisionBolsa) / 100
- SCuotasDeParticipacion = txtCuotasDeParticipacion.Text.ToString
- ICuotasDeParticipacion = Operaciones.ConvertirDecimal(SCuotasDeParticipacion)
- SValorParticipacion = txtValorDeParticipacion.Text.ToString
- IValorParticipacion = Operaciones.ConvertirDecimal(SValorParticipacion)
- FechaOperacion = dtpFechaOperacion.Value
- txtValorNominal.Text = oCEFOIN.CalculoValorNominal(ICuotasDeParticipacion, IValorParticipacion)
- SValorNominal = txtValorNominal.Text.ToString
- IValorNominal = Operaciones.ConvertirDecimal(SValorNominal)
- txtValorTransado.Text = IValorNominal
- IValorTransado = IValorNominal
- dtpFechaLiquidacion.Value = FechaOperacion
- dtpFechaLiquidacion.Value = oCEFOIN.CalculoFechaLiq(FechaOperacion, IDiasLiquidos)
- FechaLiquidacion = dtpFechaLiquidacion.Value
- txtComisionCasa.Text = CalculoComision(IPorcentajeComisionCasa, IValorTransado)
- txtComisionBolsa.Text = CalculoComision(IPorcentajeComisionBolsa, IValorTransado)
- IndexBase = cboAnioBase.SelectedIndex
- If (IndexBase = 0 Or IndexBase = 2) Then
- dtpFechaVencimiento.Value = Operaciones.FechaDias360(FechaLiquidacion, IDiasPlazo)
- ElseIf IndexBase = 1 Or IndexBase = 3 Then
- dtpFechaVencimiento.Value = FechaLiquidacion.AddDays(IDiasPlazo)
- End If
- End Sub
- Function CalculoComision(ByVal PorcComision As Double, ByVal ValTra As Double)
- Return PorcComision * ValTra
- End Function
- Private Sub txtCuotasDeParticipacion_TextChanged(sender As Object, e As EventArgs) Handles txtCuotasDeParticipacion.TextChanged
- If Not Double.TryParse(txtCuotasDeParticipacion.Text, oCEFOIN.CuotasDeParticipacion) Then
- lblErrCuotasDeParticipacion.Visible = True
- Else
- lblErrCuotasDeParticipacion.Visible = False
- End If
- Calculos()
- End Sub
- Private Sub txtCuotasDeParticipacion_LostFocus(sender As Object, e As EventArgs) Handles txtCuotasDeParticipacion.LostFocus
- If Not Double.TryParse(txtCuotasDeParticipacion.Text, oCEFOIN.CuotasDeParticipacion) Then
- lblErrCuotasDeParticipacion.Visible = True
- Else
- lblErrCuotasDeParticipacion.Visible = False
- End If
- Me.txtCuotasDeParticipacion.Text = oCEFOIN.CuotasDeParticipacion.ToString()
- RefrescarValorControles()
- End Sub
- Private Sub txtValorDeParticipacion_TextChanged(sender As Object, e As EventArgs) Handles txtValorDeParticipacion.TextChanged
- If Not Double.TryParse(txtValorDeParticipacion.Text, oCEFOIN.ValorDeParticipacion) Then
- lblErrValorDeParticipacion.Visible = True
- Else
- lblErrValorDeParticipacion.Visible = False
- End If
- Calculos()
- End Sub
- Private Sub txtValorDeParticipacion_LostFocus(sender As Object, e As EventArgs) Handles txtValorDeParticipacion.LostFocus
- If Not Double.TryParse(txtValorDeParticipacion.Text, oCEFOIN.ValorDeParticipacion) Then
- lblErrValorDeParticipacion.Visible = True
- Else
- lblErrValorDeParticipacion.Visible = False
- End If
- Me.txtValorDeParticipacion.Text = oCEFOIN.ValorDeParticipacion.ToString()
- RefrescarValorControles()
- End Sub
- Sub RefrescarValorControles()
- Me.txtValorNominal.Text = oCEFOIN.ValorNominal.ToString()
- 'Me.txtCuotasDeParticipacion.Text = oCEFOIN.CuotasDeParticipacion.ToString(Configuraciones.CodigoTXTMontos)
- 'Me.txtValorDeParticipacion.Text = oCEFOIN.ValorDeParticipacion.ToString(Configuraciones.CodigoTXTMontos)
- 'Me.txtPorcentajeComisionCasa.Text = oCEFOIN.PorcentajeComisionCasa.ToString(Configuraciones.CodigoTXTPorcentaje)
- Me.txtComisionCasa.Text = oCEFOIN.ComisionCasa.ToString()
- 'Me.txtPorcentajeComisionBolsa.Text = oCEFOIN.PorcentajeComisionBolsa.ToString(Configuraciones.CodigoTXTPorcentaje)
- Me.txtComisionBolsa.Text = oCEFOIN.ComisionBolsa.ToString()
- Me.txtValorTransado.Text = oCEFOIN.ValorTransado.ToString()
- 'Me.dtpFechaOperacion.Value = oCEFOIN.FechaOperacion
- 'Me.dtpFechaLiquidacion.Value = oCEFOIN.FechaLiquidacion
- 'Me.dtpFechaVencimiento.Value = oCEFOIN.FechaVencimiento
- 'Me.txtRendimientoOfrecido.Text = oCEFOIN.RendimientoOfrecido.ToString(Configuraciones.CodigoTXTPorcentaje)
- 'Me.cboPeriodicidad.SelectedValue = oCEFOIN.Periodicidad
- 'Me.cboAnioBase.SelectedValue = oCEFOIN.AnioBase
- End Sub
- Private Sub txtPorcentajeComisionCasa_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeComisionCasa.TextChanged
- Dim valor As Double
- If (txtPorcentajeComisionCasa.ToString.IndexOf("%") = -1) Then
- txtPorcentajeComisionCasa.Text += "%"
- End If
- If Not Double.TryParse(Me.txtPorcentajeComisionCasa.Text.Replace("%", ""), valor) Then
- lblErrComisionCasa.Visible = True
- Else
- lblErrComisionCasa.Visible = False
- End If
- oCEFOIN.PorcentajeComisionCasa = valor / 100
- Calculos()
- End Sub
- Private Sub txtPorcentajeComisionCasa_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeComisionCasa.LostFocus
- Me.txtPorcentajeComisionCasa.Text = oCEFOIN.PorcentajeComisionCasa.ToString(Configuraciones.CodigoTXTPorcentaje)
- RefrescarValorControles()
- End Sub
- Private Sub txtPorcentajeComisionBolsa_TextChanged(sender As Object, e As EventArgs) Handles txtPorcentajeComisionBolsa.TextChanged
- Dim valor As Double
- If (txtPorcentajeComisionBolsa.ToString.IndexOf("%") = -1) Then
- txtPorcentajeComisionBolsa.Text += "%"
- End If
- If Not Double.TryParse(Me.txtPorcentajeComisionBolsa.Text.Replace("%", ""), valor) Then
- lblErrComisionBolsa.Visible = True
- Else
- lblErrComisionBolsa.Visible = False
- End If
- oCEFOIN.PorcentajeComisionBolsa = valor / 100
- Calculos()
- End Sub
- Private Sub txtPorcentajeComisionBolsa_LostFocus(sender As Object, e As EventArgs) Handles txtPorcentajeComisionBolsa.LostFocus
- Me.txtPorcentajeComisionBolsa.Text = oCEFOIN.PorcentajeComisionBolsa.ToString(Configuraciones.CodigoTXTPorcentaje)
- RefrescarValorControles()
- End Sub
- Private Sub dtpFechaOperacion_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaOperacion.ValueChanged
- Calculos()
- 'oCEFOIN.FechaOperacion = dtpFechaOperacion.Value.Date
- End Sub
- Private Sub dtpFechaLiquidacion_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaLiquidacion.ValueChanged
- oCEFOIN.FechaLiquidacion = dtpFechaLiquidacion.Value.Date
- End Sub
- Private Sub dtpFechaVencimiento_ValueChanged(sender As Object, e As EventArgs) Handles dtpFechaVencimiento.ValueChanged
- oCEFOIN.FechaVencimiento = dtpFechaVencimiento.Value.Date
- End Sub
- Private Sub txtRendimientoOfrecido_TextChanged(sender As Object, e As EventArgs) Handles txtRendimientoOfrecido.TextChanged
- 'Dim valor As Double
- 'If Not Double.TryParse(txtRendimientoOfrecido.Text.Replace("%", ""), valor) Then
- 'lblErrRendimientoOfrecido.Visible = True
- 'Else
- 'lblErrRendimientoOfrecido.Visible = False
- 'End If
- 'oCEFOIN.RendimientoOfrecido = valor / 100
- Calculos()
- If (txtRendimientoOfrecido.ToString.IndexOf("%") = -1) Then
- txtRendimientoOfrecido.Text += "%"
- End If
- End Sub
- Private Sub txtRendimientoOfrecido_LostFocus(sender As Object, e As EventArgs) Handles txtRendimientoOfrecido.LostFocus
- ' txtRendimientoOfrecido.Text = oCEFOIN.RendimientoOfrecido.ToString(Configuraciones.CodigoTXTPorcentaje)
- End Sub
- Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
- If Not TypeOf cboPeriodicidad.SelectedValue Is DataRowView Then
- If Not cboPeriodicidad.SelectedValue Is Nothing Then
- oCEFOIN.Periodicidad = cboPeriodicidad.SelectedValue.ToString
- End If
- End If
- End Sub
- Private Sub cboAnioBase_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboAnioBase.SelectedIndexChanged
- If Not TypeOf cboAnioBase.SelectedItem Is DataRowView Then
- oCEFOIN.AnioBase = cboAnioBase.SelectedItem
- End If
- End Sub
- Private Sub txtPlazo_TextChanged(sender As Object, e As EventArgs) Handles txtPlazo.TextChanged
- Calculos()
- End Sub
- Private Sub btnRefrescar_Click(sender As Object, e As EventArgs) Handles btnQuitar.Click
- 'Dim coleccion = ColeccionFINV1()
- 'GuardarData.GuardarDataGrid(coleccion, Variables.Codigo)
- QuitarFila()
- End Sub
- Sub CargarDGVIngresos()
- 'Dim FondoInversion As New FondoInversionDAO
- 'Dim dr = FondoInversion.CargarData(Variables.Codigo)
- 'Dim fecha As String
- 'While dr.Read
- ' fecha = Format(dr("FechaCorte"), "dd/MM/yyyy").ToString
- ' dgvIngresos.Rows.Add(dr("correlativo"), fecha, dr("Dias"), dr("Dividendo"), dr("Ingreso"), dr("RendMensual"))
- 'End While
- End Sub
- Private Sub txtDividendo_TextChanged(sender As Object, e As EventArgs)
- 'Dim valor As Double
- 'If Not Double.TryParse(Me.txtDividendo.Text.Replace("%", ""), valor) Then
- 'lblErrDividendo.Visible = True
- 'Else
- 'lblErrDividendo.Visible = False
- 'End If
- 'oCEFOIN.Dividendo = valor / 100
- Calculos()
- End Sub
- Private Sub txtDividendo_LostFocus(sender As Object, e As EventArgs)
- 'Me.txtDividendo.Text = oCEFOIN.Dividendo.ToString(Configuraciones.CodigoTXTPorcentaje)
- End Sub
- Private Sub txtCuotasDeParticipacion_KeyUp(sender As Object, e As KeyEventArgs) Handles txtCuotasDeParticipacion.KeyUp
- Calculos()
- End Sub
- Private Sub txtValorDeParticipacion_KeyUp(sender As Object, e As KeyEventArgs) Handles txtValorDeParticipacion.KeyUp
- Calculos()
- End Sub
- Private Sub txtDiasLiq_KeyUp(sender As Object, e As KeyEventArgs) Handles txtDiasLiq.KeyUp
- Calculos()
- End Sub
- Private Sub navModificar_Click(sender As Object, e As EventArgs) Handles navModificar.Click
- TipoTransaccion = "M"
- btnAccion.Text = "Modificar"
- End Sub
- Private Sub navNuevo_Click(sender As Object, e As EventArgs) Handles navNuevo.Click
- TipoTransaccion = "N"
- btnAccion.Text = "Nuevo"
- End Sub
- Private Sub navEliminar_Click(sender As Object, e As EventArgs) Handles navEliminar.Click
- TipoTransaccion = "B"
- btnAccion.Text = "Eliminar"
- End Sub
- Private Sub btnAccion_Click(sender As Object, e As EventArgs) Handles btnAccion.Click
- Dim codigo As String = Variables.Codigo
- Dim Coleccion As Collection = ColeccionDatos()
- Dim Diccionario As Dictionary(Of String, Collection) = NuevoIngresoDiccionario()
- If (TipoTransaccion = "N") Then
- FOIN.ProcesoDatos(Coleccion, codigo, Diccionario, "Nuevo")
- ElseIf (TipoTransaccion = "M") Then
- FOIN.ProcesoDatos(Coleccion, codigo, Diccionario, "Modificar")
- ElseIf (TipoTransaccion = "B") Then
- Eliminar()
- ElseIf Not ExisteValidacion() Then
- Variables.ColeccionFINV = Coleccion
- Variables.ColeccionFINVDi = Diccionario
- Me.Close()
- End If
- End Sub
- Sub Eliminar()
- Dim codigo As String = Variables.Codigo
- FOIN.Eliminar(codigo)
- End Sub
- Function ExisteValidacion()
- Dim General As New DAOGeneral
- Dim Codigo As String = Variables.Codigo
- Dim Tabla As String = String.Empty
- Tabla = "FINV"
- Dim Existe As Boolean = General.ExisteTitulo(Codigo, Tabla)
- Return Existe
- End Function
- Private Function NuevoIngresoDiccionario()
- Dim Diccionario As New Dictionary(Of String, Collection)
- Dim Cantidad As Integer = dgvIngresos.Rows.Count - 2
- Dim Index As Integer = 0
- While Index <= Cantidad
- Dim coleccion As New Collection
- Dim FechaCorte, Dias, Dividendo, Ingreso, RendMensual, NumDiv
- NumDiv = dgvIngresos.Rows(Index).Cells("NumDiv").Value
- FechaCorte = dgvIngresos.Rows(Index).Cells("Fecha de Corte").Value
- Dias = dgvIngresos.Rows(Index).Cells("Dias").Value
- Dividendo = (CDec(dgvIngresos.Rows(Index).Cells("Dividendo").Value.ToString.Trim("%")) / 100)
- Ingreso = dgvIngresos.Rows(Index).Cells("Ingresos").Value
- RendMensual = (dgvIngresos.Rows(Index).Cells("Rendimiento Mensual").Value.ToString.Trim("%") / 100)
- coleccion.Add(NumDiv)
- coleccion.Add(FechaCorte)
- coleccion.Add(Dias)
- coleccion.Add(Dividendo)
- coleccion.Add(Ingreso)
- coleccion.Add(RendMensual)
- Diccionario.Add(NumDiv, coleccion)
- Index += 1
- End While
- Return Diccionario
- End Function
- Private Function ColeccionDatos()
- Dim Coleccion As New Collection
- Dim TipoCalculo As String = Me.TipoCalculo
- Coleccion.Add(txtValorNominal.Text)
- Coleccion.Add(txtCuotasDeParticipacion.Text)
- Coleccion.Add(txtValorDeParticipacion.Text)
- Coleccion.Add((txtPorcentajeComisionCasa.Text.ToString.Trim("%")) / 100)
- Coleccion.Add((txtPorcentajeComisionBolsa.Text.ToString.Trim("%")) / 100)
- Coleccion.Add(txtComisionCasa.Text)
- Coleccion.Add(txtComisionBolsa.Text)
- Coleccion.Add(txtValorTransado.Text)
- Coleccion.Add(dtpFechaOperacion.Value)
- Coleccion.Add(dtpFechaLiquidacion.Value)
- Coleccion.Add(dtpFechaVencimiento.Value)
- Coleccion.Add(txtDiasLiq.Text)
- Coleccion.Add(CDec(txtRendimientoOfrecido.Text.ToString.Trim("%")) / 100)
- Coleccion.Add(cboPeriodicidad.SelectedValue)
- Coleccion.Add(cboAnioBase.SelectedIndex)
- Coleccion.Add(txtPlazo.Text)
- Coleccion.Add(txtDividendo.Text.ToString.Trim("%") / 100)
- Coleccion.Add(TipoCalculo)
- Return Coleccion
- End Function
- Function TipoCalculo()
- Dim TipCalculo As String = "FinMes"
- If RadioButton1.Checked Then
- TipCalculo = "FinMes"
- Else
- If RadioButton2.Checked Then
- TipCalculo = "Mensual"
- End If
- End If
- Return TipCalculo
- End Function
- Private Sub CargarRegistroPrincipal()
- Dim FONV As New FondoInversionDAO
- Dim Codigo As String = Variables.Codigo
- Dim Coleccion As Collection = FONV.Cargar(Codigo)
- Dim TipoOperacion As String = String.Empty
- If Not Coleccion.Count = 0 Then
- txtValorNominal.Text = Operaciones.ConvertirDecimal(Coleccion(1).ToString)
- txtCuotasDeParticipacion.Text = Operaciones.ConvertirDecimal(Coleccion(2).ToString)
- txtValorDeParticipacion.Text = Operaciones.ConvertirDecimal(Coleccion(3).ToString)
- txtPorcentajeComisionCasa.Text = Operaciones.ConvertirDecimal((Coleccion(4) * 100).ToString)
- txtPorcentajeComisionBolsa.Text = Operaciones.ConvertirDecimal((Coleccion(5) * 100).ToString)
- txtComisionCasa.Text = Operaciones.ConvertirDecimal(Coleccion(6).ToString)
- txtComisionBolsa.Text = Operaciones.ConvertirDecimal(Coleccion(7).ToString)
- txtValorTransado.Text = Operaciones.ConvertirDecimal(Coleccion(8).ToString)
- dtpFechaOperacion.Value = Operaciones.ConvertirFecha(Coleccion(9).ToString)
- dtpFechaLiquidacion.Value = Operaciones.ConvertirFecha(Coleccion(10).ToString)
- dtpFechaVencimiento.Value = Operaciones.ConvertirFecha(Coleccion(11))
- txtDiasLiq.Text = Operaciones.ConvertirEntero(Coleccion(12).ToString)
- txtRendimientoOfrecido.Text = Operaciones.ConvertirDecimal((Coleccion(13) * 100).ToString)
- cboPeriodicidad.SelectedValue = Coleccion(14).ToString
- cboAnioBase.SelectedIndex = Operaciones.ConvertirEntero(Coleccion(15).ToString)
- txtPlazo.Text = Operaciones.ConvertirEntero(Coleccion(16).ToString)
- txtDividendo.Text = Operaciones.ConvertirDecimal((Coleccion(17) * 100).ToString)
- TipoOperacion = Coleccion(18).ToString
- If TipoOperacion = "FinMes" Then
- RadioButton1.Checked = True
- Else
- If TipoOperacion = "Mensual" Then
- RadioButton2.Checked = True
- End If
- End If
- End If
- End Sub
- Sub CargarFilas()
- Dim FONV As New FondoInversionDAO
- Dim Codigo As String = Variables.Codigo
- Dim Tabla As DataTable = FONV.CargarFilas(Codigo)
- For Each rows As DataRow In Tabla.Rows
- Dim NumDiv As Integer = 0
- Dim Fecha As Date = Date.Today.Date
- Dim Dias As Integer = 0
- Dim Dividendo As String = String.Empty
- Dim Ingreso As Double = 0
- Dim Rend As String = String.Empty
- NumDiv = Operaciones.ConvertirEntero(rows("NumDiv").ToString)
- Fecha = Operaciones.ConvertirFecha(rows("Fecha").ToString)
- Dias = Operaciones.ConvertirEntero(rows("Dias").ToString)
- Dividendo = (Operaciones.ConvertirDecimal(rows("Dividendo").ToString) * 100).ToString + "%"
- Ingreso = Operaciones.ConvertirDecimal(rows("Ingreso").ToString)
- Rend = (Operaciones.ConvertirDecimal(rows("Rend").ToString) * 100).ToString + "%"
- dgvIngresos.Rows.Add("", Fecha, Dias, Dividendo, Ingreso, Rend, NumDiv)
- Next
- AgregarCorrelativo()
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs)
- End Sub
- Sub AgregarCampos()
- Dim CantidadColumnas As Integer = dgvIngresos.ColumnCount
- If CantidadColumnas = 0 Then
- Dim FechaCorte, Dias, Dividendo, Ingreso, RendMensual, correlativo, NumDiv As New DataGridViewTextBoxColumn
- correlativo.Name = "correlativo"
- FechaCorte.Name = "Fecha de Corte"
- Dias.Name = "Dias"
- Dividendo.Name = "Dividendo"
- Ingreso.Name = "Ingresos"
- RendMensual.Name = "Rendimiento Mensual"
- NumDiv.Name = "NumDiv"
- dgvIngresos.Columns.Add(correlativo)
- dgvIngresos.Columns.Add(FechaCorte)
- dgvIngresos.Columns.Add(Dias)
- dgvIngresos.Columns.Add(Dividendo)
- dgvIngresos.Columns.Add(Ingreso)
- dgvIngresos.Columns.Add(RendMensual)
- dgvIngresos.Columns.Add(NumDiv)
- End If
- End Sub
- Private Sub dgvIngresos_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellContentClick
- End Sub
- Private Sub dgvIngresos_CellMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgvIngresos.CellMouseClick
- 'Calculos()
- CalculosTabla()
- End Sub
- Private Sub dgvIngresos_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles dgvIngresos.CellEndEdit
- CargarDatos()
- CalculoDGT()
- End Sub
- Private Sub txtDiasLiq_TextChanged(sender As Object, e As EventArgs) Handles txtDiasLiq.TextChanged
- Rellenar()
- Calculos()
- End Sub
- Private Sub btnModificar_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub btnEliminar_Click(sender As Object, e As EventArgs)
- End Sub
- Private Sub BindingNavigator1_RefreshItems(sender As Object, e As EventArgs) Handles BindingNavigator1.RefreshItems
- End Sub
- Private Sub btnRescate_Click(sender As Object, e As EventArgs) Handles btnRescate.Click
- 'frmRescate.Show()
- End Sub
- Private Sub txtCuotasDeParticipacion_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtCuotasDeParticipacion.KeyPress
- 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
- Private Sub txtValorDeParticipacion_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtValorDeParticipacion.KeyPress
- 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
- Private Sub txtPorcentajeComisionCasa_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeComisionCasa.KeyPress
- 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
- Private Sub txtPorcentajeComisionBolsa_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPorcentajeComisionBolsa.KeyPress
- 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
- Private Sub txtDiasLiq_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDiasLiq.KeyPress
- 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
- Private Sub txtRendimientoOfrecido_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtRendimientoOfrecido.KeyPress
- 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
- Private Sub txtPlazo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPlazo.KeyPress
- 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
- Private Sub GroupBox3_Enter(sender As Object, e As EventArgs) Handles GroupBox3.Enter
- End Sub
- Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
- End Sub
- Private Sub dgvIngresos_Click(sender As Object, e As EventArgs) Handles dgvIngresos.Click
- End Sub
- Private Sub Button1_Click_1(sender As Object, e As EventArgs)
- CargarDatos()
- End Sub
- Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs)
- End Sub
- Private Sub btnCancelat_Click(sender As Object, e As EventArgs) Handles btnCancelat.Click
- Me.Close()
- End Sub
- Sub QuitarFila()
- Dim CantidadFilas As Integer = dgvIngresos.Rows.Count - 1
- If CantidadFilas > 0 Then
- Dim result As Integer = MsgBox("¿Está seguro que desea eliminar la fila?", MsgBoxStyle.OkCancel)
- ' Test result.
- Dim codigo As String = Variables.Codigo
- Dim Numero As Integer = dgvIngresos.CurrentRow.Cells("NumDiv").Value
- If result = MsgBoxResult.Ok Then
- Try
- dgvIngresos.Rows.Remove(dgvIngresos.CurrentRow)
- FOIN.EliminarIngreso(codigo, Numero)
- Catch ex As Exception
- MsgBox("No ha seleccionado una fila")
- End Try
- End If
- Else
- MsgBox("Actualmente no tiene registros")
- End If
- End Sub
- Private Sub txtCuotasDeParticipacion_Leave(sender As Object, e As EventArgs) Handles txtCuotasDeParticipacion.Leave
- Rellenar()
- End Sub
- Private Sub txtValorDeParticipacion_Leave(sender As Object, e As EventArgs) Handles txtValorDeParticipacion.Leave
- Rellenar()
- End Sub
- Private Sub txtPorcentajeComisionCasa_Leave(sender As Object, e As EventArgs) Handles txtPorcentajeComisionCasa.Leave
- Rellenar()
- End Sub
- Private Sub txtPorcentajeComisionBolsa_Leave(sender As Object, e As EventArgs) Handles txtPorcentajeComisionBolsa.Leave
- Rellenar()
- End Sub
- Private Sub txtDiasLiq_Leave(sender As Object, e As EventArgs) Handles txtDiasLiq.Leave
- Rellenar()
- End Sub
- Private Sub txtRendimientoOfrecido_Leave(sender As Object, e As EventArgs) Handles txtRendimientoOfrecido.Leave
- Rellenar()
- End Sub
- Private Sub txtPlazo_Leave(sender As Object, e As EventArgs) Handles txtPlazo.Leave
- Rellenar()
- End Sub
- Private Sub txtDividendo_TextChanged_1(sender As Object, e As EventArgs) Handles txtDividendo.TextChanged
- If (txtDividendo.ToString.IndexOf("%") = -1) Then
- txtDividendo.Text += "%"
- End If
- Rellenar()
- End Sub
- Private Sub txtDividendo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDividendo.KeyPress
- 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 CargarTransladoNuevo()
- Dim Existe As Boolean = ExisteInversion()
- If Not RetCodigoInversionExiste And Not Existe Then
- txtRendimientoOfrecido.Text = Variables.RetRendimiento
- txtCuotasDeParticipacion.Text = Variables.RetCuotaParticipacionFINV
- txtValorDeParticipacion.Text = Variables.RetValorParticipacionFINV
- End If
- End Sub
- End Class
|