Public Class FondosDeInversionCE
    Private _ValorNominal As Double
    Private _CuotasDeParticipacion As Double
    Private _ValorDeParticipacion As Double
    Private _PorcentajeComisionCasa As Double
    Private _ComisionCasa As Double
    Private _PorcentajeComisionBolsa As Double
    Private _ComisionBolsa As Double
    Private _ValorTransado As Double
    Private _FechaOperacion As Date
    Private _FechaLiquidacion As Date
    Private _FechaVencimiento As Date
    Private _RendimientoOfrecido As Double
    Private _Periodicidad As String
    Private _AnioBase As Integer
    Private _Plazo As Integer
    Private _Dividendo As Double
    Public FondoInversionDAO = New FondoInversionDAO

    Public Property ValorNominal As Double
        Get
            Return _ValorNominal
        End Get
        Set(value As Double)
            _ValorNominal = value
            CalcularValorTransado()
        End Set
    End Property
    Public Property CuotasDeParticipacion As Double
        Get
            Return _CuotasDeParticipacion
        End Get
        Set(value As Double)
            _CuotasDeParticipacion = value
            CalcularValorNominal()
        End Set
    End Property
    Public Property ValorDeParticipacion As Double
        Get
            Return _ValorDeParticipacion
        End Get
        Set(value As Double)
            _ValorDeParticipacion = value
            CalcularValorNominal()
        End Set
    End Property
    Public Property PorcentajeComisionCasa As Double
        Get
            Return _PorcentajeComisionCasa
        End Get
        Set(value As Double)
            _PorcentajeComisionCasa = value
        End Set
    End Property
    Public Property ComisionCasa As Double
        Get
            Return _ComisionCasa
        End Get
        Set(value As Double)
            _ComisionCasa = value
            CalcularValorTransado()
        End Set
    End Property
    Public Property PorcentajeComisionBolsa As Double
        Get
            Return _PorcentajeComisionBolsa
        End Get
        Set(value As Double)
            _PorcentajeComisionBolsa = value
        End Set
    End Property
    Public Property ComisionBolsa As Double
        Get
            Return _ComisionBolsa
        End Get
        Set(value As Double)
            _ComisionBolsa = value
            CalcularValorTransado()
        End Set
    End Property
    Public Property ValorTransado As Double
        Get
            Return _ValorTransado
        End Get
        Set(value As Double)
            _ValorTransado = value
        End Set
    End Property
    Public Property FechaOperacion As Date
        Get
            Return _FechaOperacion
        End Get
        Set(value As Date)
            _FechaOperacion = value
        End Set
    End Property
    Public Property FechaLiquidacion As Date
        Get
            Return _FechaLiquidacion
        End Get
        Set(value As Date)
            _FechaLiquidacion = value
        End Set
    End Property
    Public Property FechaVencimiento As Date
        Get
            Return _FechaVencimiento
        End Get
        Set(value As Date)
            _FechaVencimiento = value
        End Set
    End Property
    Public Property RendimientoOfrecido As Double
        Get
            Return _RendimientoOfrecido
        End Get
        Set(value As Double)
            _RendimientoOfrecido = value
        End Set
    End Property
    Public Property Periodicidad As String
        Get
            Return _Periodicidad
        End Get
        Set(value As String)
            _Periodicidad = value
        End Set
    End Property
    Public Property AnioBase As Integer
        Get
            Return _AnioBase
        End Get
        Set(value As Integer)
            _AnioBase = value
        End Set
    End Property
    Public Property Plazo As Integer
        Get
            Return _Plazo
        End Get
        Set(value As Integer)
            _Plazo = value
        End Set
    End Property
    Public Property Dividendo As Double
        Get
            Return _Dividendo
        End Get
        Set(value As Double)
            _Dividendo = value
        End Set
    End Property






    Sub New()
        ValorNominal = 0
        CuotasDeParticipacion = 0
        ValorDeParticipacion = 0
        PorcentajeComisionCasa = 0
        ComisionCasa = 0
        PorcentajeComisionBolsa = 0
        ComisionBolsa = 0
        ValorTransado = 0
        FechaOperacion = Date.Now.Date
        FechaLiquidacion = Date.Now.Date
        FechaVencimiento = Date.Now.Date
        RendimientoOfrecido = 0
        Periodicidad = ""
        AnioBase = 365
        Plazo = 0
        Dividendo = 0
    End Sub

    Public Sub CalcularValorNominal()
        Dim valor As Double
        Dim vCuotasParticipacion As Double = CuotasDeParticipacion
        Dim vValorDeParticipacion As Double = ValorDeParticipacion

        Try
            valor = vCuotasParticipacion * vValorDeParticipacion
        Catch ex As Exception
            valor = 0
        End Try

        ValorNominal = valor

    End Sub

    Public Sub CalcularValorTransado()
        Dim valor As Double
        Dim vValorNominal As Double = ValorNominal
        Dim vComisionCasa As Double = ComisionCasa
        Dim vComisionBolsa As Double = ComisionBolsa

        Try
            valor = vValorNominal + vComisionCasa + vComisionBolsa
        Catch ex As Exception
            valor = 0
        End Try
        ValorTransado = valor
    End Sub


    Public Function CalculoValorNominal(ByVal CuotasParticipacion As Double, ByVal ValorParticipacion As Double)
        Dim Total = CuotasParticipacion * ValorParticipacion
        Return Total
    End Function
    Public Function CalculoFechaLiq(ByVal FechaOperaciones As Date, ByVal Dias As Integer)
        Dim fecha = FechaOperaciones.AddDays(Dias)
        Return fecha
    End Function





End Class
