frmDAP.vb 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Public Class frmDAP
  2. Private oDAOGeneral As New DAOGeneral
  3. Private Operaciones As New Operaciones
  4. Private Sub frmDAP_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5. PrepararControles()
  6. End Sub
  7. Private Sub PrepararControles()
  8. CargarPeriodos()
  9. End Sub
  10. Private Sub CargarPeriodos()
  11. Me.cboPeriodicidad.DataSource = oDAOGeneral.ListaPeriodicidad
  12. Me.cboPeriodicidad.DisplayMember = "Descripcion"
  13. Me.cboPeriodicidad.ValueMember = "Codigo"
  14. Me.cboPeriodicidad.SelectedIndex = -1
  15. End Sub
  16. Private Sub cboPeriodicidad_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboPeriodicidad.SelectedIndexChanged
  17. ControlPeriodicidad()
  18. End Sub
  19. Private Sub ControlPeriodicidad()
  20. End Sub
  21. Private Sub txtMontoInversion_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMontoInversion.KeyPress
  22. If String.IsNullOrEmpty(txtMontoInversion.Text) Then
  23. If e.KeyChar = "." Then
  24. txtMontoInversion.Text = "0"
  25. Exit Sub
  26. End If
  27. End If
  28. If (Not txtMontoInversion.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  29. Operaciones.ValidarEntrada(sender, e, True)
  30. Else
  31. Operaciones.ValidarEntrada(sender, e, False)
  32. End If
  33. End Sub
  34. Private Sub txtPlazo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPlazo.KeyPress
  35. If String.IsNullOrEmpty(txtPlazo.Text) Then
  36. If e.KeyChar = "." Then
  37. txtPlazo.Text = "0"
  38. Exit Sub
  39. End If
  40. End If
  41. If (Not txtPlazo.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  42. Operaciones.ValidarEntrada(sender, e, True)
  43. Else
  44. Operaciones.ValidarEntrada(sender, e, False)
  45. End If
  46. End Sub
  47. Private Sub txtTasa_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTasa.KeyPress
  48. If String.IsNullOrEmpty(txtTasa.Text) Then
  49. If e.KeyChar = "." Then
  50. txtTasa.Text = "0"
  51. Exit Sub
  52. End If
  53. End If
  54. If (Not txtTasa.Text.ToString.IndexOf(".") = -1 And e.KeyChar = ".") Then
  55. Operaciones.ValidarEntrada(sender, e, True)
  56. Else
  57. Operaciones.ValidarEntrada(sender, e, False)
  58. End If
  59. End Sub
  60. End Class