FondosDeInversionCE.vb 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. Public Class FondosDeInversionCE
  2. Private _ValorNominal As Double
  3. Private _CuotasDeParticipacion As Double
  4. Private _ValorDeParticipacion As Double
  5. Private _PorcentajeComisionCasa As Double
  6. Private _ComisionCasa As Double
  7. Private _PorcentajeComisionBolsa As Double
  8. Private _ComisionBolsa As Double
  9. Private _ValorTransado As Double
  10. Private _FechaOperacion As Date
  11. Private _FechaLiquidacion As Date
  12. Private _FechaVencimiento As Date
  13. Private _RendimientoOfrecido As Double
  14. Private _Periodicidad As String
  15. Private _AnioBase As Integer
  16. Private _Plazo As Integer
  17. Private _Dividendo As Double
  18. Public FondoInversionDAO = New FondoInversionDAO
  19. Dim Operaciones As New Operaciones
  20. Public Property ValorNominal As Double
  21. Get
  22. Return _ValorNominal
  23. End Get
  24. Set(value As Double)
  25. _ValorNominal = value
  26. CalcularValorTransado()
  27. End Set
  28. End Property
  29. Public Property CuotasDeParticipacion As Double
  30. Get
  31. Return _CuotasDeParticipacion
  32. End Get
  33. Set(value As Double)
  34. _CuotasDeParticipacion = value
  35. CalcularValorNominal()
  36. End Set
  37. End Property
  38. Public Property ValorDeParticipacion As Double
  39. Get
  40. Return _ValorDeParticipacion
  41. End Get
  42. Set(value As Double)
  43. _ValorDeParticipacion = value
  44. CalcularValorNominal()
  45. End Set
  46. End Property
  47. Public Property PorcentajeComisionCasa As Double
  48. Get
  49. Return _PorcentajeComisionCasa
  50. End Get
  51. Set(value As Double)
  52. _PorcentajeComisionCasa = value
  53. End Set
  54. End Property
  55. Public Property ComisionCasa As Double
  56. Get
  57. Return _ComisionCasa
  58. End Get
  59. Set(value As Double)
  60. _ComisionCasa = value
  61. CalcularValorTransado()
  62. End Set
  63. End Property
  64. Public Property PorcentajeComisionBolsa As Double
  65. Get
  66. Return _PorcentajeComisionBolsa
  67. End Get
  68. Set(value As Double)
  69. _PorcentajeComisionBolsa = value
  70. End Set
  71. End Property
  72. Public Property ComisionBolsa As Double
  73. Get
  74. Return _ComisionBolsa
  75. End Get
  76. Set(value As Double)
  77. _ComisionBolsa = value
  78. CalcularValorTransado()
  79. End Set
  80. End Property
  81. Public Property ValorTransado As Double
  82. Get
  83. Return _ValorTransado
  84. End Get
  85. Set(value As Double)
  86. _ValorTransado = value
  87. End Set
  88. End Property
  89. Public Property FechaOperacion As Date
  90. Get
  91. Return _FechaOperacion
  92. End Get
  93. Set(value As Date)
  94. _FechaOperacion = value
  95. End Set
  96. End Property
  97. Public Property FechaLiquidacion As Date
  98. Get
  99. Return _FechaLiquidacion
  100. End Get
  101. Set(value As Date)
  102. _FechaLiquidacion = value
  103. End Set
  104. End Property
  105. Public Property FechaVencimiento As Date
  106. Get
  107. Return _FechaVencimiento
  108. End Get
  109. Set(value As Date)
  110. _FechaVencimiento = value
  111. End Set
  112. End Property
  113. Public Property RendimientoOfrecido As Double
  114. Get
  115. Return _RendimientoOfrecido
  116. End Get
  117. Set(value As Double)
  118. _RendimientoOfrecido = value
  119. End Set
  120. End Property
  121. Public Property Periodicidad As String
  122. Get
  123. Return _Periodicidad
  124. End Get
  125. Set(value As String)
  126. _Periodicidad = value
  127. End Set
  128. End Property
  129. Public Property AnioBase As Integer
  130. Get
  131. Return _AnioBase
  132. End Get
  133. Set(value As Integer)
  134. _AnioBase = value
  135. End Set
  136. End Property
  137. Public Property Plazo As Integer
  138. Get
  139. Return _Plazo
  140. End Get
  141. Set(value As Integer)
  142. _Plazo = value
  143. End Set
  144. End Property
  145. Public Property Dividendo As Double
  146. Get
  147. Return _Dividendo
  148. End Get
  149. Set(value As Double)
  150. _Dividendo = value
  151. End Set
  152. End Property
  153. Sub New()
  154. ValorNominal = 0
  155. CuotasDeParticipacion = 0
  156. ValorDeParticipacion = 0
  157. PorcentajeComisionCasa = 0
  158. ComisionCasa = 0
  159. PorcentajeComisionBolsa = 0
  160. ComisionBolsa = 0
  161. ValorTransado = 0
  162. FechaOperacion = Date.Now.Date
  163. FechaLiquidacion = Date.Now.Date
  164. FechaVencimiento = Date.Now.Date
  165. RendimientoOfrecido = 0
  166. Periodicidad = ""
  167. AnioBase = 365
  168. Plazo = 0
  169. Dividendo = 0
  170. End Sub
  171. Public Sub CalcularValorNominal()
  172. Dim valor As Double
  173. Dim vCuotasParticipacion As Double = CuotasDeParticipacion
  174. Dim vValorDeParticipacion As Double = ValorDeParticipacion
  175. Try
  176. valor = vCuotasParticipacion * vValorDeParticipacion
  177. Catch ex As Exception
  178. valor = 0
  179. End Try
  180. ValorNominal = valor
  181. End Sub
  182. Public Sub CalcularValorTransado()
  183. Dim valor As Double
  184. Dim vValorNominal As Double = ValorNominal
  185. Dim vComisionCasa As Double = ComisionCasa
  186. Dim vComisionBolsa As Double = ComisionBolsa
  187. Try
  188. valor = vValorNominal + vComisionCasa + vComisionBolsa
  189. Catch ex As Exception
  190. valor = 0
  191. End Try
  192. ValorTransado = valor
  193. End Sub
  194. Public Function CalculoValorNominal(ByVal CuotasParticipacion As Double, ByVal ValorParticipacion As Double)
  195. Dim Total = CuotasParticipacion * ValorParticipacion
  196. Return Total
  197. End Function
  198. Public Function CalculoFechaLiq(ByVal FechaOperaciones As String, ByVal Dias As Integer)
  199. Dim FechaLiquidacion As Date = Operaciones.ConvertirFecha(FechaOperaciones)
  200. Dim fecha As Date = FechaLiquidacion.AddDays(Dias)
  201. Return fecha
  202. End Function
  203. End Class