FondosDeInversionCE.vb 5.8 KB

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