Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. create table Credito(
  2. id_credito int primary key identity,
  3. id_cliente int,
  4. id_Usuario int,
  5. concepto varchar(40) not null,
  6. descripcion varchar(150) not null,
  7. cantidad_credito float not null,
  8. fecha_inicio date not null,
  9. tipo_cuota varchar(10) not null,
  10. fecha_fin date not null,
  11. cantidad_cuotas int not null,
  12. cantidad_mensual float not null,
  13. estado_credito char(1) not null,
  14. estado_mora int not null,
  15. numero_credito int,
  16. saldo float,
  17. check (estado_credito='C' or estado_credito='P'),
  18. check (estado_mora=1 or estado_mora=0),
  19. check (tipo_cuota='quincenal' or tipo_cuota='mensual'),
  20. constraint fk_ic foreign key(id_cliente) references Cliente,
  21. constraint fk_iu foreign key(id_Usuario) references Usuario
  22. );
  23.  
  24. Public Class Datos
  25. Dim conex As New SqlConnection
  26. Dim conectar As String = "Data Source=Desktop-sigtqcfmyserver;Initial Catalog=ProyectoFinal2;Integrated Security=True"
  27. Public Sub New()
  28. Try
  29. conex.ConnectionString = conectar
  30. Catch ex As SqlException
  31. MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  32. End Try
  33. End Sub
  34.  
  35. //Esta es la función que utilizo para actualizar los registros
  36. Public Sub Actualizar(tabla As String, campos_valores As String, condicion As String)
  37. Try
  38. conex.Open()
  39. Dim cmd As New SqlCommand("update " & tabla & " set " & campos_valores & " where " & condicion, conex)
  40. cmd.ExecuteNonQuery()
  41. Catch ex As Exception
  42. MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  43. Finally
  44. conex.Close()
  45. End Try
  46. End Sub
  47. End Class
  48.  
  49. Public Class Pagos
  50. Dim obj as New Datos
  51. Public Sub ActualizarPago()
  52. If meses >= 1 Then
  53. cantMora = meses * precioMora **PrecioMora equivale a 2.5**
  54. tabla = "Credito"
  55. campos_valores = "Saldo=" & cantMora + saldoPend
  56. condicion = "numero_credito=" & numero_factura
  57. obj.Actualizar(tabla, campos_valores, condicion)
  58. End If
  59. End Sub
  60. End Class
  61.  
  62. Dim oldString As String = "32,3"
  63. ' Returns "Shipping List".
  64. Dim newString As String = Replace(TestString, ",", ".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement